mm_nomin.js 221 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428
  1. /*! Lazy Load 1.9.3 - MIT license - Copyright 2010-2013 Mika Tuupola */
  2. !function(a,b,c,d){var e=a(b);a.fn.lazyload=function(f){function g(){var b=0;i.each(function(){var c=a(this);if(!j.skip_invisible||c.is(":visible"))if(a.abovethetop(this,j)||a.leftofbegin(this,j));else if(a.belowthefold(this,j)||a.rightoffold(this,j)){if(++b>j.failure_limit)return!1}else c.trigger("appear"),b=0})}var h,i=this,j={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!0,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};return f&&(d!==f.failurelimit&&(f.failure_limit=f.failurelimit,delete f.failurelimit),d!==f.effectspeed&&(f.effect_speed=f.effectspeed,delete f.effectspeed),a.extend(j,f)),h=j.container===d||j.container===b?e:a(j.container),0===j.event.indexOf("scroll")&&h.bind(j.event,function(){return g()}),this.each(function(){var b=this,c=a(b);b.loaded=!1,(c.attr("src")===d||c.attr("src")===!1)&&c.is("img")&&c.attr("src",j.placeholder),c.one("appear",function(){if(!this.loaded){if(j.appear){var d=i.length;j.appear.call(b,d,j)}a("<img />").bind("load",function(){var d=c.attr("data-"+j.data_attribute);c.hide(),c.is("img")?c.attr("src",d):c.css("background-image","url('"+d+"')"),c[j.effect](j.effect_speed),b.loaded=!0;var e=a.grep(i,function(a){return!a.loaded});if(i=a(e),j.load){var f=i.length;j.load.call(b,f,j)}}).attr("src",c.attr("data-"+j.data_attribute))}}),0!==j.event.indexOf("scroll")&&c.bind(j.event,function(){b.loaded||c.trigger("appear")})}),e.bind("resize",function(){g()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&e.bind("pageshow",function(b){b.originalEvent&&b.originalEvent.persisted&&i.each(function(){a(this).trigger("appear")})}),a(c).ready(function(){g()}),this},a.belowthefold=function(c,f){var g;return g=f.container===d||f.container===b?(b.innerHeight?b.innerHeight:e.height())+e.scrollTop():a(f.container).offset().top+a(f.container).height(),g<=a(c).offset().top-f.threshold},a.rightoffold=function(c,f){var g;return g=f.container===d||f.container===b?e.width()+e.scrollLeft():a(f.container).offset().left+a(f.container).width(),g<=a(c).offset().left-f.threshold},a.abovethetop=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollTop():a(f.container).offset().top,g>=a(c).offset().top+f.threshold+a(c).height()},a.leftofbegin=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollLeft():a(f.container).offset().left,g>=a(c).offset().left+f.threshold+a(c).width()},a.inviewport=function(b,c){return!(a.rightoffold(b,c)||a.leftofbegin(b,c)||a.belowthefold(b,c)||a.abovethetop(b,c))},a.extend(a.expr[":"],{"below-the-fold":function(b){return a.belowthefold(b,{threshold:0})},"above-the-top":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-screen":function(b){return a.rightoffold(b,{threshold:0})},"left-of-screen":function(b){return!a.rightoffold(b,{threshold:0})},"in-viewport":function(b){return a.inviewport(b,{threshold:0})},"above-the-fold":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-fold":function(b){return a.rightoffold(b,{threshold:0})},"left-of-fold":function(b){return!a.rightoffold(b,{threshold:0})}})}(jQuery,window,document);
  3. /*mousewheel*/
  4. (function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
  5. /*custom scrollbar*/
  6. (function(c){var b={init:function(e){var f={set_width:false,set_height:false,horizontalScroll:false,scrollInertia:950,mouseWheel:true,mouseWheelPixels:"auto",autoDraggerLength:true,autoHideScrollbar:false,snapAmount:null,snapOffset:0,scrollButtons:{enable:false,scrollType:"continuous",scrollSpeed:"auto",scrollAmount:40},advanced:{updateOnBrowserResize:true,updateOnContentResize:false,autoExpandHorizontalScroll:false,autoScrollOnFocus:true,normalizeMouseWheelDelta:false},contentTouchScroll:true,callbacks:{onScrollStart:function(){},onScroll:function(){},onTotalScroll:function(){},onTotalScrollBack:function(){},onTotalScrollOffset:0,onTotalScrollBackOffset:0,whileScrolling:function(){}},theme:"light"},e=c.extend(true,f,e);return this.each(function(){var m=c(this);if(e.set_width){m.css("width",e.set_width)}if(e.set_height){m.css("height",e.set_height)}if(!c(document).data("mCustomScrollbar-index")){c(document).data("mCustomScrollbar-index","1")}else{var t=parseInt(c(document).data("mCustomScrollbar-index"));c(document).data("mCustomScrollbar-index",t+1)}m.wrapInner("<div class='mCustomScrollBox mCS-"+e.theme+"' id='mCSB_"+c(document).data("mCustomScrollbar-index")+"' style='position:relative; height:100%; overflow:hidden; max-width:100%;' />").addClass("mCustomScrollbar _mCS_"+c(document).data("mCustomScrollbar-index"));var g=m.children(".mCustomScrollBox");if(e.horizontalScroll){g.addClass("mCSB_horizontal").wrapInner("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />");var k=g.children(".mCSB_h_wrapper");k.wrapInner("<div class='mCSB_container' style='position:absolute; left:0;' />").children(".mCSB_container").css({width:k.children().outerWidth(),position:"relative"}).unwrap()}else{g.wrapInner("<div class='mCSB_container' style='position:relative; top:0;' />")}var o=g.children(".mCSB_container");if(c.support.touch){o.addClass("mCS_touch")}o.after("<div class='mCSB_scrollTools' style='position:absolute;'><div class='mCSB_draggerContainer'><div class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' style='position:relative;'></div></div><div class='mCSB_draggerRail'></div></div></div>");var l=g.children(".mCSB_scrollTools"),h=l.children(".mCSB_draggerContainer"),q=h.children(".mCSB_dragger");if(e.horizontalScroll){q.data("minDraggerWidth",q.width())}else{q.data("minDraggerHeight",q.height())}if(e.scrollButtons.enable){if(e.horizontalScroll){l.prepend("<a class='mCSB_buttonLeft' oncontextmenu='return false;'></a>").append("<a class='mCSB_buttonRight' oncontextmenu='return false;'></a>")}else{l.prepend("<a class='mCSB_buttonUp' oncontextmenu='return false;'></a>").append("<a class='mCSB_buttonDown' oncontextmenu='return false;'></a>")}}g.bind("scroll",function(){if(!m.is(".mCS_disabled")){g.scrollTop(0).scrollLeft(0)}});m.data({mCS_Init:true,mCustomScrollbarIndex:c(document).data("mCustomScrollbar-index"),horizontalScroll:e.horizontalScroll,scrollInertia:e.scrollInertia,scrollEasing:"mcsEaseOut",mouseWheel:e.mouseWheel,mouseWheelPixels:e.mouseWheelPixels,autoDraggerLength:e.autoDraggerLength,autoHideScrollbar:e.autoHideScrollbar,snapAmount:e.snapAmount,snapOffset:e.snapOffset,scrollButtons_enable:e.scrollButtons.enable,scrollButtons_scrollType:e.scrollButtons.scrollType,scrollButtons_scrollSpeed:e.scrollButtons.scrollSpeed,scrollButtons_scrollAmount:e.scrollButtons.scrollAmount,autoExpandHorizontalScroll:e.advanced.autoExpandHorizontalScroll,autoScrollOnFocus:e.advanced.autoScrollOnFocus,normalizeMouseWheelDelta:e.advanced.normalizeMouseWheelDelta,contentTouchScroll:e.contentTouchScroll,onScrollStart_Callback:e.callbacks.onScrollStart,onScroll_Callback:e.callbacks.onScroll,onTotalScroll_Callback:e.callbacks.onTotalScroll,onTotalScrollBack_Callback:e.callbacks.onTotalScrollBack,onTotalScroll_Offset:e.callbacks.onTotalScrollOffset,onTotalScrollBack_Offset:e.callbacks.onTotalScrollBackOffset,whileScrolling_Callback:e.callbacks.whileScrolling,bindEvent_scrollbar_drag:false,bindEvent_content_touch:false,bindEvent_scrollbar_click:false,bindEvent_mousewheel:false,bindEvent_buttonsContinuous_y:false,bindEvent_buttonsContinuous_x:false,bindEvent_buttonsPixels_y:false,bindEvent_buttonsPixels_x:false,bindEvent_focusin:false,bindEvent_autoHideScrollbar:false,mCSB_buttonScrollRight:false,mCSB_buttonScrollLeft:false,mCSB_buttonScrollDown:false,mCSB_buttonScrollUp:false});if(e.horizontalScroll){if(m.css("max-width")!=="none"){if(!e.advanced.updateOnContentResize){e.advanced.updateOnContentResize=true}}}else{if(m.css("max-height")!=="none"){var s=false,r=parseInt(m.css("max-height"));if(m.css("max-height").indexOf("%")>=0){s=r,r=m.parent().height()*s/100}m.css("overflow","hidden");g.css("max-height",r)}}m.mCustomScrollbar("update");if(e.advanced.updateOnBrowserResize){var i,j=c(window).width(),u=c(window).height();c(window).bind("resize."+m.data("mCustomScrollbarIndex"),function(){if(i){clearTimeout(i)}i=setTimeout(function(){if(!m.is(".mCS_disabled")&&!m.is(".mCS_destroyed")){var w=c(window).width(),v=c(window).height();if(j!==w||u!==v){if(m.css("max-height")!=="none"&&s){g.css("max-height",m.parent().height()*s/100)}m.mCustomScrollbar("update");j=w;u=v}}},150)})}if(e.advanced.updateOnContentResize){var p;if(e.horizontalScroll){var n=o.outerWidth()}else{var n=o.outerHeight()}p=setInterval(function(){if(e.horizontalScroll){if(e.advanced.autoExpandHorizontalScroll){o.css({position:"absolute",width:"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:o.outerWidth(),position:"relative"}).unwrap()}var v=o.outerWidth()}else{var v=o.outerHeight()}if(v!=n){m.mCustomScrollbar("update");n=v}},300)}})},update:function(){var n=c(this),k=n.children(".mCustomScrollBox"),q=k.children(".mCSB_container");q.removeClass("mCS_no_scrollbar");n.removeClass("mCS_disabled mCS_destroyed");k.scrollTop(0).scrollLeft(0);var y=k.children(".mCSB_scrollTools"),o=y.children(".mCSB_draggerContainer"),m=o.children(".mCSB_dragger");if(n.data("horizontalScroll")){var A=y.children(".mCSB_buttonLeft"),t=y.children(".mCSB_buttonRight"),f=k.width();if(n.data("autoExpandHorizontalScroll")){q.css({position:"absolute",width:"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:q.outerWidth(),position:"relative"}).unwrap()}var z=q.outerWidth()}else{var w=y.children(".mCSB_buttonUp"),g=y.children(".mCSB_buttonDown"),r=k.height(),i=q.outerHeight()}if(i>r&&!n.data("horizontalScroll")){y.css("display","block");var s=o.height();if(n.data("autoDraggerLength")){var u=Math.round(r/i*s),l=m.data("minDraggerHeight");if(u<=l){m.css({height:l})}else{if(u>=s-10){var p=s-10;m.css({height:p})}else{m.css({height:u})}}m.children(".mCSB_dragger_bar").css({"line-height":m.height()+"px"})}var B=m.height(),x=(i-r)/(s-B);n.data("scrollAmount",x).mCustomScrollbar("scrolling",k,q,o,m,w,g,A,t);var D=Math.abs(q.position().top);n.mCustomScrollbar("scrollTo",D,{scrollInertia:0,trigger:"internal"})}else{if(z>f&&n.data("horizontalScroll")){y.css("display","block");var h=o.width();if(n.data("autoDraggerLength")){var j=Math.round(f/z*h),C=m.data("minDraggerWidth");if(j<=C){m.css({width:C})}else{if(j>=h-10){var e=h-10;m.css({width:e})}else{m.css({width:j})}}}var v=m.width(),x=(z-f)/(h-v);n.data("scrollAmount",x).mCustomScrollbar("scrolling",k,q,o,m,w,g,A,t);var D=Math.abs(q.position().left);n.mCustomScrollbar("scrollTo",D,{scrollInertia:0,trigger:"internal"})}else{k.unbind("mousewheel focusin");if(n.data("horizontalScroll")){m.add(q).css("left",0)}else{m.add(q).css("top",0)}y.css("display","none");q.addClass("mCS_no_scrollbar");n.data({bindEvent_mousewheel:false,bindEvent_focusin:false})}}},scrolling:function(h,p,m,j,w,e,A,v){var k=c(this);if(!k.data("bindEvent_scrollbar_drag")){var n,o;if(c.support.msPointer){j.bind("MSPointerDown",function(H){H.preventDefault();k.data({on_drag:true});j.addClass("mCSB_dragger_onDrag");var G=c(this),J=G.offset(),F=H.originalEvent.pageX-J.left,I=H.originalEvent.pageY-J.top;if(F<G.width()&&F>0&&I<G.height()&&I>0){n=I;o=F}});c(document).bind("MSPointerMove."+k.data("mCustomScrollbarIndex"),function(H){H.preventDefault();if(k.data("on_drag")){var G=j,J=G.offset(),F=H.originalEvent.pageX-J.left,I=H.originalEvent.pageY-J.top;D(n,o,I,F)}}).bind("MSPointerUp."+k.data("mCustomScrollbarIndex"),function(x){k.data({on_drag:false});j.removeClass("mCSB_dragger_onDrag")})}else{j.bind("mousedown touchstart",function(H){H.preventDefault();H.stopImmediatePropagation();var G=c(this),K=G.offset(),F,J;if(H.type==="touchstart"){var I=H.originalEvent.touches[0]||H.originalEvent.changedTouches[0];F=I.pageX-K.left;J=I.pageY-K.top}else{k.data({on_drag:true});j.addClass("mCSB_dragger_onDrag");F=H.pageX-K.left;J=H.pageY-K.top}if(F<G.width()&&F>0&&J<G.height()&&J>0){n=J;o=F}}).bind("touchmove",function(H){H.preventDefault();H.stopImmediatePropagation();var K=H.originalEvent.touches[0]||H.originalEvent.changedTouches[0],G=c(this),J=G.offset(),F=K.pageX-J.left,I=K.pageY-J.top;D(n,o,I,F)});c(document).bind("mousemove."+k.data("mCustomScrollbarIndex"),function(H){if(k.data("on_drag")){var G=j,J=G.offset(),F=H.pageX-J.left,I=H.pageY-J.top;D(n,o,I,F)}}).bind("mouseup."+k.data("mCustomScrollbarIndex"),function(x){k.data({on_drag:false});j.removeClass("mCSB_dragger_onDrag")})}k.data({bindEvent_scrollbar_drag:true})}function D(G,H,I,F){if(k.data("horizontalScroll")){k.mCustomScrollbar("scrollTo",(j.position().left-(H))+F,{moveDragger:true,trigger:"internal"})}else{k.mCustomScrollbar("scrollTo",(j.position().top-(G))+I,{moveDragger:true,trigger:"internal"})}}if(c.support.touch&&k.data("contentTouchScroll")){if(!k.data("bindEvent_content_touch")){var l,B,r,s,u,C,E;p.bind("touchstart",function(x){x.stopImmediatePropagation();l=x.originalEvent.touches[0]||x.originalEvent.changedTouches[0];B=c(this);r=B.offset();u=l.pageX-r.left;s=l.pageY-r.top;C=s;E=u});p.bind("touchmove",function(x){x.preventDefault();x.stopImmediatePropagation();l=x.originalEvent.touches[0]||x.originalEvent.changedTouches[0];B=c(this).parent();r=B.offset();u=l.pageX-r.left;s=l.pageY-r.top;if(k.data("horizontalScroll")){k.mCustomScrollbar("scrollTo",E-u,{trigger:"internal"})}else{k.mCustomScrollbar("scrollTo",C-s,{trigger:"internal"})}})}}if(!k.data("bindEvent_scrollbar_click")){m.bind("click",function(F){var x=(F.pageY-m.offset().top)*k.data("scrollAmount"),y=c(F.target);if(k.data("horizontalScroll")){x=(F.pageX-m.offset().left)*k.data("scrollAmount")}if(y.hasClass("mCSB_draggerContainer")||y.hasClass("mCSB_draggerRail")){k.mCustomScrollbar("scrollTo",x,{trigger:"internal",scrollEasing:"draggerRailEase"})}});k.data({bindEvent_scrollbar_click:true})}if(k.data("mouseWheel")){if(!k.data("bindEvent_mousewheel")){h.bind("mousewheel",function(H,J){var G,F=k.data("mouseWheelPixels"),x=Math.abs(p.position().top),I=j.position().top,y=m.height()-j.height();if(k.data("normalizeMouseWheelDelta")){if(J<0){J=-1}else{J=1}}if(F==="auto"){F=100+Math.round(k.data("scrollAmount")/2)}if(k.data("horizontalScroll")){I=j.position().left;y=m.width()-j.width();x=Math.abs(p.position().left)}if((J>0&&I!==0)||(J<0&&I!==y)){H.preventDefault();H.stopImmediatePropagation()}G=x-(J*F);k.mCustomScrollbar("scrollTo",G,{trigger:"internal"})});k.data({bindEvent_mousewheel:true})}}if(k.data("scrollButtons_enable")){if(k.data("scrollButtons_scrollType")==="pixels"){if(k.data("horizontalScroll")){v.add(A).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend",i,g);k.data({bindEvent_buttonsContinuous_x:false});if(!k.data("bindEvent_buttonsPixels_x")){v.bind("click",function(x){x.preventDefault();q(Math.abs(p.position().left)+k.data("scrollButtons_scrollAmount"))});A.bind("click",function(x){x.preventDefault();q(Math.abs(p.position().left)-k.data("scrollButtons_scrollAmount"))});k.data({bindEvent_buttonsPixels_x:true})}}else{e.add(w).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend",i,g);k.data({bindEvent_buttonsContinuous_y:false});if(!k.data("bindEvent_buttonsPixels_y")){e.bind("click",function(x){x.preventDefault();q(Math.abs(p.position().top)+k.data("scrollButtons_scrollAmount"))});w.bind("click",function(x){x.preventDefault();q(Math.abs(p.position().top)-k.data("scrollButtons_scrollAmount"))});k.data({bindEvent_buttonsPixels_y:true})}}function q(x){if(!j.data("preventAction")){j.data("preventAction",true);k.mCustomScrollbar("scrollTo",x,{trigger:"internal"})}}}else{if(k.data("horizontalScroll")){v.add(A).unbind("click");k.data({bindEvent_buttonsPixels_x:false});if(!k.data("bindEvent_buttonsContinuous_x")){v.bind("mousedown touchstart MSPointerDown",function(y){y.preventDefault();var x=z();k.data({mCSB_buttonScrollRight:setInterval(function(){k.mCustomScrollbar("scrollTo",Math.abs(p.position().left)+x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var i=function(x){x.preventDefault();clearInterval(k.data("mCSB_buttonScrollRight"))};v.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",i);A.bind("mousedown touchstart MSPointerDown",function(y){y.preventDefault();var x=z();k.data({mCSB_buttonScrollLeft:setInterval(function(){k.mCustomScrollbar("scrollTo",Math.abs(p.position().left)-x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var g=function(x){x.preventDefault();clearInterval(k.data("mCSB_buttonScrollLeft"))};A.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",g);k.data({bindEvent_buttonsContinuous_x:true})}}else{e.add(w).unbind("click");k.data({bindEvent_buttonsPixels_y:false});if(!k.data("bindEvent_buttonsContinuous_y")){e.bind("mousedown touchstart MSPointerDown",function(y){y.preventDefault();var x=z();k.data({mCSB_buttonScrollDown:setInterval(function(){k.mCustomScrollbar("scrollTo",Math.abs(p.position().top)+x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var t=function(x){x.preventDefault();clearInterval(k.data("mCSB_buttonScrollDown"))};e.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",t);w.bind("mousedown touchstart MSPointerDown",function(y){y.preventDefault();var x=z();k.data({mCSB_buttonScrollUp:setInterval(function(){k.mCustomScrollbar("scrollTo",Math.abs(p.position().top)-x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var f=function(x){x.preventDefault();clearInterval(k.data("mCSB_buttonScrollUp"))};w.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",f);k.data({bindEvent_buttonsContinuous_y:true})}}function z(){var x=k.data("scrollButtons_scrollSpeed");if(k.data("scrollButtons_scrollSpeed")==="auto"){x=Math.round((k.data("scrollInertia")+100)/40)}return x}}}if(k.data("autoScrollOnFocus")){if(!k.data("bindEvent_focusin")){h.bind("focusin",function(){h.scrollTop(0).scrollLeft(0);var x=c(document.activeElement);if(x.is("input,textarea,select,button,a[tabindex],area,object")){var G=p.position().top,y=x.position().top,F=h.height()-x.outerHeight();if(k.data("horizontalScroll")){G=p.position().left;y=x.position().left;F=h.width()-x.outerWidth()}if(G+y<0||G+y>F){k.mCustomScrollbar("scrollTo",y,{trigger:"internal"})}}});k.data({bindEvent_focusin:true})}}if(k.data("autoHideScrollbar")){if(!k.data("bindEvent_autoHideScrollbar")){h.bind("mouseenter",function(x){h.addClass("mCS-mouse-over");d.showScrollbar.call(h.children(".mCSB_scrollTools"))}).bind("mouseleave touchend",function(x){h.removeClass("mCS-mouse-over");if(x.type==="mouseleave"){d.hideScrollbar.call(h.children(".mCSB_scrollTools"))}});k.data({bindEvent_autoHideScrollbar:true})}}},scrollTo:function(e,f){var i=c(this),o={moveDragger:false,trigger:"external",callbacks:true,scrollInertia:i.data("scrollInertia"),scrollEasing:i.data("scrollEasing")},f=c.extend(o,f),p,g=i.children(".mCustomScrollBox"),k=g.children(".mCSB_container"),r=g.children(".mCSB_scrollTools"),j=r.children(".mCSB_draggerContainer"),h=j.children(".mCSB_dragger"),t=draggerSpeed=f.scrollInertia,q,s,m,l;if(!k.hasClass("mCS_no_scrollbar")){i.data({mCS_trigger:f.trigger});if(i.data("mCS_Init")){f.callbacks=false}if(e||e===0){if(typeof(e)==="number"){if(f.moveDragger){p=e;if(i.data("horizontalScroll")){e=h.position().left*i.data("scrollAmount")}else{e=h.position().top*i.data("scrollAmount")}draggerSpeed=0}else{p=e/i.data("scrollAmount")}}else{if(typeof(e)==="string"){var v;if(e==="top"){v=0}else{if(e==="bottom"&&!i.data("horizontalScroll")){v=k.outerHeight()-g.height()}else{if(e==="left"){v=0}else{if(e==="right"&&i.data("horizontalScroll")){v=k.outerWidth()-g.width()}else{if(e==="first"){v=i.find(".mCSB_container").find(":first")}else{if(e==="last"){v=i.find(".mCSB_container").find(":last")}else{v=i.find(e)}}}}}}if(v.length===1){if(i.data("horizontalScroll")){e=v.position().left}else{e=v.position().top}p=e/i.data("scrollAmount")}else{p=e=v}}}if(i.data("horizontalScroll")){if(i.data("onTotalScrollBack_Offset")){s=-i.data("onTotalScrollBack_Offset")}if(i.data("onTotalScroll_Offset")){l=g.width()-k.outerWidth()+i.data("onTotalScroll_Offset")}if(p<0){p=e=0;clearInterval(i.data("mCSB_buttonScrollLeft"));if(!s){q=true}}else{if(p>=j.width()-h.width()){p=j.width()-h.width();e=g.width()-k.outerWidth();clearInterval(i.data("mCSB_buttonScrollRight"));if(!l){m=true}}else{e=-e}}var n=i.data("snapAmount");if(n){e=Math.round(e/n)*n-i.data("snapOffset")}d.mTweenAxis.call(this,h[0],"left",Math.round(p),draggerSpeed,f.scrollEasing);d.mTweenAxis.call(this,k[0],"left",Math.round(e),t,f.scrollEasing,{onStart:function(){if(f.callbacks&&!i.data("mCS_tweenRunning")){u("onScrollStart")}if(i.data("autoHideScrollbar")){d.showScrollbar.call(r)}},onUpdate:function(){if(f.callbacks){u("whileScrolling")}},onComplete:function(){if(f.callbacks){u("onScroll");if(q||(s&&k.position().left>=s)){u("onTotalScrollBack")}if(m||(l&&k.position().left<=l)){u("onTotalScroll")}}h.data("preventAction",false);i.data("mCS_tweenRunning",false);if(i.data("autoHideScrollbar")){if(!g.hasClass("mCS-mouse-over")){d.hideScrollbar.call(r)}}}})}else{if(i.data("onTotalScrollBack_Offset")){s=-i.data("onTotalScrollBack_Offset")}if(i.data("onTotalScroll_Offset")){l=g.height()-k.outerHeight()+i.data("onTotalScroll_Offset")}if(p<0){p=e=0;clearInterval(i.data("mCSB_buttonScrollUp"));if(!s){q=true}}else{if(p>=j.height()-h.height()){p=j.height()-h.height();e=g.height()-k.outerHeight();clearInterval(i.data("mCSB_buttonScrollDown"));if(!l){m=true}}else{e=-e}}var n=i.data("snapAmount");if(n){e=Math.round(e/n)*n-i.data("snapOffset")}d.mTweenAxis.call(this,h[0],"top",Math.round(p),draggerSpeed,f.scrollEasing);d.mTweenAxis.call(this,k[0],"top",Math.round(e),t,f.scrollEasing,{onStart:function(){if(f.callbacks&&!i.data("mCS_tweenRunning")){u("onScrollStart")}if(i.data("autoHideScrollbar")){d.showScrollbar.call(r)}},onUpdate:function(){if(f.callbacks){u("whileScrolling")}},onComplete:function(){if(f.callbacks){u("onScroll");if(q||(s&&k.position().top>=s)){u("onTotalScrollBack")}if(m||(l&&k.position().top<=l)){u("onTotalScroll")}}h.data("preventAction",false);i.data("mCS_tweenRunning",false);if(i.data("autoHideScrollbar")){if(!g.hasClass("mCS-mouse-over")){d.hideScrollbar.call(r)}}}})}if(i.data("mCS_Init")){i.data({mCS_Init:false})}}}function u(w){this.mcs={top:k.position().top,left:k.position().left,draggerTop:h.position().top,draggerLeft:h.position().left,topPct:Math.round((100*Math.abs(k.position().top))/Math.abs(k.outerHeight()-g.height())),leftPct:Math.round((100*Math.abs(k.position().left))/Math.abs(k.outerWidth()-g.width()))};switch(w){case"onScrollStart":i.data("mCS_tweenRunning",true).data("onScrollStart_Callback").call(i,this.mcs);break;case"whileScrolling":i.data("whileScrolling_Callback").call(i,this.mcs);break;case"onScroll":i.data("onScroll_Callback").call(i,this.mcs);break;case"onTotalScrollBack":i.data("onTotalScrollBack_Callback").call(i,this.mcs);break;case"onTotalScroll":i.data("onTotalScroll_Callback").call(i,this.mcs);break}}},stop:function(){var g=c(this),e=g.children().children(".mCSB_container"),f=g.children().children().children().children(".mCSB_dragger");d.mTweenAxisStop.call(this,e[0]);d.mTweenAxisStop.call(this,f[0])},disable:function(e){var j=c(this),f=j.children(".mCustomScrollBox"),h=f.children(".mCSB_container"),g=f.children(".mCSB_scrollTools"),i=g.children().children(".mCSB_dragger");f.unbind("mousewheel focusin mouseenter mouseleave touchend");h.unbind("touchstart touchmove");if(e){if(j.data("horizontalScroll")){i.add(h).css("left",0)}else{i.add(h).css("top",0)}}g.css("display","none");h.addClass("mCS_no_scrollbar");j.data({bindEvent_mousewheel:false,bindEvent_focusin:false,bindEvent_content_touch:false,bindEvent_autoHideScrollbar:false}).addClass("mCS_disabled")},destroy:function(){var e=c(this);e.removeClass("mCustomScrollbar _mCS_"+e.data("mCustomScrollbarIndex")).addClass("mCS_destroyed").children().children(".mCSB_container").unwrap().children().unwrap().siblings(".mCSB_scrollTools").remove();c(document).unbind("mousemove."+e.data("mCustomScrollbarIndex")+" mouseup."+e.data("mCustomScrollbarIndex")+" MSPointerMove."+e.data("mCustomScrollbarIndex")+" MSPointerUp."+e.data("mCustomScrollbarIndex"));c(window).unbind("resize."+e.data("mCustomScrollbarIndex"))}},d={showScrollbar:function(){this.stop().animate({opacity:1},"fast")},hideScrollbar:function(){this.stop().animate({opacity:0},"fast")},mTweenAxis:function(g,i,h,f,o,y){var y=y||{},v=y.onStart||function(){},p=y.onUpdate||function(){},w=y.onComplete||function(){};var n=t(),l,j=0,r=g.offsetTop,s=g.style;if(i==="left"){r=g.offsetLeft}var m=h-r;q();e();function t(){if(window.performance&&window.performance.now){return window.performance.now()}else{if(window.performance&&window.performance.webkitNow){return window.performance.webkitNow()}else{if(Date.now){return Date.now()}else{return allGetServerTime().getTime()}}}}function x(){if(!j){v.call()}j=t()-n;u();if(j>=g._time){g._time=(j>g._time)?j+l-(j-g._time):j+l-1;if(g._time<j+1){g._time=j+1}}if(g._time<f){g._id=_request(x)}else{w.call()}}function u(){if(f>0){g.currVal=k(g._time,r,m,f,o);s[i]=Math.round(g.currVal)+"px"}else{s[i]=h+"px"}p.call()}function e(){l=1000/60;g._time=j+l;_request=(!window.requestAnimationFrame)?function(z){u();return setTimeout(z,0.01)}:window.requestAnimationFrame;g._id=_request(x)}function q(){if(g._id==null){return}if(!window.requestAnimationFrame){clearTimeout(g._id)}else{window.cancelAnimationFrame(g._id)}g._id=null}function k(B,A,F,E,C){switch(C){case"linear":return F*B/E+A;break;case"easeOutQuad":B/=E;return -F*B*(B-2)+A;break;case"easeInOutQuad":B/=E/2;if(B<1){return F/2*B*B+A}B--;return -F/2*(B*(B-2)-1)+A;break;case"easeOutCubic":B/=E;B--;return F*(B*B*B+1)+A;break;case"easeOutQuart":B/=E;B--;return -F*(B*B*B*B-1)+A;break;case"easeOutQuint":B/=E;B--;return F*(B*B*B*B*B+1)+A;break;case"easeOutCirc":B/=E;B--;return F*Math.sqrt(1-B*B)+A;break;case"easeOutSine":return F*Math.sin(B/E*(Math.PI/2))+A;break;case"easeOutExpo":return F*(-Math.pow(2,-10*B/E)+1)+A;break;case"mcsEaseOut":var D=(B/=E)*B,z=D*B;return A+F*(0.499999999999997*z*D+-2.5*D*D+5.5*z+-6.5*D+4*B);break;case"draggerRailEase":B/=E/2;if(B<1){return F/2*B*B*B+A}B-=2;return F/2*(B*B*B+2)+A;break}}},mTweenAxisStop:function(e){if(e._id==null){return}if(!window.requestAnimationFrame){clearTimeout(e._id)}else{window.cancelAnimationFrame(e._id)}e._id=null},rafPolyfill:function(){var f=["ms","moz","webkit","o"],e=f.length;while(--e>-1&&!window.requestAnimationFrame){window.requestAnimationFrame=window[f[e]+"RequestAnimationFrame"];window.cancelAnimationFrame=window[f[e]+"CancelAnimationFrame"]||window[f[e]+"CancelRequestAnimationFrame"]}}};d.rafPolyfill.call();c.support.touch=!!("ontouchstart" in window);c.support.msPointer=window.navigator.msPointerEnabled;var a=("https:"==document.location.protocol)?"https:":"http:";c.event.special.mousewheel||document.write('<script src="'+a+'//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.0.6/jquery.mousewheel.min.js"><\/script>');c.fn.mCustomScrollbar=function(e){if(b[e]){return b[e].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof e==="object"||!e){return b.init.apply(this,arguments)}else{c.error("Method "+e+" does not exist")}}}})(jQuery);
  7. /**
  8. * SyntaxHighlighter
  9. * http://alexgorbatchev.com/SyntaxHighlighter
  10. *
  11. * SyntaxHighlighter is donationware. If you are using it, please donate.
  12. * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
  13. *
  14. * @version
  15. * 3.0.83 (July 02 2010)
  16. *
  17. * @copyright
  18. * Copyright (C) 2004-2010 Alex Gorbatchev.
  19. *
  20. * @license
  21. * Dual licensed under the MIT and GPL licenses.
  22. */
  23. eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('K M;I(M)1S 2U("2a\'t 4k M 4K 2g 3l 4G 4H");(6(){6 r(f,e){I(!M.1R(f))1S 3m("3s 15 4R");K a=f.1w;f=M(f.1m,t(f)+(e||""));I(a)f.1w={1m:a.1m,19:a.19?a.19.1a(0):N};H f}6 t(f){H(f.1J?"g":"")+(f.4s?"i":"")+(f.4p?"m":"")+(f.4v?"x":"")+(f.3n?"y":"")}6 B(f,e,a,b){K c=u.L,d,h,g;v=R;5K{O(;c--;){g=u[c];I(a&g.3r&&(!g.2p||g.2p.W(b))){g.2q.12=e;I((h=g.2q.X(f))&&h.P===e){d={3k:g.2b.W(b,h,a),1C:h};1N}}}}5v(i){1S i}5q{v=11}H d}6 p(f,e,a){I(3b.Z.1i)H f.1i(e,a);O(a=a||0;a<f.L;a++)I(f[a]===e)H a;H-1}M=6(f,e){K a=[],b=M.1B,c=0,d,h;I(M.1R(f)){I(e!==1d)1S 3m("2a\'t 5r 5I 5F 5B 5C 15 5E 5p");H r(f)}I(v)1S 2U("2a\'t W 3l M 59 5m 5g 5x 5i");e=e||"";O(d={2N:11,19:[],2K:6(g){H e.1i(g)>-1},3d:6(g){e+=g}};c<f.L;)I(h=B(f,c,b,d)){a.U(h.3k);c+=h.1C[0].L||1}Y I(h=n.X.W(z[b],f.1a(c))){a.U(h[0]);c+=h[0].L}Y{h=f.3a(c);I(h==="[")b=M.2I;Y I(h==="]")b=M.1B;a.U(h);c++}a=15(a.1K(""),n.Q.W(e,w,""));a.1w={1m:f,19:d.2N?d.19:N};H a};M.3v="1.5.0";M.2I=1;M.1B=2;K C=/\\$(?:(\\d\\d?|[$&`\'])|{([$\\w]+)})/g,w=/[^5h]+|([\\s\\S])(?=[\\s\\S]*\\1)/g,A=/^(?:[?*+]|{\\d+(?:,\\d*)?})\\??/,v=11,u=[],n={X:15.Z.X,1A:15.Z.1A,1C:1r.Z.1C,Q:1r.Z.Q,1e:1r.Z.1e},x=n.X.W(/()??/,"")[1]===1d,D=6(){K f=/^/g;n.1A.W(f,"");H!f.12}(),y=6(){K f=/x/g;n.Q.W("x",f,"");H!f.12}(),E=15.Z.3n!==1d,z={};z[M.2I]=/^(?:\\\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\\29-26-f]{2}|u[\\29-26-f]{4}|c[A-3o-z]|[\\s\\S]))/;z[M.1B]=/^(?:\\\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\\d*|x[\\29-26-f]{2}|u[\\29-26-f]{4}|c[A-3o-z]|[\\s\\S])|\\(\\?[:=!]|[?*+]\\?|{\\d+(?:,\\d*)?}\\??)/;M.1h=6(f,e,a,b){u.U({2q:r(f,"g"+(E?"y":"")),2b:e,3r:a||M.1B,2p:b||N})};M.2n=6(f,e){K a=f+"/"+(e||"");H M.2n[a]||(M.2n[a]=M(f,e))};M.3c=6(f){H r(f,"g")};M.5l=6(f){H f.Q(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g,"\\\\$&")};M.5e=6(f,e,a,b){e=r(e,"g"+(b&&E?"y":""));e.12=a=a||0;f=e.X(f);H b?f&&f.P===a?f:N:f};M.3q=6(){M.1h=6(){1S 2U("2a\'t 55 1h 54 3q")}};M.1R=6(f){H 53.Z.1q.W(f)==="[2m 15]"};M.3p=6(f,e,a,b){O(K c=r(e,"g"),d=-1,h;h=c.X(f);){a.W(b,h,++d,f,c);c.12===h.P&&c.12++}I(e.1J)e.12=0};M.57=6(f,e){H 6 a(b,c){K d=e[c].1I?e[c]:{1I:e[c]},h=r(d.1I,"g"),g=[],i;O(i=0;i<b.L;i++)M.3p(b[i],h,6(k){g.U(d.3j?k[d.3j]||"":k[0])});H c===e.L-1||!g.L?g:a(g,c+1)}([f],0)};15.Z.1p=6(f,e){H J.X(e[0])};15.Z.W=6(f,e){H J.X(e)};15.Z.X=6(f){K e=n.X.1p(J,14),a;I(e){I(!x&&e.L>1&&p(e,"")>-1){a=15(J.1m,n.Q.W(t(J),"g",""));n.Q.W(f.1a(e.P),a,6(){O(K c=1;c<14.L-2;c++)I(14[c]===1d)e[c]=1d})}I(J.1w&&J.1w.19)O(K b=1;b<e.L;b++)I(a=J.1w.19[b-1])e[a]=e[b];!D&&J.1J&&!e[0].L&&J.12>e.P&&J.12--}H e};I(!D)15.Z.1A=6(f){(f=n.X.W(J,f))&&J.1J&&!f[0].L&&J.12>f.P&&J.12--;H!!f};1r.Z.1C=6(f){M.1R(f)||(f=15(f));I(f.1J){K e=n.1C.1p(J,14);f.12=0;H e}H f.X(J)};1r.Z.Q=6(f,e){K a=M.1R(f),b,c;I(a&&1j e.58()==="3f"&&e.1i("${")===-1&&y)H n.Q.1p(J,14);I(a){I(f.1w)b=f.1w.19}Y f+="";I(1j e==="6")c=n.Q.W(J,f,6(){I(b){14[0]=1f 1r(14[0]);O(K d=0;d<b.L;d++)I(b[d])14[0][b[d]]=14[d+1]}I(a&&f.1J)f.12=14[14.L-2]+14[0].L;H e.1p(N,14)});Y{c=J+"";c=n.Q.W(c,f,6(){K d=14;H n.Q.W(e,C,6(h,g,i){I(g)5b(g){24"$":H"$";24"&":H d[0];24"`":H d[d.L-1].1a(0,d[d.L-2]);24"\'":H d[d.L-1].1a(d[d.L-2]+d[0].L);5a:i="";g=+g;I(!g)H h;O(;g>d.L-3;){i=1r.Z.1a.W(g,-1)+i;g=1Q.3i(g/10)}H(g?d[g]||"":"$")+i}Y{g=+i;I(g<=d.L-3)H d[g];g=b?p(b,i):-1;H g>-1?d[g+1]:h}})})}I(a&&f.1J)f.12=0;H c};1r.Z.1e=6(f,e){I(!M.1R(f))H n.1e.1p(J,14);K a=J+"",b=[],c=0,d,h;I(e===1d||+e<0)e=5D;Y{e=1Q.3i(+e);I(!e)H[]}O(f=M.3c(f);d=f.X(a);){I(f.12>c){b.U(a.1a(c,d.P));d.L>1&&d.P<a.L&&3b.Z.U.1p(b,d.1a(1));h=d[0].L;c=f.12;I(b.L>=e)1N}f.12===d.P&&f.12++}I(c===a.L){I(!n.1A.W(f,"")||h)b.U("")}Y b.U(a.1a(c));H b.L>e?b.1a(0,e):b};M.1h(/\\(\\?#[^)]*\\)/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"});M.1h(/\\((?!\\?)/,6(){J.19.U(N);H"("});M.1h(/\\(\\?<([$\\w]+)>/,6(f){J.19.U(f[1]);J.2N=R;H"("});M.1h(/\\\\k<([\\w$]+)>/,6(f){K e=p(J.19,f[1]);H e>-1?"\\\\"+(e+1)+(3R(f.2S.3a(f.P+f[0].L))?"":"(?:)"):f[0]});M.1h(/\\[\\^?]/,6(f){H f[0]==="[]"?"\\\\b\\\\B":"[\\\\s\\\\S]"});M.1h(/^\\(\\?([5A]+)\\)/,6(f){J.3d(f[1]);H""});M.1h(/(?:\\s+|#.*)+/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"},M.1B,6(){H J.2K("x")});M.1h(/\\./,6(){H"[\\\\s\\\\S]"},M.1B,6(){H J.2K("s")})})();1j 2e!="1d"&&(2e.M=M);K 1v=6(){6 r(a,b){a.1l.1i(b)!=-1||(a.1l+=" "+b)}6 t(a){H a.1i("3e")==0?a:"3e"+a}6 B(a){H e.1Y.2A[t(a)]}6 p(a,b,c){I(a==N)H N;K d=c!=R?a.3G:[a.2G],h={"#":"1c",".":"1l"}[b.1o(0,1)]||"3h",g,i;g=h!="3h"?b.1o(1):b.5u();I((a[h]||"").1i(g)!=-1)H a;O(a=0;d&&a<d.L&&i==N;a++)i=p(d[a],b,c);H i}6 C(a,b){K c={},d;O(d 2g a)c[d]=a[d];O(d 2g b)c[d]=b[d];H c}6 w(a,b,c,d){6 h(g){g=g||1P.5y;I(!g.1F){g.1F=g.52;g.3N=6(){J.5w=11}}c.W(d||1P,g)}a.3g?a.3g("4U"+b,h):a.4y(b,h,11)}6 A(a,b){K c=e.1Y.2j,d=N;I(c==N){c={};O(K h 2g e.1U){K g=e.1U[h];d=g.4x;I(d!=N){g.1V=h.4w();O(g=0;g<d.L;g++)c[d[g]]=h}}e.1Y.2j=c}d=e.1U[c[a]];d==N&&b!=11&&1P.1X(e.13.1x.1X+(e.13.1x.3E+a));H d}6 v(a,b){O(K c=a.1e("\\n"),d=0;d<c.L;d++)c[d]=b(c[d],d);H c.1K("\\n")}6 u(a,b){I(a==N||a.L==0||a=="\\n")H a;a=a.Q(/</g,"&1y;");a=a.Q(/ {2,}/g,6(c){O(K d="",h=0;h<c.L-1;h++)d+=e.13.1W;H d+" "});I(b!=N)a=v(a,6(c){I(c.L==0)H"";K d="";c=c.Q(/^(&2s;| )+/,6(h){d=h;H""});I(c.L==0)H d;H d+\'<17 1g="\'+b+\'">\'+c+"</17>"});H a}6 n(a,b){a.1e("\\n");O(K c="",d=0;d<50;d++)c+=" ";H a=v(a,6(h){I(h.1i("\\t")==-1)H h;O(K g=0;(g=h.1i("\\t"))!=-1;)h=h.1o(0,g)+c.1o(0,b-g%b)+h.1o(g+1,h.L);H h})}6 x(a){H a.Q(/^\\s+|\\s+$/g,"")}6 D(a,b){I(a.P<b.P)H-1;Y I(a.P>b.P)H 1;Y I(a.L<b.L)H-1;Y I(a.L>b.L)H 1;H 0}6 y(a,b){6 c(k){H k[0]}O(K d=N,h=[],g=b.2D?b.2D:c;(d=b.1I.X(a))!=N;){K i=g(d,b);I(1j i=="3f")i=[1f e.2L(i,d.P,b.23)];h=h.1O(i)}H h}6 E(a){K b=/(.*)((&1G;|&1y;).*)/;H a.Q(e.3A.3M,6(c){K d="",h=N;I(h=b.X(c)){c=h[1];d=h[2]}H\'<a 2h="\'+c+\'">\'+c+"</a>"+d})}6 z(){O(K a=1E.36("1k"),b=[],c=0;c<a.L;c++)a[c].3s=="20"&&b.U(a[c]);H b}6 f(a){a=a.1F;K b=p(a,".20",R);a=p(a,".3O",R);K c=1E.4i("3t");I(!(!a||!b||p(a,"3t"))){B(b.1c);r(b,"1m");O(K d=a.3G,h=[],g=0;g<d.L;g++)h.U(d[g].4z||d[g].4A);h=h.1K("\\r");c.39(1E.4D(h));a.39(c);c.2C();c.4C();w(c,"4u",6(){c.2G.4E(c);b.1l=b.1l.Q("1m","")})}}I(1j 3F!="1d"&&1j M=="1d")M=3F("M").M;K e={2v:{"1g-27":"","2i-1s":1,"2z-1s-2t":11,1M:N,1t:N,"42-45":R,"43-22":4,1u:R,16:R,"3V-17":R,2l:11,"41-40":R,2k:11,"1z-1k":11},13:{1W:"&2s;",2M:R,46:11,44:11,34:"4n",1x:{21:"4o 1m",2P:"?",1X:"1v\\n\\n",3E:"4r\'t 4t 1D O: ",4g:"4m 4B\'t 51 O 1z-1k 4F: ",37:\'<!4T 1z 4S "-//4V//3H 4W 1.0 4Z//4Y" "1Z://2y.3L.3K/4X/3I/3H/3I-4P.4J"><1z 4I="1Z://2y.3L.3K/4L/5L"><3J><4N 1Z-4M="5G-5M" 6K="2O/1z; 6J=6I-8" /><1t>6L 1v</1t></3J><3B 1L="25-6M:6Q,6P,6O,6N-6F;6y-2f:#6x;2f:#6w;25-22:6v;2O-3D:3C;"><T 1L="2O-3D:3C;3w-32:1.6z;"><T 1L="25-22:6A-6E;">1v</T><T 1L="25-22:.6C;3w-6B:6R;"><T>3v 3.0.76 (72 73 3x)</T><T><a 2h="1Z://3u.2w/1v" 1F="38" 1L="2f:#3y">1Z://3u.2w/1v</a></T><T>70 17 6U 71.</T><T>6T 6X-3x 6Y 6D.</T></T><T>6t 61 60 J 1k, 5Z <a 2h="6u://2y.62.2w/63-66/65?64=5X-5W&5P=5O" 1L="2f:#3y">5R</a> 5V <2R/>5U 5T 5S!</T></T></3B></1z>\'}},1Y:{2j:N,2A:{}},1U:{},3A:{6n:/\\/\\*[\\s\\S]*?\\*\\//2c,6m:/\\/\\/.*$/2c,6l:/#.*$/2c,6k:/"([^\\\\"\\n]|\\\\.)*"/g,6o:/\'([^\\\\\'\\n]|\\\\.)*\'/g,6p:1f M(\'"([^\\\\\\\\"]|\\\\\\\\.)*"\',"3z"),6s:1f M("\'([^\\\\\\\\\']|\\\\\\\\.)*\'","3z"),6q:/(&1y;|<)!--[\\s\\S]*?--(&1G;|>)/2c,3M:/\\w+:\\/\\/[\\w-.\\/?%&=:@;]*/g,6a:{18:/(&1y;|<)\\?=?/g,1b:/\\?(&1G;|>)/g},69:{18:/(&1y;|<)%=?/g,1b:/%(&1G;|>)/g},6d:{18:/(&1y;|<)\\s*1k.*?(&1G;|>)/2T,1b:/(&1y;|<)\\/\\s*1k\\s*(&1G;|>)/2T}},16:{1H:6(a){6 b(i,k){H e.16.2o(i,k,e.13.1x[k])}O(K c=\'<T 1g="16">\',d=e.16.2x,h=d.2X,g=0;g<h.L;g++)c+=(d[h[g]].1H||b)(a,h[g]);c+="</T>";H c},2o:6(a,b,c){H\'<2W><a 2h="#" 1g="6e 6h\'+b+" "+b+\'">\'+c+"</a></2W>"},2b:6(a){K b=a.1F,c=b.1l||"";b=B(p(b,".20",R).1c);K d=6(h){H(h=15(h+"6f(\\\\w+)").X(c))?h[1]:N}("6g");b&&d&&e.16.2x[d].2B(b);a.3N()},2x:{2X:["21","2P"],21:{1H:6(a){I(a.V("2l")!=R)H"";K b=a.V("1t");H e.16.2o(a,"21",b?b:e.13.1x.21)},2B:6(a){a=1E.6j(t(a.1c));a.1l=a.1l.Q("47","")}},2P:{2B:6(){K a="68=0";a+=", 18="+(31.30-33)/2+", 32="+(31.2Z-2Y)/2+", 30=33, 2Z=2Y";a=a.Q(/^,/,"");a=1P.6Z("","38",a);a.2C();K b=a.1E;b.6W(e.13.1x.37);b.6V();a.2C()}}}},35:6(a,b){K c;I(b)c=[b];Y{c=1E.36(e.13.34);O(K d=[],h=0;h<c.L;h++)d.U(c[h]);c=d}c=c;d=[];I(e.13.2M)c=c.1O(z());I(c.L===0)H d;O(h=0;h<c.L;h++){O(K g=c[h],i=a,k=c[h].1l,j=3W 0,l={},m=1f M("^\\\\[(?<2V>(.*?))\\\\]$"),s=1f M("(?<27>[\\\\w-]+)\\\\s*:\\\\s*(?<1T>[\\\\w-%#]+|\\\\[.*?\\\\]|\\".*?\\"|\'.*?\')\\\\s*;?","g");(j=s.X(k))!=N;){K o=j.1T.Q(/^[\'"]|[\'"]$/g,"");I(o!=N&&m.1A(o)){o=m.X(o);o=o.2V.L>0?o.2V.1e(/\\s*,\\s*/):[]}l[j.27]=o}g={1F:g,1n:C(i,l)};g.1n.1D!=N&&d.U(g)}H d},1M:6(a,b){K c=J.35(a,b),d=N,h=e.13;I(c.L!==0)O(K g=0;g<c.L;g++){b=c[g];K i=b.1F,k=b.1n,j=k.1D,l;I(j!=N){I(k["1z-1k"]=="R"||e.2v["1z-1k"]==R){d=1f e.4l(j);j="4O"}Y I(d=A(j))d=1f d;Y 6H;l=i.3X;I(h.2M){l=l;K m=x(l),s=11;I(m.1i("<![6G[")==0){m=m.4h(9);s=R}K o=m.L;I(m.1i("]]\\>")==o-3){m=m.4h(0,o-3);s=R}l=s?m:l}I((i.1t||"")!="")k.1t=i.1t;k.1D=j;d.2Q(k);b=d.2F(l);I((i.1c||"")!="")b.1c=i.1c;i.2G.74(b,i)}}},2E:6(a){w(1P,"4k",6(){e.1M(a)})}};e.2E=e.2E;e.1M=e.1M;e.2L=6(a,b,c){J.1T=a;J.P=b;J.L=a.L;J.23=c;J.1V=N};e.2L.Z.1q=6(){H J.1T};e.4l=6(a){6 b(j,l){O(K m=0;m<j.L;m++)j[m].P+=l}K c=A(a),d,h=1f e.1U.5Y,g=J,i="2F 1H 2Q".1e(" ");I(c!=N){d=1f c;O(K k=0;k<i.L;k++)(6(){K j=i[k];g[j]=6(){H h[j].1p(h,14)}})();d.28==N?1P.1X(e.13.1x.1X+(e.13.1x.4g+a)):h.2J.U({1I:d.28.17,2D:6(j){O(K l=j.17,m=[],s=d.2J,o=j.P+j.18.L,F=d.28,q,G=0;G<s.L;G++){q=y(l,s[G]);b(q,o);m=m.1O(q)}I(F.18!=N&&j.18!=N){q=y(j.18,F.18);b(q,j.P);m=m.1O(q)}I(F.1b!=N&&j.1b!=N){q=y(j.1b,F.1b);b(q,j.P+j[0].5Q(j.1b));m=m.1O(q)}O(j=0;j<m.L;j++)m[j].1V=c.1V;H m}})}};e.4j=6(){};e.4j.Z={V:6(a,b){K c=J.1n[a];c=c==N?b:c;K d={"R":R,"11":11}[c];H d==N?c:d},3Y:6(a){H 1E.4i(a)},4c:6(a,b){K c=[];I(a!=N)O(K d=0;d<a.L;d++)I(1j a[d]=="2m")c=c.1O(y(b,a[d]));H J.4e(c.6b(D))},4e:6(a){O(K b=0;b<a.L;b++)I(a[b]!==N)O(K c=a[b],d=c.P+c.L,h=b+1;h<a.L&&a[b]!==N;h++){K g=a[h];I(g!==N)I(g.P>d)1N;Y I(g.P==c.P&&g.L>c.L)a[b]=N;Y I(g.P>=c.P&&g.P<d)a[h]=N}H a},4d:6(a){K b=[],c=2u(J.V("2i-1s"));v(a,6(d,h){b.U(h+c)});H b},3U:6(a){K b=J.V("1M",[]);I(1j b!="2m"&&b.U==N)b=[b];a:{a=a.1q();K c=3W 0;O(c=c=1Q.6c(c||0,0);c<b.L;c++)I(b[c]==a){b=c;1N a}b=-1}H b!=-1},2r:6(a,b,c){a=["1s","6i"+b,"P"+a,"6r"+(b%2==0?1:2).1q()];J.3U(b)&&a.U("67");b==0&&a.U("1N");H\'<T 1g="\'+a.1K(" ")+\'">\'+c+"</T>"},3Q:6(a,b){K c="",d=a.1e("\\n").L,h=2u(J.V("2i-1s")),g=J.V("2z-1s-2t");I(g==R)g=(h+d-1).1q().L;Y I(3R(g)==R)g=0;O(K i=0;i<d;i++){K k=b?b[i]:h+i,j;I(k==0)j=e.13.1W;Y{j=g;O(K l=k.1q();l.L<j;)l="0"+l;j=l}a=j;c+=J.2r(i,k,a)}H c},49:6(a,b){a=x(a);K c=a.1e("\\n");J.V("2z-1s-2t");K d=2u(J.V("2i-1s"));a="";O(K h=J.V("1D"),g=0;g<c.L;g++){K i=c[g],k=/^(&2s;|\\s)+/.X(i),j=N,l=b?b[g]:d+g;I(k!=N){j=k[0].1q();i=i.1o(j.L);j=j.Q(" ",e.13.1W)}i=x(i);I(i.L==0)i=e.13.1W;a+=J.2r(g,l,(j!=N?\'<17 1g="\'+h+\' 5N">\'+j+"</17>":"")+i)}H a},4f:6(a){H a?"<4a>"+a+"</4a>":""},4b:6(a,b){6 c(l){H(l=l?l.1V||g:g)?l+" ":""}O(K d=0,h="",g=J.V("1D",""),i=0;i<b.L;i++){K k=b[i],j;I(!(k===N||k.L===0)){j=c(k);h+=u(a.1o(d,k.P-d),j+"48")+u(k.1T,j+k.23);d=k.P+k.L+(k.75||0)}}h+=u(a.1o(d),c()+"48");H h},1H:6(a){K b="",c=["20"],d;I(J.V("2k")==R)J.1n.16=J.1n.1u=11;1l="20";J.V("2l")==R&&c.U("47");I((1u=J.V("1u"))==11)c.U("6S");c.U(J.V("1g-27"));c.U(J.V("1D"));a=a.Q(/^[ ]*[\\n]+|[\\n]*[ ]*$/g,"").Q(/\\r/g," ");b=J.V("43-22");I(J.V("42-45")==R)a=n(a,b);Y{O(K h="",g=0;g<b;g++)h+=" ";a=a.Q(/\\t/g,h)}a=a;a:{b=a=a;h=/<2R\\s*\\/?>|&1y;2R\\s*\\/?&1G;/2T;I(e.13.46==R)b=b.Q(h,"\\n");I(e.13.44==R)b=b.Q(h,"");b=b.1e("\\n");h=/^\\s*/;g=4Q;O(K i=0;i<b.L&&g>0;i++){K k=b[i];I(x(k).L!=0){k=h.X(k);I(k==N){a=a;1N a}g=1Q.4q(k[0].L,g)}}I(g>0)O(i=0;i<b.L;i++)b[i]=b[i].1o(g);a=b.1K("\\n")}I(1u)d=J.4d(a);b=J.4c(J.2J,a);b=J.4b(a,b);b=J.49(b,d);I(J.V("41-40"))b=E(b);1j 2H!="1d"&&2H.3S&&2H.3S.1C(/5s/)&&c.U("5t");H b=\'<T 1c="\'+t(J.1c)+\'" 1g="\'+c.1K(" ")+\'">\'+(J.V("16")?e.16.1H(J):"")+\'<3Z 5z="0" 5H="0" 5J="0">\'+J.4f(J.V("1t"))+"<3T><3P>"+(1u?\'<2d 1g="1u">\'+J.3Q(a)+"</2d>":"")+\'<2d 1g="17"><T 1g="3O">\'+b+"</T></2d></3P></3T></3Z></T>"},2F:6(a){I(a===N)a="";J.17=a;K b=J.3Y("T");b.3X=J.1H(a);J.V("16")&&w(p(b,".16"),"5c",e.16.2b);J.V("3V-17")&&w(p(b,".17"),"56",f);H b},2Q:6(a){J.1c=""+1Q.5d(1Q.5n()*5k).1q();e.1Y.2A[t(J.1c)]=J;J.1n=C(e.2v,a||{});I(J.V("2k")==R)J.1n.16=J.1n.1u=11},5j:6(a){a=a.Q(/^\\s+|\\s+$/g,"").Q(/\\s+/g,"|");H"\\\\b(?:"+a+")\\\\b"},5f:6(a){J.28={18:{1I:a.18,23:"1k"},1b:{1I:a.1b,23:"1k"},17:1f M("(?<18>"+a.18.1m+")(?<17>.*?)(?<1b>"+a.1b.1m+")","5o")}}};H e}();1j 2e!="1d"&&(2e.1v=1v);',62,441,'||||||function|||||||||||||||||||||||||||||||||||||return|if|this|var|length|XRegExp|null|for|index|replace|true||div|push|getParam|call|exec|else|prototype||false|lastIndex|config|arguments|RegExp|toolbar|code|left|captureNames|slice|right|id|undefined|split|new|class|addToken|indexOf|typeof|script|className|source|params|substr|apply|toString|String|line|title|gutter|SyntaxHighlighter|_xregexp|strings|lt|html|test|OUTSIDE_CLASS|match|brush|document|target|gt|getHtml|regex|global|join|style|highlight|break|concat|window|Math|isRegExp|throw|value|brushes|brushName|space|alert|vars|http|syntaxhighlighter|expandSource|size|css|case|font|Fa|name|htmlScript|dA|can|handler|gm|td|exports|color|in|href|first|discoveredBrushes|light|collapse|object|cache|getButtonHtml|trigger|pattern|getLineHtml|nbsp|numbers|parseInt|defaults|com|items|www|pad|highlighters|execute|focus|func|all|getDiv|parentNode|navigator|INSIDE_CLASS|regexList|hasFlag|Match|useScriptTags|hasNamedCapture|text|help|init|br|input|gi|Error|values|span|list|250|height|width|screen|top|500|tagName|findElements|getElementsByTagName|aboutDialog|_blank|appendChild|charAt|Array|copyAsGlobal|setFlag|highlighter_|string|attachEvent|nodeName|floor|backref|output|the|TypeError|sticky|Za|iterate|freezeTokens|scope|type|textarea|alexgorbatchev|version|margin|2010|005896|gs|regexLib|body|center|align|noBrush|require|childNodes|DTD|xhtml1|head|org|w3|url|preventDefault|container|tr|getLineNumbersHtml|isNaN|userAgent|tbody|isLineHighlighted|quick|void|innerHTML|create|table|links|auto|smart|tab|stripBrs|tabs|bloggerMode|collapsed|plain|getCodeLinesHtml|caption|getMatchesHtml|findMatches|figureOutLineNumbers|removeNestedMatches|getTitleHtml|brushNotHtmlScript|substring|createElement|Highlighter|load|HtmlScript|Brush|pre|expand|multiline|min|Can|ignoreCase|find|blur|extended|toLowerCase|aliases|addEventListener|innerText|textContent|wasn|select|createTextNode|removeChild|option|same|frame|xmlns|dtd|twice|1999|equiv|meta|htmlscript|transitional|1E3|expected|PUBLIC|DOCTYPE|on|W3C|XHTML|TR|EN|Transitional||configured|srcElement|Object|after|run|dblclick|matchChain|valueOf|constructor|default|switch|click|round|execAt|forHtmlScript|token|gimy|functions|getKeywords|1E6|escape|within|random|sgi|another|finally|supply|MSIE|ie|toUpperCase|catch|returnValue|definition|event|border|imsx|constructing|one|Infinity|from|when|Content|cellpadding|flags|cellspacing|try|xhtml|Type|spaces|2930402|hosted_button_id|lastIndexOf|donate|active|development|keep|to|xclick|_s|Xml|please|like|you|paypal|cgi|cmd|webscr|bin|highlighted|scrollbars|aspScriptTags|phpScriptTags|sort|max|scriptScriptTags|toolbar_item|_|command|command_|number|getElementById|doubleQuotedString|singleLinePerlComments|singleLineCComments|multiLineCComments|singleQuotedString|multiLineDoubleQuotedString|xmlComments|alt|multiLineSingleQuotedString|If|https|1em|000|fff|background|5em|xx|bottom|75em|Gorbatchev|large|serif|CDATA|continue|utf|charset|content|About|family|sans|Helvetica|Arial|Geneva|3em|nogutter|Copyright|syntax|close|write|2004|Alex|open|JavaScript|highlighter|July|02|replaceChild|offset|83'.split('|'),0,{}))
  24. ;
  25. /**
  26. * SyntaxHighlighter
  27. * http://alexgorbatchev.com/SyntaxHighlighter
  28. *
  29. * SyntaxHighlighter is donationware. If you are using it, please donate.
  30. * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
  31. *
  32. * @version
  33. * 3.0.83 (July 02 2010)
  34. *
  35. * @copyright
  36. * Copyright (C) 2004-2010 Alex Gorbatchev.
  37. *
  38. * @license
  39. * Dual licensed under the MIT and GPL licenses.
  40. */
  41. ;(function()
  42. {
  43. // CommonJS
  44. typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
  45. function Brush()
  46. {
  47. function getKeywordsCSS(str)
  48. {
  49. return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b';
  50. };
  51. function getValuesCSS(str)
  52. {
  53. return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b';
  54. };
  55. var keywords = 'box-shadow transform transition animation box-sizing opacity border-radius pointer-events perspective perspective-origin ' +
  56. 'transform-origin user-select transform-style transition-delay transition-timing-function transition-property transition-duration ' +
  57. 'ascent azimuth background-size background-attachment background-color background-image background-position ' +
  58. 'animation-name animation-timing-function animation-duration animation-iteration-count animation-direction animation-play-state ' +
  59. 'animation-fill-mode animation-delay text-rendering font-smoothing backface-visibility ' +
  60. 'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' +
  61. 'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' +
  62. 'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' +
  63. 'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' +
  64. 'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' +
  65. 'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' +
  66. 'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' +
  67. 'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' +
  68. 'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' +
  69. 'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' +
  70. 'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' +
  71. 'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' +
  72. 'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index';
  73. var values = 'rotate translate cover translateX translateY translateZ scale rotateX rotateY preserve-3d optimizeLegibility antialiased grab inline-block ' +
  74. 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+
  75. 'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+
  76. 'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double '+
  77. 'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+
  78. 'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+
  79. 'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+
  80. 'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+
  81. 'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+
  82. 'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+
  83. 'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+
  84. 'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+
  85. 'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+
  86. 'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+
  87. 'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow';
  88. var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif';
  89. this.regexList = [
  90. { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
  91. { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
  92. { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
  93. { regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors
  94. { regex: /(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)/g, css: 'value' }, // sizes
  95. { regex: /!important/g, css: 'color3' }, // !important
  96. { regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords
  97. { regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values
  98. { regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts
  99. ];
  100. this.forHtmlScript({
  101. left: /(&lt;|<)\s*style.*?(&gt;|>)/gi,
  102. right: /(&lt;|<)\/\s*style\s*(&gt;|>)/gi
  103. });
  104. };
  105. Brush.prototype = new SyntaxHighlighter.Highlighter();
  106. Brush.aliases = ['css'];
  107. SyntaxHighlighter.brushes.CSS = Brush;
  108. // CommonJS
  109. typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
  110. })();
  111. /**
  112. * SyntaxHighlighter
  113. * http://alexgorbatchev.com/SyntaxHighlighter
  114. *
  115. * SyntaxHighlighter is donationware. If you are using it, please donate.
  116. * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
  117. *
  118. * @version
  119. * 3.0.83 (July 02 2010)
  120. *
  121. * @copyright
  122. * Copyright (C) 2004-2010 Alex Gorbatchev.
  123. *
  124. * @license
  125. * Dual licensed under the MIT and GPL licenses.
  126. */
  127. ;(function()
  128. {
  129. // CommonJS
  130. typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
  131. function Brush()
  132. {
  133. var keywords = 'break case catch continue ' +
  134. 'default delete do else false ' +
  135. 'for function if in instanceof ' +
  136. 'new null return super switch ' +
  137. 'this throw true try typeof var while with'
  138. ;
  139. var r = SyntaxHighlighter.regexLib;
  140. this.regexList = [
  141. { regex: r.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings
  142. { regex: r.multiLineSingleQuotedString, css: 'string' }, // single quoted strings
  143. { regex: r.singleLineCComments, css: 'comments' }, // one line comments
  144. { regex: r.multiLineCComments, css: 'comments' }, // multiline comments
  145. { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
  146. { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords
  147. ];
  148. this.forHtmlScript(r.scriptScriptTags);
  149. };
  150. Brush.prototype = new SyntaxHighlighter.Highlighter();
  151. Brush.aliases = ['js', 'jscript', 'javascript'];
  152. SyntaxHighlighter.brushes.JScript = Brush;
  153. // CommonJS
  154. typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
  155. })();
  156. /**
  157. * SyntaxHighlighter
  158. * http://alexgorbatchev.com/SyntaxHighlighter
  159. *
  160. * SyntaxHighlighter is donationware. If you are using it, please donate.
  161. * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
  162. *
  163. * @version
  164. * 3.0.83 (July 02 2010)
  165. *
  166. * @copyright
  167. * Copyright (C) 2004-2010 Alex Gorbatchev.
  168. *
  169. * @license
  170. * Dual licensed under the MIT and GPL licenses.
  171. */
  172. ;(function()
  173. {
  174. // CommonJS
  175. typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
  176. function Brush()
  177. {
  178. var funcs = 'abs acos acosh addcslashes addslashes ' +
  179. 'array_change_key_case array_chunk array_combine array_count_values array_diff '+
  180. 'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+
  181. 'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+
  182. 'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+
  183. 'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+
  184. 'array_push array_rand array_reduce array_reverse array_search array_shift '+
  185. 'array_slice array_splice array_sum array_udiff array_udiff_assoc '+
  186. 'array_udiff_uassoc array_uintersect array_uintersect_assoc '+
  187. 'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+
  188. 'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+
  189. 'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+
  190. 'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+
  191. 'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+
  192. 'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+
  193. 'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+
  194. 'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+
  195. 'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+
  196. 'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+
  197. 'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+
  198. 'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+
  199. 'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+
  200. 'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+
  201. 'gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set '+
  202. 'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+
  203. 'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+
  204. 'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+
  205. 'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+
  206. 'parse_ini_file parse_str parse_url passthru pathinfo print readlink realpath rewind rewinddir rmdir '+
  207. 'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+
  208. 'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+
  209. 'stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk '+
  210. 'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+
  211. 'strtoupper strtr strval substr substr_compare';
  212. var keywords = 'abstract and array as break case catch cfunction class clone const continue declare default die do ' +
  213. 'else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach ' +
  214. 'function include include_once global goto if implements interface instanceof namespace new ' +
  215. 'old_function or private protected public return require require_once static switch ' +
  216. 'throw try use var while xor ';
  217. var constants = '__FILE__ __LINE__ __METHOD__ __FUNCTION__ __CLASS__';
  218. this.regexList = [
  219. { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
  220. { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
  221. { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
  222. { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
  223. { regex: /\$\w+/g, css: 'variable' }, // variables
  224. { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // common functions
  225. { regex: new RegExp(this.getKeywords(constants), 'gmi'), css: 'constants' }, // constants
  226. { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keyword
  227. ];
  228. this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags);
  229. };
  230. Brush.prototype = new SyntaxHighlighter.Highlighter();
  231. Brush.aliases = ['php'];
  232. SyntaxHighlighter.brushes.Php = Brush;
  233. // CommonJS
  234. typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
  235. })();
  236. /**
  237. * SyntaxHighlighter
  238. * http://alexgorbatchev.com/SyntaxHighlighter
  239. *
  240. * SyntaxHighlighter is donationware. If you are using it, please donate.
  241. * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
  242. *
  243. * @version
  244. * 3.0.83 (July 02 2010)
  245. *
  246. * @copyright
  247. * Copyright (C) 2004-2010 Alex Gorbatchev.
  248. *
  249. * @license
  250. * Dual licensed under the MIT and GPL licenses.
  251. */
  252. ;(function()
  253. {
  254. // CommonJS
  255. typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
  256. function Brush()
  257. {
  258. var funcs = 'abs avg case cast coalesce convert count current_timestamp ' +
  259. 'current_user day isnull left lower month nullif replace right ' +
  260. 'session_user space substring sum system_user upper user year';
  261. var keywords = 'absolute action add after alter as asc at authorization begin bigint ' +
  262. 'binary bit by cascade char character check checkpoint close collate ' +
  263. 'column commit committed connect connection constraint contains continue ' +
  264. 'create cube current current_date current_time cursor database date ' +
  265. 'deallocate dec decimal declare default delete desc distinct double drop ' +
  266. 'dynamic else end end-exec escape except exec execute false fetch first ' +
  267. 'float for force foreign forward free from full function global goto grant ' +
  268. 'group grouping having hour ignore index inner insensitive insert instead ' +
  269. 'int integer intersect into is isolation key last level load local max min ' +
  270. 'minute modify move name national nchar next no numeric of off on only ' +
  271. 'open option order out output partial password precision prepare primary ' +
  272. 'prior privileges procedure public read real references relative repeatable ' +
  273. 'restrict return returns revoke rollback rollup rows rule schema scroll ' +
  274. 'second section select sequence serializable set size smallint static ' +
  275. 'statistics table temp temporary then time timestamp to top transaction ' +
  276. 'translation trigger true truncate uncommitted union unique update values ' +
  277. 'varchar varying view when where with work';
  278. var operators = 'all and any between cross in join like not null or outer some';
  279. this.regexList = [
  280. { regex: /--(.*)$/gm, css: 'comments' }, // one line and multiline comments
  281. { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings
  282. { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // single quoted strings
  283. { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'color2' }, // functions
  284. { regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such
  285. { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
  286. ];
  287. };
  288. Brush.prototype = new SyntaxHighlighter.Highlighter();
  289. Brush.aliases = ['sql'];
  290. SyntaxHighlighter.brushes.Sql = Brush;
  291. // CommonJS
  292. typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
  293. })();
  294. /**
  295. * SyntaxHighlighter
  296. * http://alexgorbatchev.com/SyntaxHighlighter
  297. *
  298. * SyntaxHighlighter is donationware. If you are using it, please donate.
  299. * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
  300. *
  301. * @version
  302. * 3.0.83 (July 02 2010)
  303. *
  304. * @copyright
  305. * Copyright (C) 2004-2010 Alex Gorbatchev.
  306. *
  307. * @license
  308. * Dual licensed under the MIT and GPL licenses.
  309. */
  310. ;(function()
  311. {
  312. // CommonJS
  313. typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
  314. function Brush()
  315. {
  316. function process(match, regexInfo)
  317. {
  318. var constructor = SyntaxHighlighter.Match,
  319. code = match[0],
  320. tag = new XRegExp('(&lt;|<)[\\s\\/\\?]*(?<name>[:\\w-\\.]+)', 'xg').exec(code),
  321. result = []
  322. ;
  323. if (match.attributes != null)
  324. {
  325. var attributes,
  326. regex = new XRegExp('(?<name> [\\w:\\-\\.]+)' +
  327. '\\s*=\\s*' +
  328. '(?<value> ".*?"|\'.*?\'|\\w+)',
  329. 'xg');
  330. while ((attributes = regex.exec(code)) != null)
  331. {
  332. result.push(new constructor(attributes.name, match.index + attributes.index, 'color1'));
  333. result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string'));
  334. }
  335. }
  336. if (tag != null)
  337. result.push(
  338. new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword')
  339. );
  340. return result;
  341. }
  342. this.regexList = [
  343. { regex: new XRegExp('(\\&lt;|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\&gt;|>)', 'gm'), css: 'color2' }, // <![ ... [ ... ]]>
  344. { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // <!-- ... -->
  345. { regex: new XRegExp('(&lt;|<)[\\s\\/\\?]*(\\w+)(?<attributes>.*?)[\\s\\/\\?]*(&gt;|>)', 'sg'), func: process }
  346. ];
  347. };
  348. Brush.prototype = new SyntaxHighlighter.Highlighter();
  349. Brush.aliases = ['xml', 'xhtml', 'xslt', 'html'];
  350. SyntaxHighlighter.brushes.Xml = Brush;
  351. // CommonJS
  352. typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
  353. })();
  354. /*!
  355. * jQuery Form Plugin
  356. * version: 3.45.0-2013.10.17
  357. * Requires jQuery v1.5 or later
  358. * Copyright (c) 2013 M. Alsup
  359. * Examples and documentation at: http://malsup.com/jquery/form/
  360. * Project repository: https://github.com/malsup/form
  361. * Dual licensed under the MIT and GPL licenses.
  362. * https://github.com/malsup/form#copyright-and-license
  363. */
  364. /*global ActiveXObject */
  365. ;(function($) {
  366. "use strict";
  367. /*
  368. Usage Note:
  369. -----------
  370. Do not use both ajaxSubmit and ajaxForm on the same form. These
  371. functions are mutually exclusive. Use ajaxSubmit if you want
  372. to bind your own submit handler to the form. For example,
  373. $(document).ready(function() {
  374. $('#myForm').on('submit', function(e) {
  375. e.preventDefault(); // <-- important
  376. $(this).ajaxSubmit({
  377. target: '#output'
  378. });
  379. });
  380. });
  381. Use ajaxForm when you want the plugin to manage all the event binding
  382. for you. For example,
  383. $(document).ready(function() {
  384. $('#myForm').ajaxForm({
  385. target: '#output'
  386. });
  387. });
  388. You can also use ajaxForm with delegation (requires jQuery v1.7+), so the
  389. form does not have to exist when you invoke ajaxForm:
  390. $('#myForm').ajaxForm({
  391. delegation: true,
  392. target: '#output'
  393. });
  394. When using ajaxForm, the ajaxSubmit function will be invoked for you
  395. at the appropriate time.
  396. */
  397. /**
  398. * Feature detection
  399. */
  400. var feature = {};
  401. feature.fileapi = $("<input type='file'/>").get(0).files !== undefined;
  402. feature.formdata = window.FormData !== undefined;
  403. var hasProp = !!$.fn.prop;
  404. // attr2 uses prop when it can but checks the return type for
  405. // an expected string. this accounts for the case where a form
  406. // contains inputs with names like "action" or "method"; in those
  407. // cases "prop" returns the element
  408. $.fn.attr2 = function() {
  409. if ( ! hasProp )
  410. return this.attr.apply(this, arguments);
  411. var val = this.prop.apply(this, arguments);
  412. if ( ( val && val.jquery ) || typeof val === 'string' )
  413. return val;
  414. return this.attr.apply(this, arguments);
  415. };
  416. /**
  417. * ajaxSubmit() provides a mechanism for immediately submitting
  418. * an HTML form using AJAX.
  419. */
  420. $.fn.ajaxSubmit = function(options) {
  421. /*jshint scripturl:true */
  422. // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
  423. if (!this.length) {
  424. log('ajaxSubmit: skipping submit process - no element selected');
  425. return this;
  426. }
  427. var method, action, url, $form = this;
  428. if (typeof options == 'function') {
  429. options = { success: options };
  430. }
  431. else if ( options === undefined ) {
  432. options = {};
  433. }
  434. method = options.type || this.attr2('method');
  435. action = options.url || this.attr2('action');
  436. url = (typeof action === 'string') ? $.trim(action) : '';
  437. url = url || window.location.href || '';
  438. if (url) {
  439. // clean url (don't include hash vaue)
  440. url = (url.match(/^([^#]+)/)||[])[1];
  441. }
  442. options = $.extend(true, {
  443. url: url,
  444. success: $.ajaxSettings.success,
  445. type: method || $.ajaxSettings.type,
  446. iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
  447. }, options);
  448. // hook for manipulating the form data before it is extracted;
  449. // convenient for use with rich editors like tinyMCE or FCKEditor
  450. var veto = {};
  451. this.trigger('form-pre-serialize', [this, options, veto]);
  452. if (veto.veto) {
  453. log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
  454. return this;
  455. }
  456. // provide opportunity to alter form data before it is serialized
  457. if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
  458. log('ajaxSubmit: submit aborted via beforeSerialize callback');
  459. return this;
  460. }
  461. var traditional = options.traditional;
  462. if ( traditional === undefined ) {
  463. traditional = $.ajaxSettings.traditional;
  464. }
  465. var elements = [];
  466. var qx, a = this.formToArray(options.semantic, elements);
  467. if (options.data) {
  468. options.extraData = options.data;
  469. qx = $.param(options.data, traditional);
  470. }
  471. // give pre-submit callback an opportunity to abort the submit
  472. if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
  473. log('ajaxSubmit: submit aborted via beforeSubmit callback');
  474. return this;
  475. }
  476. // fire vetoable 'validate' event
  477. this.trigger('form-submit-validate', [a, this, options, veto]);
  478. if (veto.veto) {
  479. log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
  480. return this;
  481. }
  482. var q = $.param(a, traditional);
  483. if (qx) {
  484. q = ( q ? (q + '&' + qx) : qx );
  485. }
  486. if (options.type.toUpperCase() == 'GET') {
  487. options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
  488. options.data = null; // data is null for 'get'
  489. }
  490. else {
  491. options.data = q; // data is the query string for 'post'
  492. }
  493. var callbacks = [];
  494. if (options.resetForm) {
  495. callbacks.push(function() { $form.resetForm(); });
  496. }
  497. if (options.clearForm) {
  498. callbacks.push(function() { $form.clearForm(options.includeHidden); });
  499. }
  500. // perform a load on the target only if dataType is not provided
  501. if (!options.dataType && options.target) {
  502. var oldSuccess = options.success || function(){};
  503. callbacks.push(function(data) {
  504. var fn = options.replaceTarget ? 'replaceWith' : 'html';
  505. $(options.target)[fn](data).each(oldSuccess, arguments);
  506. });
  507. }
  508. else if (options.success) {
  509. callbacks.push(options.success);
  510. }
  511. options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
  512. var context = options.context || this ; // jQuery 1.4+ supports scope context
  513. for (var i=0, max=callbacks.length; i < max; i++) {
  514. callbacks[i].apply(context, [data, status, xhr || $form, $form]);
  515. }
  516. };
  517. if (options.error) {
  518. var oldError = options.error;
  519. options.error = function(xhr, status, error) {
  520. var context = options.context || this;
  521. oldError.apply(context, [xhr, status, error, $form]);
  522. };
  523. }
  524. if (options.complete) {
  525. var oldComplete = options.complete;
  526. options.complete = function(xhr, status) {
  527. var context = options.context || this;
  528. oldComplete.apply(context, [xhr, status, $form]);
  529. };
  530. }
  531. // are there files to upload?
  532. // [value] (issue #113), also see comment:
  533. // https://github.com/malsup/form/commit/588306aedba1de01388032d5f42a60159eea9228#commitcomment-2180219
  534. var fileInputs = $('input[type=file]:enabled', this).filter(function() { return $(this).val() !== ''; });
  535. var hasFileInputs = fileInputs.length > 0;
  536. var mp = 'multipart/form-data';
  537. var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);
  538. var fileAPI = feature.fileapi && feature.formdata;
  539. log("fileAPI :" + fileAPI);
  540. var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI;
  541. var jqxhr;
  542. // options.iframe allows user to force iframe mode
  543. // 06-NOV-09: now defaulting to iframe mode if file input is detected
  544. if (options.iframe !== false && (options.iframe || shouldUseFrame)) {
  545. // hack to fix Safari hang (thanks to Tim Molendijk for this)
  546. // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
  547. if (options.closeKeepAlive) {
  548. $.get(options.closeKeepAlive, function() {
  549. jqxhr = fileUploadIframe(a);
  550. });
  551. }
  552. else {
  553. jqxhr = fileUploadIframe(a);
  554. }
  555. }
  556. else if ((hasFileInputs || multipart) && fileAPI) {
  557. jqxhr = fileUploadXhr(a);
  558. }
  559. else {
  560. jqxhr = $.ajax(options);
  561. }
  562. $form.removeData('jqxhr').data('jqxhr', jqxhr);
  563. // clear element array
  564. for (var k=0; k < elements.length; k++)
  565. elements[k] = null;
  566. // fire 'notify' event
  567. this.trigger('form-submit-notify', [this, options]);
  568. return this;
  569. // utility fn for deep serialization
  570. function deepSerialize(extraData){
  571. var serialized = $.param(extraData, options.traditional).split('&');
  572. var len = serialized.length;
  573. var result = [];
  574. var i, part;
  575. for (i=0; i < len; i++) {
  576. // #252; undo param space replacement
  577. serialized[i] = serialized[i].replace(/\+/g,' ');
  578. part = serialized[i].split('=');
  579. // #278; use array instead of object storage, favoring array serializations
  580. result.push([decodeURIComponent(part[0]), decodeURIComponent(part[1])]);
  581. }
  582. return result;
  583. }
  584. // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz)
  585. function fileUploadXhr(a) {
  586. var formdata = new FormData();
  587. for (var i=0; i < a.length; i++) {
  588. formdata.append(a[i].name, a[i].value);
  589. }
  590. if (options.extraData) {
  591. var serializedData = deepSerialize(options.extraData);
  592. for (i=0; i < serializedData.length; i++)
  593. if (serializedData[i])
  594. formdata.append(serializedData[i][0], serializedData[i][1]);
  595. }
  596. options.data = null;
  597. var s = $.extend(true, {}, $.ajaxSettings, options, {
  598. contentType: false,
  599. processData: false,
  600. cache: false,
  601. type: method || 'POST'
  602. });
  603. if (options.uploadProgress) {
  604. // workaround because jqXHR does not expose upload property
  605. s.xhr = function() {
  606. var xhr = $.ajaxSettings.xhr();
  607. if (xhr.upload) {
  608. xhr.upload.addEventListener('progress', function(event) {
  609. var percent = 0;
  610. var position = event.loaded || event.position; /*event.position is deprecated*/
  611. var total = event.total;
  612. if (event.lengthComputable) {
  613. percent = Math.ceil(position / total * 100);
  614. }
  615. options.uploadProgress(event, position, total, percent);
  616. }, false);
  617. }
  618. return xhr;
  619. };
  620. }
  621. s.data = null;
  622. var beforeSend = s.beforeSend;
  623. s.beforeSend = function(xhr, o) {
  624. //Send FormData() provided by user
  625. if (options.formData)
  626. o.data = options.formData;
  627. else
  628. o.data = formdata;
  629. if(beforeSend)
  630. beforeSend.call(this, xhr, o);
  631. };
  632. return $.ajax(s);
  633. }
  634. // private function for handling file uploads (hat tip to YAHOO!)
  635. function fileUploadIframe(a) {
  636. var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
  637. var deferred = $.Deferred();
  638. // #341
  639. deferred.abort = function(status) {
  640. xhr.abort(status);
  641. };
  642. if (a) {
  643. // ensure that every serialized input is still enabled
  644. for (i=0; i < elements.length; i++) {
  645. el = $(elements[i]);
  646. if ( hasProp )
  647. el.prop('disabled', false);
  648. else
  649. el.removeAttr('disabled');
  650. }
  651. }
  652. s = $.extend(true, {}, $.ajaxSettings, options);
  653. s.context = s.context || s;
  654. id = 'jqFormIO' + (allGetServerTime().getTime());
  655. if (s.iframeTarget) {
  656. $io = $(s.iframeTarget);
  657. n = $io.attr2('name');
  658. if (!n)
  659. $io.attr2('name', id);
  660. else
  661. id = n;
  662. }
  663. else {
  664. $io = $('<iframe name="' + id + '" src="'+ s.iframeSrc +'" />');
  665. $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
  666. }
  667. io = $io[0];
  668. xhr = { // mock object
  669. aborted: 0,
  670. responseText: null,
  671. responseXML: null,
  672. status: 0,
  673. statusText: 'n/a',
  674. getAllResponseHeaders: function() {},
  675. getResponseHeader: function() {},
  676. setRequestHeader: function() {},
  677. abort: function(status) {
  678. var e = (status === 'timeout' ? 'timeout' : 'aborted');
  679. log('aborting upload... ' + e);
  680. this.aborted = 1;
  681. try { // #214, #257
  682. if (io.contentWindow.document.execCommand) {
  683. io.contentWindow.document.execCommand('Stop');
  684. }
  685. }
  686. catch(ignore) {}
  687. $io.attr('src', s.iframeSrc); // abort op in progress
  688. xhr.error = e;
  689. if (s.error)
  690. s.error.call(s.context, xhr, e, status);
  691. if (g)
  692. $.event.trigger("ajaxError", [xhr, s, e]);
  693. if (s.complete)
  694. s.complete.call(s.context, xhr, e);
  695. }
  696. };
  697. g = s.global;
  698. // trigger ajax global events so that activity/block indicators work like normal
  699. if (g && 0 === $.active++) {
  700. $.event.trigger("ajaxStart");
  701. }
  702. if (g) {
  703. $.event.trigger("ajaxSend", [xhr, s]);
  704. }
  705. if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
  706. if (s.global) {
  707. $.active--;
  708. }
  709. deferred.reject();
  710. return deferred;
  711. }
  712. if (xhr.aborted) {
  713. deferred.reject();
  714. return deferred;
  715. }
  716. // add submitting element to data if we know it
  717. sub = form.clk;
  718. if (sub) {
  719. n = sub.name;
  720. if (n && !sub.disabled) {
  721. s.extraData = s.extraData || {};
  722. s.extraData[n] = sub.value;
  723. if (sub.type == "image") {
  724. s.extraData[n+'.x'] = form.clk_x;
  725. s.extraData[n+'.y'] = form.clk_y;
  726. }
  727. }
  728. }
  729. var CLIENT_TIMEOUT_ABORT = 1;
  730. var SERVER_ABORT = 2;
  731. function getDoc(frame) {
  732. /* it looks like contentWindow or contentDocument do not
  733. * carry the protocol property in ie8, when running under ssl
  734. * frame.document is the only valid response document, since
  735. * the protocol is know but not on the other two objects. strange?
  736. * "Same origin policy" http://en.wikipedia.org/wiki/Same_origin_policy
  737. */
  738. var doc = null;
  739. // IE8 cascading access check
  740. try {
  741. if (frame.contentWindow) {
  742. doc = frame.contentWindow.document;
  743. }
  744. } catch(err) {
  745. // IE8 access denied under ssl & missing protocol
  746. log('cannot get iframe.contentWindow document: ' + err);
  747. }
  748. if (doc) { // successful getting content
  749. return doc;
  750. }
  751. try { // simply checking may throw in ie8 under ssl or mismatched protocol
  752. doc = frame.contentDocument ? frame.contentDocument : frame.document;
  753. } catch(err) {
  754. // last attempt
  755. log('cannot get iframe.contentDocument: ' + err);
  756. doc = frame.document;
  757. }
  758. return doc;
  759. }
  760. // Rails CSRF hack (thanks to Yvan Barthelemy)
  761. var csrf_token = $('meta[name=csrf-token]').attr('content');
  762. var csrf_param = $('meta[name=csrf-param]').attr('content');
  763. if (csrf_param && csrf_token) {
  764. s.extraData = s.extraData || {};
  765. s.extraData[csrf_param] = csrf_token;
  766. }
  767. // take a breath so that pending repaints get some cpu time before the upload starts
  768. function doSubmit() {
  769. // make sure form attrs are set
  770. var t = $form.attr2('target'), a = $form.attr2('action');
  771. // update form attrs in IE friendly way
  772. form.setAttribute('target',id);
  773. if (!method || /post/i.test(method) ) {
  774. form.setAttribute('method', 'POST');
  775. }
  776. if (a != s.url) {
  777. form.setAttribute('action', s.url);
  778. }
  779. // ie borks in some cases when setting encoding
  780. if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {
  781. $form.attr({
  782. encoding: 'multipart/form-data',
  783. enctype: 'multipart/form-data'
  784. });
  785. }
  786. // support timout
  787. if (s.timeout) {
  788. timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);
  789. }
  790. // look for server aborts
  791. function checkState() {
  792. try {
  793. var state = getDoc(io).readyState;
  794. log('state = ' + state);
  795. if (state && state.toLowerCase() == 'uninitialized')
  796. setTimeout(checkState,50);
  797. }
  798. catch(e) {
  799. log('Server abort: ' , e, ' (', e.name, ')');
  800. cb(SERVER_ABORT);
  801. if (timeoutHandle)
  802. clearTimeout(timeoutHandle);
  803. timeoutHandle = undefined;
  804. }
  805. }
  806. // add "extra" data to form if provided in options
  807. var extraInputs = [];
  808. try {
  809. if (s.extraData) {
  810. for (var n in s.extraData) {
  811. if (s.extraData.hasOwnProperty(n)) {
  812. // if using the $.param format that allows for multiple values with the same name
  813. if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {
  814. extraInputs.push(
  815. $('<input type="hidden" name="'+s.extraData[n].name+'">').val(s.extraData[n].value)
  816. .appendTo(form)[0]);
  817. } else {
  818. extraInputs.push(
  819. $('<input type="hidden" name="'+n+'">').val(s.extraData[n])
  820. .appendTo(form)[0]);
  821. }
  822. }
  823. }
  824. }
  825. if (!s.iframeTarget) {
  826. // add iframe to doc and submit the form
  827. $io.appendTo('body');
  828. }
  829. if (io.attachEvent)
  830. io.attachEvent('onload', cb);
  831. else
  832. io.addEventListener('load', cb, false);
  833. setTimeout(checkState,15);
  834. try {
  835. form.submit();
  836. } catch(err) {
  837. // just in case form has element with name/id of 'submit'
  838. var submitFn = document.createElement('form').submit;
  839. submitFn.apply(form);
  840. }
  841. }
  842. finally {
  843. // reset attrs and remove "extra" input elements
  844. form.setAttribute('action',a);
  845. if(t) {
  846. form.setAttribute('target', t);
  847. } else {
  848. $form.removeAttr('target');
  849. }
  850. $(extraInputs).remove();
  851. }
  852. }
  853. if (s.forceSync) {
  854. doSubmit();
  855. }
  856. else {
  857. setTimeout(doSubmit, 10); // this lets dom updates render
  858. }
  859. var data, doc, domCheckCount = 50, callbackProcessed;
  860. function cb(e) {
  861. if (xhr.aborted || callbackProcessed) {
  862. return;
  863. }
  864. doc = getDoc(io);
  865. if(!doc) {
  866. log('cannot access response document');
  867. e = SERVER_ABORT;
  868. }
  869. if (e === CLIENT_TIMEOUT_ABORT && xhr) {
  870. xhr.abort('timeout');
  871. deferred.reject(xhr, 'timeout');
  872. return;
  873. }
  874. else if (e == SERVER_ABORT && xhr) {
  875. xhr.abort('server abort');
  876. deferred.reject(xhr, 'error', 'server abort');
  877. return;
  878. }
  879. if (!doc || doc.location.href == s.iframeSrc) {
  880. // response not received yet
  881. if (!timedOut)
  882. return;
  883. }
  884. if (io.detachEvent)
  885. io.detachEvent('onload', cb);
  886. else
  887. io.removeEventListener('load', cb, false);
  888. var status = 'success', errMsg;
  889. try {
  890. if (timedOut) {
  891. throw 'timeout';
  892. }
  893. var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
  894. log('isXml='+isXml);
  895. if (!isXml && window.opera && (doc.body === null || !doc.body.innerHTML)) {
  896. if (--domCheckCount) {
  897. // in some browsers (Opera) the iframe DOM is not always traversable when
  898. // the onload callback fires, so we loop a bit to accommodate
  899. log('requeing onLoad callback, DOM not available');
  900. setTimeout(cb, 250);
  901. return;
  902. }
  903. // let this fall through because server response could be an empty document
  904. //log('Could not access iframe DOM after mutiple tries.');
  905. //throw 'DOMException: not available';
  906. }
  907. //log('response detected');
  908. var docRoot = doc.body ? doc.body : doc.documentElement;
  909. xhr.responseText = docRoot ? docRoot.innerHTML : null;
  910. xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
  911. if (isXml)
  912. s.dataType = 'xml';
  913. xhr.getResponseHeader = function(header){
  914. var headers = {'content-type': s.dataType};
  915. return headers[header.toLowerCase()];
  916. };
  917. // support for XHR 'status' & 'statusText' emulation :
  918. if (docRoot) {
  919. xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status;
  920. xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText;
  921. }
  922. var dt = (s.dataType || '').toLowerCase();
  923. var scr = /(json|script|text)/.test(dt);
  924. if (scr || s.textarea) {
  925. // see if user embedded response in textarea
  926. var ta = doc.getElementsByTagName('textarea')[0];
  927. if (ta) {
  928. xhr.responseText = ta.value;
  929. // support for XHR 'status' & 'statusText' emulation :
  930. xhr.status = Number( ta.getAttribute('status') ) || xhr.status;
  931. xhr.statusText = ta.getAttribute('statusText') || xhr.statusText;
  932. }
  933. else if (scr) {
  934. // account for browsers injecting pre around json response
  935. var pre = doc.getElementsByTagName('pre')[0];
  936. var b = doc.getElementsByTagName('body')[0];
  937. if (pre) {
  938. xhr.responseText = pre.textContent ? pre.textContent : pre.innerText;
  939. }
  940. else if (b) {
  941. xhr.responseText = b.textContent ? b.textContent : b.innerText;
  942. }
  943. }
  944. }
  945. else if (dt == 'xml' && !xhr.responseXML && xhr.responseText) {
  946. xhr.responseXML = toXml(xhr.responseText);
  947. }
  948. try {
  949. data = httpData(xhr, dt, s);
  950. }
  951. catch (err) {
  952. status = 'parsererror';
  953. xhr.error = errMsg = (err || status);
  954. }
  955. }
  956. catch (err) {
  957. log('error caught: ',err);
  958. status = 'error';
  959. xhr.error = errMsg = (err || status);
  960. }
  961. if (xhr.aborted) {
  962. log('upload aborted');
  963. status = null;
  964. }
  965. if (xhr.status) { // we've set xhr.status
  966. status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error';
  967. }
  968. // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
  969. if (status === 'success') {
  970. if (s.success)
  971. s.success.call(s.context, data, 'success', xhr);
  972. deferred.resolve(xhr.responseText, 'success', xhr);
  973. if (g)
  974. $.event.trigger("ajaxSuccess", [xhr, s]);
  975. }
  976. else if (status) {
  977. if (errMsg === undefined)
  978. errMsg = xhr.statusText;
  979. if (s.error)
  980. s.error.call(s.context, xhr, status, errMsg);
  981. deferred.reject(xhr, 'error', errMsg);
  982. if (g)
  983. $.event.trigger("ajaxError", [xhr, s, errMsg]);
  984. }
  985. if (g)
  986. $.event.trigger("ajaxComplete", [xhr, s]);
  987. if (g && ! --$.active) {
  988. $.event.trigger("ajaxStop");
  989. }
  990. if (s.complete)
  991. s.complete.call(s.context, xhr, status);
  992. callbackProcessed = true;
  993. if (s.timeout)
  994. clearTimeout(timeoutHandle);
  995. // clean up
  996. setTimeout(function() {
  997. if (!s.iframeTarget)
  998. $io.remove();
  999. else //adding else to clean up existing iframe response.
  1000. $io.attr('src', s.iframeSrc);
  1001. xhr.responseXML = null;
  1002. }, 100);
  1003. }
  1004. var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+)
  1005. if (window.ActiveXObject) {
  1006. doc = new ActiveXObject('Microsoft.XMLDOM');
  1007. doc.async = 'false';
  1008. doc.loadXML(s);
  1009. }
  1010. else {
  1011. doc = (new DOMParser()).parseFromString(s, 'text/xml');
  1012. }
  1013. return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null;
  1014. };
  1015. var parseJSON = $.parseJSON || function(s) {
  1016. /*jslint evil:true */
  1017. return window['eval']('(' + s + ')');
  1018. };
  1019. var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4
  1020. var ct = xhr.getResponseHeader('content-type') || '',
  1021. xml = type === 'xml' || !type && ct.indexOf('xml') >= 0,
  1022. data = xml ? xhr.responseXML : xhr.responseText;
  1023. if (xml && data.documentElement.nodeName === 'parsererror') {
  1024. if ($.error)
  1025. $.error('parsererror');
  1026. }
  1027. if (s && s.dataFilter) {
  1028. data = s.dataFilter(data, type);
  1029. }
  1030. if (typeof data === 'string') {
  1031. if (type === 'json' || !type && ct.indexOf('json') >= 0) {
  1032. data = parseJSON(data);
  1033. } else if (type === "script" || !type && ct.indexOf("javascript") >= 0) {
  1034. $.globalEval(data);
  1035. }
  1036. }
  1037. return data;
  1038. };
  1039. return deferred;
  1040. }
  1041. };
  1042. /**
  1043. * ajaxForm() provides a mechanism for fully automating form submission.
  1044. *
  1045. * The advantages of using this method instead of ajaxSubmit() are:
  1046. *
  1047. * 1: This method will include coordinates for <input type="image" /> elements (if the element
  1048. * is used to submit the form).
  1049. * 2. This method will include the submit element's name/value data (for the element that was
  1050. * used to submit the form).
  1051. * 3. This method binds the submit() method to the form for you.
  1052. *
  1053. * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely
  1054. * passes the options argument along after properly binding events for submit elements and
  1055. * the form itself.
  1056. */
  1057. $.fn.ajaxForm = function(options) {
  1058. options = options || {};
  1059. options.delegation = options.delegation && $.isFunction($.fn.on);
  1060. // in jQuery 1.3+ we can fix mistakes with the ready state
  1061. if (!options.delegation && this.length === 0) {
  1062. var o = { s: this.selector, c: this.context };
  1063. if (!$.isReady && o.s) {
  1064. log('DOM not ready, queuing ajaxForm');
  1065. $(function() {
  1066. $(o.s,o.c).ajaxForm(options);
  1067. });
  1068. return this;
  1069. }
  1070. // is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
  1071. log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
  1072. return this;
  1073. }
  1074. if ( options.delegation ) {
  1075. $(document)
  1076. .off('submit.form-plugin', this.selector, doAjaxSubmit)
  1077. .off('click.form-plugin', this.selector, captureSubmittingElement)
  1078. .on('submit.form-plugin', this.selector, options, doAjaxSubmit)
  1079. .on('click.form-plugin', this.selector, options, captureSubmittingElement);
  1080. return this;
  1081. }
  1082. return this.ajaxFormUnbind()
  1083. .bind('submit.form-plugin', options, doAjaxSubmit)
  1084. .bind('click.form-plugin', options, captureSubmittingElement);
  1085. };
  1086. // private event handlers
  1087. function doAjaxSubmit(e) {
  1088. /*jshint validthis:true */
  1089. var options = e.data;
  1090. if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed
  1091. e.preventDefault();
  1092. $(e.target).ajaxSubmit(options); // #365
  1093. }
  1094. }
  1095. function captureSubmittingElement(e) {
  1096. /*jshint validthis:true */
  1097. var target = e.target;
  1098. var $el = $(target);
  1099. if (!($el.is("[type=submit],[type=image]"))) {
  1100. // is this a child element of the submit el? (ex: a span within a button)
  1101. var t = $el.closest('[type=submit]');
  1102. if (t.length === 0) {
  1103. return;
  1104. }
  1105. target = t[0];
  1106. }
  1107. var form = this;
  1108. form.clk = target;
  1109. if (target.type == 'image') {
  1110. if (e.offsetX !== undefined) {
  1111. form.clk_x = e.offsetX;
  1112. form.clk_y = e.offsetY;
  1113. } else if (typeof $.fn.offset == 'function') {
  1114. var offset = $el.offset();
  1115. form.clk_x = e.pageX - offset.left;
  1116. form.clk_y = e.pageY - offset.top;
  1117. } else {
  1118. form.clk_x = e.pageX - target.offsetLeft;
  1119. form.clk_y = e.pageY - target.offsetTop;
  1120. }
  1121. }
  1122. // clear form vars
  1123. setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);
  1124. }
  1125. // ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
  1126. $.fn.ajaxFormUnbind = function() {
  1127. return this.unbind('submit.form-plugin click.form-plugin');
  1128. };
  1129. /**
  1130. * formToArray() gathers form element data into an array of objects that can
  1131. * be passed to any of the following ajax functions: $.get, $.post, or load.
  1132. * Each object in the array has both a 'name' and 'value' property. An example of
  1133. * an array for a simple login form might be:
  1134. *
  1135. * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
  1136. *
  1137. * It is this array that is passed to pre-submit callback functions provided to the
  1138. * ajaxSubmit() and ajaxForm() methods.
  1139. */
  1140. $.fn.formToArray = function(semantic, elements) {
  1141. var a = [];
  1142. if (this.length === 0) {
  1143. return a;
  1144. }
  1145. var form = this[0];
  1146. var els = semantic ? form.getElementsByTagName('*') : form.elements;
  1147. if (!els) {
  1148. return a;
  1149. }
  1150. var i,j,n,v,el,max,jmax;
  1151. for(i=0, max=els.length; i < max; i++) {
  1152. el = els[i];
  1153. n = el.name;
  1154. if (!n || el.disabled) {
  1155. continue;
  1156. }
  1157. if (semantic && form.clk && el.type == "image") {
  1158. // handle image inputs on the fly when semantic == true
  1159. if(form.clk == el) {
  1160. a.push({name: n, value: $(el).val(), type: el.type });
  1161. a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
  1162. }
  1163. continue;
  1164. }
  1165. v = $.fieldValue(el, true);
  1166. if (v && v.constructor == Array) {
  1167. if (elements)
  1168. elements.push(el);
  1169. for(j=0, jmax=v.length; j < jmax; j++) {
  1170. a.push({name: n, value: v[j]});
  1171. }
  1172. }
  1173. else if (feature.fileapi && el.type == 'file') {
  1174. if (elements)
  1175. elements.push(el);
  1176. var files = el.files;
  1177. if (files.length) {
  1178. for (j=0; j < files.length; j++) {
  1179. a.push({name: n, value: files[j], type: el.type});
  1180. }
  1181. }
  1182. else {
  1183. // #180
  1184. a.push({ name: n, value: '', type: el.type });
  1185. }
  1186. }
  1187. else if (v !== null && typeof v != 'undefined') {
  1188. if (elements)
  1189. elements.push(el);
  1190. a.push({name: n, value: v, type: el.type, required: el.required});
  1191. }
  1192. }
  1193. if (!semantic && form.clk) {
  1194. // input type=='image' are not found in elements array! handle it here
  1195. var $input = $(form.clk), input = $input[0];
  1196. n = input.name;
  1197. if (n && !input.disabled && input.type == 'image') {
  1198. a.push({name: n, value: $input.val()});
  1199. a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
  1200. }
  1201. }
  1202. return a;
  1203. };
  1204. /**
  1205. * Serializes form data into a 'submittable' string. This method will return a string
  1206. * in the format: name1=value1&amp;name2=value2
  1207. */
  1208. $.fn.formSerialize = function(semantic) {
  1209. //hand off to jQuery.param for proper encoding
  1210. return $.param(this.formToArray(semantic));
  1211. };
  1212. /**
  1213. * Serializes all field elements in the jQuery object into a query string.
  1214. * This method will return a string in the format: name1=value1&amp;name2=value2
  1215. */
  1216. $.fn.fieldSerialize = function(successful) {
  1217. var a = [];
  1218. this.each(function() {
  1219. var n = this.name;
  1220. if (!n) {
  1221. return;
  1222. }
  1223. var v = $.fieldValue(this, successful);
  1224. if (v && v.constructor == Array) {
  1225. for (var i=0,max=v.length; i < max; i++) {
  1226. a.push({name: n, value: v[i]});
  1227. }
  1228. }
  1229. else if (v !== null && typeof v != 'undefined') {
  1230. a.push({name: this.name, value: v});
  1231. }
  1232. });
  1233. //hand off to jQuery.param for proper encoding
  1234. return $.param(a);
  1235. };
  1236. /**
  1237. * Returns the value(s) of the element in the matched set. For example, consider the following form:
  1238. *
  1239. * <form><fieldset>
  1240. * <input name="A" type="text" />
  1241. * <input name="A" type="text" />
  1242. * <input name="B" type="checkbox" value="B1" />
  1243. * <input name="B" type="checkbox" value="B2"/>
  1244. * <input name="C" type="radio" value="C1" />
  1245. * <input name="C" type="radio" value="C2" />
  1246. * </fieldset></form>
  1247. *
  1248. * var v = $('input[type=text]').fieldValue();
  1249. * // if no values are entered into the text inputs
  1250. * v == ['','']
  1251. * // if values entered into the text inputs are 'foo' and 'bar'
  1252. * v == ['foo','bar']
  1253. *
  1254. * var v = $('input[type=checkbox]').fieldValue();
  1255. * // if neither checkbox is checked
  1256. * v === undefined
  1257. * // if both checkboxes are checked
  1258. * v == ['B1', 'B2']
  1259. *
  1260. * var v = $('input[type=radio]').fieldValue();
  1261. * // if neither radio is checked
  1262. * v === undefined
  1263. * // if first radio is checked
  1264. * v == ['C1']
  1265. *
  1266. * The successful argument controls whether or not the field element must be 'successful'
  1267. * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
  1268. * The default value of the successful argument is true. If this value is false the value(s)
  1269. * for each element is returned.
  1270. *
  1271. * Note: This method *always* returns an array. If no valid value can be determined the
  1272. * array will be empty, otherwise it will contain one or more values.
  1273. */
  1274. $.fn.fieldValue = function(successful) {
  1275. for (var val=[], i=0, max=this.length; i < max; i++) {
  1276. var el = this[i];
  1277. var v = $.fieldValue(el, successful);
  1278. if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
  1279. continue;
  1280. }
  1281. if (v.constructor == Array)
  1282. $.merge(val, v);
  1283. else
  1284. val.push(v);
  1285. }
  1286. return val;
  1287. };
  1288. /**
  1289. * Returns the value of the field element.
  1290. */
  1291. $.fieldValue = function(el, successful) {
  1292. var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
  1293. if (successful === undefined) {
  1294. successful = true;
  1295. }
  1296. if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
  1297. (t == 'checkbox' || t == 'radio') && !el.checked ||
  1298. (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
  1299. tag == 'select' && el.selectedIndex == -1)) {
  1300. return null;
  1301. }
  1302. if (tag == 'select') {
  1303. var index = el.selectedIndex;
  1304. if (index < 0) {
  1305. return null;
  1306. }
  1307. var a = [], ops = el.options;
  1308. var one = (t == 'select-one');
  1309. var max = (one ? index+1 : ops.length);
  1310. for(var i=(one ? index : 0); i < max; i++) {
  1311. var op = ops[i];
  1312. if (op.selected) {
  1313. var v = op.value;
  1314. if (!v) { // extra pain for IE...
  1315. v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value;
  1316. }
  1317. if (one) {
  1318. return v;
  1319. }
  1320. a.push(v);
  1321. }
  1322. }
  1323. return a;
  1324. }
  1325. return $(el).val();
  1326. };
  1327. /**
  1328. * Clears the form data. Takes the following actions on the form's input fields:
  1329. * - input text fields will have their 'value' property set to the empty string
  1330. * - select elements will have their 'selectedIndex' property set to -1
  1331. * - checkbox and radio inputs will have their 'checked' property set to false
  1332. * - inputs of type submit, button, reset, and hidden will *not* be effected
  1333. * - button elements will *not* be effected
  1334. */
  1335. $.fn.clearForm = function(includeHidden) {
  1336. return this.each(function() {
  1337. $('input,select,textarea', this).clearFields(includeHidden);
  1338. });
  1339. };
  1340. /**
  1341. * Clears the selected form elements.
  1342. */
  1343. $.fn.clearFields = $.fn.clearInputs = function(includeHidden) {
  1344. var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; // 'hidden' is not in this list
  1345. return this.each(function() {
  1346. var t = this.type, tag = this.tagName.toLowerCase();
  1347. if (re.test(t) || tag == 'textarea') {
  1348. this.value = '';
  1349. }
  1350. else if (t == 'checkbox' || t == 'radio') {
  1351. this.checked = false;
  1352. }
  1353. else if (tag == 'select') {
  1354. this.selectedIndex = -1;
  1355. }
  1356. else if (t == "file") {
  1357. if (/MSIE/.test(navigator.userAgent)) {
  1358. $(this).replaceWith($(this).clone(true));
  1359. } else {
  1360. $(this).val('');
  1361. }
  1362. }
  1363. else if (includeHidden) {
  1364. // includeHidden can be the value true, or it can be a selector string
  1365. // indicating a special test; for example:
  1366. // $('#myForm').clearForm('.special:hidden')
  1367. // the above would clean hidden inputs that have the class of 'special'
  1368. if ( (includeHidden === true && /hidden/.test(t)) ||
  1369. (typeof includeHidden == 'string' && $(this).is(includeHidden)) )
  1370. this.value = '';
  1371. }
  1372. });
  1373. };
  1374. /**
  1375. * Resets the form data. Causes all form elements to be reset to their original value.
  1376. */
  1377. $.fn.resetForm = function() {
  1378. return this.each(function() {
  1379. // guard against an input with the name of 'reset'
  1380. // note that IE reports the reset function as an 'object'
  1381. if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {
  1382. this.reset();
  1383. }
  1384. });
  1385. };
  1386. /**
  1387. * Enables or disables any matching elements.
  1388. */
  1389. $.fn.enable = function(b) {
  1390. if (b === undefined) {
  1391. b = true;
  1392. }
  1393. return this.each(function() {
  1394. this.disabled = !b;
  1395. });
  1396. };
  1397. /**
  1398. * Checks/unchecks any matching checkboxes or radio buttons and
  1399. * selects/deselects and matching option elements.
  1400. */
  1401. $.fn.selected = function(select) {
  1402. if (select === undefined) {
  1403. select = true;
  1404. }
  1405. return this.each(function() {
  1406. var t = this.type;
  1407. if (t == 'checkbox' || t == 'radio') {
  1408. this.checked = select;
  1409. }
  1410. else if (this.tagName.toLowerCase() == 'option') {
  1411. var $sel = $(this).parent('select');
  1412. if (select && $sel[0] && $sel[0].type == 'select-one') {
  1413. // deselect all other options
  1414. $sel.find('option').selected(false);
  1415. }
  1416. this.selected = select;
  1417. }
  1418. });
  1419. };
  1420. // expose debug var
  1421. $.fn.ajaxSubmit.debug = false;
  1422. // helper fn for console logging
  1423. function log() {
  1424. if (!$.fn.ajaxSubmit.debug)
  1425. return;
  1426. var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
  1427. if (window.console && window.console.log) {
  1428. window.console.log(msg);
  1429. }
  1430. else if (window.opera && window.opera.postError) {
  1431. window.opera.postError(msg);
  1432. }
  1433. }
  1434. })( (typeof(jQuery) != 'undefined') ? jQuery : window.Zepto );
  1435. /**
  1436. * This jQuery plugin displays pagination links inside the selected elements.
  1437. *
  1438. * This plugin needs at least jQuery 1.4.2
  1439. *
  1440. * @author Gabriel Birke (birke *at* d-scribe *dot* de)
  1441. * @version 2.2
  1442. * @param {int} maxentries Number of entries to paginate
  1443. * @param {Object} opts Several options (see README for documentation)
  1444. * @return {Object} jQuery Object
  1445. */
  1446. (function($){
  1447. /**
  1448. * @class Class for calculating pagination values
  1449. */
  1450. $.PaginationCalculator = function(maxentries, opts) {
  1451. this.maxentries = maxentries;
  1452. this.opts = opts;
  1453. }
  1454. $.extend($.PaginationCalculator.prototype, {
  1455. /**
  1456. * Calculate the maximum number of pages
  1457. * @method
  1458. * @returns {Number}
  1459. */
  1460. numPages:function() {
  1461. return Math.ceil(this.maxentries/this.opts.items_per_page);
  1462. },
  1463. /**
  1464. * Calculate start and end point of pagination links depending on
  1465. * current_page and num_display_entries.
  1466. * @returns {Array}
  1467. */
  1468. getInterval:function(current_page) {
  1469. var ne_half = Math.floor(this.opts.num_display_entries/2);
  1470. var np = this.numPages();
  1471. var upper_limit = np - this.opts.num_display_entries;
  1472. var start = current_page > ne_half ? Math.max( Math.min(current_page - ne_half, upper_limit), 0 ) : 0;
  1473. var end = current_page > ne_half?Math.min(current_page+ne_half + (this.opts.num_display_entries % 2), np):Math.min(this.opts.num_display_entries, np);
  1474. return {start:start, end:end};
  1475. }
  1476. });
  1477. // Initialize jQuery object container for pagination renderers
  1478. $.PaginationRenderers = {}
  1479. /**
  1480. * @class Default renderer for rendering pagination links
  1481. */
  1482. $.PaginationRenderers.defaultRenderer = function(maxentries, opts) {
  1483. this.maxentries = maxentries;
  1484. this.opts = opts;
  1485. this.pc = new $.PaginationCalculator(maxentries, opts);
  1486. }
  1487. $.extend($.PaginationRenderers.defaultRenderer.prototype, {
  1488. /**
  1489. * Helper function for generating a single link (or a span tag if it's the current page)
  1490. * @param {Number} page_id The page id for the new item
  1491. * @param {Number} current_page
  1492. * @param {Object} appendopts Options for the new item: text and classes
  1493. * @returns {jQuery} jQuery object containing the link
  1494. */
  1495. createLink:function(page_id, current_page, appendopts){
  1496. var lnk, np = this.pc.numPages();
  1497. page_id = page_id<0?0:(page_id<np?page_id:np-1); // Normalize page id to sane value
  1498. appendopts = $.extend({text:page_id+1, classes:""}, appendopts||{});
  1499. if(page_id == current_page){
  1500. lnk = $("<li class='current'><a>" + appendopts.text + "</a></li>");
  1501. }
  1502. else
  1503. {
  1504. lnk = $("<li><a>" + appendopts.text + "</a></li>")
  1505. lnk.find('a').attr('href', this.opts.link_to.replace(/__id__/,page_id+1));
  1506. }
  1507. if(appendopts.classes){ lnk.addClass(appendopts.classes); }
  1508. lnk.find('a').data('page_id', page_id);
  1509. return lnk;
  1510. },
  1511. // Generate a range of numeric links
  1512. appendRange:function(container, current_page, start, end, opts) {
  1513. var i;
  1514. for(i=start; i<end; i++) {
  1515. this.createLink(i, current_page, opts).appendTo(container);
  1516. }
  1517. },
  1518. getLinks:function(current_page, eventHandler) {
  1519. var begin, end,
  1520. interval = this.pc.getInterval(current_page),
  1521. np = this.pc.numPages(),
  1522. fragment = $("<div class='pagination'></div>");
  1523. // Generate "Previous"-Link
  1524. if(this.opts.prev_text && (current_page > 0 || this.opts.prev_show_always)){
  1525. fragment.append(this.createLink(current_page-1, current_page, {text:this.opts.prev_text, classes:"prev"}));
  1526. }
  1527. // Generate starting points
  1528. if (interval.start > 0 && this.opts.num_edge_entries > 0)
  1529. {
  1530. end = Math.min(this.opts.num_edge_entries, interval.start);
  1531. this.appendRange(fragment, current_page, 0, end, {classes:'sp'});
  1532. if(this.opts.num_edge_entries < interval.start && this.opts.ellipse_text)
  1533. {
  1534. $("<span>"+this.opts.ellipse_text+"</span>").appendTo(fragment);
  1535. }
  1536. }
  1537. // Generate interval links
  1538. this.appendRange(fragment, current_page, interval.start, interval.end);
  1539. // Generate ending points
  1540. if (interval.end < np && this.opts.num_edge_entries > 0)
  1541. {
  1542. if(np-this.opts.num_edge_entries > interval.end && this.opts.ellipse_text)
  1543. {
  1544. $("<span>"+this.opts.ellipse_text+"</span>").appendTo(fragment);
  1545. }
  1546. begin = Math.max(np-this.opts.num_edge_entries, interval.end);
  1547. this.appendRange(fragment, current_page, begin, np, {classes:'ep'});
  1548. }
  1549. // Generate "Next"-Link
  1550. if(this.opts.next_text && (current_page < np-1 || this.opts.next_show_always)){
  1551. fragment.append(this.createLink(current_page+1, current_page, {text:this.opts.next_text, classes:"next"}));
  1552. }
  1553. $('a', fragment).click(eventHandler);
  1554. return fragment;
  1555. }
  1556. });
  1557. // Extend jQuery
  1558. $.fn.pagination = function(maxentries, opts){
  1559. // Initialize options with default values
  1560. opts = $.extend({
  1561. items_per_page:10,
  1562. num_display_entries:11,
  1563. current_page:0,
  1564. num_edge_entries:0,
  1565. link_to:"###",
  1566. prev_text:"<",
  1567. next_text:">",
  1568. ellipse_text:"...",
  1569. prev_show_always:true,
  1570. next_show_always:true,
  1571. renderer:"defaultRenderer",
  1572. show_if_single_page:true,
  1573. load_first_page:true,
  1574. callback:function(){}
  1575. },opts||{});
  1576. var containers = this,
  1577. renderer, links, current_page;
  1578. /**
  1579. * This is the event handling function for the pagination links.
  1580. * @param {int} page_id The new page number
  1581. */
  1582. function paginationClickHandler(evt){
  1583. var links,
  1584. new_current_page = $(evt.target).data('page_id'),
  1585. continuePropagation = selectPage(new_current_page);
  1586. if (!continuePropagation) {
  1587. evt.stopPropagation();
  1588. }
  1589. return continuePropagation;
  1590. }
  1591. /**
  1592. * This is a utility function for the internal event handlers.
  1593. * It sets the new current page on the pagination container objects,
  1594. * generates a new HTMl fragment for the pagination links and calls
  1595. * the callback function.
  1596. */
  1597. function selectPage(new_current_page) {
  1598. // update the link display of a all containers
  1599. containers.data('current_page', new_current_page);
  1600. links = renderer.getLinks(new_current_page, paginationClickHandler);
  1601. containers.empty();
  1602. links.appendTo(containers);
  1603. // call the callback and propagate the event if it does not return false
  1604. var continuePropagation = opts.callback(new_current_page, containers);
  1605. return continuePropagation;
  1606. }
  1607. // -----------------------------------
  1608. // Initialize containers
  1609. // -----------------------------------
  1610. current_page = parseInt(opts.current_page);
  1611. containers.data('current_page', current_page);
  1612. // Create a sane value for maxentries and items_per_page
  1613. maxentries = (!maxentries || maxentries < 0)?1:maxentries;
  1614. opts.items_per_page = (!opts.items_per_page || opts.items_per_page < 0)?1:opts.items_per_page;
  1615. if(!$.PaginationRenderers[opts.renderer])
  1616. {
  1617. throw new ReferenceError("Pagination renderer '" + opts.renderer + "' was not found in jQuery.PaginationRenderers object.");
  1618. }
  1619. renderer = new $.PaginationRenderers[opts.renderer](maxentries, opts);
  1620. // Attach control events to the DOM elements
  1621. var pc = new $.PaginationCalculator(maxentries, opts);
  1622. var np = pc.numPages();
  1623. containers.bind('setPage', {numPages:np}, function(evt, page_id) {
  1624. if(page_id >= 0 && page_id < evt.data.numPages) {
  1625. selectPage(page_id); return false;
  1626. }
  1627. });
  1628. containers.bind('prevPage', function(evt){
  1629. var current_page = $(this).data('current_page');
  1630. if (current_page > 0) {
  1631. selectPage(current_page - 1);
  1632. }
  1633. return false;
  1634. });
  1635. containers.bind('nextPage', {numPages:np}, function(evt){
  1636. var current_page = $(this).data('current_page');
  1637. if(current_page < evt.data.numPages - 1) {
  1638. selectPage(current_page + 1);
  1639. }
  1640. return false;
  1641. });
  1642. // When all initialisation is done, draw the links
  1643. links = renderer.getLinks(current_page, paginationClickHandler);
  1644. containers.empty();
  1645. if(np > 1 || opts.show_if_single_page) {
  1646. links.appendTo(containers);
  1647. }
  1648. // call callback function
  1649. if(opts.load_first_page) {
  1650. //opts.callback(current_page, containers);
  1651. }
  1652. } // End of $.fn.pagination block
  1653. })(jQuery);
  1654. /*
  1655. SWFObject v2.2 <http://code.google.com/p/swfobject/>
  1656. is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
  1657. */
  1658. ;var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;
  1659. if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;
  1660. X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);
  1661. ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0;}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");
  1662. if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)];}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac};
  1663. }(),k=function(){if(!M.w3){return;}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f();
  1664. }if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false);}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);
  1665. f();}});if(O==top){(function(){if(J){return;}try{j.documentElement.doScroll("left");}catch(X){setTimeout(arguments.callee,0);return;}f();})();}}if(M.wk){(function(){if(J){return;
  1666. }if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return;}f();})();}s(f);}}();function f(){if(J){return;}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));
  1667. Z.parentNode.removeChild(Z);}catch(aa){return;}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]();}}function K(X){if(J){X();}else{U[U.length]=X;}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false);
  1668. }else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false);}else{if(typeof O.attachEvent!=D){i(O,"onload",Y);}else{if(typeof O.onload=="function"){var X=O.onload;
  1669. O.onload=function(){X();Y();};}else{O.onload=Y;}}}}}function h(){if(T){V();}else{H();}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);
  1670. aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");
  1671. M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)];}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return;}}X.removeChild(aa);Z=null;H();
  1672. })();}else{H();}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);
  1673. if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa);}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;
  1674. ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class");}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align");
  1675. }var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value");
  1676. }}P(ai,ah,Y,ab);}else{p(ae);if(ab){ab(aa);}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z;}ab(aa);}}}}}function z(aa){var X=null;
  1677. var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y;}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z;}}}return X;}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312);
  1678. }function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null;}else{l=ae;Q=X;}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310";
  1679. }if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137";}j.title=j.title.slice(0,47)+" - Flash Player Installation";
  1680. var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac;
  1681. }else{ab.flashvars=ac;}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";
  1682. (function(){if(ae.readyState==4){ae.parentNode.removeChild(ae);}else{setTimeout(arguments.callee,10);}})();}u(aa,ab,X);}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");
  1683. Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y);}else{setTimeout(arguments.callee,10);
  1684. }})();}else{Y.parentNode.replaceChild(g(Y),Y);}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML;}else{var Y=ab.getElementsByTagName(r)[0];
  1685. if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true));
  1686. }}}}}return aa;}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X;}if(aa){if(typeof ai.id==D){ai.id=Y;}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae];
  1687. }else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"';}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"';}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />';
  1688. }}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id);}else{var Z=C(r);Z.setAttribute("type",q);
  1689. for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac]);}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac]);
  1690. }}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab]);}}aa.parentNode.replaceChild(Z,aa);X=Z;}}return X;}function e(Z,X,Y){var aa=C("param");
  1691. aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa);}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";
  1692. (function(){if(X.readyState==4){b(Y);}else{setTimeout(arguments.callee,10);}})();}else{X.parentNode.removeChild(X);}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null;
  1693. }}Y.parentNode.removeChild(Y);}}function c(Z){var X=null;try{X=j.getElementById(Z);}catch(Y){}return X;}function C(X){return j.createElement(X);}function i(Z,X,Y){Z.attachEvent(X,Y);
  1694. I[I.length]=[Z,X,Y];}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false;
  1695. }function v(ac,Y,ad,ab){if(M.ie&&M.mac){return;}var aa=j.getElementsByTagName("head")[0];if(!aa){return;}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;
  1696. G=null;}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1];
  1697. }G=X;}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y);}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"));
  1698. }}}function w(Z,X){if(!m){return;}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y;}else{v("#"+Z,"visibility:"+Y);}}function L(Y){var Z=/[\\\"<>\.;]/;
  1699. var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y;}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;
  1700. for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2]);}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa]);}for(var Y in M){M[Y]=null;}M=null;for(var X in swfobject){swfobject[X]=null;
  1701. }swfobject=null;});}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;
  1702. w(ab,false);}else{if(Z){Z({success:false,id:ab});}}},getObjectById:function(X){if(M.w3){return z(X);}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};
  1703. if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al];}}aj.data=ab;
  1704. aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak];}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai];
  1705. }else{am.flashvars=ai+"="+Z[ai];}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true);}X.success=true;X.ref=an;}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);
  1706. return;}else{w(ah,true);}}if(ac){ac(X);}});}else{if(ac){ac(X);}}},switchOffAutoHideShow:function(){m=false;},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]};
  1707. },hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X);}else{return undefined;}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y);
  1708. }},removeSWF:function(X){if(M.w3){y(X);}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X);}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;
  1709. if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1];}if(aa==null){return L(Z);}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)));
  1710. }}}return"";},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block";
  1711. }}if(E){E(B);}}a=false;}}};}();
  1712. /*
  1713. SWFUpload: http://www.swfupload.org, http://swfupload.googlecode.com
  1714. mmSWFUpload 1.0: Flash upload dialog - http://profandesign.se/swfupload/, http://www.vinterwebb.se/
  1715. SWFUpload is (c) 2006-2007 Lars Huring, Olov Nilzén and Mammon Media and is released under the MIT License:
  1716. http://www.opensource.org/licenses/mit-license.php
  1717. SWFUpload 2 is (c) 2007-2008 Jake Roberts and is released under the MIT License:
  1718. http://www.opensource.org/licenses/mit-license.php
  1719. */
  1720. var SWFUpload;if(SWFUpload==undefined){SWFUpload=function(a){this.initSWFUpload(a)}}SWFUpload.prototype.initSWFUpload=function(b){try{this.customSettings={};this.settings=b;this.eventQueue=[];this.movieName="SWFUpload_"+SWFUpload.movieCount++;this.movieElement=null;SWFUpload.instances[this.movieName]=this;this.initSettings();this.loadFlash();this.displayDebugInfo()}catch(a){delete SWFUpload.instances[this.movieName];throw a}};SWFUpload.instances={};SWFUpload.movieCount=0;SWFUpload.version="2.2.0 2009-03-25";SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130};SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290};SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5};SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,START_UPLOAD:-120};SWFUpload.CURSOR={ARROW:-1,HAND:-2};SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"};SWFUpload.completeURL=function(a){if(typeof(a)!=="string"||a.match(/^https?:\/\//i)||a.match(/^\//)){return a}var c=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"");var b=window.location.pathname.lastIndexOf("/");if(b<=0){path="/"}else{path=window.location.pathname.substr(0,b)+"/"}return path+a};SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(b,a){this.settings[b]=(this.settings[b]==undefined)?a:this.settings[b]};this.ensureDefault("upload_url","");this.ensureDefault("preserve_relative_urls",false);this.ensureDefault("file_post_name","Filedata");this.ensureDefault("post_params",{});this.ensureDefault("use_query_string",false);this.ensureDefault("requeue_on_error",false);this.ensureDefault("http_success",[]);this.ensureDefault("assume_success_timeout",0);this.ensureDefault("file_types","*.*");this.ensureDefault("file_types_description","All Files");this.ensureDefault("file_size_limit",0);this.ensureDefault("file_upload_limit",0);this.ensureDefault("file_queue_limit",0);this.ensureDefault("flash_url","swfupload.swf");this.ensureDefault("prevent_swf_caching",true);this.ensureDefault("button_image_url","");this.ensureDefault("button_width",1);this.ensureDefault("button_height",1);this.ensureDefault("button_text","");this.ensureDefault("button_text_style","color: #000000; font-size: 16pt;");this.ensureDefault("button_text_top_padding",0);this.ensureDefault("button_text_left_padding",0);this.ensureDefault("button_action",SWFUpload.BUTTON_ACTION.SELECT_FILES);this.ensureDefault("button_disabled",false);this.ensureDefault("button_placeholder_id","");this.ensureDefault("button_placeholder",null);this.ensureDefault("button_cursor",SWFUpload.CURSOR.ARROW);this.ensureDefault("button_window_mode",SWFUpload.WINDOW_MODE.WINDOW);this.ensureDefault("debug",false);this.settings.debug_enabled=this.settings.debug;this.settings.return_upload_start_handler=this.returnUploadStart;this.ensureDefault("swfupload_loaded_handler",null);this.ensureDefault("file_dialog_start_handler",null);this.ensureDefault("file_queued_handler",null);this.ensureDefault("file_queue_error_handler",null);this.ensureDefault("file_dialog_complete_handler",null);this.ensureDefault("upload_start_handler",null);this.ensureDefault("upload_progress_handler",null);this.ensureDefault("upload_error_handler",null);this.ensureDefault("upload_success_handler",null);this.ensureDefault("upload_complete_handler",null);this.ensureDefault("debug_handler",this.debugMessage);this.ensureDefault("custom_settings",{});this.customSettings=this.settings.custom_settings;if(!!this.settings.prevent_swf_caching){this.settings.flash_url=this.settings.flash_url+(this.settings.flash_url.indexOf("?")<0?"?":"&")+"preventswfcaching="+allGetServerTime().getTime()}if(!this.settings.preserve_relative_urls){this.settings.upload_url=SWFUpload.completeURL(this.settings.upload_url);this.settings.button_image_url=SWFUpload.completeURL(this.settings.button_image_url)}delete this.ensureDefault};SWFUpload.prototype.loadFlash=function(){var a,b;if(document.getElementById(this.movieName)!==null){throw"ID "+this.movieName+" is already in use. The Flash Object could not be added"}a=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder;if(a==undefined){throw"Could not find the placeholder element: "+this.settings.button_placeholder_id}b=document.createElement("div");b.innerHTML=this.getFlashHTML();a.parentNode.replaceChild(b.firstChild,a);if(window[this.movieName]==undefined){window[this.movieName]=this.getMovieElement()}};SWFUpload.prototype.getFlashHTML=function(){return['<object id="',this.movieName,'" type="application/x-shockwave-flash" data="',this.settings.flash_url,'" width="',this.settings.button_width,'" height="',this.settings.button_height,'" class="swfupload">','<param name="wmode" value="',this.settings.button_window_mode,'" />','<param name="movie" value="',this.settings.flash_url,'" />','<param name="quality" value="high" />','<param name="menu" value="false" />','<param name="allowScriptAccess" value="always" />','<param name="flashvars" value="'+this.getFlashVars()+'" />',"</object>"].join("")};SWFUpload.prototype.getFlashVars=function(){var b=this.buildParamString();var a=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&amp;uploadURL=",encodeURIComponent(this.settings.upload_url),"&amp;useQueryString=",encodeURIComponent(this.settings.use_query_string),"&amp;requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&amp;httpSuccess=",encodeURIComponent(a),"&amp;assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&amp;params=",encodeURIComponent(b),"&amp;filePostName=",encodeURIComponent(this.settings.file_post_name),"&amp;fileTypes=",encodeURIComponent(this.settings.file_types),"&amp;fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&amp;fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&amp;fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&amp;fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&amp;debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&amp;buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&amp;buttonWidth=",encodeURIComponent(this.settings.button_width),"&amp;buttonHeight=",encodeURIComponent(this.settings.button_height),"&amp;buttonText=",encodeURIComponent(this.settings.button_text),"&amp;buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&amp;buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&amp;buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&amp;buttonAction=",encodeURIComponent(this.settings.button_action),"&amp;buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&amp;buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("")};SWFUpload.prototype.getMovieElement=function(){if(this.movieElement==undefined){this.movieElement=document.getElementById(this.movieName)}if(this.movieElement===null){throw"Could not find Flash element"}return this.movieElement};SWFUpload.prototype.buildParamString=function(){var c=this.settings.post_params;var b=[];if(typeof(c)==="object"){for(var a in c){if(c.hasOwnProperty(a)){b.push(encodeURIComponent(a.toString())+"="+encodeURIComponent(c[a].toString()))}}}return b.join("&amp;")};SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,false);var a=null;a=this.getMovieElement();if(a&&typeof(a.CallFunction)==="unknown"){for(var c in a){try{if(typeof(a[c])==="function"){a[c]=null}}catch(e){}}try{a.parentNode.removeChild(a)}catch(b){}}window[this.movieName]=null;SWFUpload.instances[this.movieName]=null;delete SWFUpload.instances[this.movieName];this.movieElement=null;this.settings=null;this.customSettings=null;this.eventQueue=null;this.movieName=null;return true}catch(d){return false}};SWFUpload.prototype.displayDebugInfo=function(){this.debug(["---SWFUpload Instance Info---\n","Version: ",SWFUpload.version,"\n","Movie Name: ",this.movieName,"\n","Settings:\n","\t","upload_url: ",this.settings.upload_url,"\n","\t","flash_url: ",this.settings.flash_url,"\n","\t","use_query_string: ",this.settings.use_query_string.toString(),"\n","\t","requeue_on_error: ",this.settings.requeue_on_error.toString(),"\n","\t","http_success: ",this.settings.http_success.join(", "),"\n","\t","assume_success_timeout: ",this.settings.assume_success_timeout,"\n","\t","file_post_name: ",this.settings.file_post_name,"\n","\t","post_params: ",this.settings.post_params.toString(),"\n","\t","file_types: ",this.settings.file_types,"\n","\t","file_types_description: ",this.settings.file_types_description,"\n","\t","file_size_limit: ",this.settings.file_size_limit,"\n","\t","file_upload_limit: ",this.settings.file_upload_limit,"\n","\t","file_queue_limit: ",this.settings.file_queue_limit,"\n","\t","debug: ",this.settings.debug.toString(),"\n","\t","prevent_swf_caching: ",this.settings.prevent_swf_caching.toString(),"\n","\t","button_placeholder_id: ",this.settings.button_placeholder_id.toString(),"\n","\t","button_placeholder: ",(this.settings.button_placeholder?"Set":"Not Set"),"\n","\t","button_image_url: ",this.settings.button_image_url.toString(),"\n","\t","button_width: ",this.settings.button_width.toString(),"\n","\t","button_height: ",this.settings.button_height.toString(),"\n","\t","button_text: ",this.settings.button_text.toString(),"\n","\t","button_text_style: ",this.settings.button_text_style.toString(),"\n","\t","button_text_top_padding: ",this.settings.button_text_top_padding.toString(),"\n","\t","button_text_left_padding: ",this.settings.button_text_left_padding.toString(),"\n","\t","button_action: ",this.settings.button_action.toString(),"\n","\t","button_disabled: ",this.settings.button_disabled.toString(),"\n","\t","custom_settings: ",this.settings.custom_settings.toString(),"\n","Event Handlers:\n","\t","swfupload_loaded_handler assigned: ",(typeof this.settings.swfupload_loaded_handler==="function").toString(),"\n","\t","file_dialog_start_handler assigned: ",(typeof this.settings.file_dialog_start_handler==="function").toString(),"\n","\t","file_queued_handler assigned: ",(typeof this.settings.file_queued_handler==="function").toString(),"\n","\t","file_queue_error_handler assigned: ",(typeof this.settings.file_queue_error_handler==="function").toString(),"\n","\t","upload_start_handler assigned: ",(typeof this.settings.upload_start_handler==="function").toString(),"\n","\t","upload_progress_handler assigned: ",(typeof this.settings.upload_progress_handler==="function").toString(),"\n","\t","upload_error_handler assigned: ",(typeof this.settings.upload_error_handler==="function").toString(),"\n","\t","upload_success_handler assigned: ",(typeof this.settings.upload_success_handler==="function").toString(),"\n","\t","upload_complete_handler assigned: ",(typeof this.settings.upload_complete_handler==="function").toString(),"\n","\t","debug_handler assigned: ",(typeof this.settings.debug_handler==="function").toString(),"\n"].join(""))};SWFUpload.prototype.addSetting=function(b,c,a){if(c==undefined){return(this.settings[b]=a)}else{return(this.settings[b]=c)}};SWFUpload.prototype.getSetting=function(a){if(this.settings[a]!=undefined){return this.settings[a]}return""};SWFUpload.prototype.callFlash=function(functionName,argumentArray){argumentArray=argumentArray||[];var movieElement=this.getMovieElement();var returnValue,returnString;try{returnString=movieElement.CallFunction('<invoke name="'+functionName+'" returntype="javascript">'+__flash__argumentsToXML(argumentArray,0)+"</invoke>");returnValue=eval(returnString)}catch(ex){throw"Call to "+functionName+" failed"}if(returnValue!=undefined&&typeof returnValue.post==="object"){returnValue=this.unescapeFilePostParams(returnValue)}return returnValue};SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile")};SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles")};SWFUpload.prototype.startUpload=function(a){this.callFlash("StartUpload",[a])};SWFUpload.prototype.cancelUpload=function(a,b){if(b!==false){b=true}this.callFlash("CancelUpload",[a,b])};SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload")};SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats")};SWFUpload.prototype.setStats=function(a){this.callFlash("SetStats",[a])};SWFUpload.prototype.getFile=function(a){if(typeof(a)==="number"){return this.callFlash("GetFileByIndex",[a])}else{return this.callFlash("GetFile",[a])}};SWFUpload.prototype.addFileParam=function(a,b,c){return this.callFlash("AddFileParam",[a,b,c])};SWFUpload.prototype.removeFileParam=function(a,b){this.callFlash("RemoveFileParam",[a,b])};SWFUpload.prototype.setUploadURL=function(a){this.settings.upload_url=a.toString();this.callFlash("SetUploadURL",[a])};SWFUpload.prototype.setPostParams=function(a){this.settings.post_params=a;this.callFlash("SetPostParams",[a])};SWFUpload.prototype.addPostParam=function(a,b){this.settings.post_params[a]=b;this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.removePostParam=function(a){delete this.settings.post_params[a];this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.setFileTypes=function(a,b){this.settings.file_types=a;this.settings.file_types_description=b;this.callFlash("SetFileTypes",[a,b])};SWFUpload.prototype.setFileSizeLimit=function(a){this.settings.file_size_limit=a;this.callFlash("SetFileSizeLimit",[a])};SWFUpload.prototype.setFileUploadLimit=function(a){this.settings.file_upload_limit=a;this.callFlash("SetFileUploadLimit",[a])};SWFUpload.prototype.setFileQueueLimit=function(a){this.settings.file_queue_limit=a;this.callFlash("SetFileQueueLimit",[a])};SWFUpload.prototype.setFilePostName=function(a){this.settings.file_post_name=a;this.callFlash("SetFilePostName",[a])};SWFUpload.prototype.setUseQueryString=function(a){this.settings.use_query_string=a;this.callFlash("SetUseQueryString",[a])};SWFUpload.prototype.setRequeueOnError=function(a){this.settings.requeue_on_error=a;this.callFlash("SetRequeueOnError",[a])};SWFUpload.prototype.setHTTPSuccess=function(a){if(typeof a==="string"){a=a.replace(" ","").split(",")}this.settings.http_success=a;this.callFlash("SetHTTPSuccess",[a])};SWFUpload.prototype.setAssumeSuccessTimeout=function(a){this.settings.assume_success_timeout=a;this.callFlash("SetAssumeSuccessTimeout",[a])};SWFUpload.prototype.setDebugEnabled=function(a){this.settings.debug_enabled=a;this.callFlash("SetDebugEnabled",[a])};SWFUpload.prototype.setButtonImageURL=function(a){if(a==undefined){a=""}this.settings.button_image_url=a;this.callFlash("SetButtonImageURL",[a])};SWFUpload.prototype.setButtonDimensions=function(c,a){this.settings.button_width=c;this.settings.button_height=a;var b=this.getMovieElement();if(b!=undefined){b.style.width=c+"px";b.style.height=a+"px"}this.callFlash("SetButtonDimensions",[c,a])};SWFUpload.prototype.setButtonText=function(a){this.settings.button_text=a;this.callFlash("SetButtonText",[a])};SWFUpload.prototype.setButtonTextPadding=function(b,a){this.settings.button_text_top_padding=a;this.settings.button_text_left_padding=b;this.callFlash("SetButtonTextPadding",[b,a])};SWFUpload.prototype.setButtonTextStyle=function(a){this.settings.button_text_style=a;this.callFlash("SetButtonTextStyle",[a])};SWFUpload.prototype.setButtonDisabled=function(a){this.settings.button_disabled=a;this.callFlash("SetButtonDisabled",[a])};SWFUpload.prototype.setButtonAction=function(a){this.settings.button_action=a;this.callFlash("SetButtonAction",[a])};SWFUpload.prototype.setButtonCursor=function(a){this.settings.button_cursor=a;this.callFlash("SetButtonCursor",[a])};SWFUpload.prototype.queueEvent=function(b,c){if(c==undefined){c=[]}else{if(!(c instanceof Array)){c=[c]}}var a=this;if(typeof this.settings[b]==="function"){this.eventQueue.push(function(){this.settings[b].apply(this,c)});setTimeout(function(){a.executeNextEvent()},0)}else{if(this.settings[b]!==null){throw"Event handler "+b+" is unknown or is not a function"}}};SWFUpload.prototype.executeNextEvent=function(){var a=this.eventQueue?this.eventQueue.shift():null;if(typeof(a)==="function"){a.apply(this)}};SWFUpload.prototype.unescapeFilePostParams=function(c){var e=/[$]([0-9a-f]{4})/i;var f={};var d;if(c!=undefined){for(var a in c.post){if(c.post.hasOwnProperty(a)){d=a;var b;while((b=e.exec(d))!==null){d=d.replace(b[0],String.fromCharCode(parseInt("0x"+b[1],16)))}f[d]=c.post[a]}}c.post=f}return c};SWFUpload.prototype.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface")}catch(a){return false}};SWFUpload.prototype.flashReady=function(){var a=this.getMovieElement();if(!a){this.debug("Flash called back ready but the flash movie can't be found.");return}this.cleanUp(a);this.queueEvent("swfupload_loaded_handler")};SWFUpload.prototype.cleanUp=function(a){try{if(this.movieElement&&typeof(a.CallFunction)==="unknown"){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var c in a){try{if(typeof(a[c])==="function"){a[c]=null}}catch(b){}}}}catch(d){}window.__flash__removeCallback=function(e,f){try{if(e){e[f]=null}}catch(g){}}};SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler")};SWFUpload.prototype.fileQueued=function(a){a=this.unescapeFilePostParams(a);this.queueEvent("file_queued_handler",a)};SWFUpload.prototype.fileQueueError=function(a,c,b){a=this.unescapeFilePostParams(a);this.queueEvent("file_queue_error_handler",[a,c,b])};SWFUpload.prototype.fileDialogComplete=function(b,c,a){this.queueEvent("file_dialog_complete_handler",[b,c,a])};SWFUpload.prototype.uploadStart=function(a){a=this.unescapeFilePostParams(a);this.queueEvent("return_upload_start_handler",a)};SWFUpload.prototype.returnUploadStart=function(a){var b;if(typeof this.settings.upload_start_handler==="function"){a=this.unescapeFilePostParams(a);b=this.settings.upload_start_handler.call(this,a)}else{if(this.settings.upload_start_handler!=undefined){throw"upload_start_handler must be a function"}}if(b===undefined){b=true}b=!!b;this.callFlash("ReturnUploadStart",[b])};SWFUpload.prototype.uploadProgress=function(a,c,b){a=this.unescapeFilePostParams(a);this.queueEvent("upload_progress_handler",[a,c,b])};SWFUpload.prototype.uploadError=function(a,c,b){a=this.unescapeFilePostParams(a);this.queueEvent("upload_error_handler",[a,c,b])};SWFUpload.prototype.uploadSuccess=function(b,a,c){b=this.unescapeFilePostParams(b);this.queueEvent("upload_success_handler",[b,a,c])};SWFUpload.prototype.uploadComplete=function(a){a=this.unescapeFilePostParams(a);this.queueEvent("upload_complete_handler",a)};SWFUpload.prototype.debug=function(a){this.queueEvent("debug_handler",a)};SWFUpload.prototype.debugMessage=function(c){if(this.settings.debug){var a,d=[];if(typeof c==="object"&&typeof c.name==="string"&&typeof c.message==="string"){for(var b in c){if(c.hasOwnProperty(b)){d.push(b+": "+c[b])}}a=d.join("\n")||"";d=a.split("\n");a="EXCEPTION: "+d.join("\nEXCEPTION: ");SWFUpload.Console.writeLine(a)}else{SWFUpload.Console.writeLine(c)}}};SWFUpload.Console={};SWFUpload.Console.writeLine=function(d){var b,a;try{b=document.getElementById("SWFUpload_Console");if(!b){a=document.createElement("form");document.getElementsByTagName("body")[0].appendChild(a);b=document.createElement("textarea");b.id="SWFUpload_Console";b.style.fontFamily="monospace";b.setAttribute("wrap","off");b.wrap="off";b.style.overflow="auto";b.style.width="700px";b.style.height="350px";b.style.margin="5px";a.appendChild(b)}b.value+=d+"\n";b.scrollTop=b.scrollHeight-b.clientHeight}catch(c){alert("Exception: "+c.name+" Message: "+c.message)}};
  1721. /*
  1722. Uploadify v3.2.1
  1723. Copyright (c) 2012 Reactive Apps, Ronnie Garcia
  1724. Released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
  1725. */
  1726. (function($) {
  1727. // These methods can be called by adding them as the first argument in the uploadify plugin call
  1728. var methods = {
  1729. init : function(options, swfUploadOptions) {
  1730. return this.each(function() {
  1731. // Create a reference to the jQuery DOM object
  1732. var $this = $(this);
  1733. // Clone the original DOM object
  1734. var $clone = $this.clone();
  1735. // Setup the default options
  1736. var settings = $.extend({
  1737. // Required Settings
  1738. id : $this.attr('id'), // The ID of the DOM object
  1739. swf : 'uploadify.swf', // The path to the uploadify SWF file
  1740. uploader : 'uploadify.php', // The path to the server-side upload script
  1741. // Options
  1742. auto : true, // Automatically upload files when added to the queue
  1743. buttonClass : '', // A class name to add to the browse button DOM object
  1744. buttonCursor : 'hand', // The cursor to use with the browse button
  1745. buttonImage : null, // (String or null) The path to an image to use for the Flash browse button if not using CSS to style the button
  1746. buttonText : 'SELECT FILES', // The text to use for the browse button
  1747. checkExisting : false, // The path to a server-side script that checks for existing files on the server
  1748. debug : false, // Turn on swfUpload debugging mode
  1749. fileObjName : 'Filedata', // The name of the file object to use in your server-side script
  1750. fileSizeLimit : 0, // The maximum size of an uploadable file in KB (Accepts units B KB MB GB if string, 0 for no limit)
  1751. fileTypeDesc : 'All Files', // The description for file types in the browse dialog
  1752. fileTypeExts : '*.*', // Allowed extensions in the browse dialog (server-side validation should also be used)
  1753. height : 30, // The height of the browse button
  1754. itemTemplate : false, // The template for the file item in the queue
  1755. method : 'post', // The method to use when sending files to the server-side upload script
  1756. multi : true, // Allow multiple file selection in the browse dialog
  1757. formData : {}, // An object with additional data to send to the server-side upload script with every file upload
  1758. preventCaching : true, // Adds a random value to the Flash URL to prevent caching of it (conflicts with existing parameters)
  1759. progressData : 'percentage', // ('percentage' or 'speed') Data to show in the queue item during a file upload
  1760. queueID : false, // The ID of the DOM object to use as a file queue (without the #)
  1761. queueSizeLimit : 999, // The maximum number of files that can be in the queue at one time
  1762. removeCompleted : true, // Remove queue items from the queue when they are done uploading
  1763. removeTimeout : 3, // The delay in seconds before removing a queue item if removeCompleted is set to true
  1764. requeueErrors : false, // Keep errored files in the queue and keep trying to upload them
  1765. successTimeout : 30, // The number of seconds to wait for Flash to detect the server's response after the file has finished uploading
  1766. uploadLimit : 0, // The maximum number of files you can upload
  1767. width : 120, // The width of the browse button
  1768. // Events
  1769. overrideEvents : [] // (Array) A list of default event handlers to skip
  1770. /*
  1771. onCancel // Triggered when a file is cancelled from the queue
  1772. onClearQueue // Triggered during the 'clear queue' method
  1773. onDestroy // Triggered when the uploadify object is destroyed
  1774. onDialogClose // Triggered when the browse dialog is closed
  1775. onDialogOpen // Triggered when the browse dialog is opened
  1776. onDisable // Triggered when the browse button gets disabled
  1777. onEnable // Triggered when the browse button gets enabled
  1778. onFallback // Triggered is Flash is not detected
  1779. onInit // Triggered when Uploadify is initialized
  1780. onQueueComplete // Triggered when all files in the queue have been uploaded
  1781. onSelectError // Triggered when an error occurs while selecting a file (file size, queue size limit, etc.)
  1782. onSelect // Triggered for each file that is selected
  1783. onSWFReady // Triggered when the SWF button is loaded
  1784. onUploadComplete // Triggered when a file upload completes (success or error)
  1785. onUploadError // Triggered when a file upload returns an error
  1786. onUploadSuccess // Triggered when a file is uploaded successfully
  1787. onUploadProgress // Triggered every time a file progress is updated
  1788. onUploadStart // Triggered immediately before a file upload starts
  1789. */
  1790. }, options);
  1791. // Prepare settings for SWFUpload
  1792. var swfUploadSettings = {
  1793. assume_success_timeout : settings.successTimeout,
  1794. button_placeholder_id : settings.id,
  1795. button_width : settings.width,
  1796. button_height : settings.height,
  1797. button_text : null,
  1798. button_text_style : null,
  1799. button_text_top_padding : 0,
  1800. button_text_left_padding : 0,
  1801. button_action : (settings.multi ? SWFUpload.BUTTON_ACTION.SELECT_FILES : SWFUpload.BUTTON_ACTION.SELECT_FILE),
  1802. button_disabled : false,
  1803. button_cursor : (settings.buttonCursor == 'arrow' ? SWFUpload.CURSOR.ARROW : SWFUpload.CURSOR.HAND),
  1804. button_window_mode : SWFUpload.WINDOW_MODE.TRANSPARENT,
  1805. debug : settings.debug,
  1806. requeue_on_error : settings.requeueErrors,
  1807. file_post_name : settings.fileObjName,
  1808. file_size_limit : settings.fileSizeLimit,
  1809. file_types : settings.fileTypeExts,
  1810. file_types_description : settings.fileTypeDesc,
  1811. file_queue_limit : settings.queueSizeLimit,
  1812. file_upload_limit : settings.uploadLimit,
  1813. flash_url : settings.swf,
  1814. prevent_swf_caching : settings.preventCaching,
  1815. post_params : settings.formData,
  1816. upload_url : settings.uploader,
  1817. use_query_string : (settings.method == 'get'),
  1818. // Event Handlers
  1819. file_dialog_complete_handler : handlers.onDialogClose,
  1820. file_dialog_start_handler : handlers.onDialogOpen,
  1821. file_queued_handler : handlers.onSelect,
  1822. file_queue_error_handler : handlers.onSelectError,
  1823. swfupload_loaded_handler : settings.onSWFReady,
  1824. upload_complete_handler : handlers.onUploadComplete,
  1825. upload_error_handler : handlers.onUploadError,
  1826. upload_progress_handler : handlers.onUploadProgress,
  1827. upload_start_handler : handlers.onUploadStart,
  1828. upload_success_handler : handlers.onUploadSuccess
  1829. }
  1830. // Merge the user-defined options with the defaults
  1831. if (swfUploadOptions) {
  1832. swfUploadSettings = $.extend(swfUploadSettings, swfUploadOptions);
  1833. }
  1834. // Add the user-defined settings to the swfupload object
  1835. swfUploadSettings = $.extend(swfUploadSettings, settings);
  1836. // Detect if Flash is available
  1837. var playerVersion = swfobject.getFlashPlayerVersion();
  1838. var flashInstalled = (playerVersion.major >= 9);
  1839. if (flashInstalled) {
  1840. // Create the swfUpload instance
  1841. window['uploadify_' + settings.id] = new SWFUpload(swfUploadSettings);
  1842. var swfuploadify = window['uploadify_' + settings.id];
  1843. // Add the SWFUpload object to the elements data object
  1844. $this.data('uploadify', swfuploadify);
  1845. // Wrap the instance
  1846. var $wrapper = $('<div />', {
  1847. 'id' : settings.id,
  1848. 'class' : 'uploadify',
  1849. 'css' : {
  1850. 'height' : settings.height + 'px',
  1851. 'width' : settings.width + 'px'
  1852. }
  1853. });
  1854. $('#' + swfuploadify.movieName).wrap($wrapper);
  1855. // Recreate the reference to wrapper
  1856. $wrapper = $('#' + settings.id);
  1857. // Add the data object to the wrapper
  1858. $wrapper.data('uploadify', swfuploadify);
  1859. // Create the button
  1860. var $button = $('<div />', {
  1861. 'id' : settings.id + '-button',
  1862. 'class' : 'uploadify-button ' + settings.buttonClass
  1863. });
  1864. if (settings.buttonImage) {
  1865. $button.css({
  1866. 'background-image' : "url('" + settings.buttonImage + "')",
  1867. 'text-indent' : '-9999px'
  1868. });
  1869. }
  1870. $button.html('<span class="uploadify-button-text">' + settings.buttonText + '</span>')
  1871. .css({
  1872. 'height' : settings.height + 'px',
  1873. 'line-height' : settings.height + 'px',
  1874. 'width' : settings.width + 'px'
  1875. });
  1876. // Append the button to the wrapper
  1877. $wrapper.append($button);
  1878. // Adjust the styles of the movie
  1879. $('#' + swfuploadify.movieName).css({
  1880. 'position' : 'absolute',
  1881. 'z-index' : 1
  1882. });
  1883. // Create the file queue
  1884. if (!settings.queueID) {
  1885. var $queue = $('<div />', {
  1886. 'id' : settings.id + '-queue',
  1887. 'class' : 'uploadify-queue'
  1888. });
  1889. $wrapper.after($queue);
  1890. swfuploadify.settings.queueID = settings.id + '-queue';
  1891. swfuploadify.settings.defaultQueue = true;
  1892. }
  1893. // Create some queue related objects and variables
  1894. swfuploadify.queueData = {
  1895. files : {}, // The files in the queue
  1896. filesSelected : 0, // The number of files selected in the last select operation
  1897. filesQueued : 0, // The number of files added to the queue in the last select operation
  1898. filesReplaced : 0, // The number of files replaced in the last select operation
  1899. filesCancelled : 0, // The number of files that were cancelled instead of replaced
  1900. filesErrored : 0, // The number of files that caused error in the last select operation
  1901. uploadsSuccessful : 0, // The number of files that were successfully uploaded
  1902. uploadsErrored : 0, // The number of files that returned errors during upload
  1903. averageSpeed : 0, // The average speed of the uploads in KB
  1904. queueLength : 0, // The number of files in the queue
  1905. queueSize : 0, // The size in bytes of the entire queue
  1906. uploadSize : 0, // The size in bytes of the upload queue
  1907. queueBytesUploaded : 0, // The size in bytes that have been uploaded for the current upload queue
  1908. uploadQueue : [], // The files currently to be uploaded
  1909. errorMsg : 'Some files were not added to the queue:'
  1910. };
  1911. // Save references to all the objects
  1912. swfuploadify.original = $clone;
  1913. swfuploadify.wrapper = $wrapper;
  1914. swfuploadify.button = $button;
  1915. swfuploadify.queue = $queue;
  1916. // Call the user-defined init event handler
  1917. if (settings.onInit) settings.onInit.call($this, swfuploadify);
  1918. } else {
  1919. // Call the fallback function
  1920. if (settings.onFallback) settings.onFallback.call($this);
  1921. }
  1922. });
  1923. },
  1924. // Stop a file upload and remove it from the queue
  1925. cancel : function(fileID, supressEvent) {
  1926. var args = arguments;
  1927. this.each(function() {
  1928. // Create a reference to the jQuery DOM object
  1929. var $this = $(this),
  1930. swfuploadify = $this.data('uploadify'),
  1931. settings = swfuploadify.settings,
  1932. delay = -1;
  1933. if (args[0]) {
  1934. // Clear the queue
  1935. if (args[0] == '*') {
  1936. var queueItemCount = swfuploadify.queueData.queueLength;
  1937. $('#' + settings.queueID).find('.uploadify-queue-item').each(function() {
  1938. delay++;
  1939. if (args[1] === true) {
  1940. swfuploadify.cancelUpload($(this).attr('id'), false);
  1941. } else {
  1942. swfuploadify.cancelUpload($(this).attr('id'));
  1943. }
  1944. $(this).find('.data').removeClass('data').html(' - Cancelled');
  1945. $(this).find('.uploadify-progress-bar').remove();
  1946. $(this).delay(1000 + 100 * delay).fadeOut(500, function() {
  1947. $(this).remove();
  1948. });
  1949. });
  1950. swfuploadify.queueData.queueSize = 0;
  1951. swfuploadify.queueData.queueLength = 0;
  1952. // Trigger the onClearQueue event
  1953. if (settings.onClearQueue) settings.onClearQueue.call($this, queueItemCount);
  1954. } else {
  1955. for (var n = 0; n < args.length; n++) {
  1956. swfuploadify.cancelUpload(args[n]);
  1957. $('#' + args[n]).find('.data').removeClass('data').html(' - Cancelled');
  1958. $('#' + args[n]).find('.uploadify-progress-bar').remove();
  1959. $('#' + args[n]).delay(1000 + 100 * n).fadeOut(500, function() {
  1960. $(this).remove();
  1961. });
  1962. }
  1963. }
  1964. } else {
  1965. var item = $('#' + settings.queueID).find('.uploadify-queue-item').get(0);
  1966. $item = $(item);
  1967. swfuploadify.cancelUpload($item.attr('id'));
  1968. $item.find('.data').removeClass('data').html(' - Cancelled');
  1969. $item.find('.uploadify-progress-bar').remove();
  1970. $item.delay(1000).fadeOut(500, function() {
  1971. $(this).remove();
  1972. });
  1973. }
  1974. });
  1975. },
  1976. // Revert the DOM object back to its original state
  1977. destroy : function() {
  1978. this.each(function() {
  1979. // Create a reference to the jQuery DOM object
  1980. var $this = $(this),
  1981. swfuploadify = $this.data('uploadify'),
  1982. settings = swfuploadify.settings;
  1983. // Destroy the SWF object and
  1984. swfuploadify.destroy();
  1985. // Destroy the queue
  1986. if (settings.defaultQueue) {
  1987. $('#' + settings.queueID).remove();
  1988. }
  1989. // Reload the original DOM element
  1990. $('#' + settings.id).replaceWith(swfuploadify.original);
  1991. // Call the user-defined event handler
  1992. if (settings.onDestroy) settings.onDestroy.call(this);
  1993. delete swfuploadify;
  1994. });
  1995. },
  1996. // Disable the select button
  1997. disable : function(isDisabled) {
  1998. this.each(function() {
  1999. // Create a reference to the jQuery DOM object
  2000. var $this = $(this),
  2001. swfuploadify = $this.data('uploadify'),
  2002. settings = swfuploadify.settings;
  2003. // Call the user-defined event handlers
  2004. if (isDisabled) {
  2005. swfuploadify.button.addClass('disabled');
  2006. if (settings.onDisable) settings.onDisable.call(this);
  2007. } else {
  2008. swfuploadify.button.removeClass('disabled');
  2009. if (settings.onEnable) settings.onEnable.call(this);
  2010. }
  2011. // Enable/disable the browse button
  2012. swfuploadify.setButtonDisabled(isDisabled);
  2013. });
  2014. },
  2015. // Get or set the settings data
  2016. settings : function(name, value, resetObjects) {
  2017. var args = arguments;
  2018. var returnValue = value;
  2019. this.each(function() {
  2020. // Create a reference to the jQuery DOM object
  2021. var $this = $(this),
  2022. swfuploadify = $this.data('uploadify'),
  2023. settings = swfuploadify.settings;
  2024. if (typeof(args[0]) == 'object') {
  2025. for (var n in value) {
  2026. setData(n,value[n]);
  2027. }
  2028. }
  2029. if (args.length === 1) {
  2030. returnValue = settings[name];
  2031. } else {
  2032. switch (name) {
  2033. case 'uploader':
  2034. swfuploadify.setUploadURL(value);
  2035. break;
  2036. case 'formData':
  2037. if (!resetObjects) {
  2038. value = $.extend(settings.formData, value);
  2039. }
  2040. swfuploadify.setPostParams(settings.formData);
  2041. break;
  2042. case 'method':
  2043. if (value == 'get') {
  2044. swfuploadify.setUseQueryString(true);
  2045. } else {
  2046. swfuploadify.setUseQueryString(false);
  2047. }
  2048. break;
  2049. case 'fileObjName':
  2050. swfuploadify.setFilePostName(value);
  2051. break;
  2052. case 'fileTypeExts':
  2053. swfuploadify.setFileTypes(value, settings.fileTypeDesc);
  2054. break;
  2055. case 'fileTypeDesc':
  2056. swfuploadify.setFileTypes(settings.fileTypeExts, value);
  2057. break;
  2058. case 'fileSizeLimit':
  2059. swfuploadify.setFileSizeLimit(value);
  2060. break;
  2061. case 'uploadLimit':
  2062. swfuploadify.setFileUploadLimit(value);
  2063. break;
  2064. case 'queueSizeLimit':
  2065. swfuploadify.setFileQueueLimit(value);
  2066. break;
  2067. case 'buttonImage':
  2068. swfuploadify.button.css('background-image', settingValue);
  2069. break;
  2070. case 'buttonCursor':
  2071. if (value == 'arrow') {
  2072. swfuploadify.setButtonCursor(SWFUpload.CURSOR.ARROW);
  2073. } else {
  2074. swfuploadify.setButtonCursor(SWFUpload.CURSOR.HAND);
  2075. }
  2076. break;
  2077. case 'buttonText':
  2078. $('#' + settings.id + '-button').find('.uploadify-button-text').html(value);
  2079. break;
  2080. case 'width':
  2081. swfuploadify.setButtonDimensions(value, settings.height);
  2082. break;
  2083. case 'height':
  2084. swfuploadify.setButtonDimensions(settings.width, value);
  2085. break;
  2086. case 'multi':
  2087. if (value) {
  2088. swfuploadify.setButtonAction(SWFUpload.BUTTON_ACTION.SELECT_FILES);
  2089. } else {
  2090. swfuploadify.setButtonAction(SWFUpload.BUTTON_ACTION.SELECT_FILE);
  2091. }
  2092. break;
  2093. }
  2094. settings[name] = value;
  2095. }
  2096. });
  2097. if (args.length === 1) {
  2098. return returnValue;
  2099. }
  2100. },
  2101. // Stop the current uploads and requeue what is in progress
  2102. stop : function() {
  2103. this.each(function() {
  2104. // Create a reference to the jQuery DOM object
  2105. var $this = $(this),
  2106. swfuploadify = $this.data('uploadify');
  2107. // Reset the queue information
  2108. swfuploadify.queueData.averageSpeed = 0;
  2109. swfuploadify.queueData.uploadSize = 0;
  2110. swfuploadify.queueData.bytesUploaded = 0;
  2111. swfuploadify.queueData.uploadQueue = [];
  2112. swfuploadify.stopUpload();
  2113. });
  2114. },
  2115. // Start uploading files in the queue
  2116. upload : function() {
  2117. var args = arguments;
  2118. this.each(function() {
  2119. // Create a reference to the jQuery DOM object
  2120. var $this = $(this),
  2121. swfuploadify = $this.data('uploadify');
  2122. // Reset the queue information
  2123. swfuploadify.queueData.averageSpeed = 0;
  2124. swfuploadify.queueData.uploadSize = 0;
  2125. swfuploadify.queueData.bytesUploaded = 0;
  2126. swfuploadify.queueData.uploadQueue = [];
  2127. // Upload the files
  2128. if (args[0]) {
  2129. if (args[0] == '*') {
  2130. swfuploadify.queueData.uploadSize = swfuploadify.queueData.queueSize;
  2131. swfuploadify.queueData.uploadQueue.push('*');
  2132. swfuploadify.startUpload();
  2133. } else {
  2134. for (var n = 0; n < args.length; n++) {
  2135. swfuploadify.queueData.uploadSize += swfuploadify.queueData.files[args[n]].size;
  2136. swfuploadify.queueData.uploadQueue.push(args[n]);
  2137. }
  2138. swfuploadify.startUpload(swfuploadify.queueData.uploadQueue.shift());
  2139. }
  2140. } else {
  2141. swfuploadify.startUpload();
  2142. }
  2143. });
  2144. }
  2145. }
  2146. // These functions handle all the events that occur with the file uploader
  2147. var handlers = {
  2148. // Triggered when the file dialog is opened
  2149. onDialogOpen : function() {
  2150. // Load the swfupload settings
  2151. var settings = this.settings;
  2152. // Reset some queue info
  2153. this.queueData.errorMsg = 'Some files were not added to the queue:';
  2154. this.queueData.filesReplaced = 0;
  2155. this.queueData.filesCancelled = 0;
  2156. // Call the user-defined event handler
  2157. if (settings.onDialogOpen) settings.onDialogOpen.call(this);
  2158. },
  2159. // Triggered when the browse dialog is closed
  2160. onDialogClose : function(filesSelected, filesQueued, queueLength) {
  2161. // Load the swfupload settings
  2162. var settings = this.settings;
  2163. // Update the queue information
  2164. this.queueData.filesErrored = filesSelected - filesQueued;
  2165. this.queueData.filesSelected = filesSelected;
  2166. this.queueData.filesQueued = filesQueued - this.queueData.filesCancelled;
  2167. this.queueData.queueLength = queueLength;
  2168. // Run the default event handler
  2169. if ($.inArray('onDialogClose', settings.overrideEvents) < 0) {
  2170. if (this.queueData.filesErrored > 0) {
  2171. alert(this.queueData.errorMsg);
  2172. }
  2173. }
  2174. // Call the user-defined event handler
  2175. if (settings.onDialogClose) settings.onDialogClose.call(this, this.queueData);
  2176. // Upload the files if auto is true
  2177. if (settings.auto) $('#' + settings.id).uploadify('upload', '*');
  2178. },
  2179. // Triggered once for each file added to the queue
  2180. onSelect : function(file) {
  2181. // Load the swfupload settings
  2182. var settings = this.settings;
  2183. // Check if a file with the same name exists in the queue
  2184. var queuedFile = {};
  2185. for (var n in this.queueData.files) {
  2186. queuedFile = this.queueData.files[n];
  2187. if (queuedFile.uploaded != true && queuedFile.name == file.name) {
  2188. var replaceQueueItem = confirm('The file named "' + file.name + '" is already in the queue.\nDo you want to replace the existing item in the queue?');
  2189. if (!replaceQueueItem) {
  2190. this.cancelUpload(file.id);
  2191. this.queueData.filesCancelled++;
  2192. return false;
  2193. } else {
  2194. $('#' + queuedFile.id).remove();
  2195. this.cancelUpload(queuedFile.id);
  2196. this.queueData.filesReplaced++;
  2197. }
  2198. }
  2199. }
  2200. // Get the size of the file
  2201. var fileSize = Math.round(file.size / 1024);
  2202. var suffix = 'KB';
  2203. if (fileSize > 1000) {
  2204. fileSize = Math.round(fileSize / 1000);
  2205. suffix = 'MB';
  2206. }
  2207. var fileSizeParts = fileSize.toString().split('.');
  2208. fileSize = fileSizeParts[0];
  2209. if (fileSizeParts.length > 1) {
  2210. fileSize += '.' + fileSizeParts[1].substr(0,2);
  2211. }
  2212. fileSize += suffix;
  2213. // Truncate the filename if it's too long
  2214. var fileName = file.name;
  2215. if (fileName.length > 25) {
  2216. fileName = fileName.substr(0,25) + '...';
  2217. }
  2218. // Create the file data object
  2219. itemData = {
  2220. 'fileID' : file.id,
  2221. 'instanceID' : settings.id,
  2222. 'fileName' : fileName,
  2223. 'fileSize' : fileSize
  2224. }
  2225. // Create the file item template
  2226. if (settings.itemTemplate == false) {
  2227. settings.itemTemplate = '<div id="${fileID}" class="uploadify-queue-item">\
  2228. <div class="cancel">\
  2229. <a href="javascript:$(\'#${instanceID}\').uploadify(\'cancel\', \'${fileID}\')">X</a>\
  2230. </div>\
  2231. <span class="fileName">${fileName} (${fileSize})</span><span class="data"></span>\
  2232. <div class="uploadify-progress">\
  2233. <div class="uploadify-progress-bar"><!--Progress Bar--></div>\
  2234. </div>\
  2235. </div>';
  2236. }
  2237. // Run the default event handler
  2238. if ($.inArray('onSelect', settings.overrideEvents) < 0) {
  2239. // Replace the item data in the template
  2240. itemHTML = settings.itemTemplate;
  2241. for (var d in itemData) {
  2242. itemHTML = itemHTML.replace(new RegExp('\\$\\{' + d + '\\}', 'g'), itemData[d]);
  2243. }
  2244. // Add the file item to the queue
  2245. $('#' + settings.queueID).append(itemHTML);
  2246. }
  2247. this.queueData.queueSize += file.size;
  2248. this.queueData.files[file.id] = file;
  2249. // Call the user-defined event handler
  2250. if (settings.onSelect) settings.onSelect.apply(this, arguments);
  2251. },
  2252. // Triggered when a file is not added to the queue
  2253. onSelectError : function(file, errorCode, errorMsg) {
  2254. // Load the swfupload settings
  2255. var settings = this.settings;
  2256. // Run the default event handler
  2257. if ($.inArray('onSelectError', settings.overrideEvents) < 0) {
  2258. switch(errorCode) {
  2259. case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:
  2260. if (settings.queueSizeLimit > errorMsg) {
  2261. this.queueData.errorMsg += '\nThe number of files selected exceeds the remaining upload limit (' + errorMsg + ').';
  2262. } else {
  2263. this.queueData.errorMsg += '\nThe number of files selected exceeds the queue size limit (' + settings.queueSizeLimit + ').';
  2264. }
  2265. break;
  2266. case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
  2267. this.queueData.errorMsg += '\nThe file "' + file.name + '" exceeds the size limit (' + settings.fileSizeLimit + ').';
  2268. break;
  2269. case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
  2270. this.queueData.errorMsg += '\nThe file "' + file.name + '" is empty.';
  2271. break;
  2272. case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
  2273. this.queueData.errorMsg += '\nThe file "' + file.name + '" is not an accepted file type (' + settings.fileTypeDesc + ').';
  2274. break;
  2275. }
  2276. }
  2277. if (errorCode != SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) {
  2278. delete this.queueData.files[file.id];
  2279. }
  2280. // Call the user-defined event handler
  2281. if (settings.onSelectError) settings.onSelectError.apply(this, arguments);
  2282. },
  2283. // Triggered when all the files in the queue have been processed
  2284. onQueueComplete : function() {
  2285. if (this.settings.onQueueComplete) this.settings.onQueueComplete.call(this, this.settings.queueData);
  2286. },
  2287. // Triggered when a file upload successfully completes
  2288. onUploadComplete : function(file) {
  2289. // Load the swfupload settings
  2290. var settings = this.settings,
  2291. swfuploadify = this;
  2292. // Check if all the files have completed uploading
  2293. var stats = this.getStats();
  2294. this.queueData.queueLength = stats.files_queued;
  2295. if (this.queueData.uploadQueue[0] == '*') {
  2296. if (this.queueData.queueLength > 0) {
  2297. this.startUpload();
  2298. } else {
  2299. this.queueData.uploadQueue = [];
  2300. // Call the user-defined event handler for queue complete
  2301. if (settings.onQueueComplete) settings.onQueueComplete.call(this, this.queueData);
  2302. }
  2303. } else {
  2304. if (this.queueData.uploadQueue.length > 0) {
  2305. this.startUpload(this.queueData.uploadQueue.shift());
  2306. } else {
  2307. this.queueData.uploadQueue = [];
  2308. // Call the user-defined event handler for queue complete
  2309. if (settings.onQueueComplete) settings.onQueueComplete.call(this, this.queueData);
  2310. }
  2311. }
  2312. // Call the default event handler
  2313. if ($.inArray('onUploadComplete', settings.overrideEvents) < 0) {
  2314. if (settings.removeCompleted) {
  2315. switch (file.filestatus) {
  2316. case SWFUpload.FILE_STATUS.COMPLETE:
  2317. setTimeout(function() {
  2318. if ($('#' + file.id)) {
  2319. swfuploadify.queueData.queueSize -= file.size;
  2320. swfuploadify.queueData.queueLength -= 1;
  2321. delete swfuploadify.queueData.files[file.id]
  2322. $('#' + file.id).fadeOut(500, function() {
  2323. $(this).remove();
  2324. });
  2325. }
  2326. }, settings.removeTimeout * 1000);
  2327. break;
  2328. case SWFUpload.FILE_STATUS.ERROR:
  2329. if (!settings.requeueErrors) {
  2330. setTimeout(function() {
  2331. if ($('#' + file.id)) {
  2332. swfuploadify.queueData.queueSize -= file.size;
  2333. swfuploadify.queueData.queueLength -= 1;
  2334. delete swfuploadify.queueData.files[file.id];
  2335. $('#' + file.id).fadeOut(500, function() {
  2336. $(this).remove();
  2337. });
  2338. }
  2339. }, settings.removeTimeout * 1000);
  2340. }
  2341. break;
  2342. }
  2343. } else {
  2344. file.uploaded = true;
  2345. }
  2346. }
  2347. // Call the user-defined event handler
  2348. if (settings.onUploadComplete) settings.onUploadComplete.call(this, file);
  2349. },
  2350. // Triggered when a file upload returns an error
  2351. onUploadError : function(file, errorCode, errorMsg) {
  2352. // Load the swfupload settings
  2353. var settings = this.settings;
  2354. // Set the error string
  2355. var errorString = 'Error';
  2356. switch(errorCode) {
  2357. case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:
  2358. errorString = 'HTTP Error (' + errorMsg + ')';
  2359. break;
  2360. case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL:
  2361. errorString = 'Missing Upload URL';
  2362. break;
  2363. case SWFUpload.UPLOAD_ERROR.IO_ERROR:
  2364. errorString = 'IO Error';
  2365. break;
  2366. case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:
  2367. errorString = 'Security Error';
  2368. break;
  2369. case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:
  2370. alert('The upload limit has been reached (' + errorMsg + ').');
  2371. errorString = 'Exceeds Upload Limit';
  2372. break;
  2373. case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:
  2374. errorString = 'Failed';
  2375. break;
  2376. case SWFUpload.UPLOAD_ERROR.SPECIFIED_FILE_ID_NOT_FOUND:
  2377. break;
  2378. case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:
  2379. errorString = 'Validation Error';
  2380. break;
  2381. case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:
  2382. errorString = 'Cancelled';
  2383. this.queueData.queueSize -= file.size;
  2384. this.queueData.queueLength -= 1;
  2385. if (file.status == SWFUpload.FILE_STATUS.IN_PROGRESS || $.inArray(file.id, this.queueData.uploadQueue) >= 0) {
  2386. this.queueData.uploadSize -= file.size;
  2387. }
  2388. // Trigger the onCancel event
  2389. if (settings.onCancel) settings.onCancel.call(this, file);
  2390. delete this.queueData.files[file.id];
  2391. break;
  2392. case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:
  2393. errorString = 'Stopped';
  2394. break;
  2395. }
  2396. // Call the default event handler
  2397. if ($.inArray('onUploadError', settings.overrideEvents) < 0) {
  2398. if (errorCode != SWFUpload.UPLOAD_ERROR.FILE_CANCELLED && errorCode != SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED) {
  2399. $('#' + file.id).addClass('uploadify-error');
  2400. }
  2401. // Reset the progress bar
  2402. $('#' + file.id).find('.uploadify-progress-bar').css('width','1px');
  2403. // Add the error message to the queue item
  2404. if (errorCode != SWFUpload.UPLOAD_ERROR.SPECIFIED_FILE_ID_NOT_FOUND && file.status != SWFUpload.FILE_STATUS.COMPLETE) {
  2405. $('#' + file.id).find('.data').html(' - ' + errorString);
  2406. }
  2407. }
  2408. var stats = this.getStats();
  2409. this.queueData.uploadsErrored = stats.upload_errors;
  2410. // Call the user-defined event handler
  2411. if (settings.onUploadError) settings.onUploadError.call(this, file, errorCode, errorMsg, errorString);
  2412. },
  2413. // Triggered periodically during a file upload
  2414. onUploadProgress : function(file, fileBytesLoaded, fileTotalBytes) {
  2415. // Load the swfupload settings
  2416. var settings = this.settings;
  2417. // Setup all the variables
  2418. var timer = allGetServerTime();
  2419. var newTime = timer.getTime();
  2420. var lapsedTime = newTime - this.timer;
  2421. if (lapsedTime > 500) {
  2422. this.timer = newTime;
  2423. }
  2424. var lapsedBytes = fileBytesLoaded - this.bytesLoaded;
  2425. this.bytesLoaded = fileBytesLoaded;
  2426. var queueBytesLoaded = this.queueData.queueBytesUploaded + fileBytesLoaded;
  2427. var percentage = Math.round(fileBytesLoaded / fileTotalBytes * 100);
  2428. // Calculate the average speed
  2429. var suffix = 'KB/s';
  2430. var mbs = 0;
  2431. var kbs = (lapsedBytes / 1024) / (lapsedTime / 1000);
  2432. kbs = Math.floor(kbs * 10) / 10;
  2433. if (this.queueData.averageSpeed > 0) {
  2434. this.queueData.averageSpeed = Math.floor((this.queueData.averageSpeed + kbs) / 2);
  2435. } else {
  2436. this.queueData.averageSpeed = Math.floor(kbs);
  2437. }
  2438. if (kbs > 1000) {
  2439. mbs = (kbs * .001);
  2440. this.queueData.averageSpeed = Math.floor(mbs);
  2441. suffix = 'MB/s';
  2442. }
  2443. // Call the default event handler
  2444. if ($.inArray('onUploadProgress', settings.overrideEvents) < 0) {
  2445. if (settings.progressData == 'percentage') {
  2446. $('#' + file.id).find('.data').html(' - ' + percentage + '%');
  2447. } else if (settings.progressData == 'speed' && lapsedTime > 500) {
  2448. $('#' + file.id).find('.data').html(' - ' + this.queueData.averageSpeed + suffix);
  2449. }
  2450. $('#' + file.id).find('.uploadify-progress-bar').css('width', percentage + '%');
  2451. }
  2452. // Call the user-defined event handler
  2453. if (settings.onUploadProgress) settings.onUploadProgress.call(this, file, fileBytesLoaded, fileTotalBytes, queueBytesLoaded, this.queueData.uploadSize);
  2454. },
  2455. // Triggered right before a file is uploaded
  2456. onUploadStart : function(file) {
  2457. // Load the swfupload settings
  2458. var settings = this.settings;
  2459. var timer = allGetServerTime();
  2460. this.timer = timer.getTime();
  2461. this.bytesLoaded = 0;
  2462. if (this.queueData.uploadQueue.length == 0) {
  2463. this.queueData.uploadSize = file.size;
  2464. }
  2465. if (settings.checkExisting) {
  2466. $.ajax({
  2467. type : 'POST',
  2468. async : false,
  2469. url : settings.checkExisting,
  2470. data : {filename: file.name},
  2471. success : function(data) {
  2472. if (data == 1) {
  2473. var overwrite = confirm('A file with the name "' + file.name + '" already exists on the server.\nWould you like to replace the existing file?');
  2474. if (!overwrite) {
  2475. this.cancelUpload(file.id);
  2476. $('#' + file.id).remove();
  2477. if (this.queueData.uploadQueue.length > 0 && this.queueData.queueLength > 0) {
  2478. if (this.queueData.uploadQueue[0] == '*') {
  2479. this.startUpload();
  2480. } else {
  2481. this.startUpload(this.queueData.uploadQueue.shift());
  2482. }
  2483. }
  2484. }
  2485. }
  2486. }
  2487. });
  2488. }
  2489. // Call the user-defined event handler
  2490. if (settings.onUploadStart) settings.onUploadStart.call(this, file);
  2491. },
  2492. // Triggered when a file upload returns a successful code
  2493. onUploadSuccess : function(file, data, response) {
  2494. // Load the swfupload settings
  2495. var settings = this.settings;
  2496. var stats = this.getStats();
  2497. this.queueData.uploadsSuccessful = stats.successful_uploads;
  2498. this.queueData.queueBytesUploaded += file.size;
  2499. // Call the default event handler
  2500. if ($.inArray('onUploadSuccess', settings.overrideEvents) < 0) {
  2501. $('#' + file.id).find('.data').html(' - Complete');
  2502. }
  2503. // Call the user-defined event handler
  2504. if (settings.onUploadSuccess) settings.onUploadSuccess.call(this, file, data, response);
  2505. }
  2506. }
  2507. $.fn.uploadify = function(method) {
  2508. if (methods[method]) {
  2509. return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
  2510. } else if (typeof method === 'object' || !method) {
  2511. return methods.init.apply(this, arguments);
  2512. } else {
  2513. $.error('The method ' + method + ' does not exist in $.uploadify');
  2514. }
  2515. }
  2516. })($);
  2517. /*! jQuery Validation Plugin - v1.11.1 - 3/22/2013\n* https://github.com/jzaefferer/jquery-validation
  2518. * Copyright (c) 2013 Jörn Zaefferer; Licensed MIT */
  2519. (function(t) {
  2520. t.extend(t.fn, {
  2521. validate: function(e) {
  2522. if (!this.length) return e && e.debug && window.console && console.warn("Nothing selected, can't validate, returning nothing."), void 0;
  2523. var i = t.data(this[0], "validator");
  2524. return i ? i : (this.attr("novalidate", "novalidate"), i = new t.validator(e, this[0]), t.data(this[0], "validator", i), i.settings.onsubmit && (this.validateDelegate(":submit", "click", function(e) {
  2525. i.settings.submitHandler && (i.submitButton = e.target), t(e.target).hasClass("cancel") && (i.cancelSubmit = !0), void 0 !== t(e.target).attr("formnovalidate") && (i.cancelSubmit = !0)
  2526. }), this.submit(function(e) {
  2527. function s() {
  2528. var s;
  2529. return i.settings.submitHandler ? (i.submitButton && (s = t("<input type='hidden'/>").attr("name", i.submitButton.name).val(t(i.submitButton).val()).appendTo(i.currentForm)), i.settings.submitHandler.call(i, i.currentForm, e), i.submitButton && s.remove(), !1) : !0
  2530. }
  2531. return i.settings.debug && e.preventDefault(), i.cancelSubmit ? (i.cancelSubmit = !1, s()) : i.form() ? i.pendingRequest ? (i.formSubmitted = !0, !1) : s() : (i.focusInvalid(), !1)
  2532. })), i)
  2533. },
  2534. valid: function() {
  2535. if (t(this[0]).is("form")) return this.validate().form();
  2536. var e = !0,
  2537. i = t(this[0].form).validate();
  2538. return this.each(function() {
  2539. e = e && i.element(this)
  2540. }), e
  2541. },
  2542. removeAttrs: function(e) {
  2543. var i = {}, s = this;
  2544. return t.each(e.split(/\s/), function(t, e) {
  2545. i[e] = s.attr(e), s.removeAttr(e)
  2546. }), i
  2547. },
  2548. rules: function(e, i) {
  2549. var s = this[0];
  2550. if (e) {
  2551. var r = t.data(s.form, "validator").settings,
  2552. n = r.rules,
  2553. a = t.validator.staticRules(s);
  2554. switch (e) {
  2555. case "add":
  2556. t.extend(a, t.validator.normalizeRule(i)), delete a.messages, n[s.name] = a, i.messages && (r.messages[s.name] = t.extend(r.messages[s.name], i.messages));
  2557. break;
  2558. case "remove":
  2559. if (!i) return delete n[s.name], a;
  2560. var u = {};
  2561. return t.each(i.split(/\s/), function(t, e) {
  2562. u[e] = a[e], delete a[e]
  2563. }), u
  2564. }
  2565. }
  2566. var o = t.validator.normalizeRules(t.extend({}, t.validator.classRules(s), t.validator.attributeRules(s), t.validator.dataRules(s), t.validator.staticRules(s)), s);
  2567. if (o.required) {
  2568. var l = o.required;
  2569. delete o.required, o = t.extend({
  2570. required: l
  2571. }, o)
  2572. }
  2573. return o
  2574. }
  2575. }), t.extend(t.expr[":"], {
  2576. blank: function(e) {
  2577. return !t.trim("" + t(e).val())
  2578. },
  2579. filled: function(e) {
  2580. return !!t.trim("" + t(e).val())
  2581. },
  2582. unchecked: function(e) {
  2583. return !t(e).prop("checked")
  2584. }
  2585. }), t.validator = function(e, i) {
  2586. this.settings = t.extend(!0, {}, t.validator.defaults, e), this.currentForm = i, this.init()
  2587. }, t.validator.format = function(e, i) {
  2588. return 1 === arguments.length ? function() {
  2589. var i = t.makeArray(arguments);
  2590. return i.unshift(e), t.validator.format.apply(this, i)
  2591. } : (arguments.length > 2 && i.constructor !== Array && (i = t.makeArray(arguments).slice(1)), i.constructor !== Array && (i = [i]), t.each(i, function(t, i) {
  2592. e = e.replace(RegExp("\\{" + t + "\\}", "g"), function() {
  2593. return i
  2594. })
  2595. }), e)
  2596. }, t.extend(t.validator, {
  2597. defaults: {
  2598. messages: {},
  2599. groups: {},
  2600. rules: {},
  2601. errorClass: "error",
  2602. validClass: "valid",
  2603. errorElement: "label",
  2604. focusInvalid: !0,
  2605. errorContainer: t([]),
  2606. errorLabelContainer: t([]),
  2607. onsubmit: !0,
  2608. ignore: ":hidden",
  2609. ignoreTitle: !1,
  2610. onfocusin: function(t) {
  2611. this.lastActive = t, this.settings.focusCleanup && !this.blockFocusCleanup && (this.settings.unhighlight && this.settings.unhighlight.call(this, t, this.settings.errorClass, this.settings.validClass), this.addWrapper(this.errorsFor(t)).hide())
  2612. },
  2613. onfocusout: function(t) {
  2614. this.checkable(t) || !(t.name in this.submitted) && this.optional(t) || this.element(t)
  2615. },
  2616. onkeyup: function(t, e) {
  2617. (9 !== e.which || "" !== this.elementValue(t)) && (t.name in this.submitted || t === this.lastElement) && this.element(t)
  2618. },
  2619. onclick: function(t) {
  2620. t.name in this.submitted ? this.element(t) : t.parentNode.name in this.submitted && this.element(t.parentNode)
  2621. },
  2622. highlight: function(e, i, s) {
  2623. "radio" === e.type ? this.findByName(e.name).addClass(i).removeClass(s) : t(e).addClass(i).removeClass(s)
  2624. },
  2625. unhighlight: function(e, i, s) {
  2626. "radio" === e.type ? this.findByName(e.name).removeClass(i).addClass(s) : t(e).removeClass(i).addClass(s)
  2627. }
  2628. },
  2629. setDefaults: function(e) {
  2630. t.extend(t.validator.defaults, e)
  2631. },
  2632. messages: {
  2633. required: "This field is required.",
  2634. remote: "Please fix this field.",
  2635. email: "Please enter a valid email address.",
  2636. url: "Please enter a valid URL.",
  2637. date: "Please enter a valid date.",
  2638. dateISO: "Please enter a valid date (ISO).",
  2639. number: "Please enter a valid number.",
  2640. digits: "Please enter only digits.",
  2641. creditcard: "Please enter a valid credit card number.",
  2642. equalTo: "Please enter the same value again.",
  2643. maxlength: t.validator.format("Please enter no more than {0} characters."),
  2644. minlength: t.validator.format("Please enter at least {0} characters."),
  2645. rangelength: t.validator.format("Please enter a value between {0} and {1} characters long."),
  2646. range: t.validator.format("Please enter a value between {0} and {1}."),
  2647. max: t.validator.format("Please enter a value less than or equal to {0}."),
  2648. min: t.validator.format("Please enter a value greater than or equal to {0}.")
  2649. },
  2650. autoCreateRanges: !1,
  2651. prototype: {
  2652. init: function() {
  2653. function e(e) {
  2654. var i = t.data(this[0].form, "validator"),
  2655. s = "on" + e.type.replace(/^validate/, "");
  2656. i.settings[s] && i.settings[s].call(i, this[0], e)
  2657. }
  2658. this.labelContainer = t(this.settings.errorLabelContainer), this.errorContext = this.labelContainer.length && this.labelContainer || t(this.currentForm), this.containers = t(this.settings.errorContainer).add(this.settings.errorLabelContainer), this.submitted = {}, this.valueCache = {}, this.pendingRequest = 0, this.pending = {}, this.invalid = {}, this.reset();
  2659. var i = this.groups = {};
  2660. t.each(this.settings.groups, function(e, s) {
  2661. "string" == typeof s && (s = s.split(/\s/)), t.each(s, function(t, s) {
  2662. i[s] = e
  2663. })
  2664. });
  2665. var s = this.settings.rules;
  2666. t.each(s, function(e, i) {
  2667. s[e] = t.validator.normalizeRule(i)
  2668. }), t(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ", "focusin focusout keyup", e).validateDelegate("[type='radio'], [type='checkbox'], select, option", "click", e), this.settings.invalidHandler && t(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler)
  2669. },
  2670. form: function() {
  2671. return this.checkForm(), t.extend(this.submitted, this.errorMap), this.invalid = t.extend({}, this.errorMap), this.valid() || t(this.currentForm).triggerHandler("invalid-form", [this]), this.showErrors(), this.valid()
  2672. },
  2673. checkForm: function() {
  2674. this.prepareForm();
  2675. for (var t = 0, e = this.currentElements = this.elements(); e[t]; t++) this.check(e[t]);
  2676. return this.valid()
  2677. },
  2678. element: function(e) {
  2679. e = this.validationTargetFor(this.clean(e)), this.lastElement = e, this.prepareElement(e), this.currentElements = t(e);
  2680. var i = this.check(e) !== !1;
  2681. return i ? delete this.invalid[e.name] : this.invalid[e.name] = !0, this.numberOfInvalids() || (this.toHide = this.toHide.add(this.containers)), this.showErrors(), i
  2682. },
  2683. showErrors: function(e) {
  2684. if (e) {
  2685. t.extend(this.errorMap, e), this.errorList = [];
  2686. for (var i in e) this.errorList.push({
  2687. message: e[i],
  2688. element: this.findByName(i)[0]
  2689. });
  2690. this.successList = t.grep(this.successList, function(t) {
  2691. return !(t.name in e)
  2692. })
  2693. }
  2694. this.settings.showErrors ? this.settings.showErrors.call(this, this.errorMap, this.errorList) : this.defaultShowErrors()
  2695. },
  2696. resetForm: function() {
  2697. t.fn.resetForm && t(this.currentForm).resetForm(), this.submitted = {}, this.lastElement = null, this.prepareForm(), this.hideErrors(), this.elements().removeClass(this.settings.errorClass).removeData("previousValue")
  2698. },
  2699. numberOfInvalids: function() {
  2700. return this.objectLength(this.invalid)
  2701. },
  2702. objectLength: function(t) {
  2703. var e = 0;
  2704. for (var i in t) e++;
  2705. return e
  2706. },
  2707. hideErrors: function() {
  2708. this.addWrapper(this.toHide).hide()
  2709. },
  2710. valid: function() {
  2711. return 0 === this.size()
  2712. },
  2713. size: function() {
  2714. return this.errorList.length
  2715. },
  2716. focusInvalid: function() {
  2717. if (this.settings.focusInvalid) try {
  2718. t(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(":visible").focus().trigger("focusin")
  2719. } catch (e) {}
  2720. },
  2721. findLastActive: function() {
  2722. var e = this.lastActive;
  2723. return e && 1 === t.grep(this.errorList, function(t) {
  2724. return t.element.name === e.name
  2725. }).length && e
  2726. },
  2727. elements: function() {
  2728. var e = this,
  2729. i = {};
  2730. return t(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function() {
  2731. return !this.name && e.settings.debug && window.console && console.error("%o has no name assigned", this), this.name in i || !e.objectLength(t(this).rules()) ? !1 : (i[this.name] = !0, !0)
  2732. })
  2733. },
  2734. clean: function(e) {
  2735. return t(e)[0]
  2736. },
  2737. errors: function() {
  2738. var e = this.settings.errorClass.replace(" ", ".");
  2739. return t(this.settings.errorElement + "." + e, this.errorContext)
  2740. },
  2741. reset: function() {
  2742. this.successList = [], this.errorList = [], this.errorMap = {}, this.toShow = t([]), this.toHide = t([]), this.currentElements = t([])
  2743. },
  2744. prepareForm: function() {
  2745. this.reset(), this.toHide = this.errors().add(this.containers)
  2746. },
  2747. prepareElement: function(t) {
  2748. this.reset(), this.toHide = this.errorsFor(t)
  2749. },
  2750. elementValue: function(e) {
  2751. var i = t(e).attr("type"),
  2752. s = t(e).val();
  2753. return "radio" === i || "checkbox" === i ? t("input[name='" + t(e).attr("name") + "']:checked").val() : "string" == typeof s ? s.replace(/\r/g, "") : s
  2754. },
  2755. check: function(e) {
  2756. e = this.validationTargetFor(this.clean(e));
  2757. var i, s = t(e).rules(),
  2758. r = !1,
  2759. n = this.elementValue(e);
  2760. for (var a in s) {
  2761. var u = {
  2762. method: a,
  2763. parameters: s[a]
  2764. };
  2765. try {
  2766. if (i = t.validator.methods[a].call(this, n, e, u.parameters), "dependency-mismatch" === i) {
  2767. r = !0;
  2768. continue
  2769. }
  2770. if (r = !1, "pending" === i) return this.toHide = this.toHide.not(this.errorsFor(e)), void 0;
  2771. if (!i) return this.formatAndAdd(e, u), !1
  2772. } catch (o) {
  2773. throw this.settings.debug && window.console && console.log("Exception occurred when checking element " + e.id + ", check the '" + u.method + "' method.", o), o
  2774. }
  2775. }
  2776. return r ? void 0 : (this.objectLength(s) && this.successList.push(e), !0)
  2777. },
  2778. customDataMessage: function(e, i) {
  2779. return t(e).data("msg-" + i.toLowerCase()) || e.attributes && t(e).attr("data-msg-" + i.toLowerCase())
  2780. },
  2781. customMessage: function(t, e) {
  2782. var i = this.settings.messages[t];
  2783. return i && (i.constructor === String ? i : i[e])
  2784. },
  2785. findDefined: function() {
  2786. for (var t = 0; arguments.length > t; t++)
  2787. if (void 0 !== arguments[t]) return arguments[t];
  2788. return void 0
  2789. },
  2790. defaultMessage: function(e, i) {
  2791. return this.findDefined(this.customMessage(e.name, i), this.customDataMessage(e, i), !this.settings.ignoreTitle && e.title || void 0, t.validator.messages[i], "<strong>Warning: No message defined for " + e.name + "</strong>")
  2792. },
  2793. formatAndAdd: function(e, i) {
  2794. var s = this.defaultMessage(e, i.method),
  2795. r = /\$?\{(\d+)\}/g;
  2796. "function" == typeof s ? s = s.call(this, i.parameters, e) : r.test(s) && (s = t.validator.format(s.replace(r, "{$1}"), i.parameters)), this.errorList.push({
  2797. message: s,
  2798. element: e
  2799. }), this.errorMap[e.name] = s, this.submitted[e.name] = s
  2800. },
  2801. addWrapper: function(t) {
  2802. return this.settings.wrapper && (t = t.add(t.parent(this.settings.wrapper))), t
  2803. },
  2804. defaultShowErrors: function() {
  2805. var t, e;
  2806. for (t = 0; this.errorList[t]; t++) {
  2807. var i = this.errorList[t];
  2808. this.settings.highlight && this.settings.highlight.call(this, i.element, this.settings.errorClass, this.settings.validClass), this.showLabel(i.element, i.message)
  2809. }
  2810. if (this.errorList.length && (this.toShow = this.toShow.add(this.containers)), this.settings.success)
  2811. for (t = 0; this.successList[t]; t++) this.showLabel(this.successList[t]);
  2812. if (this.settings.unhighlight)
  2813. for (t = 0, e = this.validElements(); e[t]; t++) this.settings.unhighlight.call(this, e[t], this.settings.errorClass, this.settings.validClass);
  2814. this.toHide = this.toHide.not(this.toShow), this.hideErrors(), this.addWrapper(this.toShow).show()
  2815. },
  2816. validElements: function() {
  2817. return this.currentElements.not(this.invalidElements())
  2818. },
  2819. invalidElements: function() {
  2820. return t(this.errorList).map(function() {
  2821. return this.element
  2822. })
  2823. },
  2824. showLabel: function(e, i) {
  2825. var s = this.errorsFor(e);
  2826. s.length ? (s.removeClass(this.settings.validClass).addClass(this.settings.errorClass), s.html(i)) : (s = t("<" + this.settings.errorElement + ">").attr("for", this.idOrName(e)).addClass(this.settings.errorClass).html(i || ""), this.settings.wrapper && (s = s.hide().show().wrap("<" + this.settings.wrapper + "/>").parent()), this.labelContainer.append(s).length || (this.settings.errorPlacement ? this.settings.errorPlacement(s, t(e)) : s.insertAfter(e))), !i && this.settings.success && (s.text(""), "string" == typeof this.settings.success ? s.addClass(this.settings.success) : this.settings.success(s, e)), this.toShow = this.toShow.add(s)
  2827. },
  2828. errorsFor: function(e) {
  2829. var i = this.idOrName(e);
  2830. return this.errors().filter(function() {
  2831. return t(this).attr("for") === i
  2832. })
  2833. },
  2834. idOrName: function(t) {
  2835. return this.groups[t.name] || (this.checkable(t) ? t.name : t.id || t.name)
  2836. },
  2837. validationTargetFor: function(t) {
  2838. return this.checkable(t) && (t = this.findByName(t.name).not(this.settings.ignore)[0]), t
  2839. },
  2840. checkable: function(t) {
  2841. return /radio|checkbox/i.test(t.type)
  2842. },
  2843. findByName: function(e) {
  2844. return t(this.currentForm).find("[name='" + e + "']")
  2845. },
  2846. getLength: function(e, i) {
  2847. switch (i.nodeName.toLowerCase()) {
  2848. case "select":
  2849. return t("option:selected", i).length;
  2850. case "input":
  2851. if (this.checkable(i)) return this.findByName(i.name).filter(":checked").length
  2852. }
  2853. return e.length
  2854. },
  2855. depend: function(t, e) {
  2856. return this.dependTypes[typeof t] ? this.dependTypes[typeof t](t, e) : !0
  2857. },
  2858. dependTypes: {
  2859. "boolean": function(t) {
  2860. return t
  2861. },
  2862. string: function(e, i) {
  2863. return !!t(e, i.form).length
  2864. },
  2865. "function": function(t, e) {
  2866. return t(e)
  2867. }
  2868. },
  2869. optional: function(e) {
  2870. var i = this.elementValue(e);
  2871. return !t.validator.methods.required.call(this, i, e) && "dependency-mismatch"
  2872. },
  2873. startRequest: function(t) {
  2874. this.pending[t.name] || (this.pendingRequest++, this.pending[t.name] = !0)
  2875. },
  2876. stopRequest: function(e, i) {
  2877. this.pendingRequest--, 0 > this.pendingRequest && (this.pendingRequest = 0), delete this.pending[e.name], i && 0 === this.pendingRequest && this.formSubmitted && this.form() ? (t(this.currentForm).submit(), this.formSubmitted = !1) : !i && 0 === this.pendingRequest && this.formSubmitted && (t(this.currentForm).triggerHandler("invalid-form", [this]), this.formSubmitted = !1)
  2878. },
  2879. previousValue: function(e) {
  2880. return t.data(e, "previousValue") || t.data(e, "previousValue", {
  2881. old: null,
  2882. valid: !0,
  2883. message: this.defaultMessage(e, "remote")
  2884. })
  2885. }
  2886. },
  2887. classRuleSettings: {
  2888. required: {
  2889. required: !0
  2890. },
  2891. email: {
  2892. email: !0
  2893. },
  2894. url: {
  2895. url: !0
  2896. },
  2897. date: {
  2898. date: !0
  2899. },
  2900. dateISO: {
  2901. dateISO: !0
  2902. },
  2903. number: {
  2904. number: !0
  2905. },
  2906. digits: {
  2907. digits: !0
  2908. },
  2909. creditcard: {
  2910. creditcard: !0
  2911. }
  2912. },
  2913. addClassRules: function(e, i) {
  2914. e.constructor === String ? this.classRuleSettings[e] = i : t.extend(this.classRuleSettings, e)
  2915. },
  2916. classRules: function(e) {
  2917. var i = {}, s = t(e).attr("class");
  2918. return s && t.each(s.split(" "), function() {
  2919. this in t.validator.classRuleSettings && t.extend(i, t.validator.classRuleSettings[this])
  2920. }), i
  2921. },
  2922. attributeRules: function(e) {
  2923. var i = {}, s = t(e),
  2924. r = s[0].getAttribute("type");
  2925. for (var n in t.validator.methods) {
  2926. var a;
  2927. "required" === n ? (a = s.get(0).getAttribute(n), "" === a && (a = !0), a = !! a) : a = s.attr(n), /min|max/.test(n) && (null === r || /number|range|text/.test(r)) && (a = Number(a)), a ? i[n] = a : r === n && "range" !== r && (i[n] = !0)
  2928. }
  2929. return i.maxlength && /-1|2147483647|524288/.test(i.maxlength) && delete i.maxlength, i
  2930. },
  2931. dataRules: function(e) {
  2932. var i, s, r = {}, n = t(e);
  2933. for (i in t.validator.methods) s = n.data("rule-" + i.toLowerCase()), void 0 !== s && (r[i] = s);
  2934. return r
  2935. },
  2936. staticRules: function(e) {
  2937. var i = {}, s = t.data(e.form, "validator");
  2938. return s.settings.rules && (i = t.validator.normalizeRule(s.settings.rules[e.name]) || {}), i
  2939. },
  2940. normalizeRules: function(e, i) {
  2941. return t.each(e, function(s, r) {
  2942. if (r === !1) return delete e[s], void 0;
  2943. if (r.param || r.depends) {
  2944. var n = !0;
  2945. switch (typeof r.depends) {
  2946. case "string":
  2947. n = !! t(r.depends, i.form).length;
  2948. break;
  2949. case "function":
  2950. n = r.depends.call(i, i)
  2951. }
  2952. n ? e[s] = void 0 !== r.param ? r.param : !0 : delete e[s]
  2953. }
  2954. }), t.each(e, function(s, r) {
  2955. e[s] = t.isFunction(r) ? r(i) : r
  2956. }), t.each(["minlength", "maxlength"], function() {
  2957. e[this] && (e[this] = Number(e[this]))
  2958. }), t.each(["rangelength", "range"], function() {
  2959. var i;
  2960. e[this] && (t.isArray(e[this]) ? e[this] = [Number(e[this][0]), Number(e[this][1])] : "string" == typeof e[this] && (i = e[this].split(/[\s,]+/), e[this] = [Number(i[0]), Number(i[1])]))
  2961. }), t.validator.autoCreateRanges && (e.min && e.max && (e.range = [e.min, e.max], delete e.min, delete e.max), e.minlength && e.maxlength && (e.rangelength = [e.minlength, e.maxlength], delete e.minlength, delete e.maxlength)), e
  2962. },
  2963. normalizeRule: function(e) {
  2964. if ("string" == typeof e) {
  2965. var i = {};
  2966. t.each(e.split(/\s/), function() {
  2967. i[this] = !0
  2968. }), e = i
  2969. }
  2970. return e
  2971. },
  2972. addMethod: function(e, i, s) {
  2973. t.validator.methods[e] = i, t.validator.messages[e] = void 0 !== s ? s : t.validator.messages[e], 3 > i.length && t.validator.addClassRules(e, t.validator.normalizeRule(e))
  2974. },
  2975. methods: {
  2976. required: function(e, i, s) {
  2977. if (!this.depend(s, i)) return "dependency-mismatch";
  2978. if ("select" === i.nodeName.toLowerCase()) {
  2979. var r = t(i).val();
  2980. return r && r.length > 0
  2981. }
  2982. return this.checkable(i) ? this.getLength(e, i) > 0 : t.trim(e).length > 0
  2983. },
  2984. email: function(t, e) {
  2985. return this.optional(e) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(t)
  2986. },
  2987. url: function(t, e) {
  2988. return this.optional(e) || /^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(t)
  2989. },
  2990. date: function(t, e) {
  2991. return this.optional(e) || !/Invalid|NaN/.test("" + new Date(t))
  2992. },
  2993. dateISO: function(t, e) {
  2994. return this.optional(e) || /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(t)
  2995. },
  2996. number: function(t, e) {
  2997. return this.optional(e) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(t)
  2998. },
  2999. digits: function(t, e) {
  3000. return this.optional(e) || /^\d+$/.test(t)
  3001. },
  3002. creditcard: function(t, e) {
  3003. if (this.optional(e)) return "dependency-mismatch";
  3004. if (/[^0-9 \-]+/.test(t)) return !1;
  3005. var i = 0,
  3006. s = 0,
  3007. r = !1;
  3008. t = t.replace(/\D/g, "");
  3009. for (var n = t.length - 1; n >= 0; n--) {
  3010. var a = t.charAt(n);
  3011. s = parseInt(a, 10), r && (s *= 2) > 9 && (s -= 9), i += s, r = !r
  3012. }
  3013. return 0 === i % 10
  3014. },
  3015. minlength: function(e, i, s) {
  3016. var r = t.isArray(e) ? e.length : this.getLength(t.trim(e), i);
  3017. return this.optional(i) || r >= s
  3018. },
  3019. maxlength: function(e, i, s) {
  3020. var r = t.isArray(e) ? e.length : this.getLength(t.trim(e), i);
  3021. return this.optional(i) || s >= r
  3022. },
  3023. rangelength: function(e, i, s) {
  3024. var r = t.isArray(e) ? e.length : this.getLength(t.trim(e), i);
  3025. return this.optional(i) || r >= s[0] && s[1] >= r
  3026. },
  3027. min: function(t, e, i) {
  3028. return this.optional(e) || t >= i
  3029. },
  3030. max: function(t, e, i) {
  3031. return this.optional(e) || i >= t
  3032. },
  3033. range: function(t, e, i) {
  3034. return this.optional(e) || t >= i[0] && i[1] >= t
  3035. },
  3036. equalTo: function(e, i, s) {
  3037. var r = t(s);
  3038. return this.settings.onfocusout && r.unbind(".validate-equalTo").bind("blur.validate-equalTo", function() {
  3039. t(i).valid()
  3040. }), e === r.val()
  3041. },
  3042. remote: function(e, i, s) {
  3043. if (this.optional(i)) return "dependency-mismatch";
  3044. var r = this.previousValue(i);
  3045. if (this.settings.messages[i.name] || (this.settings.messages[i.name] = {}), r.originalMessage = this.settings.messages[i.name].remote, this.settings.messages[i.name].remote = r.message, s = "string" == typeof s && {
  3046. url: s
  3047. } || s, r.old === e) return r.valid;
  3048. r.old = e;
  3049. var n = this;
  3050. this.startRequest(i);
  3051. var a = {};
  3052. return a[i.name] = e, t.ajax(t.extend(!0, {
  3053. url: s,
  3054. mode: "abort",
  3055. port: "validate" + i.name,
  3056. dataType: "json",
  3057. data: a,
  3058. success: function(s) {
  3059. n.settings.messages[i.name].remote = r.originalMessage;
  3060. var a = s === !0 || "true" === s;
  3061. if (a) {
  3062. var u = n.formSubmitted;
  3063. n.prepareElement(i), n.formSubmitted = u, n.successList.push(i), delete n.invalid[i.name], n.showErrors()
  3064. } else {
  3065. var o = {}, l = s || n.defaultMessage(i, "remote");
  3066. o[i.name] = r.message = t.isFunction(l) ? l(e) : l, n.invalid[i.name] = !0, n.showErrors(o)
  3067. }
  3068. r.valid = a, n.stopRequest(i, a)
  3069. }
  3070. }, s)), "pending"
  3071. }
  3072. }
  3073. }), t.format = t.validator.format
  3074. })(jQuery),
  3075. function(t) {
  3076. var e = {};
  3077. if (t.ajaxPrefilter) t.ajaxPrefilter(function(t, i, s) {
  3078. var r = t.port;
  3079. "abort" === t.mode && (e[r] && e[r].abort(), e[r] = s)
  3080. });
  3081. else {
  3082. var i = t.ajax;
  3083. t.ajax = function(s) {
  3084. var r = ("mode" in s ? s : t.ajaxSettings).mode,
  3085. n = ("port" in s ? s : t.ajaxSettings).port;
  3086. return "abort" === r ? (e[n] && e[n].abort(), e[n] = i.apply(this, arguments), e[n]) : i.apply(this, arguments)
  3087. }
  3088. }
  3089. }(jQuery),
  3090. function(t) {
  3091. t.extend(t.fn, {
  3092. validateDelegate: function(e, i, s) {
  3093. return this.bind(i, function(i) {
  3094. var r = t(i.target);
  3095. return r.is(e) ? s.apply(r, arguments) : void 0
  3096. })
  3097. }
  3098. })
  3099. }(jQuery);
  3100. // Underscore.js 1.5.2
  3101. // http://underscorejs.org
  3102. // (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  3103. // Underscore may be freely distributed under the MIT license.
  3104. (function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,g=e.filter,d=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,w=Object.keys,_=i.bind,j=function(n){return n instanceof j?n:this instanceof j?(this._wrapped=n,void 0):new j(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=j),exports._=j):n._=j,j.VERSION="1.5.2";var A=j.each=j.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a=j.keys(n),u=0,i=a.length;i>u;u++)if(t.call(e,n[a[u]],a[u],n)===r)return};j.map=j.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e.push(t.call(r,n,u,i))}),e)};var E="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=j.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(E);return r},j.reduceRight=j.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=j.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=j.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(E);return r},j.find=j.detect=function(n,t,r){var e;return O(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},j.filter=j.select=function(n,t,r){var e=[];return null==n?e:g&&n.filter===g?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},j.reject=function(n,t,r){return j.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},j.every=j.all=function(n,t,e){t||(t=j.identity);var u=!0;return null==n?u:d&&n.every===d?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var O=j.some=j.any=function(n,t,e){t||(t=j.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};j.contains=j.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:O(n,function(n){return n===t})},j.invoke=function(n,t){var r=o.call(arguments,2),e=j.isFunction(t);return j.map(n,function(n){return(e?t:n[t]).apply(n,r)})},j.pluck=function(n,t){return j.map(n,function(n){return n[t]})},j.where=function(n,t,r){return j.isEmpty(t)?r?void 0:[]:j[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},j.findWhere=function(n,t){return j.where(n,t,!0)},j.max=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);if(!t&&j.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>e.computed&&(e={value:n,computed:a})}),e.value},j.min=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);if(!t&&j.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a<e.computed&&(e={value:n,computed:a})}),e.value},j.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=j.random(r++),e[r-1]=e[t],e[t]=n}),e},j.sample=function(n,t,r){return arguments.length<2||r?n[j.random(n.length-1)]:j.shuffle(n).slice(0,Math.max(0,t))};var k=function(n){return j.isFunction(n)?n:function(t){return t[n]}};j.sortBy=function(n,t,r){var e=k(t);return j.pluck(j.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={},i=null==r?j.identity:k(r);return A(t,function(r,a){var o=i.call(e,r,a,t);n(u,o,r)}),u}};j.groupBy=F(function(n,t,r){(j.has(n,t)?n[t]:n[t]=[]).push(r)}),j.indexBy=F(function(n,t,r){n[t]=r}),j.countBy=F(function(n,t){j.has(n,t)?n[t]++:n[t]=1}),j.sortedIndex=function(n,t,r,e){r=null==r?j.identity:k(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;r.call(e,n[o])<u?i=o+1:a=o}return i},j.toArray=function(n){return n?j.isArray(n)?o.call(n):n.length===+n.length?j.map(n,j.identity):j.values(n):[]},j.size=function(n){return null==n?0:n.length===+n.length?n.length:j.keys(n).length},j.first=j.head=j.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},j.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},j.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},j.rest=j.tail=j.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},j.compact=function(n){return j.filter(n,j.identity)};var M=function(n,t,r){return t&&j.every(n,j.isArray)?c.apply(r,n):(A(n,function(n){j.isArray(n)||j.isArguments(n)?t?a.apply(r,n):M(n,t,r):r.push(n)}),r)};j.flatten=function(n,t){return M(n,t,[])},j.without=function(n){return j.difference(n,o.call(arguments,1))},j.uniq=j.unique=function(n,t,r,e){j.isFunction(t)&&(e=r,r=t,t=!1);var u=r?j.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:j.contains(a,r))||(a.push(r),i.push(n[e]))}),i},j.union=function(){return j.uniq(j.flatten(arguments,!0))},j.intersection=function(n){var t=o.call(arguments,1);return j.filter(j.uniq(n),function(n){return j.every(t,function(t){return j.indexOf(t,n)>=0})})},j.difference=function(n){var t=c.apply(e,o.call(arguments,1));return j.filter(n,function(n){return!j.contains(t,n)})},j.zip=function(){for(var n=j.max(j.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;n>r;r++)t[r]=j.pluck(arguments,""+r);return t},j.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},j.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=j.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},j.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},j.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);e>u;)i[u++]=n,n+=r;return i};var R=function(){};j.bind=function(n,t){var r,e;if(_&&n.bind===_)return _.apply(n,o.call(arguments,1));if(!j.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));R.prototype=n.prototype;var u=new R;R.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},j.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},j.bindAll=function(n){var t=o.call(arguments,1);if(0===t.length)throw new Error("bindAll must be passed function names");return A(t,function(t){n[t]=j.bind(n[t],n)}),n},j.memoize=function(n,t){var r={};return t||(t=j.identity),function(){var e=t.apply(this,arguments);return j.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},j.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},j.defer=function(n){return j.delay.apply(j,[n,1].concat(o.call(arguments,1)))},j.throttle=function(n,t,r){var e,u,i,a=null,o=0;r||(r={});var c=function(){o=r.leading===!1?0:new Date,a=null,i=n.apply(e,u)};return function(){var l=new Date;o||r.leading!==!1||(o=l);var f=t-(l-o);return e=this,u=arguments,0>=f?(clearTimeout(a),a=null,o=l,i=n.apply(e,u)):a||r.trailing===!1||(a=setTimeout(c,f)),i}},j.debounce=function(n,t,r){var e,u,i,a,o;return function(){i=this,u=arguments,a=new Date;var c=function(){var l=new Date-a;t>l?e=setTimeout(c,t-l):(e=null,r||(o=n.apply(i,u)))},l=r&&!e;return e||(e=setTimeout(c,t)),l&&(o=n.apply(i,u)),o}},j.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},j.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},j.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},j.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},j.keys=w||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)j.has(n,r)&&t.push(r);return t},j.values=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},j.pairs=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},j.invert=function(n){for(var t={},r=j.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},j.functions=j.methods=function(n){var t=[];for(var r in n)j.isFunction(n[r])&&t.push(r);return t.sort()},j.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},j.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},j.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)j.contains(r,u)||(t[u]=n[u]);return t},j.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},j.clone=function(n){return j.isObject(n)?j.isArray(n)?n.slice():j.extend({},n):n},j.tap=function(n,t){return t(n),n};var S=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof j&&(n=n._wrapped),t instanceof j&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==String(t);case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;var a=n.constructor,o=t.constructor;if(a!==o&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(o)&&o instanceof o))return!1;r.push(n),e.push(t);var c=0,f=!0;if("[object Array]"==u){if(c=n.length,f=c==t.length)for(;c--&&(f=S(n[c],t[c],r,e)););}else{for(var s in n)if(j.has(n,s)&&(c++,!(f=j.has(t,s)&&S(n[s],t[s],r,e))))break;if(f){for(s in t)if(j.has(t,s)&&!c--)break;f=!c}}return r.pop(),e.pop(),f};j.isEqual=function(n,t){return S(n,t,[],[])},j.isEmpty=function(n){if(null==n)return!0;if(j.isArray(n)||j.isString(n))return 0===n.length;for(var t in n)if(j.has(n,t))return!1;return!0},j.isElement=function(n){return!(!n||1!==n.nodeType)},j.isArray=x||function(n){return"[object Array]"==l.call(n)},j.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){j["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),j.isArguments(arguments)||(j.isArguments=function(n){return!(!n||!j.has(n,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(n){return"function"==typeof n}),j.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},j.isNaN=function(n){return j.isNumber(n)&&n!=+n},j.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},j.isNull=function(n){return null===n},j.isUndefined=function(n){return n===void 0},j.has=function(n,t){return f.call(n,t)},j.noConflict=function(){return n._=t,this},j.identity=function(n){return n},j.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},j.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var I={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};I.unescape=j.invert(I.escape);var T={escape:new RegExp("["+j.keys(I.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(I.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(n){j[n]=function(t){return null==t?"":(""+t).replace(T[n],function(t){return I[n][t]})}}),j.result=function(n,t){if(null==n)return void 0;var r=n[t];return j.isFunction(r)?r.call(n):r},j.mixin=function(n){A(j.functions(n),function(t){var r=j[t]=n[t];j.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),z.call(this,r.apply(j,n))}})};var N=0;j.uniqueId=function(n){var t=++N+"";return n?n+t:t},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(n,t,r){var e;r=j.defaults({},r,j.templateSettings);var u=new RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(D,function(n){return"\\"+B[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=new Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,j);var c=function(n){return e.call(this,n,j)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},j.chain=function(n){return j(n).chain()};var z=function(n){return this._chain?j(n).chain():n};j.mixin(j),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];j.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],z.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];j.prototype[n]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this);
  3105. //# sourceMappingURL=underscore-min.map
  3106. ;