Produced by Araxis Merge on 4/9/2018 3:46:08 PM Eastern Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | TelehealthMgmtPlat_4.0.zip\Telehealth Management Platform 4.0\CRM-Prod.zip\CRM-Prod\VA.TMP.WebResources\J Script Functions\ServiceActivity | mcs_ServiceActivity.min.js | Fri Feb 23 23:11:34 2018 UTC |
| 2 | TelehealthMgmtPlat_4.0.zip\Telehealth Management Platform 4.0\CRM-Prod.zip\CRM-Prod\VA.TMP.WebResources\J Script Functions\ServiceActivity | mcs_ServiceActivity.min.js | Mon Apr 9 13:52:54 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 1 | 88 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | /*! | |
| 2 | * jQuery JavaScript Library v 1.7.1 | |
| 3 | * http:// jquery.com / | |
| 4 | * | |
| 5 | * Copyrig ht 2011, J ohn Resig | |
| 6 | * Dual li censed und er the MIT or GPL Ve rsion 2 li censes. | |
| 7 | * http:// jquery.org /license | |
| 8 | * | |
| 9 | * Include s Sizzle.j s | |
| 10 | * http:// sizzlejs.c om/ | |
| 11 | * Copyrig ht 2011, T he Dojo Fo undation | |
| 12 | * Release d under th e MIT, BSD , and GPL Licenses. | |
| 13 | * | |
| 14 | * Date: M on Nov 21 21:11:03 2 011 -0500 | |
| 15 | */ | |
| 16 | function o penNewRecu rringAppoi ntmentMast er(n,t,i){ var r;if(t ypeof Xrm! ="undefine d"&&typeof Xrm.Utili ty!="undef ined")r={} ,r.formid= "4a8cda55- 024e-419c- bbe1-9540e 0b8e297",r .subject=n ,r.cvt_ser viceactivi tyid=t,r.c vt_service activityid name=i,Xrm .Utility.o penEntityF orm("recur ringappoin tmentmaste r",null,r) ;else{var f=["formid =4a8cda55- 024e-419c- bbe1-9540e 0b8e297"," subject="+ n,"cvt_ser viceactivi tyid="+t," cvt_servic eactivityi dname="+i] ,u=Xrm.Pag e.context. getServerU rl();u.mat ch(/\/$/)& &(u=u.subs tring(0,u. length-1)) ;typeof Xr m.Page.con text.getCl ientUrl!=" undefined" &&(u=Xrm.P age.contex t.getClien tUrl());wi ndow.open( u+"/main.a spx?etn=re curringapp ointmentma ster&paget ype=entity record&ext raqs="+enc odeURIComp onent(f.jo in("&"))," _blank","l ocation=no ,menubar=n o,status=n o,toolbar= no,resizab le=yes",!1 )}}functio n CreateRe curringSer viceActivi ty(){var n ="Recurrin g "+Xrm.Pa ge.getAttr ibute("sub ject").get Value();op enNewRecur ringAppoin tmentMaste r(n,Xrm.Pa ge.data.en tity.getId (),n)}var CrmRestKit ,XrmSvcToo lkit,MCS,t otalPatien ts,totalGr oupPatient s;(functio n(n,t){fun ction kr(n ){var i=lt [n]={},t,r ;for(n=n.s plit(/\s+/ ),t=0,r=n. length;t<r ;t++)i[n[t ]]=!0;retu rn i}funct ion yt(n,r ,u){if(u== =t&&n.node Type===1){ var f="dat a-"+r.repl ace(vt,"-$ 1").toLowe rCase();if (u=n.getAt tribute(f) ,typeof u= ="string") {try{u=u== ="true"?!0 :u==="fals e"?!1:u=== "null"?nul l:i.isNume ric(u)?par seFloat(u) :at.test(u )?i.parseJ SON(u):u}c atch(e){}i .data(n,r, u)}else u= t}return u }function it(n){for( var t in n )if((t!==" data"||!i. isEmptyObj ect(n[t])) &&t!=="toJ SON")retur n!1;return !0}functio n pt(n,t,r ){var u=t+ "defer",f= t+"queue", e=t+"mark" ,o=i._data (n,u);!o|| r!=="queue "&&i._data (n,f)||r!= ="mark"&&i ._data(n,e )||setTime out(functi on(){i._da ta(n,f)||i ._data(n,e )||(i.remo veData(n,u ,!0),o.fir e())},0)}f unction h( ){return!1 }function b(){return !0}functio n ui(n){re turn!n||!n .parentNod e||n.paren tNode.node Type===11} function f i(n,t,r){i f(t=t||0,i .isFunctio n(t))retur n i.grep(n ,function( n,i){var u =!!t.call( n,i,n);ret urn u===r} );if(t.nod eType)retu rn i.grep( n,function (n){return n===t===r });if(type of t=="str ing"){var u=i.grep(n ,function( n){return n.nodeType ===1});if( lu.test(t) )return i. filter(t,u ,!r);t=i.f ilter(t,u) }return i. grep(n,fun ction(n){r eturn i.in Array(n,t) >=0===r})} function e i(n){var i =oi.split( "|"),t=n.c reateDocum entFragmen t();if(t.c reateEleme nt)while(i .length)t. createElem ent(i.pop( ));return t}function nf(n){ret urn i.node Name(n,"ta ble")?n.ge tElementsB yTagName(" tbody")[0] ||n.append Child(n.ow nerDocumen t.createEl ement("tbo dy")):n}fu nction vi( n,t){if(t. nodeType== =1&&i.hasD ata(n)){va r r,u,o,s= i._data(n) ,e=i._data (t,s),f=s. events;if( f){delete e.handle;e .events={} ;for(r in f)for(u=0, o=f[r].len gth;u<o;u+ +)i.event. add(t,r+(f [r][u].nam espace?"." :"")+f[r][ u].namespa ce,f[r][u] ,f[r][u].d ata)}e.dat a&&(e.data =i.extend( {},e.data) )}}functio n yi(n,t){ var r;t.no deType===1 &&(t.clear Attributes &&t.clearA ttributes( ),t.mergeA ttributes& &t.mergeAt tributes(n ),r=t.node Name.toLow erCase(),r ==="object "?t.outerH TML=n.oute rHTML:r=== "input"&&( n.type===" checkbox"| |n.type=== "radio")?( n.checked& &(t.defaul tChecked=t .checked=n .checked), t.value!== n.value&&( t.value=n. value)):r= =="option" ?t.selecte d=n.defaul tSelected: (r==="inpu t"||r==="t extarea")& &(t.defaul tValue=n.d efaultValu e),t.remov eAttribute (i.expando ))}functio n k(n){ret urn typeof n.getElem entsByTagN ame!="unde fined"?n.g etElements ByTagName( "*"):typeo f n.queryS electorAll !="undefin ed"?n.quer ySelectorA ll("*"):[] }function pi(n){(n.t ype==="che ckbox"||n. type==="ra dio")&&(n. defaultChe cked=n.che cked)}func tion wi(n) {var t=(n. nodeName|| "").toLowe rCase();t= =="input"? pi(n):t!== "script"&& typeof n.g etElements ByTagName! ="undefine d"&&i.grep (n.getElem entsByTagN ame("input "),pi)}fun ction tf(n ){var t=r. createElem ent("div") ;return ai .appendChi ld(t),t.in nerHTML=n. outerHTML, t.firstChi ld}functio n rf(n,t){ t.src?i.aj ax({url:t. src,async: !1,dataTyp e:"script" }):i.globa lEval((t.t ext||t.tex tContent|| t.innerHTM L||"").rep lace(gu,"/ *$0*/"));t .parentNod e&&t.paren tNode.remo veChild(t) }function gi(n,t,r){ var u=t=== "width"?n. offsetWidt h:n.offset Height,e=t ==="width" ?hf:cf,f=0 ,o=e.lengt h;if(u>0){ if(r!=="bo rder")for( ;f<o;f++)r ||(u-=pars eFloat(i.c ss(n,"padd ing"+e[f]) )||0),r=== "margin"?u +=parseFlo at(i.css(n ,r+e[f]))| |0:u-=pars eFloat(i.c ss(n,"bord er"+e[f]+" Width"))|| 0;return u +"px"}if(u =c(n,t,t), (u<0||u==n ull)&&(u=n .style[t]| |0),u=pars eFloat(u)| |0,r)for(; f<o;f++)u+ =parseFloa t(i.css(n, "padding"+ e[f]))||0, r!=="paddi ng"&&(u+=p arseFloat( i.css(n,"b order"+e[f ]+"Width") )||0),r=== "margin"&& (u+=parseF loat(i.css (n,r+e[f]) )||0);retu rn u+"px"} function o r(n){retur n function (t,r){if(t ypeof t!=" string"&&( r=t,t="*") ,i.isFunct ion(r))for (var o=t.t oLowerCase ().split(i r),f=0,h=o .length,u, s,e;f<h;f+ +)u=o[f],e =/^\+/.tes t(u),e&&(u =u.substr( 1)||"*"),s =n[u]=n[u] ||[],s[e?" unshift":" push"](r)} }function d(n,i,r,u, f,e){f=f|| i.dataType s[0];e=e|| {};e[f]=!0 ;for(var s =n[f],h=0, l=s?s.leng th:0,c=n== =et,o;h<l& &(c||!o);h ++)o=s[h]( i,r,u),typ eof o=="st ring"&&(!c ||e[o]?o=t :(i.dataTy pes.unshif t(o),o=d(n ,i,r,u,o,e )));return !c&&o||e[" *"]||(o=d( n,i,r,u,"* ",e)),o}fu nction sr( n,r){var u ,f,e=i.aja xSettings. flatOption s||{};for( u in r)r[u ]!==t&&((e [u]?n:f||( f={}))[u]= r[u]);f&&i .extend(!0 ,n,f)}func tion ot(n, t,r,u){if( i.isArray( t))i.each( t,function (t,f){r||a f.test(n)? u(n,f):ot( n+"["+(typ eof f=="ob ject"||i.i sArray(f)? t:"")+"]", f,r,u)});e lse if(r|| t==null||t ypeof t!=" object")u( n,t);else for(var f in t)ot(n+ "["+f+"]", t[f],r,u)} function n e(n,i,r){v ar s=n.con tents,f=n. dataTypes, c=n.respon seFields,o ,u,e,h;for (u in c)u in r&&(i[c [u]]=r[u]) ;while(f[0 ]==="*")f. shift(),o= ==t&&(o=n. mimeType|| i.getRespo nseHeader( "content-t ype"));if( o)for(u in s)if(s[u] &&s[u].tes t(o)){f.un shift(u);b reak}if(f[ 0]in r)e=f [0];else{f or(u in r) {if(!f[0]| |n.convert ers[u+" "+ f[0]]){e=u ;break}h|| (h=u)}e=e| |h}if(e)re turn e!==f [0]&&f.uns hift(e),r[ e]}functio n te(n,r){ n.dataFilt er&&(r=n.d ataFilter( r,n.dataTy pe));for(v ar v=n.dat aTypes,s={ },l,p=v.le ngth,a,u=v [0],h,y,f, e,o,c=1;c< p;c++){if( c===1)for( l in n.con verters)ty peof l=="s tring"&&(s [l.toLower Case()]=n. converters [l]);if(h= u,u=v[c],u ==="*")u=h ;else if(h !=="*"&&h! ==u){if(y= h+" "+u,f= s[y]||s["* "+u],!f){ o=t;for(e in s)if(a= e.split(" "),(a[0]== =h||a[0]== ="*")&&(o= s[a[1]+" " +u],o)){e= s[e];e===! 0?f=o:o=== !0&&(f=e); break}}f|| o||i.error ("No conve rsion from "+y.repla ce(" "," t o "));f!== !0&&(r=f?f (r):o(e(r) ))}}return r}functio n lr(){try {return ne w n.XMLHtt pRequest}c atch(t){}} function i e(){try{re turn new n .ActiveXOb ject("Micr osoft.XMLH TTP")}catc h(t){}}fun ction vr() {return se tTimeout(f e,0),tt=i. now()}func tion fe(){ tt=t}funct ion v(n,t) {var r={}; return i.e ach(ar.con cat.apply( [],ar.slic e(0,t)),fu nction(){r [this]=n}) ,r}functio n yr(n){if (!st[n]){v ar e=r.bod y,t=i("<"+ n+">").app endTo(e),u =t.css("di splay");t. remove();( u==="none" ||u==="")& &(f||(f=r. createElem ent("ifram e"),f.fram eBorder=f. width=f.he ight=0),e. appendChil d(f),a&&f. createElem ent||(a=(f .contentWi ndow||f.co ntentDocum ent).docum ent,a.writ e((r.compa tMode==="C SS1Compat" ?"<!doctyp e html>":" ")+"<html> <body>"),a .close()), t=a.create Element(n) ,a.body.ap pendChild( t),u=i.css (t,"displa y"),e.remo veChild(f) );st[n]=u} return st[ n]}functio n ct(n){re turn i.isW indow(n)?n :n.nodeTyp e===9?n.de faultView| |n.parentW indow:!1}v ar r=n.doc ument,wr=n .navigator ,br=n.loca tion,i=fun ction(){fu nction b() {if(!i.isR eady){try{ r.document Element.do Scroll("le ft")}catch (n){setTim eout(b,1); return}i.r eady()}}va r i=functi on(n,t){re turn new i .fn.init(n ,t,c)},k=n .jQuery,d= n.$,c,g=/^ (?:[^#<]*( <[\w\W]+>) [^>]*$|#([ \w\-]*)$)/ ,l=/\S/,a= /^\s+/,v=/ \s+$/,nt=/ ^<(\w+)\s* \/?>(?:<\/ \1>)?$/,tt =/^[\],:{} \s]*$/,it= /\\(?:["\\ \/bfnrt]|u [0-9a-fA-F ]{4})/g,rt =/"[^"\\\n \r]*"|true |false|nul l|-?\d+(?: \.\d*)?(?: [eE][+\-]? \d+)?/g,ut =/(?:^|:|, )(?:\s*\[) +/g,ft=/(w ebkit)[ \/ ]([\w.]+)/ ,et=/(oper a)(?:.*ver sion)?[ \/ ]([\w.]+)/ ,ot=/(msie ) ([\w.]+) /,st=/(moz illa)(?:.* ? rv:([\w. ]+))?/,ht= /-([a-z]|[ 0-9])/ig,c t=/^-ms-/, lt=functio n(n,t){ret urn(t+""). toUpperCas e()},at=wr .userAgent ,e,o,u,vt= Object.pro totype.toS tring,s=Ob ject.proto type.hasOw nProperty, h=Array.pr ototype.pu sh,f=Array .prototype .slice,y=S tring.prot otype.trim ,p=Array.p rototype.i ndexOf,w={ };return i .fn=i.prot otype={con structor:i ,init:func tion(n,u,f ){var o,s, e,h;if(!n) return thi s;if(n.nod eType)retu rn this.co ntext=this [0]=n,this .length=1, this;if(n= =="body"&& !u&&r.body )return th is.context =r,this[0] =r.body,th is.selecto r=n,this.l ength=1,th is;if(type of n=="str ing"){if(o =n.charAt( 0)==="<"&& n.charAt(n .length-1) ===">"&&n. length>=3? [null,n,nu ll]:g.exec (n),o&&(o[ 1]||!u)){i f(o[1])ret urn u=u in stanceof i ?u[0]:u,h= u?u.ownerD ocument||u :r,e=nt.ex ec(n),e?i. isPlainObj ect(u)?(n= [r.createE lement(e[1 ])],i.fn.a ttr.call(n ,u,!0)):n= [h.createE lement(e[1 ])]:(e=i.b uildFragme nt([o[1]], [h]),n=(e. cacheable? i.clone(e. fragment): e.fragment ).childNod es),i.merg e(this,n); if(s=r.get ElementByI d(o[2]),s& &s.parentN ode){if(s. id!==o[2]) return f.f ind(n);thi s.length=1 ;this[0]=s }return th is.context =r,this.se lector=n,t his}return !u||u.jque ry?(u||f). find(n):th is.constru ctor(u).fi nd(n)}retu rn i.isFun ction(n)?f .ready(n): (n.selecto r!==t&&(th is.selecto r=n.select or,this.co ntext=n.co ntext),i.m akeArray(n ,this))},s elector:"" ,jquery:"1 .7.1",leng th:0,size: function() {return th is.length} ,toArray:f unction(){ return f.c all(this,0 )},get:fun ction(n){r eturn n==n ull?this.t oArray():n <0?this[th is.length+ n]:this[n] },pushStac k:function (n,t,r){va r u=this.c onstructor ();return i.isArray( n)?h.apply (u,n):i.me rge(u,n),u .prevObjec t=this,u.c ontext=thi s.context, t==="find" ?u.selecto r=this.sel ector+(thi s.selector ?" ":"")+r :t&&(u.sel ector=this .selector+ "."+t+"("+ r+")"),u}, each:funct ion(n,t){r eturn i.ea ch(this,n, t)},ready: function(n ){return i .bindReady (),o.add(n ),this},eq :function( n){return n=+n,n===- 1?this.sli ce(n):this .slice(n,n +1)},first :function( ){return t his.eq(0)} ,last:func tion(){ret urn this.e q(-1)},sli ce:functio n(){return this.push Stack(f.ap ply(this,a rguments), "slice",f. call(argum ents).join (","))},ma p:function (n){return this.push Stack(i.ma p(this,fun ction(t,i) {return n. call(t,i,t )}))},end: function() {return th is.prevObj ect||this. constructo r(null)},p ush:h,sort :[].sort,s plice:[].s plice},i.f n.init.pro totype=i.f n,i.extend =i.fn.exte nd=functio n(){var o, e,u,r,s,h, n=argument s[0]||{},f =1,l=argum ents.lengt h,c=!1;for (typeof n= ="boolean" &&(c=n,n=a rguments[1 ]||{},f=2) ,typeof n= ="object"| |i.isFunct ion(n)||(n ={}),l===f &&(n=this, --f);f<l;f ++)if((o=a rguments[f ])!=null)f or(e in o) (u=n[e],r= o[e],n!==r )&&(c&&r&& (i.isPlain Object(r)| |(s=i.isAr ray(r)))?( s?(s=!1,h= u&&i.isArr ay(u)?u:[] ):h=u&&i.i sPlainObje ct(u)?u:{} ,n[e]=i.ex tend(c,h,r )):r!==t&& (n[e]=r)); return n}, i.extend({ noConflict :function( t){return n.$===i&&( n.$=d),t&& n.jQuery== =i&&(n.jQu ery=k),i}, isReady:!1 ,readyWait :1,holdRea dy:functio n(n){n?i.r eadyWait++ :i.ready(! 0)},ready: function(n ){if(n===! 0&&!--i.re adyWait||n !==!0&&!i. isReady){i f(!r.body) return set Timeout(i. ready,1);i f(i.isRead y=!0,n!==! 0&&--i.rea dyWait>0)r eturn;o.fi reWith(r,[ i]);i.fn.t rigger&&i( r).trigger ("ready"). off("ready ")}},bindR eady:funct ion(){if(! o){if(o=i. Callbacks( "once memo ry"),r.rea dyState=== "complete" )return se tTimeout(i .ready,1); if(r.addEv entListene r)r.addEve ntListener ("DOMConte ntLoaded", u,!1),n.ad dEventList ener("load ",i.ready, !1);else i f(r.attach Event){r.a ttachEvent ("onreadys tatechange ",u);n.att achEvent(" onload",i. ready);var t=!1;try{ t=n.frameE lement==nu ll}catch(f ){}r.docum entElement .doScroll& &t&&b()}}} ,isFunctio n:function (n){return i.type(n) ==="functi on"},isArr ay:Array.i sArray||fu nction(n){ return i.t ype(n)===" array"},is Window:fun ction(n){r eturn n&&t ypeof n==" object"&&" setInterva l"in n},is Numeric:fu nction(n){ return!isN aN(parseFl oat(n))&&i sFinite(n) },type:fun ction(n){r eturn n==n ull?String (n):w[vt.c all(n)]||" object"},i sPlainObje ct:functio n(n){if(!n ||i.type(n )!=="objec t"||n.node Type||i.is Window(n)) return!1;t ry{if(n.co nstructor& &!s.call(n ,"construc tor")&&!s. call(n.con structor.p rototype," isPrototyp eOf"))retu rn!1}catch (u){return !1}for(var r in n);r eturn r=== t||s.call( n,r)},isEm ptyObject: function(n ){for(var t in n)ret urn!1;retu rn!0},erro r:function (n){throw new Error( n);},parse JSON:funct ion(t){if( typeof t!= "string"|| !t)return null;if(t= i.trim(t), n.JSON&&n. JSON.parse )return n. JSON.parse (t);if(tt. test(t.rep lace(it,"@ ").replace (rt,"]").r eplace(ut, "")))retur n new Func tion("retu rn "+t)(); i.error("I nvalid JSO N: "+t)},p arseXML:fu nction(r){ var u,f;tr y{n.DOMPar ser?(f=new DOMParser ,u=f.parse FromString (r,"text/x ml")):(u=n ew ActiveX Object("Mi crosoft.XM LDOM"),u.a sync="fals e",u.loadX ML(r))}cat ch(e){u=t} return u&& u.document Element&&! u.getEleme ntsByTagNa me("parser error").le ngth||i.er ror("Inval id XML: "+ r),u},noop :function( ){},global Eval:funct ion(t){t&& l.test(t)& &(n.execSc ript||func tion(t){n. eval.call( n,t)})(t)} ,camelCase :function( n){return n.replace( ct,"ms-"). replace(ht ,lt)},node Name:funct ion(n,t){r eturn n.no deName&&n. nodeName.t oUpperCase ()===t.toU pperCase() },each:fun ction(n,r, u){var f,e =0,o=n.len gth,s=o=== t||i.isFun ction(n);i f(u){if(s) {for(f in n)if(r.app ly(n[f],u) ===!1)brea k}else for (;e<o;)if( r.apply(n[ e++],u)=== !1)break}e lse if(s){ for(f in n )if(r.call (n[f],f,n[ f])===!1)b reak}else for(;e<o;) if(r.call( n[e],e,n[e ++])===!1) break;retu rn n},trim :y?functio n(n){retur n n==null? "":y.call( n)}:functi on(n){retu rn n==null ?"":n.toSt ring().rep lace(a,"") .replace(v ,"")},make Array:func tion(n,t){ var u=t||[ ],r;return n!=null&& (r=i.type( n),n.lengt h==null||r ==="string "||r==="fu nction"||r ==="regexp "||i.isWin dow(n)?h.c all(u,n):i .merge(u,n )),u},inAr ray:functi on(n,t,i){ var r;if(t ){if(p)ret urn p.call (t,n,i);fo r(r=t.leng th,i=i?i<0 ?Math.max( 0,r+i):i:0 ;i<r;i++)i f(i in t&& t[i]===n)r eturn i}re turn-1},me rge:functi on(n,i){va r u=n.leng th,r=0,f;i f(typeof i .length==" number")fo r(f=i.leng th;r<f;r++ )n[u++]=i[ r];else wh ile(i[r]!= =t)n[u++]= i[r++];ret urn n.leng th=u,n},gr ep:functio n(n,t,i){v ar u=[],f, r,e;for(i= !!i,r=0,e= n.length;r <e;r++)f=! !t(n[r],r) ,i!==f&&u. push(n[r]) ;return u} ,map:funct ion(n,r,u) {var f,h,e =[],s=0,o= n.length,c =n instanc eof i||o!= =t&&typeof o=="numbe r"&&(o>0&& n[0]&&n[o- 1]||o===0| |i.isArray (n));if(c) for(;s<o;s ++)f=r(n[s ],s,u),f!= null&&(e[e .length]=f );else for (h in n)f= r(n[h],h,u ),f!=null& &(e[e.leng th]=f);ret urn e.conc at.apply([ ],e)},guid :1,proxy:f unction(n, r){var e,o ,u;return( typeof r== "string"&& (e=n[r],r= n,n=e),!i. isFunction (n))?t:(o= f.call(arg uments,2), u=function (){return n.apply(r, o.concat(f .call(argu ments)))}, u.guid=n.g uid=n.guid ||u.guid|| i.guid++,u )},access: function(n ,r,u,f,e,o ){var c=n. length,h,s ;if(typeof r=="objec t"){for(h in r)i.acc ess(n,h,r[ h],f,e,u); return n}i f(u!==t){f or(f=!o&&f &&i.isFunc tion(u),s= 0;s<c;s++) e(n[s],r,f ?u.call(n[ s],s,e(n[s ],r)):u,o) ;return n} return c?e (n[0],r):t },now:func tion(){ret urn(new Da te).getTim e()},uaMat ch:functio n(n){n=n.t oLowerCase ();var t=f t.exec(n)| |et.exec(n )||ot.exec (n)||n.ind exOf("comp atible")<0 &&st.exec( n)||[];ret urn{browse r:t[1]||"" ,version:t [2]||"0"}} ,sub:funct ion(){func tion n(t,i ){return n ew n.fn.in it(t,i)}i. extend(!0, n,this);n. superclass =this;n.fn =n.prototy pe=this(); n.fn.const ructor=n;n .sub=this. sub;n.fn.i nit=functi on(r,u){re turn u&&u instanceof i&&!(u in stanceof n )&&(u=n(u) ),i.fn.ini t.call(thi s,r,u,t)}; n.fn.init. prototype= n.fn;var t =n(r);retu rn n},brow ser:{}}),i .each("Boo lean Numbe r String F unction Ar ray Date R egExp Obje ct".split( " "),funct ion(n,t){w ["[object "+t+"]"]=t .toLowerCa se()}),e=i .uaMatch(a t),e.brows er&&(i.bro wser[e.bro wser]=!0,i .browser.v ersion=e.v ersion),i. browser.we bkit&&(i.b rowser.saf ari=!0),l. test("Â ") &&(a=/^[\s \xA0]+/,v= /[\s\xA0]+ $/),c=i(r) ,r.addEven tListener? u=function (){r.remov eEventList ener("DOMC ontentLoad ed",u,!1); i.ready()} :r.attachE vent&&(u=f unction(){ r.readySta te==="comp lete"&&(r. detachEven t("onready statechang e",u),i.re ady())}),i }(),lt={}, p,at,vt,hr ,y,g,cr,l, pr,ht;i.Ca llbacks=fu nction(n){ n=n?lt[n]| |kr(n):{}; var r=[],f =[],u,s,c, h,e,l=func tion(t){fo r(var u,e, f=0,s=t.le ngth;f<s;f ++)u=t[f], e=i.type(u ),e==="arr ay"?l(u):e ==="functi on"&&(n.un ique&&o.ha s(u)||r.pu sh(u))},a= function(t ,i){for(i= i||[],u=!n .memory||[ t,i],s=!0, e=c||0,c=0 ,h=r.lengt h;r&&e<h;e ++)if(r[e] .apply(t,i )===!1&&n. stopOnFals e){u=!0;br eak}s=!1;r &&(n.once? u===!0?o.d isable():r =[]:f&&f.l ength&&(u= f.shift(), o.fireWith (u[0],u[1] )))},o={ad d:function (){if(r){v ar n=r.len gth;l(argu ments);s?h =r.length: u&&u!==!0& &(c=n,a(u[ 0],u[1]))} return thi s},remove: function() {var t;if( r)for(var u=argument s,i=0,f=u. length;i<f ;i++)for(t =0;t<r.len gth;t++)if (u[i]===r[ t]&&(s&&t< =h&&(h--,t <=e&&e--), r.splice(t --,1),n.un ique))brea k;return t his},has:f unction(n) {if(r)for( var t=0,i= r.length;t <i;t++)if( n===r[t])r eturn!0;re turn!1},em pty:functi on(){retur n r=[],thi s},disable :function( ){return r =f=u=t,thi s},disable d:function (){return! r},lock:fu nction(){r eturn f=t, u&&u!==!0| |o.disable (),this},l ocked:func tion(){ret urn!f},fir eWith:func tion(t,i){ return f&& (s?n.once| |f.push([t ,i]):n.onc e&&u||a(t, i)),this}, fire:funct ion(){retu rn o.fireW ith(this,a rguments), this},fire d:function (){return! !u}};retur n o};p=[]. slice;i.ex tend({Defe rred:funct ion(n){var r=i.Callb acks("once memory"), u=i.Callba cks("once memory"),f =i.Callbac ks("memory "),s="pend ing",h={re solve:r,re ject:u,not ify:f},e={ done:r.add ,fail:u.ad d,progress :f.add,sta te:functio n(){return s},isReso lved:r.fir ed,isRejec ted:u.fire d,then:fun ction(n,i, r){return t.done(n). fail(i).pr ogress(r), this},alwa ys:functio n(){return t.done.ap ply(t,argu ments).fai l.apply(t, arguments) ,this},pip e:function (n,r,u){re turn i.Def erred(func tion(f){i. each({done :[n,"resol ve"],fail: [r,"reject "],progres s:[u,"noti fy"]},func tion(n,r){ var e=r[0] ,o=r[1],u; i.isFuncti on(e)?t[n] (function( ){u=e.appl y(this,arg uments);u& &i.isFunct ion(u.prom ise)?u.pro mise().the n(f.resolv e,f.reject ,f.notify) :f[o+"With "](this=== t?f:this,[ u])}):t[n] (f[o])})}) .promise() },promise: function(n ){if(n==nu ll)n=e;els e for(var t in e)n[t ]=e[t];ret urn n}},t= e.promise( {});for(va r o in h)t [o]=h[o].f ire,t[o+"W ith"]=h[o] .fireWith; return t.d one(functi on(){s="re solved"},u .disable,f .lock).fai l(function (){s="reje cted"},r.d isable,f.l ock),n&&n. call(t,t), t},when:fu nction(n){ function h (n){return function( i){r[n]=ar guments.le ngth>1?p.c all(argume nts,0):i;- -e||t.reso lveWith(t, r)}}functi on c(n){re turn funct ion(i){o[n ]=argument s.length>1 ?p.call(ar guments,0) :i;t.notif yWith(s,o) }}var r=p. call(argum ents,0),u= 0,f=r.leng th,o=new A rray(f),e= f,l=f,t=f< =1&&n&&i.i sFunction( n.promise) ?n:i.Defer red(),s=t. promise(); if(f>1){fo r(;u<f;u++ )r[u]&&r[u ].promise& &i.isFunct ion(r[u].p romise)?r[ u].promise ().then(h( u),t.rejec t,c(u)):-- e;e||t.res olveWith(t ,r)}else t !==n&&t.re solveWith( t,f?[n]:[] );return s }});i.supp ort=functi on(){var u ,y,o,l,a,f ,s,e,c,v,p ,h,t=r.cre ateElement ("div"),w= r.document Element;if (t.setAttr ibute("cla ssName","t "),t.inner HTML=" < link/><tab le><\/tabl e><a href= '/a' style ='top:1px; float:left ;opacity:. 55;'>a<\/a ><input ty pe='checkb ox'/>",y=t .getElemen tsByTagNam e("*"),o=t .getElemen tsByTagNam e("a")[0], !y||!y.len gth||!o)re turn{};l=r .createEle ment("sele ct");a=l.a ppendChild (r.createE lement("op tion"));f= t.getEleme ntsByTagNa me("input" )[0];u={le adingWhite space:t.fi rstChild.n odeType=== 3,tbody:!t .getElemen tsByTagNam e("tbody") .length,ht mlSerializ e:!!t.getE lementsByT agName("li nk").lengt h,style:/t op/.test(o .getAttrib ute("style ")),hrefNo rmalized:o .getAttrib ute("href" )==="/a",o pacity:/^0 .55/.test( o.style.op acity),css Float:!!o. style.cssF loat,check On:f.value ==="on",op tSelected: a.selected ,getSetAtt ribute:t.c lassName!= ="t",encty pe:!!r.cre ateElement ("form").e nctype,htm l5Clone:r. createElem ent("nav") .cloneNode (!0).outer HTML!=="<: nav><\/:na v>",submit Bubbles:!0 ,changeBub bles:!0,fo cusinBubbl es:!1,dele teExpando: !0,noClone Event:!0,i nlineBlock NeedsLayou t:!1,shrin kWrapBlock s:!1,relia bleMarginR ight:!0};f .checked=! 0;u.noClon eChecked=f .cloneNode (!0).check ed;l.disab led=!0;u.o ptDisabled =!a.disabl ed;try{del ete t.test }catch(b){ u.deleteEx pando=!1}i f(!t.addEv entListene r&&t.attac hEvent&&t. fireEvent& &(t.attach Event("onc lick",func tion(){u.n oCloneEven t=!1}),t.c loneNode(! 0).fireEve nt("onclic k")),f=r.c reateEleme nt("input" ),f.value= "t",f.setA ttribute(" type","rad io"),u.rad ioValue=f. value==="t ",f.setAtt ribute("ch ecked","ch ecked"),t. appendChil d(f),e=r.c reateDocum entFragmen t(),e.appe ndChild(t. lastChild) ,u.checkCl one=e.clon eNode(!0). cloneNode( !0).lastCh ild.checke d,u.append Checked=f. checked,e. removeChil d(f),e.app endChild(t ),t.innerH TML="",n.g etComputed Style&&(s= r.createEl ement("div "),s.style .width="0" ,s.style.m arginRight ="0",t.sty le.width=" 2px",t.app endChild(s ),u.reliab leMarginRi ght=(parse Int((n.get ComputedSt yle(s,null )||{margin Right:0}). marginRigh t,10)||0)= ==0),t.att achEvent)f or(p in{su bmit:1,cha nge:1,focu sin:1})v=" on"+p,h=v in t,h||(t .setAttrib ute(v,"ret urn;"),h=t ypeof t[v] =="functio n"),u[p+"B ubbles"]=h ;return e. removeChil d(t),e=l=a =s=t=f=nul l,i(functi on(){var f ,e,n,p,o,l ,a,v,y,w,s =r.getElem entsByTagN ame("body" )[0];s&&(l =1,a="posi tion:absol ute;top:0; left:0;wid th:1px;hei ght:1px;ma rgin:0;",v ="visibili ty:hidden; border:0;" ,y="style= '"+a+"bord er:5px sol id #000;pa dding:0;'" ,w="<div " +y+"><div> <\/div><\/ div><table "+y+" cel lpadding=' 0' cellspa cing='0'>< tr><td><\/ td><\/tr>< \/table>", f=r.create Element("d iv"),f.sty le.cssText =v+"width: 0;height:0 ;position: static;top :0;margin- top:"+l+"p x",s.inser tBefore(f, s.firstChi ld),t=r.cr eateElemen t("div"),f .appendChi ld(t),t.in nerHTML="< table><tr> <td style= 'padding:0 ;border:0; display:no ne'><\/td> <td>t<\/td ><\/tr><\/ table>",c= t.getEleme ntsByTagNa me("td"),h =c[0].offs etHeight== =0,c[0].st yle.displa y="",c[1]. style.disp lay="none" ,u.reliabl eHiddenOff sets=h&&c[ 0].offsetH eight===0, t.innerHTM L="",t.sty le.width=t .style.pad dingLeft=" 1px",i.box Model=u.bo xModel=t.o ffsetWidth ===2,typeo f t.style. zoom!="und efined"&&( t.style.di splay="inl ine",t.sty le.zoom=1, u.inlineBl ockNeedsLa yout=t.off setWidth== =2,t.style .display=" ",t.innerH TML="<div style='wid th:4px;'>< \/div>",u. shrinkWrap Blocks=t.o ffsetWidth !==2),t.st yle.cssTex t=a+v,t.in nerHTML=w, e=t.firstC hild,n=e.f irstChild, p=e.nextSi bling.firs tChild.fir stChild,o= {doesNotAd dBorder:n. offsetTop! ==5,doesAd dBorderFor TableAndCe lls:p.offs etTop===5} ,n.style.p osition="f ixed",n.st yle.top="2 0px",o.fix edPosition =n.offsetT op===20||n .offsetTop ===15,n.st yle.positi on=n.style .top="",e. style.over flow="hidd en",e.styl e.position ="relative ",o.subtra ctsBorderF orOverflow NotVisible =n.offsetT op===-5,o. doesNotInc ludeMargin InBodyOffs et=s.offse tTop!==l,s .removeChi ld(f),t=f= null,i.ext end(u,o))} ),u}();at= /^(?:\{.*\ }|\[.*\])$ /;vt=/([A- Z])/g;i.ex tend({cach e:{},uuid: 0,expando: "jQuery"+( i.fn.jquer y+Math.ran dom()).rep lace(/\D/g ,""),noDat a:{embed:! 0,object:" clsid:D27C DB6E-AE6D- 11cf-96B8- 4445535400 00",applet :!0},hasDa ta:functio n(n){retur n n=n.node Type?i.cac he[n[i.exp ando]]:n[i .expando], !!n&&!it(n )},data:fu nction(n,r ,u,f){if(i .acceptDat a(n)){var a,o,h,c=i. expando,v= typeof r== "string",l =n.nodeTyp e,s=l?i.ca che:n,e=l? n[c]:n[c]& &c,y=r===" events";if (e&&s[e]&& (y||f||s[e ].data)||! v||u!==t)r eturn(e||( l?n[c]=e=+ +i.uuid:e= c),s[e]||( s[e]={},l| |(s[e].toJ SON=i.noop )),(typeof r=="objec t"||typeof r=="funct ion")&&(f? s[e]=i.ext end(s[e],r ):s[e].dat a=i.extend (s[e].data ,r)),a=o=s [e],f||(o. data||(o.d ata={}),o= o.data),u! ==t&&(o[i. camelCase( r)]=u),y&& !o[r])?a.e vents:(v?( h=o[r],h== null&&(h=o [i.camelCa se(r)])):h =o,h)}},re moveData:f unction(n, t,r){if(i. acceptData (n)){var e ,s,c,o=i.e xpando,h=n .nodeType, u=h?i.cach e:n,f=h?n[ o]:o;if(u[ f]){if(t&& (e=r?u[f]: u[f].data, e)){for(i. isArray(t) ||(t in e? t=[t]:(t=i .camelCase (t),t=t in e?[t]:t.s plit(" ")) ),s=0,c=t. length;s<c ;s++)delet e e[t[s]]; if(!(r?it: i.isEmptyO bject)(e)) return}(r| |(delete u [f].data,i t(u[f])))& &(i.suppor t.deleteEx pando||!u. setInterva l?delete u [f]:u[f]=n ull,h&&(i. support.de leteExpand o?delete n [o]:n.remo veAttribut e?n.remove Attribute( o):n[o]=nu ll))}}},_d ata:functi on(n,t,r){ return i.d ata(n,t,r, !0)},accep tData:func tion(n){if (n.nodeNam e){var t=i .noData[n. nodeName.t oLowerCase ()];if(t)r eturn!(t== =!0||n.get Attribute( "classid") !==t)}retu rn!0}});i. fn.extend( {data:func tion(n,r){ var u,s,e, f=null,o,h ;if(typeof n=="undef ined"){if( this.lengt h&&(f=i.da ta(this[0] ),this[0]. nodeType== =1&&!i._da ta(this[0] ,"parsedAt trs"))){fo r(s=this[0 ].attribut es,o=0,h=s .length;o< h;o++)e=s[ o].name,e. indexOf("d ata-")===0 &&(e=i.cam elCase(e.s ubstring(5 )),yt(this [0],e,f[e] ));i._data (this[0]," parsedAttr s",!0)}ret urn f}retu rn typeof n=="object "?this.eac h(function (){i.data( this,n)}): (u=n.split ("."),u[1] =u[1]?"."+ u[1]:"",r= ==t?(f=thi s.triggerH andler("ge tData"+u[1 ]+"!",[u[0 ]]),f===t& &this.leng th&&(f=i.d ata(this[0 ],n),f=yt( this[0],n, f)),f===t& &u[1]?this .data(u[0] ):f):this. each(funct ion(){var t=i(this), f=[u[0],r] ;t.trigger Handler("s etData"+u[ 1]+"!",f); i.data(thi s,n,r);t.t riggerHand ler("chang eData"+u[1 ]+"!",f)}) )},removeD ata:functi on(n){retu rn this.ea ch(functio n(){i.remo veData(thi s,n)})}}); i.extend({ _mark:func tion(n,t){ n&&(t=(t|| "fx")+"mar k",i._data (n,t,(i._d ata(n,t)|| 0)+1))},_u nmark:func tion(n,t,r ){if(n!==! 0&&(r=t,t= n,n=!1),t) {r=r||"fx" ;var u=r+" mark",f=n? 0:(i._data (t,u)||1)- 1;f?i._dat a(t,u,f):( i.removeDa ta(t,u,!0) ,pt(t,r,"m ark"))}},q ueue:funct ion(n,t,r) {var u;if( n)return t =(t||"fx") +"queue",u =i._data(n ,t),r&&(!u ||i.isArra y(r)?u=i._ data(n,t,i .makeArray (r)):u.pus h(r)),u||[ ]},dequeue :function( n,t){t=t|| "fx";var r =i.queue(n ,t),u=r.sh ift(),f={} ;u==="inpr ogress"&&( u=r.shift( ));u&&(t== ="fx"&&r.u nshift("in progress") ,i._data(n ,t+".run", f),u.call( n,function (){i.deque ue(n,t)},f ));r.lengt h||(i.remo veData(n,t +"queue "+ t+".run",! 0),pt(n,t, "queue"))} });i.fn.ex tend({queu e:function (n,r){retu rn(typeof n!="string "&&(r=n,n= "fx"),r=== t)?i.queue (this[0],n ):this.eac h(function (){var t=i .queue(thi s,n,r);n== ="fx"&&t[0 ]!=="inpro gress"&&i. dequeue(th is,n)})},d equeue:fun ction(n){r eturn this .each(func tion(){i.d equeue(thi s,n)})},de lay:functi on(n,t){re turn n=i.f x?i.fx.spe eds[n]||n: n,t=t||"fx ",this.que ue(t,funct ion(t,i){v ar r=setTi meout(t,n) ;i.stop=fu nction(){c learTimeou t(r)}})},c learQueue: function(n ){return t his.queue( n||"fx",[] )},promise :function( n,r){funct ion c(){-- o||e.resol veWith(u,[ u])}typeof n!="strin g"&&(r=n,n =t);n=n||" fx";for(va r e=i.Defe rred(),u=t his,f=u.le ngth,o=1,s =n+"defer" ,l=n+"queu e",a=n+"ma rk",h;f--; )(h=i.data (u[f],s,t, !0)||(i.da ta(u[f],l, t,!0)||i.d ata(u[f],a ,t,!0))&&i .data(u[f] ,s,i.Callb acks("once memory"), !0))&&(o++ ,h.add(c)) ;return c( ),e.promis e()}});var wt=/[\n\t \r]/g,w=/\ s+/,dr=/\r /g,gr=/^(? :button|in put)$/i,nu =/^(?:butt on|input|o bject|sele ct|textare a)$/i,tu=/ ^a(?:rea)? $/i,bt=/^( ?:autofocu s|autoplay |async|che cked|contr ols|defer| disabled|h idden|loop |multiple| open|reado nly|requir ed|scoped| selected)$ /i,kt=i.su pport.getS etAttribut e,e,dt,gt; i.fn.exten d({attr:fu nction(n,t ){return i .access(th is,n,t,!0, i.attr)},r emoveAttr: function(n ){return t his.each(f unction(){ i.removeAt tr(this,n) })},prop:f unction(n, t){return i.access(t his,n,t,!0 ,i.prop)}, removeProp :function( n){return n=i.propFi x[n]||n,th is.each(fu nction(){t ry{this[n] =t;delete this[n]}ca tch(i){}}) },addClass :function( n){var r,f ,o,t,e,u,s ;if(i.isFu nction(n)) return thi s.each(fun ction(t){i (this).add Class(n.ca ll(this,t, this.class Name))});i f(n&&typeo f n=="stri ng")for(r= n.split(w) ,f=0,o=thi s.length;f <o;f++)if( t=this[f], t.nodeType ===1)if(t. className| |r.length! ==1){for(e =" "+t.cla ssName+" " ,u=0,s=r.l ength;u<s; u++)~e.ind exOf(" "+r [u]+" ")|| (e+=r[u]+" ");t.clas sName=i.tr im(e)}else t.classNa me=n;retur n this},re moveClass: function(n ){var o,u, s,r,f,e,h; if(i.isFun ction(n))r eturn this .each(func tion(t){i( this).remo veClass(n. call(this, t,this.cla ssName))}) ;if(n&&typ eof n=="st ring"||n== =t)for(o=( n||"").spl it(w),u=0, s=this.len gth;u<s;u+ +)if(r=thi s[u],r.nod eType===1& &r.classNa me)if(n){f or(f=(" "+ r.classNam e+" ").rep lace(wt," "),e=0,h=o .length;e< h;e++)f=f. replace(" "+o[e]+" " ," ");r.cl assName=i. trim(f)}el se r.class Name="";re turn this} ,toggleCla ss:functio n(n,t){var r=typeof n,u=typeof t=="boole an";return i.isFunct ion(n)?thi s.each(fun ction(r){i (this).tog gleClass(n .call(this ,r,this.cl assName,t) ,t)}):this .each(func tion(){if( r==="strin g")for(var f,s=0,o=i (this),e=t ,h=n.split (w);f=h[s+ +];)e=u?e: !o.hasClas s(f),o[e?" addClass": "removeCla ss"](f);el se(r==="un defined"|| r==="boole an")&&(thi s.classNam e&&i._data (this,"__c lassName__ ",this.cla ssName),th is.classNa me=this.cl assName||n ===!1?"":i ._data(thi s,"__class Name__")|| "")})},has Class:func tion(n){fo r(var i=" "+n+" ",t= 0,r=this.l ength;t<r; t++)if(thi s[t].nodeT ype===1&&( " "+this[t ].classNam e+" ").rep lace(wt," ").indexOf (i)>-1)ret urn!0;retu rn!1},val: function(n ){var r,u, e,f=this[0 ];return a rguments.l ength?(e=i .isFunctio n(n),this. each(funct ion(u){var o=i(this) ,f;this.no deType===1 &&(f=e?n.c all(this,u ,o.val()): n,f==null? f="":typeo f f=="numb er"?f+="": i.isArray( f)&&(f=i.m ap(f,funct ion(n){ret urn n==nul l?"":n+""} )),r=i.val Hooks[this .nodeName. toLowerCas e()]||i.va lHooks[thi s.type],r& &"set"in r &&r.set(th is,f,"valu e")!==t||( this.value =f))})):f? (r=i.valHo oks[f.node Name.toLow erCase()]| |i.valHook s[f.type], r&&"get"in r&&(u=r.g et(f,"valu e"))!==t)? u:(u=f.val ue,typeof u=="string "?u.replac e(dr,""):u ==null?"": u):void 0} });i.exten d({valHook s:{option: {get:funct ion(n){var t=n.attri butes.valu e;return!t ||t.specif ied?n.valu e:n.text}} ,select:{g et:functio n(n){var o ,r,h,t,u=n .selectedI ndex,s=[], f=n.option s,e=n.type ==="select -one";if(u <0)return null;for(r =e?u:0,h=e ?u+1:f.len gth;r<h;r+ +)if(t=f[r ],t.select ed&&(i.sup port.optDi sabled?!t. disabled:t .getAttrib ute("disab led")===nu ll)&&(!t.p arentNode. disabled|| !i.nodeNam e(t.parent Node,"optg roup"))){i f(o=i(t).v al(),e)ret urn o;s.pu sh(o)}retu rn e&&!s.l ength&&f.l ength?i(f[ u]).val(): s},set:fun ction(n,t) {var r=i.m akeArray(t );return i (n).find(" option").e ach(functi on(){this. selected=i .inArray(i (this).val (),r)>=0}) ,r.length| |(n.select edIndex=-1 ),r}}},att rFn:{val:! 0,css:!0,h tml:!0,tex t:!0,data: !0,width:! 0,height:! 0,offset:! 0},attr:fu nction(n,r ,u,f){var o,s,h,c=n. nodeType;i f(n&&c!==3 &&c!==8&&c !==2){if(f &&r in i.a ttrFn)retu rn i(n)[r] (u);if(typ eof n.getA ttribute== "undefined ")return i .prop(n,r, u);if(h=c! ==1||!i.is XMLDoc(n), h&&(r=r.to LowerCase( ),s=i.attr Hooks[r]|| (bt.test(r )?dt:e)),u !==t){if(u ===null){i .removeAtt r(n,r);ret urn}return s&&"set"i n s&&h&&(o =s.set(n,u ,r))!==t?o :(n.setAtt ribute(r," "+u),u)}re turn s&&"g et"in s&&h &&(o=s.get (n,r))!==n ull?o:(o=n .getAttrib ute(r),o== =null?t:o) }},removeA ttr:functi on(n,t){va r u,f,r,o, e=0;if(t&& n.nodeType ===1)for(f =t.toLower Case().spl it(w),o=f. length;e<o ;e++)r=f[e ],r&&(u=i. propFix[r] ||r,i.attr (n,r,""),n .removeAtt ribute(kt? r:u),bt.te st(r)&&u i n n&&(n[u] =!1))},att rHooks:{ty pe:{set:fu nction(n,t ){if(gr.te st(n.nodeN ame)&&n.pa rentNode)i .error("ty pe propert y can't be changed") ;else if(! i.support. radioValue &&t==="rad io"&&i.nod eName(n,"i nput")){va r r=n.valu e;return n .setAttrib ute("type" ,t),r&&(n. value=r),t }}},value: {get:funct ion(n,t){r eturn e&&i .nodeName( n,"button" )?e.get(n, t):t in n? n.value:nu ll},set:fu nction(n,t ,r){if(e&& i.nodeName (n,"button "))return e.set(n,t, r);n.value =t}}},prop Fix:{tabin dex:"tabIn dex",reado nly:"readO nly","for" :"htmlFor" ,"class":" className" ,maxlength :"maxLengt h",cellspa cing:"cell Spacing",c ellpadding :"cellPadd ing",rowsp an:"rowSpa n",colspan :"colSpan" ,usemap:"u seMap",fra meborder:" frameBorde r",content editable:" contentEdi table"},pr op:functio n(n,r,u){v ar e,f,s,o =n.nodeTyp e;if(n&&o! ==3&&o!==8 &&o!==2)re turn s=o!= =1||!i.isX MLDoc(n),s &&(r=i.pro pFix[r]||r ,f=i.propH ooks[r]),u !==t?f&&"s et"in f&&( e=f.set(n, u,r))!==t? e:n[r]=u:f &&"get"in f&&(e=f.ge t(n,r))!== null?e:n[r ]},propHoo ks:{tabInd ex:{get:fu nction(n){ var i=n.ge tAttribute Node("tabi ndex");ret urn i&&i.s pecified?p arseInt(i. value,10): nu.test(n. nodeName)| |tu.test(n .nodeName) &&n.href?0 :t}}}});i. attrHooks. tabindex=i .propHooks .tabIndex; dt={get:fu nction(n,r ){var u,f= i.prop(n,r );return f ===!0||typ eof f!="bo olean"&&(u =n.getAttr ibuteNode( r))&&u.nod eValue!==! 1?r.toLowe rCase():t} ,set:funct ion(n,t,r) {var u;ret urn t===!1 ?i.removeA ttr(n,r):( u=i.propFi x[r]||r,u in n&&(n[u ]=!0),n.se tAttribute (r,r.toLow erCase())) ,r}};kt||( gt={name:! 0,id:!0},e =i.valHook s.button={ get:functi on(n,i){va r r;return r=n.getAt tributeNod e(i),r&&(g t[i]?r.nod eValue!==" ":r.specif ied)?r.nod eValue:t}, set:functi on(n,t,i){ var u=n.ge tAttribute Node(i);re turn u||(u =r.createA ttribute(i ),n.setAtt ributeNode (u)),u.nod eValue=t+" "}},i.attr Hooks.tabi ndex.set=e .set,i.eac h(["width" ,"height"] ,function( n,t){i.att rHooks[t]= i.extend(i .attrHooks [t],{set:f unction(n, i){if(i=== "")return n.setAttri bute(t,"au to"),i}})} ),i.attrHo oks.conten teditable= {get:e.get ,set:funct ion(n,t,i) {t===""&&( t="false") ;e.set(n,t ,i)}});i.s upport.hre fNormalize d||i.each( ["href","s rc","width ","height" ],function (n,r){i.at trHooks[r] =i.extend( i.attrHook s[r],{get: function(n ){var i=n. getAttribu te(r,2);re turn i===n ull?t:i}}) });i.suppo rt.style|| (i.attrHoo ks.style={ get:functi on(n){retu rn n.style .cssText.t oLowerCase ()||t},set :function( n,t){retur n n.style. cssText="" +t}});i.su pport.optS elected||( i.propHook s.selected =i.extend( i.propHook s.selected ,{get:func tion(n){va r t=n.pare ntNode;ret urn t&&(t. selectedIn dex,t.pare ntNode&&t. parentNode .selectedI ndex),null }}));i.sup port.encty pe||(i.pro pFix.encty pe="encodi ng");i.sup port.check On||i.each (["radio", "checkbox" ],function (){i.valHo oks[this]= {get:funct ion(n){ret urn n.getA ttribute(" value")=== null?"on": n.value}}} );i.each([ "radio","c heckbox"], function() {i.valHook s[this]=i. extend(i.v alHooks[th is],{set:f unction(n, t){if(i.is Array(t))r eturn n.ch ecked=i.in Array(i(n) .val(),t)> =0}})});va r rt=/^(?: textarea|i nput|selec t)$/i,ni=/ ^([^\.]*)? (?:\.(.+)) ?$/,iu=/\b hover(\.\S +)?\b/,ru= /^key/,uu= /^(?:mouse |contextme nu)|click/ ,ti=/^(?:f ocusinfocu s|focusout blur)$/,fu =/^(\w*)(? :#([\w\-]+ ))?(?:\.([ \w\-]+))?$ /,eu=funct ion(n){var t=fu.exec (n);return t&&(t[1]= (t[1]||"") .toLowerCa se(),t[3]= t[3]&&new RegExp("(? :^|\\s)"+t [3]+"(?:\\ s|$)")),t} ,ou=functi on(n,t){va r i=n.attr ibutes||{} ;return(!t [1]||n.nod eName.toLo werCase()= ==t[1])&&( !t[2]||(i. id||{}).va lue===t[2] )&&(!t[3]| |t[3].test ((i["class "]||{}).va lue))},ii= function(n ){return i .event.spe cial.hover ?n:n.repla ce(iu,"mou seenter$1 mouseleave $1")};i.ev ent={add:f unction(n, r,u,f,e){v ar a,s,v,y ,p,o,w,l,b ,c,h;if(n. nodeType!= =3&&n.node Type!==8&& r&&u&&(a=i ._data(n)) ){for(u.ha ndler&&(b= u,u=b.hand ler),u.gui d||(u.guid =i.guid++) ,v=a.event s,v||(a.ev ents=v={}) ,s=a.handl e,s||(a.ha ndle=s=fun ction(n){r eturn type of i!="und efined"&&( !n||i.even t.triggere d!==n.type )?i.event. dispatch.a pply(s.ele m,argument s):t},s.el em=n),r=i. trim(ii(r) ).split(" "),y=0;y<r .length;y+ +)p=ni.exe c(r[y])||[ ],o=p[1],w =(p[2]||"" ).split(". ").sort(), h=i.event. special[o] ||{},o=(e? h.delegate Type:h.bin dType)||o, h=i.event. special[o] ||{},l=i.e xtend({typ e:o,origTy pe:p[1],da ta:f,handl er:u,guid: u.guid,sel ector:e,qu ick:eu(e), namespace: w.join("." )},b),c=v[ o],c||(c=v [o]=[],c.d elegateCou nt=0,h.set up&&h.setu p.call(n,f ,w,s)!==!1 ||(n.addEv entListene r?n.addEve ntListener (o,s,!1):n .attachEve nt&&n.atta chEvent("o n"+o,s))), h.add&&(h. add.call(n ,l),l.hand ler.guid|| (l.handler .guid=u.gu id)),e?c.s plice(c.de legateCoun t++,0,l):c .push(l),i .event.glo bal[o]=!0; n=null}},g lobal:{},r emove:func tion(n,t,r ,u,f){var y=i.hasDat a(n)&&i._d ata(n),l,p ,e,b,h,k,a ,v,c,w,o,s ;if(y&&(v= y.events)) {for(t=i.t rim(ii(t|| "")).split (" "),l=0; l<t.length ;l++){if(p =ni.exec(t [l])||[],e =b=p[1],h= p[2],!e){f or(e in v) i.event.re move(n,e+t [l],r,u,!0 );continue }for(c=i.e vent.speci al[e]||{}, e=(u?c.del egateType: c.bindType )||e,o=v[e ]||[],k=o. length,h=h ?new RegEx p("(^|\\.) "+h.split( ".").sort( ).join("\\ .(?:.*\\.) ?")+"(\\.| $)"):null, a=0;a<o.le ngth;a++)s =o[a],(f|| b===s.orig Type)&&(!r ||r.guid== =s.guid)&& (!h||h.tes t(s.namesp ace))&&(!u ||u===s.se lector||u= =="**"&&s. selector)& &(o.splice (a--,1),s. selector&& o.delegate Count--,c. remove&&c. remove.cal l(n,s));o. length===0 &&k!==o.le ngth&&(c.t eardown&&c .teardown. call(n,h)! ==!1||i.re moveEvent( n,e,y.hand le),delete v[e])}i.i sEmptyObje ct(v)&&(w= y.handle,w &&(w.elem= null),i.re moveData(n ,["events" ,"handle"] ,!0))}},cu stomEvent: {getData:! 0,setData: !0,changeD ata:!0},tr igger:func tion(r,u,f ,e){if(!f| |f.nodeTyp e!==3&&f.n odeType!== 8){var o=r .type||r,p =[],w,k,c, s,h,a,l,v, y,b;if(!ti .test(o+i. event.trig gered)&&(o .indexOf(" !")>=0&&(o =o.slice(0 ,-1),k=!0) ,o.indexOf (".")>=0&& (p=o.split ("."),o=p. shift(),p. sort()),f& &!i.event. customEven t[o]||i.ev ent.global [o])){if(r =typeof r= ="object"? r[i.expand o]?r:new i .Event(o,r ):new i.Ev ent(o),r.t ype=o,r.is Trigger=!0 ,r.exclusi ve=k,r.nam espace=p.j oin("."),r .namespace _re=r.name space?new RegExp("(^ |\\.)"+p.j oin("\\.(? :.*\\.)?") +"(\\.|$)" ):null,a=o .indexOf(" :")<0?"on" +o:"",!f){ w=i.cache; for(c in w )w[c].even ts&&w[c].e vents[o]&& i.event.tr igger(r,u, w[c].handl e.elem,!0) ;return}if (r.result= t,r.target ||(r.targe t=f),u=u!= null?i.mak eArray(u): [],u.unshi ft(r),l=i. event.spec ial[o]||{} ,!l.trigge r||l.trigg er.apply(f ,u)!==!1){ if(y=[[f,l .bindType| |o]],!e&&! l.noBubble &&!i.isWin dow(f)){fo r(b=l.dele gateType|| o,s=ti.tes t(b+o)?f:f .parentNod e,h=null;s ;s=s.paren tNode)y.pu sh([s,b]), h=s;h&&h== =f.ownerDo cument&&y. push([h.de faultView| |h.parentW indow||n,b ])}for(c=0 ;c<y.lengt h&&!r.isPr opagationS topped();c ++)s=y[c][ 0],r.type= y[c][1],v= (i._data(s ,"events") ||{})[r.ty pe]&&i._da ta(s,"hand le"),v&&v. apply(s,u) ,v=a&&s[a] ,v&&i.acce ptData(s)& &v.apply(s ,u)===!1&& r.preventD efault();r eturn r.ty pe=o,e||r. isDefaultP revented() ||l._defau lt&&l._def ault.apply (f.ownerDo cument,u)! ==!1||o=== "click"&&i .nodeName( f,"a")||!i .acceptDat a(f)||a&&f [o]&&(o!== "focus"&&o !=="blur"| |r.target. offsetWidt h!==0)&&!i .isWindow( f)&&(h=f[a ],h&&(f[a] =null),i.e vent.trigg ered=o,f[o ](),i.even t.triggere d=t,h&&(f[ a]=h)),r.r esult}}}}, dispatch:f unction(r) {r=i.event .fix(r||n. event);var h=(i._dat a(this,"ev ents")||{} )[r.type]| |[],c=h.de legateCoun t,b=[].sli ce.call(ar guments,0) ,k=!r.excl usive&&!r. namespace, l=[],f,a,e ,v,y,p,o,w ,u,s;if(b[ 0]=r,r.del egateTarge t=this,c&& !r.target. disabled&& !(r.button &&r.type== ="click")) for(v=i(th is),v.cont ext=this.o wnerDocume nt||this,e =r.target; e!=this;e= e.parentNo de||this){ for(p={},w =[],v[0]=e ,f=0;f<c;f ++)u=h[f], s=u.select or,p[s]=== t&&(p[s]=u .quick?ou( e,u.quick) :v.is(s)), p[s]&&w.pu sh(u);w.le ngth&&l.pu sh({elem:e ,matches:w })}for(h.l ength>c&&l .push({ele m:this,mat ches:h.sli ce(c)}),f= 0;f<l.leng th&&!r.isP ropagation Stopped(); f++)for(o= l[f],r.cur rentTarget =o.elem,a= 0;a<o.matc hes.length &&!r.isImm ediateProp agationSto pped();a++ )u=o.match es[a],(k|| !r.namespa ce&&!u.nam espace||r. namespace_ re&&r.name space_re.t est(u.name space))&&( r.data=u.d ata,r.hand leObj=u,y= ((i.event. special[u. origType]| |{}).handl e||u.handl er).apply( o.elem,b), y!==t&&(r. result=y,y ===!1&&(r. preventDef ault(),r.s topPropaga tion()))); return r.r esult},pro ps:"attrCh ange attrN ame relate dNode srcE lement alt Key bubble s cancelab le ctrlKey currentTa rget event Phase meta Key relate dTarget sh iftKey tar get timeSt amp view w hich".spli t(" "),fix Hooks:{},k eyHooks:{p rops:"char charCode key keyCod e".split(" "),filter :function( n,t){retur n n.which= =null&&(n. which=t.ch arCode!=nu ll?t.charC ode:t.keyC ode),n}},m ouseHooks: {props:"bu tton butto ns clientX clientY f romElement offsetX o ffsetY pag eX pageY s creenX scr eenY toEle ment".spli t(" "),fil ter:functi on(n,i){va r o,u,f,e= i.button,s =i.fromEle ment;retur n n.pageX= =null&&i.c lientX!=nu ll&&(o=n.t arget.owne rDocument| |r,u=o.doc umentEleme nt,f=o.bod y,n.pageX= i.clientX+ (u&&u.scro llLeft||f& &f.scrollL eft||0)-(u &&u.client Left||f&&f .clientLef t||0),n.pa geY=i.clie ntY+(u&&u. scrollTop| |f&&f.scro llTop||0)- (u&&u.clie ntTop||f&& f.clientTo p||0)),!n. relatedTar get&&s&&(n .relatedTa rget=s===n .target?i. toElement: s),n.which ||e===t||( n.which=e& 1?1:e&2?3: e&4?2:0),n }},fix:fun ction(n){i f(n[i.expa ndo])retur n n;var e, o,u=n,f=i. event.fixH ooks[n.typ e]||{},s=f .props?thi s.props.co ncat(f.pro ps):this.p rops;for(n =i.Event(u ),e=s.leng th;e;)o=s[ --e],n[o]= u[o];retur n n.target ||(n.targe t=u.srcEle ment||r),n .target.no deType===3 &&(n.targe t=n.target .parentNod e),n.metaK ey===t&&(n .metaKey=n .ctrlKey), f.filter?f .filter(n, u):n},spec ial:{ready :{setup:i. bindReady} ,load:{noB ubble:!0}, focus:{del egateType: "focusin"} ,blur:{del egateType: "focusout" },beforeun load:{setu p:function (n,t,r){i. isWindow(t his)&&(thi s.onbefore unload=r)} ,teardown: function(n ,t){this.o nbeforeunl oad===t&&( this.onbef oreunload= null)}}},s imulate:fu nction(n,t ,r,u){var f=i.extend (new i.Eve nt,r,{type :n,isSimul ated:!0,or iginalEven t:{}});u?i .event.tri gger(f,nul l,t):i.eve nt.dispatc h.call(t,f );f.isDefa ultPrevent ed()&&r.pr eventDefau lt()}};i.e vent.handl e=i.event. dispatch;i .removeEve nt=r.remov eEventList ener?funct ion(n,t,i) {n.removeE ventListen er&&n.remo veEventLis tener(t,i, !1)}:funct ion(n,t,i) {n.detachE vent&&n.de tachEvent( "on"+t,i)} ;i.Event=f unction(n, t){if(!(th is instanc eof i.Even t))return new i.Even t(n,t);n&& n.type?(th is.origina lEvent=n,t his.type=n .type,this .isDefault Prevented= n.defaultP revented|| n.returnVa lue===!1|| n.getPreve ntDefault& &n.getPrev entDefault ()?b:h):th is.type=n; t&&i.exten d(this,t); this.timeS tamp=n&&n. timeStamp| |i.now();t his[i.expa ndo]=!0};i .Event.pro totype={pr eventDefau lt:functio n(){this.i sDefaultPr evented=b; var n=this .originalE vent;n&&(n .preventDe fault?n.pr eventDefau lt():n.ret urnValue=! 1)},stopPr opagation: function() {this.isPr opagationS topped=b;v ar n=this. originalEv ent;n&&(n. stopPropag ation&&n.s topPropaga tion(),n.c ancelBubbl e=!0)},sto pImmediate Propagatio n:function (){this.is ImmediateP ropagation Stopped=b; this.stopP ropagation ()},isDefa ultPrevent ed:h,isPro pagationSt opped:h,is ImmediateP ropagation Stopped:h} ;i.each({m ouseenter: "mouseover ",mouselea ve:"mouseo ut"},funct ion(n,t){i .event.spe cial[n]={d elegateTyp e:t,bindTy pe:t,handl e:function (n){var f= this,r=n.r elatedTarg et,u=n.han dleObj,o=u .selector, e;return r &&(r===f|| i.contains (f,r))||(n .type=u.or igType,e=u .handler.a pply(this, arguments) ,n.type=t) ,e}}});i.s upport.sub mitBubbles ||(i.event .special.s ubmit={set up:functio n(){if(i.n odeName(th is,"form") )return!1; i.event.ad d(this,"cl ick._submi t keypress ._submit", function(n ){var u=n. target,r=i .nodeName( u,"input") ||i.nodeNa me(u,"butt on")?u.for m:t;r&&!r. _submit_at tached&&(i .event.add (r,"submit ._submit", function(n ){this.par entNode&&! n.isTrigge r&&i.event .simulate( "submit",t his.parent Node,n,!0) }),r._subm it_attache d=!0)})},t eardown:fu nction(){i f(i.nodeNa me(this,"f orm"))retu rn!1;i.eve nt.remove( this,"._su bmit")}}); i.support. changeBubb les||(i.ev ent.specia l.change={ setup:func tion(){if( rt.test(th is.nodeNam e))return( this.type= =="checkbo x"||this.t ype==="rad io")&&(i.e vent.add(t his,"prope rtychange. _change",f unction(n) {n.origina lEvent.pro pertyName= =="checked "&&(this._ just_chang ed=!0)}),i .event.add (this,"cli ck._change ",function (n){this._ just_chang ed&&!n.isT rigger&&(t his._just_ changed=!1 ,i.event.s imulate("c hange",thi s,n,!0))}) ),!1;i.eve nt.add(thi s,"beforea ctivate._c hange",fun ction(n){v ar t=n.tar get;rt.tes t(t.nodeNa me)&&!t._c hange_atta ched&&(i.e vent.add(t ,"change._ change",fu nction(n){ !this.pare ntNode||n. isSimulate d||n.isTri gger||i.ev ent.simula te("change ",this.par entNode,n, !0)}),t._c hange_atta ched=!0)}) },handle:f unction(n) {var t=n.t arget;if(t his!==t||n .isSimulat ed||n.isTr igger||t.t ype!=="rad io"&&t.typ e!=="check box")retur n n.handle Obj.handle r.apply(th is,argumen ts)},teard own:functi on(){retur n i.event. remove(thi s,"._chang e"),rt.tes t(this.nod eName)}}); i.support. focusinBub bles||i.ea ch({focus: "focusin", blur:"focu sout"},fun ction(n,t) {var u=0,f =function( n){i.event .simulate( t,n.target ,i.event.f ix(n),!0)} ;i.event.s pecial[t]= {setup:fun ction(){u+ +==0&&r.ad dEventList ener(n,f,! 0)},teardo wn:functio n(){--u==0 &&r.remove EventListe ner(n,f,!0 )}}});i.fn .extend({o n:function (n,r,u,f,e ){var o,s; if(typeof n=="object "){typeof r!="string "&&(u=r,r= t);for(s i n n)this.o n(s,r,u,n[ s],e);retu rn this}if (u==null&& f==null?(f =r,u=r=t): f==null&&( typeof r== "string"?( f=u,u=t):( f=u,u=r,r= t)),f===!1 )f=h;else if(!f)retu rn this;re turn e===1 &&(o=f,f=f unction(n) {return i( ).off(n),o .apply(thi s,argument s)},f.guid =o.guid||( o.guid=i.g uid++)),th is.each(fu nction(){i .event.add (this,n,f, u,r)})},on e:function (n,t,i,r){ return thi s.on.call( this,n,t,i ,r,1)},off :function( n,r,u){var f,e;if(n& &n.prevent Default&&n .handleObj )return f= n.handleOb j,i(n.dele gateTarget ).off(f.na mespace?f. type+"."+f .namespace :f.type,f. selector,f .handler), this;if(ty peof n=="o bject"){fo r(e in n)t his.off(e, r,n[e]);re turn this} return(r== =!1||typeo f r=="func tion")&&(u =r,r=t),u= ==!1&&(u=h ),this.eac h(function (){i.event .remove(th is,n,u,r)} )},bind:fu nction(n,t ,i){return this.on(n ,null,t,i) },unbind:f unction(n, t){return this.off(n ,null,t)}, live:funct ion(n,t,r) {i(this.co ntext).on( n,this.sel ector,t,r) ;return th is},die:fu nction(n,t ){return i (this.cont ext).off(n ,this.sele ctor||"**" ,t),this}, delegate:f unction(n, t,i,r){ret urn this.o n(t,n,i,r) },undelega te:functio n(n,t,i){r eturn argu ments.leng th==1?this .off(n,"** "):this.of f(t,n,i)}, trigger:fu nction(n,t ){return t his.each(f unction(){ i.event.tr igger(n,t, this)})},t riggerHand ler:functi on(n,t){if (this[0])r eturn i.ev ent.trigge r(n,t,this [0],!0)},t oggle:func tion(n){va r t=argume nts,u=n.gu id||i.guid ++,r=0,f=f unction(u) {var f=(i. _data(this ,"lastTogg le"+n.guid )||0)%r;re turn i._da ta(this,"l astToggle" +n.guid,f+ 1),u.preve ntDefault( ),t[f].app ly(this,ar guments)|| !1};for(f. guid=u;r<t .length;)t [r++].guid =u;return this.click (f)},hover :function( n,t){retur n this.mou seenter(n) .mouseleav e(t||n)}}) ;i.each("b lur focus focusin fo cusout loa d resize s croll unlo ad click d blclick mo usedown mo useup mous emove mous eover mous eout mouse enter mous eleave cha nge select submit ke ydown keyp ress keyup error con textmenu". split(" ") ,function( n,t){i.fn[ t]=functio n(n,i){ret urn i==nul l&&(i=n,n= null),argu ments.leng th>0?this. on(t,null, n,i):this. trigger(t) };i.attrFn &&(i.attrF n[t]=!0);r u.test(t)& &(i.event. fixHooks[t ]=i.event. keyHooks); uu.test(t) &&(i.event .fixHooks[ t]=i.event .mouseHook s)}); | |
| 17 | /*! | |
| 18 | * Sizzle CSS Select or Engine | |
| 19 | * Copyri ght 2011, The Dojo F oundation | |
| 20 | * Releas ed under t he MIT, BS D, and GPL Licenses. | |
| 21 | * More i nformation : http://s izzlejs.co m/ | |
| 22 | */ | |
| 23 | (function( ){function d(n,t,i,r ,u,f){for( var o,h,s= 0,c=r.leng th;s<c;s++ )if(o=r[s] ,o){for(h= !1,o=o[n]; o;){if(o[e ]===i){h=r [o.sizset] ;break}if( o.nodeType !==1||f||( o[e]=i,o.s izset=s),o .nodeName. toLowerCas e()===t){h =o;break}o =o[n]}r[s] =h}}functi on g(t,i,r ,u,f,o){fo r(var s,c, h=0,l=u.le ngth;h<l;h ++)if(s=u[ h],s){for( c=!1,s=s[t ];s;){if(s [e]===r){c =u[s.sizse t];break}i f(s.nodeTy pe===1)if( o||(s[e]=r ,s.sizset= h),typeof i!="string "){if(s=== i){c=!0;br eak}}else if(n.filte r(i,[s]).l ength>0){c =s;break}s =s[t]}u[h] =c}}var v= /((?:\((?: \([^()]+\) |[^()]+)+\ )|\[(?:\[[ ^\[\]]*\]| ['"][^'"]* ['"]|[^\[\ ]'"]+)+\]| \\.|[^ >+~ ,(\[\\]+)+ |[>+~])(\s *,\s*)?((? :.|\r|\n)* )/g,e="siz cache"+(Ma th.random( )+"").repl ace(".","" ),y=0,b=Ob ject.proto type.toStr ing,c=!1,k =!0,o=/\\/ g,nt=/\r\n /g,l=/\W/, n,s,f,a,h, w;[0,0].so rt(functio n(){return k=!1,0}); n=function (t,i,e,o){ var nt;if( e=e||[],i= i||r,nt=i, i.nodeType !==1&&i.no deType!==9 )return[]; if(!t||typ eof t!="st ring")retu rn e;var y ,a,h,g,l,p ,k,c,it=!0 ,d=n.isXML (i),s=[],r t=t;do if( v.exec("") ,y=v.exec( rt),y&&(rt =y[3],s.pu sh(y[1]),y [2])){g=y[ 3];break}w hile(y);if (s.length> 1&&tt.exec (t))if(s.l ength===2& &u.relativ e[s[0]])a= w(s[0]+s[1 ],i,o);els e for(a=u. relative[s [0]]?[i]:n (s.shift() ,i);s.leng th;)t=s.sh ift(),u.re lative[t]& &(t+=s.shi ft()),a=w( t,a,o);els e if(!o&&s .length>1& &i.nodeTyp e===9&&!d& &u.match.I D.test(s[0 ])&&!u.mat ch.ID.test (s[s.lengt h-1])&&(l= n.find(s.s hift(),i,d ),i=l.expr ?n.filter( l.expr,l.s et)[0]:l.s et[0]),i)f or(l=o?{ex pr:s.pop() ,set:f(o)} :n.find(s. pop(),s.le ngth===1&& (s[0]==="~ "||s[0]=== "+")&&i.pa rentNode?i .parentNod e:i,d),a=l .expr?n.fi lter(l.exp r,l.set):l .set,s.len gth>0?h=f( a):it=!1;s .length;)p =s.pop(),k =p,u.relat ive[p]?k=s .pop():p=" ",k==null& &(k=i),u.r elative[p] (h,k,d);el se h=s=[]; if(h||(h=a ),h||n.err or(p||t),b .call(h)== ="[object Array]")if (it)if(i&& i.nodeType ===1)for(c =0;h[c]!=n ull;c++)h[ c]&&(h[c]= ==!0||h[c] .nodeType= ==1&&n.con tains(i,h[ c]))&&e.pu sh(a[c]);e lse for(c= 0;h[c]!=nu ll;c++)h[c ]&&h[c].no deType===1 &&e.push(a [c]);else e.push.app ly(e,h);el se f(h,e); return g&& (n(g,nt,e, o),n.uniqu eSort(e)), e};n.uniqu eSort=func tion(n){if (a&&(c=k,n .sort(a),c ))for(var t=1;t<n.le ngth;t++)n [t]===n[t- 1]&&n.spli ce(t--,1); return n}; n.matches= function(t ,i){return n(t,null, null,i)};n .matchesSe lector=fun ction(t,i) {return n( i,null,nul l,[t]).len gth>0};n.f ind=functi on(n,t,i){ var f,e,c, r,s,h;if(! n)return[] ;for(e=0,c =u.order.l ength;e<c; e++)if(s=u .order[e], (r=u.leftM atch[s].ex ec(n))&&(h =r[1],r.sp lice(1,1), h.substr(h .length-1) !=="\\"&&( r[1]=(r[1] ||"").repl ace(o,""), f=u.find[s ](r,t,i),f !=null))){ n=n.replac e(u.match[ s],"");bre ak}return f||(f=type of t.getEl ementsByTa gName!="un defined"?t .getElemen tsByTagNam e("*"):[]) ,{set:f,ex pr:n}};n.f ilter=func tion(i,r,f ,e){for(va r o,h,c,l, y,b,p,a,w, k=i,v=[],s =r,d=r&&r[ 0]&&n.isXM L(r[0]);i& &r.length; ){for(c in u.filter) if((o=u.le ftMatch[c] .exec(i))! =null&&o[2 ]){if(b=u. filter[c], p=o[1],h=! 1,o.splice (1,1),p.su bstr(p.len gth-1)===" \\")contin ue;if(s=== v&&(v=[]), u.preFilte r[c])if(o= u.preFilte r[c](o,s,f ,v,e,d),o) {if(o===!0 )continue} else h=l=! 0;if(o)for (a=0;(y=s[ a])!=null; a++)y&&(l= b(y,o,a,s) ,w=e^l,f&& l!=null?w? h=!0:s[a]= !1:w&&(v.p ush(y),h=! 0));if(l!= =t){if(f|| (s=v),i=i. replace(u. match[c]," "),!h)retu rn[];break }}if(i===k )if(h==nul l)n.error( i);else br eak;k=i}re turn s};n. error=func tion(n){th row new Er ror("Synta x error, u nrecognize d expressi on: "+n);} ;var p=n.g etText=fun ction(n){v ar i,r,t=n .nodeType, u="";if(t) {if(t===1| |t===9){if (typeof n. textConten t=="string ")return n .textConte nt;if(type of n.inner Text=="str ing")retur n n.innerT ext.replac e(nt,"");f or(n=n.fir stChild;n; n=n.nextSi bling)u+=p (n)}else i f(t===3||t ===4)retur n n.nodeVa lue}else f or(i=0;r=n [i];i++)r. nodeType!= =8&&(u+=p( r));return u},u=n.se lectors={o rder:["ID" ,"NAME","T AG"],match :{ID:/#((? :[\w\u00c0 -\uFFFF\-] |\\.)+)/,C LASS:/\.(( ?:[\w\u00c 0-\uFFFF\- ]|\\.)+)/, NAME:/\[na me=['"]*(( ?:[\w\u00c 0-\uFFFF\- ]|\\.)+)[' "]*\]/,ATT R:/\[\s*(( ?:[\w\u00c 0-\uFFFF\- ]|\\.)+)\s *(?:(\S?=) \s*(?:(['" ])(.*?)\3| (#?(?:[\w\ u00c0-\uFF FF\-]|\\.) *)|)|)\s*\ ]/,TAG:/^( (?:[\w\u00 c0-\uFFFF\ *\-]|\\.)+ )/,CHILD:/ :(only|nth |last|firs t)-child(? :\(\s*(eve n|odd|(?:[ +\-]?\d+|( ?:[+\-]?\d *)?n\s*(?: [+\-]\s*\d +)?))\s*\) )?/,POS:/: (nth|eq|gt |lt|first| last|even| odd)(?:\(( \d*)\))?(? =[^\-]|$)/ ,PSEUDO:/: ((?:[\w\u0 0c0-\uFFFF \-]|\\.)+) (?:\((['"] ?)((?:\([^ \)]+\)|[^\ (\)]*)+)\2 \))?/},lef tMatch:{}, attrMap:{" class":"cl assName"," for":"html For"},attr Handle:{hr ef:functio n(n){retur n n.getAtt ribute("hr ef")},type :function( n){return n.getAttri bute("type ")}},relat ive:{"+":f unction(t, i){var f=t ypeof i==" string",e= f&&!l.test (i),o=f&&! e,u,s,r;fo r(e&&(i=i. toLowerCas e()),u=0,s =t.length; u<s;u++)if (r=t[u]){w hile((r=r. previousSi bling)&&r. nodeType!= =1);t[u]=o ||r&&r.nod eName.toLo werCase()= ==i?r||!1: r===i}o&&n .filter(i, t,!0)},">" :function( t,i){var u ,f=typeof i=="string ",r=0,o=t. length,e;i f(f&&!l.te st(i))for( i=i.toLowe rCase();r< o;r++)u=t[ r],u&&(e=u .parentNod e,t[r]=e.n odeName.to LowerCase( )===i?e:!1 );else{for (;r<o;r++) u=t[r],u&& (t[r]=f?u. parentNode :u.parentN ode===i);f &&n.filter (i,t,!0)}} ,"":functi on(n,t,i){ var r,f=y+ +,u=g;type of t!="str ing"||l.te st(t)||(t= t.toLowerC ase(),r=t, u=d);u("pa rentNode", t,f,n,r,i) },"~":func tion(n,t,i ){var r,f= y++,u=g;ty peof t!="s tring"||l. test(t)||( t=t.toLowe rCase(),r= t,u=d);u(" previousSi bling",t,f ,n,r,i)}}, find:{ID:f unction(n, t,i){if(ty peof t.get ElementByI d!="undefi ned"&&!i){ var r=t.ge tElementBy Id(n[1]);r eturn r&&r .parentNod e?[r]:[]}} ,NAME:func tion(n,t){ var r,u,i, f;if(typeo f t.getEle mentsByNam e!="undefi ned"){for( r=[],u=t.g etElements ByName(n[1 ]),i=0,f=u .length;i< f;i++)u[i] .getAttrib ute("name" )===n[1]&& r.push(u[i ]);return r.length== =0?null:r} },TAG:func tion(n,t){ if(typeof t.getEleme ntsByTagNa me!="undef ined")retu rn t.getEl ementsByTa gName(n[1] )}},preFil ter:{CLASS :function( n,t,i,r,u, f){if(n=" "+n[1].rep lace(o,"") +" ",f)ret urn n;for( var s=0,e; (e=t[s])!= null;s++)e &&(u^(e.cl assName&&( " "+e.clas sName+" ") .replace(/ [\t\n\r]/g ," ").inde xOf(n)>=0) ?i||r.push (e):i&&(t[ s]=!1));re turn!1},ID :function( n){return n[1].repla ce(o,"")}, TAG:functi on(n){retu rn n[1].re place(o,"" ).toLowerC ase()},CHI LD:functio n(t){if(t[ 1]==="nth" ){t[2]||n. error(t[0] );t[2]=t[2 ].replace( /^\+|\s*/g ,"");var i =/(-?)(\d* )(?:n([+\- ]?\d*))?/. exec(t[2]= =="even"&& "2n"||t[2] ==="odd"&& "2n+1"||!/ \D/.test(t [2])&&"0n+ "+t[2]||t[ 2]);t[2]=i [1]+(i[2]| |1)-0;t[3] =i[3]-0}el se t[2]&&n .error(t[0 ]);return t[0]=y++,t },ATTR:fun ction(n,t, i,r,f,e){v ar s=n[1]= n[1].repla ce(o,"");r eturn!e&&u .attrMap[s ]&&(n[1]=u .attrMap[s ]),n[4]=(n [4]||n[5]| |"").repla ce(o,""),n [2]==="~=" &&(n[4]=" "+n[4]+" " ),n},PSEUD O:function (t,i,r,f,e ){if(t[1]= =="not")if ((v.exec(t [3])||""). length>1|| /^\w/.test (t[3]))t[3 ]=n(t[3],n ull,null,i );else{var o=n.filte r(t[3],i,r ,!0^e);ret urn r||f.p ush.apply( f,o),!1}el se if(u.ma tch.POS.te st(t[0])|| u.match.CH ILD.test(t [0]))retur n!0;return t},POS:fu nction(n){ return n.u nshift(!0) ,n}},filte rs:{enable d:function (n){return n.disable d===!1&&n. type!=="hi dden"},dis abled:func tion(n){re turn n.dis abled===!0 },checked: function(n ){return n .checked== =!0},selec ted:functi on(n){retu rn n.paren tNode&&n.p arentNode. selectedIn dex,n.sele cted===!0} ,parent:fu nction(n){ return!!n. firstChild },empty:fu nction(n){ return!n.f irstChild} ,has:funct ion(t,i,r) {return!!n (r[3],t).l ength},hea der:functi on(n){retu rn/h\d/i.t est(n.node Name)},tex t:function (n){var t= n.getAttri bute("type "),i=n.typ e;return n .nodeName. toLowerCas e()==="inp ut"&&"text "===i&&(t= ==i||t===n ull)},radi o:function (n){return n.nodeNam e.toLowerC ase()==="i nput"&&"ra dio"===n.t ype},check box:functi on(n){retu rn n.nodeN ame.toLowe rCase()=== "input"&&" checkbox"= ==n.type}, file:funct ion(n){ret urn n.node Name.toLow erCase()== ="input"&& "file"===n .type},pas sword:func tion(n){re turn n.nod eName.toLo werCase()= =="input"& &"password "===n.type },submit:f unction(n) {var t=n.n odeName.to LowerCase( );return(t ==="input" ||t==="but ton")&&"su bmit"===n. type},imag e:function (n){return n.nodeNam e.toLowerC ase()==="i nput"&&"im age"===n.t ype},reset :function( n){var t=n .nodeName. toLowerCas e();return (t==="inpu t"||t==="b utton")&&" reset"===n .type},but ton:functi on(n){var t=n.nodeNa me.toLower Case();ret urn t==="i nput"&&"bu tton"===n. type||t=== "button"}, input:func tion(n){re turn/input |select|te xtarea|but ton/i.test (n.nodeNam e)},focus: function(n ){return n ===n.owner Document.a ctiveEleme nt}},setFi lters:{fir st:functio n(n,t){ret urn t===0} ,last:func tion(n,t,i ,r){return t===r.len gth-1},eve n:function (n,t){retu rn t%2==0} ,odd:funct ion(n,t){r eturn t%2= =1},lt:fun ction(n,t, i){return t<i[3]-0}, gt:functio n(n,t,i){r eturn t>i[ 3]-0},nth: function(n ,t,i){retu rn i[3]-0= ==t},eq:fu nction(n,t ,i){return i[3]-0=== t}},filter :{PSEUDO:f unction(t, i,r,f){var e=i[1],h= u.filters[ e],s,o,c;i f(h)return h(t,r,i,f );if(e===" contains") return(t.t extContent ||t.innerT ext||p([t] )||"").ind exOf(i[3]) >=0;if(e== ="not"){fo r(s=i[3],o =0,c=s.len gth;o<c;o+ +)if(s[o]= ==t)return !1;return! 0}n.error( e)},CHILD: function(n ,t){var r, o,s,u,h,f, c=t[1],i=n ;switch(c) {case"only ":case"fir st":while( i=i.previo usSibling) if(i.nodeT ype===1)re turn!1;if( c==="first ")return!0 ;i=n;case" last":whil e(i=i.next Sibling)if (i.nodeTyp e===1)retu rn!1;retur n!0;case"n th":if(r=t [2],o=t[3] ,r===1&&o= ==0)return !0;if(s=t[ 0],u=n.par entNode,u& &(u[e]!==s ||!n.nodeI ndex)){for (h=0,i=u.f irstChild; i;i=i.next Sibling)i. nodeType== =1&&(i.nod eIndex=++h );u[e]=s}r eturn f=n. nodeIndex- o,r===0?f= ==0:f%r==0 &&f/r>=0}} ,ID:functi on(n,t){re turn n.nod eType===1& &n.getAttr ibute("id" )===t},TAG :function( n,t){retur n t==="*"& &n.nodeTyp e===1||!!n .nodeName& &n.nodeNam e.toLowerC ase()===t} ,CLASS:fun ction(n,t) {return(" "+(n.class Name||n.ge tAttribute ("class")) +" ").inde xOf(t)>-1} ,ATTR:func tion(t,i){ var o=i[1] ,s=n.attr? n.attr(t,o ):u.attrHa ndle[o]?u. attrHandle [o](t):t[o ]!=null?t[ o]:t.getAt tribute(o) ,f=s+"",e= i[2],r=i[4 ];return s ==null?e== ="!=":!e&& n.attr?s!= null:e===" ="?f===r:e ==="*="?f. indexOf(r) >=0:e==="~ ="?(" "+f+ " ").index Of(r)>=0:r ?e==="!="? f!==r:e=== "^="?f.ind exOf(r)=== 0:e==="$=" ?f.substr( f.length-r .length)== =r:e==="|= "?f===r||f .substr(0, r.length+1 )===r+"-": !1:f&&s!== !1},POS:fu nction(n,t ,i,r){var e=t[2],f=u .setFilter s[e];if(f) return f(n ,i,t,r)}}} ,tt=u.matc h.POS,it=f unction(n, t){return" \\"+(+t+1) };for(s in u.match)u .match[s]= new RegExp (u.match[s ].source+/ (?![^\[]*\ ])(?![^\(] *\))/.sour ce),u.left Match[s]=n ew RegExp( /(^(?:.|\r |\n)*?)/.s ource+u.ma tch[s].sou rce.replac e(/\\(\d+) /g,it));f= function(n ,t){return (n=Array.p rototype.s lice.call( n,0),t)?(t .push.appl y(t,n),t): n};try{Arr ay.prototy pe.slice.c all(r.docu mentElemen t.childNod es,0)[0].n odeType}ca tch(rt){f= function(n ,t){var i= 0,r=t||[], u;if(b.cal l(n)==="[o bject Arra y]")Array. prototype. push.apply (r,n);else if(typeof n.length= ="number") for(u=n.le ngth;i<u;i ++)r.push( n[i]);else for(;n[i] ;i++)r.pus h(n[i]);re turn r}}r. documentEl ement.comp areDocumen tPosition? a=function (n,t){retu rn n===t?( c=!0,0):!n .compareDo cumentPosi tion||!t.c ompareDocu mentPositi on?n.compa reDocument Position?- 1:1:n.comp areDocumen tPosition( t)&4?-1:1} :(a=functi on(n,t){va r i;if(n== =t)return c=!0,0;if( n.sourceIn dex&&t.sou rceIndex)r eturn n.so urceIndex- t.sourceIn dex;var e, l,u=[],f=[ ],o=n.pare ntNode,s=t .parentNod e,r=o;if(o ===s)retur n h(n,t);i f(o){if(!s )return 1} else retur n-1;while( r)u.unshif t(r),r=r.p arentNode; for(r=s;r; )f.unshift (r),r=r.pa rentNode;f or(e=u.len gth,l=f.le ngth,i=0;i <e&&i<l;i+ +)if(u[i]! ==f[i])ret urn h(u[i] ,f[i]);ret urn i===e? h(n,f[i],- 1):h(u[i], t,1)},h=fu nction(n,t ,i){if(n== =t)return i;for(var r=n.nextSi bling;r;){ if(r===t)r eturn-1;r= r.nextSibl ing}return 1}),funct ion(){var n=r.create Element("d iv"),f="sc ript"+(new Date).get Time(),i=r .documentE lement;n.i nnerHTML=" <a name='" +f+"'/>";i .insertBef ore(n,i.fi rstChild); r.getEleme ntById(f)& &(u.find.I D=function (n,i,r){if (typeof i. getElement ById!="und efined"&&! r){var u=i .getElemen tById(n[1] );return u ?u.id===n[ 1]||typeof u.getAttr ibuteNode! ="undefine d"&&u.getA ttributeNo de("id").n odeValue== =n[1]?[u]: t:[]}},u.f ilter.ID=f unction(n, t){var i=t ypeof n.ge tAttribute Node!="und efined"&&n .getAttrib uteNode("i d");return n.nodeTyp e===1&&i&& i.nodeValu e===t});i. removeChil d(n);i=n=n ull}(),fun ction(){va r n=r.crea teElement( "div");n.a ppendChild (r.createC omment("") );n.getEle mentsByTag Name("*"). length>0&& (u.find.TA G=function (n,t){var i=t.getEle mentsByTag Name(n[1]) ,u,r;if(n[ 1]==="*"){ for(u=[],r =0;i[r];r+ +)i[r].nod eType===1& &u.push(i[ r]);i=u}re turn i});n .innerHTML ="<a href= '#'><\/a>" ;n.firstCh ild&&typeo f n.firstC hild.getAt tribute!=" undefined" &&n.firstC hild.getAt tribute("h ref")!=="# "&&(u.attr Handle.hre f=function (n){return n.getAttr ibute("hre f",2)});n= null}();r. querySelec torAll&&fu nction(){v ar i=n,t=r .createEle ment("div" ),o="__siz zle__",e;i f(t.innerH TML="<p cl ass='TEST' ><\/p>",!t .querySele ctorAll||t .querySele ctorAll(". TEST").len gth!==0){n =function( t,e,s,h){v ar c,l;if( e=e||r,!h& &!n.isXML( e)){if(c=/ ^(\w+$)|^\ .([\w\-]+$ )|^#([\w\- ]+$)/.exec (t),c&&(e. nodeType== =1||e.node Type===9)) {if(c[1])r eturn f(e. getElement sByTagName (t),s);if( c[2]&&u.fi nd.CLASS&& e.getEleme ntsByClass Name)retur n f(e.getE lementsByC lassName(c [2]),s)}if (e.nodeTyp e===9){if( t==="body" &&e.body)r eturn f([e .body],s); if(c&&c[3] )if(l=e.ge tElementBy Id(c[3]),l &&l.parent Node){if(l .id===c[3] )return f( [l],s)}els e return f ([],s);try {return f( e.querySel ectorAll(t ),s)}catch (b){}}else if(e.node Type===1&& e.nodeName .toLowerCa se()!=="ob ject"){var w=e,v=e.g etAttribut e("id"),a= v||o,y=e.p arentNode, p=/^\s*[+~ ]/.test(t) ;v?a=a.rep lace(/'/g, "\\$&"):e. setAttribu te("id",a) ;p&&y&&(e= e.parentNo de);try{if (!p||y)ret urn f(e.qu erySelecto rAll("[id= '"+a+"'] " +t),s)}cat ch(k){}fin ally{v||w. removeAttr ibute("id" )}}}return i(t,e,s,h )};for(e i n i)n[e]=i [e];t=null }}(),funct ion(){var t=r.docume ntElement, i=t.matche sSelector| |t.mozMatc hesSelecto r||t.webki tMatchesSe lector||t. msMatchesS elector,e, f;if(i){e= !i.call(r. createElem ent("div") ,"div");f= !1;try{i.c all(r.docu mentElemen t,"[test!= '']:sizzle ")}catch(o ){f=!0}n.m atchesSele ctor=funct ion(t,r){i f(r=r.repl ace(/\=\s* ([^'"\]]*) \s*\]/g,"= '$1']"),!n .isXML(t)) try{if(f|| !u.match.P SEUDO.test (r)&&!/!=/ .test(r)){ var o=i.ca ll(t,r);if (o||!e||t. document&& t.document .nodeType! ==11)retur n o}}catch (s){}retur n n(r,null ,null,[t]) .length>0} }}(),funct ion(){var n=r.create Element("d iv");(n.in nerHTML="< div class= 'test e'>< \/div><div class='te st'><\/div >",n.getEl ementsByCl assName&&n .getElemen tsByClassN ame("e").l ength!==0) &&(n.lastC hild.class Name="e",n .getElemen tsByClassN ame("e").l ength!==1) &&(u.order .splice(1, 0,"CLASS") ,u.find.CL ASS=functi on(n,t,i){ if(typeof t.getEleme ntsByClass Name!="und efined"&&! i)return t .getElemen tsByClassN ame(n[1])} ,n=null)}( );n.contai ns=r.docum entElement .contains? function(n ,t){return n!==t&&(n .contains? n.contains (t):!0)}:r .documentE lement.com pareDocume ntPosition ?function( n,t){retur n!!(n.comp areDocumen tPosition( t)&16)}:fu nction(){r eturn!1};n .isXML=fun ction(n){v ar t=(n?n. ownerDocum ent||n:0). documentEl ement;retu rn t?t.nod eName!=="H TML":!1};w =function( t,i,r){for (var e,o=[ ],s="",h=i .nodeType? [i]:i,f,c; e=u.match. PSEUDO.exe c(t);)s+=e [0],t=t.re place(u.ma tch.PSEUDO ,"");for(t =u.relativ e[t]?t+"*" :t,f=0,c=h .length;f< c;f++)n(t, h[f],o,r); return n.f ilter(s,o) };n.attr=i .attr;n.se lectors.at trMap={};i .find=n;i. expr=n.sel ectors;i.e xpr[":"]=i .expr.filt ers;i.uniq ue=n.uniqu eSort;i.te xt=n.getTe xt;i.isXML Doc=n.isXM L;i.contai ns=n.conta ins})();va r su=/Unti l$/,hu=/^( ?:parents| prevUntil| prevAll)/, cu=/,/,lu= /^.[^:#\[\ .,]*$/,au= Array.prot otype.slic e,ri=i.exp r.match.PO S,vu={chil dren:!0,co ntents:!0, next:!0,pr ev:!0};i.f n.extend({ find:funct ion(n){var s=this,t, f,r,o,u,e; if(typeof n!="string ")return i (n).filter (function( ){for(t=0, f=s.length ;t<f;t++)i f(i.contai ns(s[t],th is))return !0});for(r =this.push Stack(""," find",n),t =0,f=this. length;t<f ;t++)if(o= r.length,i .find(n,th is[t],r),t >0)for(u=o ;u<r.lengt h;u++)for( e=0;e<o;e+ +)if(r[e]= ==r[u]){r. splice(u-- ,1);break} return r}, has:functi on(n){var t=i(n);ret urn this.f ilter(func tion(){for (var n=0,r =t.length; n<r;n++)if (i.contain s(this,t[n ]))return! 0})},not:f unction(n) {return th is.pushSta ck(fi(this ,n,!1),"no t",n)},fil ter:functi on(n){retu rn this.pu shStack(fi (this,n,!0 ),"filter" ,n)},is:fu nction(n){ return!!n& &(typeof n =="string" ?ri.test(n )?i(n,this .context). index(this [0])>=0:i. filter(n,t his).lengt h>0:this.f ilter(n).l ength>0)}, closest:fu nction(n,t ){var f=[] ,u,s,r=thi s[0],e,o;i f(i.isArra y(n)){for( e=1;r&&r.o wnerDocume nt&&r!==t; ){for(u=0; u<n.length ;u++)i(r). is(n[u])&& f.push({se lector:n[u ],elem:r,l evel:e});r =r.parentN ode;e++}re turn f}for (o=ri.test (n)||typeo f n!="stri ng"?i(n,t| |this.cont ext):0,u=0 ,s=this.le ngth;u<s;u ++)for(r=t his[u];r;) if(o?o.ind ex(r)>-1:i .find.matc hesSelecto r(r,n)){f. push(r);br eak}else i f(r=r.pare ntNode,!r| |!r.ownerD ocument||r ===t||r.no deType===1 1)break;re turn f=f.l ength>1?i. unique(f): f,this.pus hStack(f," closest",n )},index:f unction(n) {return n? typeof n== "string"?i .inArray(t his[0],i(n )):i.inArr ay(n.jquer y?n[0]:n,t his):this[ 0]&&this[0 ].parentNo de?this.pr evAll().le ngth:-1},a dd:functio n(n,t){var u=typeof n=="string "?i(n,t):i .makeArray (n&&n.node Type?[n]:n ),r=i.merg e(this.get (),u);retu rn this.pu shStack(ui (u[0])||ui (r[0])?r:i .unique(r) )},andSelf :function( ){return t his.add(th is.prevObj ect)}});i. each({pare nt:functio n(n){var t =n.parentN ode;return t&&t.node Type!==11? t:null},pa rents:func tion(n){re turn i.dir (n,"parent Node")},pa rentsUntil :function( n,t,r){ret urn i.dir( n,"parentN ode",r)},n ext:functi on(n){retu rn i.nth(n ,2,"nextSi bling")},p rev:functi on(n){retu rn i.nth(n ,2,"previo usSibling" )},nextAll :function( n){return i.dir(n,"n extSibling ")},prevAl l:function (n){return i.dir(n," previousSi bling")},n extUntil:f unction(n, t,r){retur n i.dir(n, "nextSibli ng",r)},pr evUntil:fu nction(n,t ,r){return i.dir(n," previousSi bling",r)} ,siblings: function(n ){return i .sibling(n .parentNod e.firstChi ld,n)},chi ldren:func tion(n){re turn i.sib ling(n.fir stChild)}, contents:f unction(n) {return i. nodeName(n ,"iframe") ?n.content Document|| n.contentW indow.docu ment:i.mak eArray(n.c hildNodes) }},functio n(n,t){i.f n[n]=funct ion(r,u){v ar f=i.map (this,t,r) ;return su .test(n)|| (u=r),u&&t ypeof u==" string"&&( f=i.filter (u,f)),f=t his.length >1&&!vu[n] ?i.unique( f):f,(this .length>1| |cu.test(u ))&&hu.tes t(n)&&(f=f .reverse() ),this.pus hStack(f,n ,au.call(a rguments). join(",")) }});i.exte nd({filter :function( n,t,r){ret urn r&&(n= ":not("+n+ ")"),t.len gth===1?i. find.match esSelector (t[0],n)?[ t[0]]:[]:i .find.matc hes(n,t)}, dir:functi on(n,r,u){ for(var e= [],f=n[r]; f&&f.nodeT ype!==9&&( u===t||f.n odeType!== 1||!i(f).i s(u));)f.n odeType=== 1&&e.push( f),f=f[r]; return e}, nth:functi on(n,t,i){ t=t||1;for (var r=0;n ;n=n[i])if (n.nodeTyp e===1&&++r ===t)break ;return n} ,sibling:f unction(n, t){for(var i=[];n;n= n.nextSibl ing)n.node Type===1&& n!==t&&i.p ush(n);ret urn i}});v ar oi="abb r|article| aside|audi o|canvas|d atalist|de tails|figc aption|fig ure|footer |header|hg roup|mark| meter|nav| output|pro gress|sect ion|summar y|time|vid eo",yu=/ j Query\d+=" (?:\d+|nul l)"/g,ut=/ ^\s+/,si=/ <(?!area|b r|col|embe d|hr|img|i nput|link| meta|param )(([\w:]+) [^>]*)\/>/ ig,hi=/<([ \w:]+)/,pu =/<tbody/i ,wu=/<|&#? \w+;/,bu=/ <(?:script |style)/i, ku=/<(?:sc ript|objec t|embed|op tion|style )/i,ci=new RegExp("< (?:"+oi+") ","i"),li= /checked\s *(?:[^=]|= \s*.checke d.)/i,du=/ \/(java|ec ma)script/ i,gu=/^\s* <!(?:\[CDA TA\[|\-\-) /,u={optio n:[1,"<sel ect multip le='multip le'>","<\/ select>"], legend:[1, "<fieldset >","<\/fie ldset>"],t head:[1,"< table>","< \/table>"] ,tr:[2,"<t able><tbod y>","<\/tb ody><\/tab le>"],td:[ 3,"<table> <tbody><tr >","<\/tr> <\/tbody>< \/table>"] ,col:[2,"< table><tbo dy><\/tbod y><colgrou p>","<\/co lgroup><\/ table>"],a rea:[1,"<m ap>","<\/m ap>"],_def ault:[0,"" ,""]},ai=e i(r);u.opt group=u.op tion;u.tbo dy=u.tfoot =u.colgrou p=u.captio n=u.thead; u.th=u.td; i.support. htmlSerial ize||(u._d efault=[1, "div<div>" ,"<\/div>" ]);i.fn.ex tend({text :function( n){return i.isFuncti on(n)?this .each(func tion(t){va r r=i(this );r.text(n .call(this ,t,r.text( )))}):type of n!="obj ect"&&n!== t?this.emp ty().appen d((this[0] &&this[0]. ownerDocum ent||r).cr eateTextNo de(n)):i.t ext(this)} ,wrapAll:f unction(n) {if(i.isFu nction(n)) return thi s.each(fun ction(t){i (this).wra pAll(n.cal l(this,t)) });if(this [0]){var t =i(n,this[ 0].ownerDo cument).eq (0).clone( !0);this[0 ].parentNo de&&t.inse rtBefore(t his[0]);t. map(functi on(){for(v ar n=this; n.firstChi ld&&n.firs tChild.nod eType===1; )n=n.first Child;retu rn n}).app end(this)} return thi s},wrapInn er:functio n(n){retur n i.isFunc tion(n)?th is.each(fu nction(t){ i(this).wr apInner(n. call(this, t))}):this .each(func tion(){var t=i(this) ,r=t.conte nts();r.le ngth?r.wra pAll(n):t. append(n)} )},wrap:fu nction(n){ var t=i.is Function(n );return t his.each(f unction(r) {i(this).w rapAll(t?n .call(this ,r):n)})}, unwrap:fun ction(){re turn this. parent().e ach(functi on(){i.nod eName(this ,"body")|| i(this).re placeWith( this.child Nodes)}).e nd()},appe nd:functio n(){return this.domM anip(argum ents,!0,fu nction(n){ this.nodeT ype===1&&t his.append Child(n)}) },prepend: function() {return th is.domMani p(argument s,!0,funct ion(n){thi s.nodeType ===1&&this .insertBef ore(n,this .firstChil d)})},befo re:functio n(){if(thi s[0]&&this [0].parent Node)retur n this.dom Manip(argu ments,!1,f unction(n) {this.pare ntNode.ins ertBefore( n,this)}); if(argumen ts.length) {var n=i.c lean(argum ents);retu rn n.push. apply(n,th is.toArray ()),this.p ushStack(n ,"before", arguments) }},after:f unction(){ if(this[0] &&this[0]. parentNode )return th is.domMani p(argument s,!1,funct ion(n){thi s.parentNo de.insertB efore(n,th is.nextSib ling)});if (arguments .length){v ar n=this. pushStack( this,"afte r",argumen ts);return n.push.ap ply(n,i.cl ean(argume nts)),n}}, remove:fun ction(n,t) {for(var u =0,r;(r=th is[u])!=nu ll;u++)(!n ||i.filter (n,[r]).le ngth)&&(t| |r.nodeTyp e!==1||(i. cleanData( r.getEleme ntsByTagNa me("*")),i .cleanData ([r])),r.p arentNode& &r.parentN ode.remove Child(r)); return thi s},empty:f unction(){ for(var t= 0,n;(n=thi s[t])!=nul l;t++)for( n.nodeType ===1&&i.cl eanData(n. getElement sByTagName ("*"));n.f irstChild; )n.removeC hild(n.fir stChild);r eturn this },clone:fu nction(n,t ){return n =n==null?! 1:n,t=t==n ull?n:t,th is.map(fun ction(){re turn i.clo ne(this,n, t)})},html :function( n){if(n=== t)return t his[0]&&th is[0].node Type===1?t his[0].inn erHTML.rep lace(yu,"" ):null;if( typeof n!= "string"|| bu.test(n) ||!i.suppo rt.leading Whitespace &&ut.test( n)||u[(hi. exec(n)||[ "",""])[1] .toLowerCa se()])i.is Function(n )?this.eac h(function (t){var r= i(this);r. html(n.cal l(this,t,r .html()))} ):this.emp ty().appen d(n);else{ n=n.replac e(si,"<$1> <\/$2>");t ry{for(var r=0,f=thi s.length;r <f;r++)thi s[r].nodeT ype===1&&( i.cleanDat a(this[r]. getElement sByTagName ("*")),thi s[r].inner HTML=n)}ca tch(e){thi s.empty(). append(n)} }return th is},replac eWith:func tion(n){re turn this[ 0]&&this[0 ].parentNo de?i.isFun ction(n)?t his.each(f unction(t) {var r=i(t his),u=r.h tml();r.re placeWith( n.call(thi s,t,u))}): (typeof n! ="string"& &(n=i(n).d etach()),t his.each(f unction(){ var t=this .nextSibli ng,r=this. parentNode ;i(this).r emove();t? i(t).befor e(n):i(r). append(n)} )):this.le ngth?this. pushStack( i(i.isFunc tion(n)?n( ):n),"repl aceWith",n ):this},de tach:funct ion(n){ret urn this.r emove(n,!0 )},domMani p:function (n,r,u){va r c,h,f,o, e=n[0],l=[ ];if(!i.su pport.chec kClone&&ar guments.le ngth===3&& typeof e== "string"&& li.test(e) )return th is.each(fu nction(){i (this).dom Manip(n,r, u,!0)});if (i.isFunct ion(e))ret urn this.e ach(functi on(f){var o=i(this); n[0]=e.cal l(this,f,r ?o.html(): t);o.domMa nip(n,r,u) });if(this [0]){if(o= e&&e.paren tNode,c=i. support.pa rentNode&& o&&o.nodeT ype===11&& o.childNod es.length= ==this.len gth?{fragm ent:o}:i.b uildFragme nt(n,this, l),f=c.fra gment,h=f. childNodes .length=== 1?f=f.firs tChild:f.f irstChild, h){r=r&&i. nodeName(h ,"tr");for (var s=0,a =this.leng th,v=a-1;s <a;s++)u.c all(r?nf(t his[s],h): this[s],c. cacheable| |a>1&&s<v? i.clone(f, !0,!0):f)} l.length&& i.each(l,r f)}return this}});i. buildFragm ent=functi on(n,t,u){ var e,h,s, o,f=n[0];r eturn t&&t [0]&&(o=t[ 0].ownerDo cument||t[ 0]),o.crea teDocument Fragment|| (o=r),n.le ngth===1&& typeof f== "string"&& f.length<5 12&&o===r& &f.charAt( 0)==="<"&& !ku.test(f )&&(i.supp ort.checkC lone||!li. test(f))&& (i.support .html5Clon e||!ci.tes t(f))&&(h= !0,s=i.fra gments[f], s&&s!==1&& (e=s)),e|| (e=o.creat eDocumentF ragment(), i.clean(n, o,e,u)),h& &(i.fragme nts[f]=s?e :1),{fragm ent:e,cach eable:h}}; i.fragment s={};i.eac h({appendT o:"append" ,prependTo :"prepend" ,insertBef ore:"befor e",insertA fter:"afte r",replace All:"repla ceWith"},f unction(n, t){i.fn[n] =function( r){var e=[ ],u=i(r),o =this.leng th===1&&th is[0].pare ntNode,f,h ,s;if(o&&o .nodeType= ==11&&o.ch ildNodes.l ength===1& &u.length= ==1)return u[t](this [0]),this; for(f=0,h= u.length;f <h;f++)s=( f>0?this.c lone(!0):t his).get() ,i(u[f])[t ](s),e=e.c oncat(s);r eturn this .pushStack (e,n,u.sel ector)}}); i.extend({ clone:func tion(n,t,r ){var f,e, u,o=i.supp ort.html5C lone||!ci. test("<"+n .nodeName) ?n.cloneNo de(!0):tf( n);if((!i. support.no CloneEvent ||!i.suppo rt.noClone Checked)&& (n.nodeTyp e===1||n.n odeType=== 11)&&!i.is XMLDoc(n)) for(yi(n,o ),f=k(n),e =k(o),u=0; f[u];++u)e [u]&&yi(f[ u],e[u]);i f(t&&(vi(n ,o),r))for (f=k(n),e= k(o),u=0;f [u];++u)vi (f[u],e[u] );return f =e=null,o} ,clean:fun ction(n,t, f,e){var p ,s,c,h,o,y ,a,b,k;for (t=t||r,ty peof t.cre ateElement =="undefin ed"&&(t=t. ownerDocum ent||t[0]& &t[0].owne rDocument| |r),s=[],h =0;(o=n[h] )!=null;h+ +)if(typeo f o=="numb er"&&(o+=" "),o){if(t ypeof o==" string")if (wu.test(o )){o=o.rep lace(si,"< $1><\/$2>" );var w=(h i.exec(o)| |["",""])[ 1].toLower Case(),v=u [w]||u._de fault,d=v[ 0],l=t.cre ateElement ("div");fo r(t===r?ai .appendChi ld(l):ei(t ).appendCh ild(l),l.i nnerHTML=v [1]+o+v[2] ;d--;)l=l. lastChild; if(!i.supp ort.tbody) for(y=pu.t est(o),a=w ==="table" &&!y?l.fir stChild&&l .firstChil d.childNod es:v[1]=== "<table>"& &!y?l.chil dNodes:[], c=a.length -1;c>=0;-- c)i.nodeNa me(a[c],"t body")&&!a [c].childN odes.lengt h&&a[c].pa rentNode.r emoveChild (a[c]);!i. support.le adingWhite space&&ut. test(o)&&l .insertBef ore(t.crea teTextNode (ut.exec(o )[0]),l.fi rstChild); o=l.childN odes}else o=t.create TextNode(o );if(!i.su pport.appe ndChecked) if(o[0]&&t ypeof(b=o. length)==" number")fo r(c=0;c<b; c++)wi(o[c ]);else wi (o);o.node Type?s.pus h(o):s=i.m erge(s,o)} if(f)for(p =function( n){return! n.type||du .test(n.ty pe)},h=0;s [h];h++)e& &i.nodeNam e(s[h],"sc ript")&&(! s[h].type| |s[h].type .toLowerCa se()==="te xt/javascr ipt")?e.pu sh(s[h].pa rentNode?s [h].parent Node.remov eChild(s[h ]):s[h]):( s[h].nodeT ype===1&&( k=i.grep(s [h].getEle mentsByTag Name("scri pt"),p),s. splice.app ly(s,[h+1, 0].concat( k))),f.app endChild(s [h]));retu rn s},clea nData:func tion(n){fo r(var f,r, u,e=i.cach e,s=i.even t.special, h=i.suppor t.deleteEx pando,o=0, t;(t=n[o]) !=null;o++ )if((!t.no deName||!i .noData[t. nodeName.t oLowerCase ()])&&(u=t [i.expando ],u)){if(r =e[u],r&&r .events){f or(f in r. events)s[f ]?i.event. remove(t,f ):i.remove Event(t,f, r.handle); r.handle&& (r.handle. elem=null) }h?delete t[i.expand o]:t.remov eAttribute &&t.remove Attribute( i.expando) ;delete e[ u]}}});var ft=/alpha \([^)]*\)/ i,uf=/opac ity=([^)]* )/,ff=/([A -Z]|^ms)/g ,bi=/^-?\d +(?:px)?$/ i,ef=/^-?\ d/,of=/^([ \-+])=([\- +.\de]+)/, sf={positi on:"absolu te",visibi lity:"hidd en",displa y:"block"} ,hf=["Left ","Right"] ,cf=["Top" ,"Bottom"] ,c,ki,di;i .fn.css=fu nction(n,r ){return a rguments.l ength===2& &r===t?thi s:i.access (this,n,r, !0,functio n(n,r,u){r eturn u!== t?i.style( n,r,u):i.c ss(n,r)})} ;i.extend( {cssHooks: {opacity:{ get:functi on(n,t){if (t){var i= c(n,"opaci ty","opaci ty");retur n i===""?" 1":i}retur n n.style. opacity}}} ,cssNumber :{fillOpac ity:!0,fon tWeight:!0 ,lineHeigh t:!0,opaci ty:!0,orph ans:!0,wid ows:!0,zIn dex:!0,zoo m:!0},cssP rops:{floa t:i.suppor t.cssFloat ?"cssFloat ":"styleFl oat"},styl e:function (n,r,u,f){ if(n&&n.no deType!==3 &&n.nodeTy pe!==8&&n. style){var o,s,h=i.c amelCase(r ),c=n.styl e,e=i.cssH ooks[h];if (r=i.cssPr ops[h]||h, u!==t){if( s=typeof u ,s==="stri ng"&&(o=of .exec(u))& &(u=+(o[1] +1)*+o[2]+ parseFloat (i.css(n,r )),s="numb er"),u==nu ll||s==="n umber"&&is NaN(u))ret urn;if(s!= ="number"| |i.cssNumb er[h]||(u+ ="px"),!e| |!("set"in e)||(u=e. set(n,u))! ==t)try{c[ r]=u}catch (l){}}else return e& &"get"in e &&(o=e.get (n,!1,f))! ==t?o:c[r] }},css:fun ction(n,r, u){var e,f ;return(r= i.camelCas e(r),f=i.c ssHooks[r] ,r=i.cssPr ops[r]||r, r==="cssFl oat"&&(r=" float"),f& &"get"in f &&(e=f.get (n,!0,u))! ==t)?e:c?c (n,r):void 0},swap:f unction(n, t,i){var u ={};for(va r r in t)u [r]=n.styl e[r],n.sty le[r]=t[r] ;i.call(n) ;for(r in t)n.style[ r]=u[r]}}) ;i.curCSS= i.css;i.ea ch(["heigh t","width" ],function (n,t){i.cs sHooks[t]= {get:funct ion(n,r,u) {var f;if( r)return n .offsetWid th!==0?gi( n,t,u):(i. swap(n,sf, function() {f=gi(n,t, u)}),f)},s et:functio n(n,t){if( bi.test(t) ){if(t=par seFloat(t) ,t>=0)retu rn t+"px"} else retur n t}}});i. support.op acity||(i. cssHooks.o pacity={ge t:function (n,t){retu rn uf.test ((t&&n.cur rentStyle? n.currentS tyle.filte r:n.style. filter)||" ")?parseFl oat(RegExp .$1)/100+" ":t?"1":"" },set:func tion(n,t){ var r=n.st yle,u=n.cu rrentStyle ,e=i.isNum eric(t)?"a lpha(opaci ty="+t*100 +")":"",f= u&&u.filte r||r.filte r||"";(r.z oom=1,t>=1 &&i.trim(f .replace(f t,""))===" "&&(r.remo veAttribut e("filter" ),u&&!u.fi lter))||(r .filter=ft .test(f)?f .replace(f t,e):f+" " +e)}});i(f unction(){ i.support. reliableMa rginRight| |(i.cssHoo ks.marginR ight={get: function(n ,t){var r; return i.s wap(n,{dis play:"inli ne-block"} ,function( ){r=t?c(n, "margin-ri ght","marg inRight"): n.style.ma rginRight} ),r}})});r .defaultVi ew&&r.defa ultView.ge tComputedS tyle&&(ki= function(n ,t){var r, u,f;return t=t.repla ce(ff,"-$1 ").toLower Case(),(u= n.ownerDoc ument.defa ultView)&& (f=u.getCo mputedStyl e(n,null)) &&(r=f.get PropertyVa lue(t),r!= =""||i.con tains(n.ow nerDocumen t.document Element,n) ||(r=i.sty le(n,t))), r});r.docu mentElemen t.currentS tyle&&(di= function(n ,t){var f, u,e,i=n.cu rrentStyle &&n.curren tStyle[t], r=n.style; return i== =null&&r&& (e=r[t])&& (i=e),!bi. test(i)&&e f.test(i)& &(f=r.left ,u=n.runti meStyle&&n .runtimeSt yle.left,u &&(n.runti meStyle.le ft=n.curre ntStyle.le ft),r.left =t==="font Size"?"1em ":i||0,i=r .pixelLeft +"px",r.le ft=f,u&&(n .runtimeSt yle.left=u )),i===""? "auto":i}) ;c=ki||di; i.expr&&i. expr.filte rs&&(i.exp r.filters. hidden=fun ction(n){v ar t=n.off setWidth,r =n.offsetH eight;retu rn t===0&& r===0||!i. support.re liableHidd enOffsets& &(n.style& &n.style.d isplay||i. css(n,"dis play"))=== "none"},i. expr.filte rs.visible =function( n){return! i.expr.fil ters.hidde n(n)});var lf=/%20/g ,af=/\[\]$ /,nr=/\r?\ n/g,vf=/#. *$/,yf=/^( .*?):[ \t] *([^\r\n]* )\r?$/mg,p f=/^(?:col or|date|da tetime|dat etime-loca l|email|hi dden|month |number|pa ssword|ran ge|search| tel|text|t ime|url|we ek)$/i,wf= /^(?:GET|H EAD)$/,bf= /^\/\//,tr =/\?/,kf=/ <script\b[ ^<]*(?:(?! <\/script> )<[^<]*)*< \/script>/ gi,df=/^(? :select|te xtarea)/i, ir=/\s+/,g f=/([?&])_ =[^&]*/,rr =/^([\w\+\ .\-]+:)(?: \/\/([^\/? #:]*)(?::( \d+))?)?/, ur=i.fn.lo ad,et={},f r={},o,s,e r=["*/"]+[ "*"];try{o =br.href}c atch(ee){o =r.createE lement("a" );o.href=" ";o=o.href }s=rr.exec (o.toLower Case())||[ ];i.fn.ext end({load: function(n ,r,u){var f,e,o,s;re turn typeo f n!="stri ng"&&ur?ur .apply(thi s,argument s):this.le ngth?(f=n. indexOf(" "),f>=0&&( e=n.slice( f,n.length ),n=n.slic e(0,f)),o= "GET",r&&( i.isFuncti on(r)?(u=r ,r=t):type of r=="obj ect"&&(r=i .param(r,i .ajaxSetti ngs.tradit ional),o=" POST")),s= this,i.aja x({url:n,t ype:o,data Type:"html ",data:r,c omplete:fu nction(n,t ,r){r=n.re sponseText ;n.isResol ved()&&(n. done(funct ion(n){r=n }),s.html( e?i("<div> ").append( r.replace( kf,"")).fi nd(e):r)); u&&s.each( u,[r,t,n]) }}),this): this},seri alize:func tion(){ret urn i.para m(this.ser ializeArra y())},seri alizeArray :function( ){return t his.map(fu nction(){r eturn this .elements? i.makeArra y(this.ele ments):thi s}).filter (function( ){return t his.name&& !this.disa bled&&(thi s.checked| |df.test(t his.nodeNa me)||pf.te st(this.ty pe))}).map (function( n,t){var r =i(this).v al();retur n r==null? null:i.isA rray(r)?i. map(r,func tion(n){re turn{name: t.name,val ue:n.repla ce(nr,"\r\ n")}}):{na me:t.name, value:r.re place(nr," \r\n")}}). get()}});i .each("aja xStart aja xStop ajax Complete a jaxError a jaxSuccess ajaxSend" .split(" " ),function (n,t){i.fn [t]=functi on(n){retu rn this.on (t,n)}});i .each(["ge t","post"] ,function( n,r){i[r]= function(n ,u,f,e){re turn i.isF unction(u) &&(e=e||f, f=u,u=t),i .ajax({typ e:r,url:n, data:u,suc cess:f,dat aType:e})} });i.exten d({getScri pt:functio n(n,r){ret urn i.get( n,t,r,"scr ipt")},get JSON:funct ion(n,t,r) {return i. get(n,t,r, "json")},a jaxSetup:f unction(n, t){return t?sr(n,i.a jaxSetting s):(t=n,n= i.ajaxSett ings),sr(n ,t),n},aja xSettings: {url:o,isL ocal:/^(?: about|app| app\-stora ge|.+\-ext ension|fil e|res|widg et):$/.tes t(s[1]),gl obal:!0,ty pe:"GET",c ontentType :"applicat ion/x-www- form-urlen coded",pro cessData:! 0,async:!0 ,accepts:{ xml:"appli cation/xml , text/xml ",html:"te xt/html",t ext:"text/ plain",jso n:"applica tion/json, text/java script","* ":er},cont ents:{xml: /xml/,html :/html/,js on:/json/} ,responseF ields:{xml :"response XML",text: "responseT ext"},conv erters:{"* text":n.S tring,"tex t html":!0 ,"text jso n":i.parse JSON,"text xml":i.pa rseXML},fl atOptions: {context:! 0,url:!0}} ,ajaxPrefi lter:or(et ),ajaxTran sport:or(f r),ajax:fu nction(n,r ){function w(n,r,s,l ){if(e!==2 ){e=2;nt&& clearTimeo ut(nt);c=t ;g=l||"";f .readyStat e=n>0?4:0; var p,d,w, a=r,ut=s?n e(u,f,s):t ,tt,it;if( n>=200&&n< 300||n===3 04)if(u.if Modified&& ((tt=f.get ResponseHe ader("Last -Modified" ))&&(i.las tModified[ o]=tt),(it =f.getResp onseHeader ("Etag"))& &(i.etag[o ]=it)),n== =304)a="no tmodified" ,p=!0;else try{d=te( u,ut);a="s uccess";p= !0}catch(f t){a="pars ererror";w =ft}else w =a,(!a||n) &&(a="erro r",n<0&&(n =0));f.sta tus=n;f.st atusText=" "+(r||a);p ?k.resolve With(h,[d, a,f]):k.re jectWith(h ,[f,a,w]); f.statusCo de(y);y=t; v&&b.trigg er("ajax"+ (p?"Succes s":"Error" ),[f,u,p?d :w]);rt.fi reWith(h,[ f,a]);v&&( b.trigger( "ajaxCompl ete",[f,u] ),--i.acti ve||i.even t.trigger( "ajaxStop" ))}}var tt ,it;typeof n=="objec t"&&(r=n,n =t);r=r||{ };var u=i. ajaxSetup( {},r),h=u. context||u ,b=h!==u&& (h.nodeTyp e||h insta nceof i)?i (h):i.even t,k=i.Defe rred(),rt= i.Callback s("once me mory"),y=u .statusCod e||{},o,ut ={},ft={}, g,p,c,nt,l ,e=0,v,a,f ={readySta te:0,setRe questHeade r:function (n,t){if(! e){var i=n .toLowerCa se();n=ft[ i]=ft[i]|| n;ut[n]=t} return thi s},getAllR esponseHea ders:funct ion(){retu rn e===2?g :null},get ResponseHe ader:funct ion(n){var i;if(e=== 2){if(!p)f or(p={};i= yf.exec(g) ;)p[i[1].t oLowerCase ()]=i[2];i =p[n.toLow erCase()]} return i== =t?null:i} ,overrideM imeType:fu nction(n){ return e|| (u.mimeTyp e=n),this} ,abort:fun ction(n){r eturn n=n| |"abort",c &&c.abort( n),w(0,n), this}};if( k.promise( f),f.succe ss=f.done, f.error=f. fail,f.com plete=rt.a dd,f.statu sCode=func tion(n){if (n){var t; if(e<2)for (t in n)y[ t]=[y[t],n [t]];else t=n[f.stat us],f.then (t,t)}retu rn this},u .url=((n|| u.url)+"") .replace(v f,"").repl ace(bf,s[1 ]+"//"),u. dataTypes= i.trim(u.d ataType||" *").toLowe rCase().sp lit(ir),u. crossDomai n==null&&( l=rr.exec( u.url.toLo werCase()) ,u.crossDo main=!!(l& &(l[1]!=s[ 1]||l[2]!= s[2]||(l[3 ]||(l[1]== ="http:"?8 0:443))!=( s[3]||(s[1 ]==="http: "?80:443)) ))),u.data &&u.proces sData&&typ eof u.data !="string" &&(u.data= i.param(u. data,u.tra ditional)) ,d(et,u,r, f),e===2)r eturn!1;v= u.global;u .type=u.ty pe.toUpper Case();u.h asContent= !wf.test(u .type);v&& i.active++ ==0&&i.eve nt.trigger ("ajaxStar t");u.hasC ontent||(u .data&&(u. url+=(tr.t est(u.url) ?"&":"?")+ u.data,del ete u.data ),o=u.url, u.cache=== !1&&(tt=i. now(),it=u .url.repla ce(gf,"$1_ ="+tt),u.u rl=it+(it= ==u.url?(t r.test(u.u rl)?"&":"? ")+"_="+tt :"")));(u. data&&u.ha sContent&& u.contentT ype!==!1|| r.contentT ype)&&f.se tRequestHe ader("Cont ent-Type", u.contentT ype);u.ifM odified&&( o=o||u.url ,i.lastMod ified[o]&& f.setReque stHeader(" If-Modifie d-Since",i .lastModif ied[o]),i. etag[o]&&f .setReques tHeader("I f-None-Mat ch",i.etag [o]));f.se tRequestHe ader("Acce pt",u.data Types[0]&& u.accepts[ u.dataType s[0]]?u.ac cepts[u.da taTypes[0] ]+(u.dataT ypes[0]!== "*"?", "+e r+"; q=0.0 1":""):u.a ccepts["*" ]);for(a i n u.header s)f.setReq uestHeader (a,u.heade rs[a]);if( u.beforeSe nd&&(u.bef oreSend.ca ll(h,f,u)= ==!1||e=== 2))return f.abort(), !1;for(a i n{success: 1,error:1, complete:1 })f[a](u[a ]);if(c=d( fr,u,r,f), c){f.ready State=1;v& &b.trigger ("ajaxSend ",[f,u]);u .async&&u. timeout>0& &(nt=setTi meout(func tion(){f.a bort("time out")},u.t imeout));t ry{e=1;c.s end(ut,w)} catch(ot){ if(e<2)w(- 1,ot);else throw ot; }}else w(- 1,"No Tran sport");re turn f},pa ram:functi on(n,r){va r u=[],e=f unction(n, t){t=i.isF unction(t) ?t():t;u[u .length]=e ncodeURICo mponent(n) +"="+encod eURICompon ent(t)},f; if(r===t&& (r=i.ajaxS ettings.tr aditional) ,i.isArray (n)||n.jqu ery&&!i.is PlainObjec t(n))i.eac h(n,functi on(){e(thi s.name,thi s.value)}) ;else for( f in n)ot( f,n[f],r,e );return u .join("&") .replace(l f,"+")}}); i.extend({ active:0,l astModifie d:{},etag: {}});hr=i. now();y=/( \=)\?(&|$) |\?\?/i;i. ajaxSetup( {jsonp:"ca llback",js onpCallbac k:function (){return i.expando+ "_"+hr++}} );i.ajaxPr efilter("j son jsonp" ,function( t,r,u){var h=t.conte ntType===" applicatio n/x-www-fo rm-urlenco ded"&&type of t.data= ="string"; if(t.dataT ypes[0]=== "jsonp"||t .jsonp!==! 1&&(y.test (t.url)||h &&y.test(t .data))){v ar o,f=t.j sonpCallba ck=i.isFun ction(t.js onpCallbac k)?t.jsonp Callback() :t.jsonpCa llback,c=n [f],e=t.ur l,s=t.data ,l="$1"+f+ "$2";retur n t.jsonp! ==!1&&(e=e .replace(y ,l),t.url= ==e&&(h&&( s=s.replac e(y,l)),t. data===s&& (e+=(/\?/. test(e)?"& ":"?")+t.j sonp+"="+f ))),t.url= e,t.data=s ,n[f]=func tion(n){o= [n]},u.alw ays(functi on(){n[f]= c;o&&i.isF unction(c) &&n[f](o[0 ])}),t.con verters["s cript json "]=functio n(){return o||i.erro r(f+" was not called "),o[0]},t .dataTypes [0]="json" ,"script"} });i.ajaxS etup({acce pts:{scrip t:"text/ja vascript, applicatio n/javascri pt, applic ation/ecma script, ap plication/ x-ecmascri pt"},conte nts:{scrip t:/javascr ipt|ecmasc ript/},con verters:{" text scrip t":functio n(n){retur n i.global Eval(n),n} }});i.ajax Prefilter( "script",f unction(n) {n.cache== =t&&(n.cac he=!1);n.c rossDomain &&(n.type= "GET",n.gl obal=!1)}) ;i.ajaxTra nsport("sc ript",func tion(n){if (n.crossDo main){var i,u=r.head ||r.getEle mentsByTag Name("head ")[0]||r.d ocumentEle ment;retur n{send:fun ction(f,e) {i=r.creat eElement(" script");i .async="as ync";n.scr iptCharset &&(i.chars et=n.scrip tCharset); i.src=n.ur l;i.onload =i.onready statechang e=function (n,r){(r|| !i.readySt ate||/load ed|complet e/.test(i. readyState ))&&(i.onl oad=i.onre adystatech ange=null, u&&i.paren tNode&&u.r emoveChild (i),i=t,r| |e(200,"su ccess"))}; u.insertBe fore(i,u.f irstChild) },abort:fu nction(){i f(i)i.onlo ad(0,1)}}} });g=n.Act iveXObject ?function( ){for(var n in l)l[n ](0,1)}:!1 ;cr=0;i.aj axSettings .xhr=n.Act iveXObject ?function( ){return!t his.isLoca l&&lr()||i e()}:lr,fu nction(n){ i.extend(i .support,{ ajax:!!n,c ors:!!n&&" withCreden tials"in n })}(i.ajax Settings.x hr());i.su pport.ajax &&i.ajaxTr ansport(fu nction(r){ if(!r.cros sDomain||i .support.c ors){var u ;return{se nd:functio n(f,e){var o=r.xhr() ,h,s;if(r. username?o .open(r.ty pe,r.url,r .async,r.u sername,r. password): o.open(r.t ype,r.url, r.async),r .xhrFields )for(s in r.xhrField s)o[s]=r.x hrFields[s ];r.mimeTy pe&&o.over rideMimeTy pe&&o.over rideMimeTy pe(r.mimeT ype);r.cro ssDomain|| f["X-Reque sted-With" ]||(f["X-R equested-W ith"]="XML HttpReques t");try{fo r(s in f)o .setReques tHeader(s, f[s])}catc h(c){}o.se nd(r.hasCo ntent&&r.d ata||null) ;u=functio n(n,f){var s,v,y,c,a ;try{if(u& &(f||o.rea dyState=== 4))if(u=t, h&&(o.onre adystatech ange=i.noo p,g&&delet e l[h]),f) o.readySta te!==4&&o. abort();el se{s=o.sta tus;y=o.ge tAllRespon seHeaders( );c={};a=o .responseX ML;a&&a.do cumentElem ent&&(c.xm l=a);c.tex t=o.respon seText;try {v=o.statu sText}catc h(w){v=""} s||!r.isLo cal||r.cro ssDomain?s ===1223&&( s=204):s=c .text?200: 404}}catch (p){f||e(- 1,p)}c&&e( s,v,c,y)}; r.async&&o .readyStat e!==4?(h=+ +cr,g&&(l| |(l={},i(n ).unload(g )),l[h]=u) ,o.onready statechang e=u):u()}, abort:func tion(){u&& u(0,1)}}}} );var st={ },f,a,re=/ ^(?:toggle |show|hide )$/,ue=/^( [+\-]=)?([ \d+.\-]+)( [a-z%]*)$/ i,nt,ar=[[ "height"," marginTop" ,"marginBo ttom","pad dingTop"," paddingBot tom"],["wi dth","marg inLeft","m arginRight ","padding Left","pad dingRight" ],["opacit y"]],tt;i. fn.extend( {show:func tion(n,t,r ){var u,e, f,o;if(n|| n===0)retu rn this.an imate(v("s how",3),n, t,r);for(f =0,o=this. length;f<o ;f++)u=thi s[f],u.sty le&&(e=u.s tyle.displ ay,i._data (u,"olddis play")||e! =="none"|| (e=u.style .display=" "),e===""& &i.css(u," display")= =="none"&& i._data(u, "olddispla y",yr(u.no deName))); for(f=0;f< o;f++)u=th is[f],u.st yle&&(e=u. style.disp lay,(e===" "||e==="no ne")&&(u.s tyle.displ ay=i._data (u,"olddis play")||"" ));return this},hide :function( n,t,r){if( n||n===0)r eturn this .animate(v ("hide",3) ,n,t,r);fo r(var f,e, u=0,o=this .length;u< o;u++)f=th is[u],f.st yle&&(e=i. css(f,"dis play"),e== ="none"||i ._data(f," olddisplay ")||i._dat a(f,"olddi splay",e)) ;for(u=0;u <o;u++)thi s[u].style &&(this[u] .style.dis play="none ");return this},_tog gle:i.fn.t oggle,togg le:functio n(n,t,r){v ar u=typeo f n=="bool ean";retur n i.isFunc tion(n)&&i .isFunctio n(t)?this. _toggle.ap ply(this,a rguments): n==null||u ?this.each (function( ){var t=u? n:i(this). is(":hidde n");i(this )[t?"show" :"hide"]() }):this.an imate(v("t oggle",3), n,t,r),thi s},fadeTo: function(n ,t,i,r){re turn this. filter(":h idden").cs s("opacity ",0).show( ).end().an imate({opa city:t},n, i,r)},anim ate:functi on(n,t,r,u ){function e(){f.que ue===!1&&i ._mark(thi s);var u=i .extend({} ,f),y=this .nodeType= ==1,v=y&&i (this).is( ":hidden") ,e,t,r,o,h ,s,c,l,a;u .animatedP roperties= {};for(r i n n){if(e= i.camelCas e(r),r!==e &&(n[e]=n[ r],delete n[r]),t=n[ e],i.isArr ay(t)?(u.a nimatedPro perties[e] =t[1],t=n[ e]=t[0]):u .animatedP roperties[ e]=u.speci alEasing&& u.specialE asing[e]|| u.easing|| "swing",t= =="hide"&& v||t==="sh ow"&&!v)re turn u.com plete.call (this);y&& (e==="heig ht"||e===" width")&&( u.overflow =[this.sty le.overflo w,this.sty le.overflo wX,this.st yle.overfl owY],i.css (this,"dis play")===" inline"&&i .css(this, "float")== ="none"&&( i.support. inlineBloc kNeedsLayo ut&&yr(thi s.nodeName )!=="inlin e"?this.st yle.zoom=1 :this.styl e.display= "inline-bl ock"))}u.o verflow!=n ull&&(this .style.ove rflow="hid den");for( r in n)o=n ew i.fx(th is,u,r),t= n[r],re.te st(t)?(a=i ._data(thi s,"toggle" +r)||(t=== "toggle"?v ?"show":"h ide":0),a? (i._data(t his,"toggl e"+r,a===" show"?"hid e":"show") ,o[a]()):o [t]()):(h= ue.exec(t) ,s=o.cur() ,h?(c=pars eFloat(h[2 ]),l=h[3]| |(i.cssNum ber[r]?"": "px"),l!== "px"&&(i.s tyle(this, r,(c||1)+l ),s=(c||1) /o.cur()*s ,i.style(t his,r,s+l) ),h[1]&&(c =(h[1]===" -="?-1:1)* c+s),o.cus tom(s,c,l) ):o.custom (s,t,"")); return!0}v ar f=i.spe ed(t,r,u); return i.i sEmptyObje ct(n)?this .each(f.co mplete,[!1 ]):(n=i.ex tend({},n) ,f.queue== =!1?this.e ach(e):thi s.queue(f. queue,e))} ,stop:func tion(n,r,u ){return t ypeof n!=" string"&&( u=r,r=n,n= t),r&&n!== !1&&this.q ueue(n||"f x",[]),thi s.each(fun ction(){fu nction o(n ,t,r){var f=t[r];i.r emoveData( n,r,!0);f. stop(u)}va r t,e=!1,f =i.timers, r=i._data( this);if(u ||i._unmar k(!0,this) ,n==null)f or(t in r) r[t]&&r[t] .stop&&t.i ndexOf(".r un")===t.l ength-4&&o (this,r,t) ;else r[t= n+".run"]& &r[t].stop &&o(this,r ,t);for(t= f.length;t --;)f[t].e lem===this &&(n==null ||f[t].que ue===n)&&( u?f[t](!0) :f[t].save State(),e= !0,f.splic e(t,1));u& &e||i.dequ eue(this,n )})}});i.e ach({slide Down:v("sh ow",1),sli deUp:v("hi de",1),sli deToggle:v ("toggle", 1),fadeIn: {opacity:" show"},fad eOut:{opac ity:"hide" },fadeTogg le:{opacit y:"toggle" }},functio n(n,t){i.f n[n]=funct ion(n,i,r) {return th is.animate (t,n,i,r)} });i.exten d({speed:f unction(n, t,r){var u =n&&typeof n=="objec t"?i.exten d({},n):{c omplete:r| |!r&&t||i. isFunction (n)&&n,dur ation:n,ea sing:r&&t| |t&&!i.isF unction(t) &&t};retur n u.durati on=i.fx.of f?0:typeof u.duratio n=="number "?u.durati on:u.durat ion in i.f x.speeds?i .fx.speeds [u.duratio n]:i.fx.sp eeds._defa ult,(u.que ue==null|| u.queue=== !0)&&(u.qu eue="fx"), u.old=u.co mplete,u.c omplete=fu nction(n){ i.isFuncti on(u.old)& &u.old.cal l(this);u. queue?i.de queue(this ,u.queue): n!==!1&&i. _unmark(th is)},u},ea sing:{line ar:functio n(n,t,i,r) {return i+ r*n},swing :function( n,t,i,r){r eturn(-Mat h.cos(n*Ma th.PI)/2+. 5)*r+i}},t imers:[],f x:function (n,t,i){th is.options =t;this.el em=n;this. prop=i;t.o rig=t.orig ||{}}});i. fx.prototy pe={update :function( ){this.opt ions.step& &this.opti ons.step.c all(this.e lem,this.n ow,this);( i.fx.step[ this.prop] ||i.fx.ste p._default )(this)},c ur:functio n(){if(thi s.elem[thi s.prop]!=n ull&&(!thi s.elem.sty le||this.e lem.style[ this.prop] ==null))re turn this. elem[this. prop];var t,n=i.css( this.elem, this.prop) ;return is NaN(t=pars eFloat(n)) ?!n||n===" auto"?0:n: t},custom: function(n ,r,u){func tion e(n){ return f.s tep(n)}var f=this,o= i.fx;this. startTime= tt||vr();t his.end=r; this.now=t his.start= n;this.pos =this.stat e=0;this.u nit=u||thi s.unit||(i .cssNumber [this.prop ]?"":"px") ;e.queue=t his.option s.queue;e. elem=this. elem;e.sav eState=fun ction(){f. options.hi de&&i._dat a(f.elem," fxshow"+f. prop)===t& &i._data(f .elem,"fxs how"+f.pro p,f.start) };e()&&i.t imers.push (e)&&!nt&& (nt=setInt erval(o.ti ck,o.inter val))},sho w:function (){var n=i ._data(thi s.elem,"fx show"+this .prop);thi s.options. orig[this. prop]=n||i .style(thi s.elem,thi s.prop);th is.options .show=!0;n !==t?this. custom(thi s.cur(),n) :this.cust om(this.pr op==="widt h"||this.p rop==="hei ght"?1:0,t his.cur()) ;i(this.el em).show() },hide:fun ction(){th is.options .orig[this .prop]=i._ data(this. elem,"fxsh ow"+this.p rop)||i.st yle(this.e lem,this.p rop);this. options.hi de=!0;this .custom(th is.cur(),0 )},step:fu nction(n){ var r,f,e, o=tt||vr() ,s=!0,u=th is.elem,t= this.optio ns;if(n||o >=t.durati on+this.st artTime){t his.now=th is.end;thi s.pos=this .state=1;t his.update ();t.anima tedPropert ies[this.p rop]=!0;fo r(r in t.a nimatedPro perties)t. animatedPr operties[r ]!==!0&&(s =!1);if(s) {if(t.over flow==null ||i.suppor t.shrinkWr apBlocks|| i.each(["" ,"X","Y"], function(n ,i){u.styl e["overflo w"+i]=t.ov erflow[n]} ),t.hide&& i(u).hide( ),t.hide|| t.show)for (r in t.an imatedProp erties)i.s tyle(u,r,t .orig[r]), i.removeDa ta(u,"fxsh ow"+r,!0), i.removeDa ta(u,"togg le"+r,!0); e=t.comple te;e&&(t.c omplete=!1 ,e.call(u) )}return!1 }return t. duration== Infinity?t his.now=o: (f=o-this. startTime, this.state =f/t.durat ion,this.p os=i.easin g[t.animat edProperti es[this.pr op]](this. state,f,0, 1,t.durati on),this.n ow=this.st art+(this. end-this.s tart)*this .pos),this .update(), !0}};i.ext end(i.fx,{ tick:funct ion(){for( var r,n=i. timers,t=0 ;t<n.lengt h;t++)r=n[ t],r()||n[ t]!==r||n. splice(t-- ,1);n.leng th||i.fx.s top()},int erval:13,s top:functi on(){clear Interval(n t);nt=null },speeds:{ slow:600,f ast:200,_d efault:400 },step:{op acity:func tion(n){i. style(n.el em,"opacit y",n.now)} ,_default: function(n ){n.elem.s tyle&&n.el em.style[n .prop]!=nu ll?n.elem. style[n.pr op]=n.now+ n.unit:n.e lem[n.prop ]=n.now}}} );i.each([ "width","h eight"],fu nction(n,t ){i.fx.ste p[t]=funct ion(n){i.s tyle(n.ele m,t,Math.m ax(0,n.now )+n.unit)} });i.expr& &i.expr.fi lters&&(i. expr.filte rs.animate d=function (n){return i.grep(i. timers,fun ction(t){r eturn n=== t.elem}).l ength});pr =/^t(?:abl e|d|h)$/i; ht=/^(?:bo dy|html)$/ i;i.fn.off set="getBo undingClie ntRect"in r.document Element?fu nction(n){ var t=this [0],r,f,u; if(n)retur n this.eac h(function (t){i.offs et.setOffs et(this,n, t)});if(!t ||!t.owner Document)r eturn null ;if(t===t. ownerDocum ent.body)r eturn i.of fset.bodyO ffset(t);t ry{r=t.get BoundingCl ientRect() }catch(y){ }if(f=t.ow nerDocumen t,u=f.docu mentElemen t,!r||!i.c ontains(u, t))return r?{top:r.t op,left:r. left}:{top :0,left:0} ;var e=f.b ody,o=ct(f ),s=u.clie ntTop||e.c lientTop|| 0,h=u.clie ntLeft||e. clientLeft ||0,c=o.pa geYOffset| |i.support .boxModel& &u.scrollT op||e.scro llTop,l=o. pageXOffse t||i.suppo rt.boxMode l&&u.scrol lLeft||e.s crollLeft, a=r.top+c- s,v=r.left +l-h;retur n{top:a,le ft:v}}:fun ction(n){v ar t=this[ 0];if(n)re turn this. each(funct ion(t){i.o ffset.setO ffset(this ,n,t)});if (!t||!t.ow nerDocumen t)return n ull;if(t== =t.ownerDo cument.bod y)return i .offset.bo dyOffset(t );for(var r,h=t.offs etParent,a =t,c=t.own erDocument ,l=c.docum entElement ,e=c.body, s=c.defaul tView,o=s? s.getCompu tedStyle(t ,null):t.c urrentStyl e,u=t.offs etTop,f=t. offsetLeft ;(t=t.pare ntNode)&&t !==e&&t!== l;){if(i.s upport.fix edPosition &&o.positi on==="fixe d")break;r =s?s.getCo mputedStyl e(t,null): t.currentS tyle;u-=t. scrollTop; f-=t.scrol lLeft;t=== h&&(u+=t.o ffsetTop,f +=t.offset Left,!i.su pport.does NotAddBord er||i.supp ort.doesAd dBorderFor TableAndCe lls&&pr.te st(t.nodeN ame)||(u+= parseFloat (r.borderT opWidth)|| 0,f+=parse Float(r.bo rderLeftWi dth)||0),a =h,h=t.off setParent) ;i.support .subtracts BorderForO verflowNot Visible&&r .overflow! =="visible "&&(u+=par seFloat(r. borderTopW idth)||0,f +=parseFlo at(r.borde rLeftWidth )||0);o=r} return(o.p osition=== "relative" ||o.positi on==="stat ic")&&(u+= e.offsetTo p,f+=e.off setLeft),i .support.f ixedPositi on&&o.posi tion==="fi xed"&&(u+= Math.max(l .scrollTop ,e.scrollT op),f+=Mat h.max(l.sc rollLeft,e .scrollLef t)),{top:u ,left:f}}; i.offset={ bodyOffset :function( n){var t=n .offsetTop ,r=n.offse tLeft;retu rn i.suppo rt.doesNot IncludeMar ginInBodyO ffset&&(t+ =parseFloa t(i.css(n, "marginTop "))||0,r+= parseFloat (i.css(n," marginLeft "))||0),{t op:t,left: r}},setOff set:functi on(n,t,r){ var f=i.cs s(n,"posit ion");f=== "static"&& (n.style.p osition="r elative"); var e=i(n) ,o=e.offse t(),l=i.cs s(n,"top") ,a=i.css(n ,"left"),v =(f==="abs olute"||f= =="fixed") &&i.inArra y("auto",[ l,a])>-1,u ={},s={},h ,c;v?(s=e. position() ,h=s.top,c =s.left):( h=parseFlo at(l)||0,c =parseFloa t(a)||0);i .isFunctio n(t)&&(t=t .call(n,r, o));t.top! =null&&(u. top=t.top- o.top+h);t .left!=nul l&&(u.left =t.left-o. left+c);"u sing"in t? t.using.ca ll(n,u):e. css(u)}};i .fn.extend ({position :function( ){if(!this [0])return null;var u=this[0], n=this.off setParent( ),t=this.o ffset(),r= ht.test(n[ 0].nodeNam e)?{top:0, left:0}:n. offset();r eturn t.to p-=parseFl oat(i.css( u,"marginT op"))||0,t .left-=par seFloat(i. css(u,"mar ginLeft")) ||0,r.top+ =parseFloa t(i.css(n[ 0],"border TopWidth") )||0,r.lef t+=parseFl oat(i.css( n[0],"bord erLeftWidt h"))||0,{t op:t.top-r .top,left: t.left-r.l eft}},offs etParent:f unction(){ return thi s.map(func tion(){for (var n=thi s.offsetPa rent||r.bo dy;n&&!ht. test(n.nod eName)&&i. css(n,"pos ition")=== "static";) n=n.offset Parent;ret urn n})}}) ;i.each([" Left","Top "],functio n(n,r){var u="scroll "+r;i.fn[u ]=function (r){var e, f;return r ===t?(e=th is[0],!e)? null:(f=ct (e),f?"pag eXOffset"i n f?f[n?"p ageYOffset ":"pageXOf fset"]:i.s upport.box Model&&f.d ocument.do cumentElem ent[u]||f. document.b ody[u]:e[u ]):this.ea ch(functio n(){f=ct(t his);f?f.s crollTo(n? i(f).scrol lLeft():r, n?r:i(f).s crollTop() ):this[u]= r})}});i.e ach(["Heig ht","Width "],functio n(n,r){var u=r.toLow erCase();i .fn["inner "+r]=funct ion(){var n=this[0]; return n?n .style?par seFloat(i. css(n,u,"p adding")): this[u](): null};i.fn ["outer"+r ]=function (n){var t= this[0];re turn t?t.s tyle?parse Float(i.cs s(t,u,n?"m argin":"bo rder")):th is[u]():nu ll};i.fn[u ]=function (n){var f= this[0],e, o,s,h;retu rn f?i.isF unction(n) ?this.each (function( t){var r=i (this);r[u ](n.call(t his,t,r[u] ()))}):i.i sWindow(f) ?(e=f.docu ment.docum entElement ["client"+ r],o=f.doc ument.body ,f.documen t.compatMo de==="CSS1 Compat"&&e ||o&&o["cl ient"+r]|| e):f.nodeT ype===9?Ma th.max(f.d ocumentEle ment["clie nt"+r],f.b ody["scrol l"+r],f.do cumentElem ent["scrol l"+r],f.bo dy["offset "+r],f.doc umentEleme nt["offset "+r]):n=== t?(s=i.css (f,u),h=pa rseFloat(s ),i.isNume ric(h)?h:s ):this.css (u,typeof n=="string "?n:n+"px" ):n==null? null:this} });n.jQuer y=n.$=i;ty peof defin e=="functi on"&&defin e.amd&&def ine.amd.jQ uery&&defi ne("jquery ",[],funct ion(){retu rn i})})(w indow);thi s.JSON||(t his.JSON={ }),functio n(){functi on i(n){re turn n<10? "0"+n:n}fu nction o(n ){return e .lastIndex =0,e.test( n)?'"'+n.r eplace(e,f unction(n) {var t=s[n ];return t ypeof t==" string"?t: "\\u"+("00 00"+n.char CodeAt(0). toString(1 6)).slice( -4)})+'"': '"'+n+'"'} function u (i,f){var c,l,s,a,v= n,h,e=f[i] ;e&&typeof e=="objec t"&&typeof e.toJSON= ="function "&&(e=e.to JSON(i));t ypeof t==" function"& &(e=t.call (f,i,e));s witch(type of e){case "string":r eturn o(e) ;case"numb er":return isFinite( e)?String( e):"null"; case"boole an":case"n ull":retur n String(e );case"obj ect":if(!e )return"nu ll";if(n+= r,h=[],Obj ect.protot ype.toStri ng.apply(e )==="[obje ct Array]" ){for(a=e. length,c=0 ;c<a;c+=1) h[c]=u(c,e )||"null"; return s=h .length=== 0?"[]":n?" [\n"+n+h.j oin(",\n"+ n)+"\n"+v+ "]":"["+h. join(",")+ "]",n=v,s} if(t&&type of t=="obj ect")for(a =t.length, c=0;c<a;c+ =1)l=t[c], typeof l== "string"&& (s=u(l,e), s&&h.push( o(l)+(n?": ":":")+s) );else for (l in e)Ob ject.hasOw nProperty. call(e,l)& &(s=u(l,e) ,s&&h.push (o(l)+(n?" : ":":")+s ));return s=h.length ===0?"{}": n?"{\n"+n+ h.join(",\ n"+n)+"\n" +v+"}":"{" +h.join(", ")+"}",n=v ,s}}typeof Date.prot otype.toJS ON!="funct ion"&&(Dat e.prototyp e.toJSON=f unction(){ return isF inite(this .valueOf() )?this.get UTCFullYea r()+"-"+i( this.getUT CMonth()+1 )+"-"+i(th is.getUTCD ate())+"T" +i(this.ge tUTCHours( ))+":"+i(t his.getUTC Minutes()) +":"+i(thi s.getUTCSe conds())+" Z":null},S tring.prot otype.toJS ON=Number. prototype. toJSON=Boo lean.proto type.toJSO N=function (){return this.value Of()});var f=/[\u000 0\u00ad\u0 600-\u0604 \u070f\u17 b4\u17b5\u 200c-\u200 f\u2028-\u 202f\u2060 -\u206f\uf eff\ufff0- \uffff]/g, e=/[\\\"\x 00-\x1f\x7 f-\x9f\u00 ad\u0600-\ u0604\u070 f\u17b4\u1 7b5\u200c- \u200f\u20 28-\u202f\ u2060-\u20 6f\ufeff\u fff0-\ufff f]/g,n,r,s ={"\b":"\\ b","\t":"\ \t","\n":" \\n","\f": "\\f","\r" :"\\r",'"' :'\\"',"\\ ":"\\\\"}, t;typeof J SON.string ify!="func tion"&&(JS ON.stringi fy=functio n(i,f,e){v ar o;if(n= "",r="",ty peof e=="n umber")for (o=0;o<e;o +=1)r+=" " ;else type of e=="str ing"&&(r=e );if(t=f,f &&typeof f !="functio n"&&(typeo f f!="obje ct"||typeo f f.length !="number" ))throw ne w Error("J SON.string ify");retu rn u("",{" ":i})});ty peof JSON. parse!="fu nction"&&( JSON.parse =function( n,t){funct ion r(n,i) {var f,e,u =n[i];if(u &&typeof u =="object" )for(f in u)Object.h asOwnPrope rty.call(u ,f)&&(e=r( u,f),e!==u ndefined?u [f]=e:dele te u[f]);r eturn t.ca ll(n,i,u)} var i;if(n =String(n) ,f.lastInd ex=0,f.tes t(n)&&(n=n .replace(f ,function( n){return" \\u"+("000 0"+n.charC odeAt(0).t oString(16 )).slice(- 4)})),/^[\ ],:{}\s]*$ /.test(n.r eplace(/\\ (?:["\\\/b fnrt]|u[0- 9a-fA-F]{4 })/g,"@"). replace(/" [^"\\\n\r] *"|true|fa lse|null|- ?\d+(?:\.\ d*)?(?:[eE ][+\-]?\d+ )?/g,"]"). replace(/( ?:^|:|,)(? :\s*\[)+/g ,"")))retu rn i=eval( "("+n+")") ,typeof t= ="function "?r({"":i} ,""):i;thr ow new Syn taxError(" JSON.parse ");})}();C rmRestKit= function(n ,t,i){"use strict";f unction s( ){if(typeo f GetGloba lContext!= "undefined ")return G etGlobalCo ntext();if (typeof Xr m!="undefi ned")retur n Xrm.Page .context;t hrow new E rror("Cont ext is not available .");}funct ion h(){va r t=null,u =n.locatio n.protocol +"//"+n.lo cation.hos t,r=s();re turn Xrm.P age.contex t.getClien tUrl!==i?t =Xrm.Page. context.ge tClientUrl ():r.isOut lookClient ()&&!r.isO utlookOnli ne()?t=u:( t=r.getCli entUrl(),t =t.replace (/^(http|h ttps):\/\/ ([_a-zA-Z0 -9\-\.]+)( :([0-9]{1, 5}))?/,u), t=t.replac e(/\/$/,"" )),t}funct ion u(){re turn h()+o }function c(n,t){var r=null;re turn n!==i &&n!==null &&(r={__me tadata:{ty pe:"Micros oft.Crm.Sd k.Data.Ser vices.Enti tyReferenc e"},Id:n}, t!==i&&t!= =null&&(r. LogicalNam e=t)),r}fu nction l(n ){return{_ _metadata: {type:"Mic rosoft.Crm .Sdk.Data. Services.O ptionSetVa lue"},Valu e:n}}funct ion a(n){r eturn{__me tadata:{ty pe:"Micros oft.Crm.Sd k.Data.Ser vices.Mone y"},Value: n}}functio n v(n){ret urn new Da te(parseIn t(n.replac e("/Date(" ,"").repla ce(")/","" ),10))}fun ction r(n, t){var r={ type:"GET" ,async:!0, contentTyp e:"applica tion/json; charset=u tf-8",data type:"json ",beforeSe nd:functio n(n){n.set RequestHea der("Accep t","applic ation/json ")}};retur n n=$.exte nd(r,n),n. async=t=== i?!0:t,$.a jax(n)}fun ction y(t, f,e,o,s,h) {var l=h== =i?!0:h,c= u(),a={url :c+"/"+f+" Set(guid'" +t+"')/$li nks/"+s,ty pe:"POST", data:n.JSO N.stringif y({uri:c+" /"+o+"Set( guid'"+e+" ')"})};ret urn r(a,l) }function p(n,t,f,e, o){var s=o ===i?!0:o, h=u(),c={u rl:h+"/"+t +"Set(guid '"+n+"')/$ links/"+e+ "(guid'"+f +"')",type :"POST",be foreSend:f unction(n) {n.setRequ estHeader( "Accept"," applicatio n/json");n .setReques tHeader("X -HTTP-Meth od","DELET E")}};retu rn r(c,s)} function w (n,t,f,e){ var o=e=== i?!0:e,s=n +"Set",h=u ()+"/"+s+" (guid'"+t+ "')?$selec t="+f.join (",");retu rn r({url: h},o)}func tion f(n,t ){return r ({url:n},t )}function b(n,t,f,e ,o){var c= o===i?!0:o ,s,h;retur n e=e?"&$f ilter="+en codeURICom ponent(e): "",s=n+"Se t",h=u()+" /"+s+"?$se lect="+t.j oin(",")+" &$expand=" +f+e,r({ur l:h},c)}fu nction e(n ,t,f,e){va r h=e===i? !0:e,o,s;r eturn f=f? "&$filter= "+encodeUR IComponent (f):"",o=n +"Set",s=u ()+"/"+o+" ?$select=" +t.join(", ")+f,r({ur l:s},h)}fu nction k(n ,t,i,r){va r u=new $. Deferred,o =[];return e(n,t,i,r ).then(fun ction s(n) {o=o.conca t(n.d.resu lts);n.d._ _next?(f(n .d.__next, r).then(s, u.reject), u.notify(n )):u.resol ve(o)},u.r eject),u.p romise()}f unction d( t,f,e){var o=e===i?! 0:e,s=t+"S et",h=n.JS ON.stringi fy(f),c=u( )+"/"+s;re turn r({ty pe:"POST", url:c,data :h},o)}fun ction g(t, f,e,o){var s=o===i?! 0:o,h=t+"S et",c=n.JS ON.stringi fy(e),l=u( )+"/"+h+"( guid'"+f+" ')",a={typ e:"POST",u rl:l,data: c,beforeSe nd:functio n(n){n.set RequestHea der("Accep t","applic ation/json ");n.setRe questHeade r("X-HTTP- Method","M ERGE")}};r eturn r(a, s)}functio n nt(n,t,f ){var e=f= ==i?!0:f,o =n+"Set",s =u()+"/"+o +"(guid'"+ t+"')",h={ type:"POST ",url:s,be foreSend:f unction(n) {n.setRequ estHeader( "Accept"," applicatio n/json");n .setReques tHeader("X -HTTP-Meth od","DELET E")}};retu rn r(h,e)} var o="/XR MServices/ 2011/Organ izationDat a.svc";ret urn{Versio n:"2.6.0", Retrieve:w ,ByQuery:e ,ByQueryUr l:f,ByExpa ndQuery:b, ByQueryAll :k,Create: d,Update:g ,Delete:nt ,Associate :y,Disasso ciate:p,En tityRefere nceFactory :c,OptionS etValueFac tory:l,Mon eyValueFac tory:a,Par seODataDat e:v}}(wind ow,documen t);typeof MCS=="unde fined"&&(M CS={});MCS .cvt_Commo n={};MCS.c vt_Common. FORM_TYPE_ CREATE=1;M CS.cvt_Com mon.FORM_T YPE_UPDATE =2;MCS.cvt _Common.FO RM_TYPE_RE AD_ONLY=3; MCS.cvt_Co mmon.FORM_ TYPE_DISAB LED=4;MCS. cvt_Common .FORM_TYPE _QUICKCREA TE=5;MCS.c vt_Common. FORM_TYPE_ BULKEDIT=6 ;MCS.cvt_C ommon.Blan kGUID="000 00000-0000 -0000-0000 -000000000 000";MCS.c vt_Common. Appointmen tOccursInP ast=functi on(){var n ,t,i;retur n Xrm.Page .ui.getFor mType()==M CS.cvt_Com mon.FORM_T YPE_CREATE ?!1:(n=Xrm .Page.getA ttribute(" scheduleds tart"),n== null)?!1:( t=n.getVal ue(),t==nu ll)?!1:(i= new Date,i >t?!0:!1)} ;MCS.cvt_C ommon.Buil dRelations hipServerU rl=functio n(){var n= Xrm.Page.c ontext.get ClientUrl( );return n .match(/\/ $/)&&(n=n. substring( 0,n.length -1)),n};MC S.cvt_Comm on.checkNu ll=functio n(n){var t =Xrm.Page. getAttribu te(n);retu rn t!=null ?t.getValu e():null}; MCS.cvt_Co mmon.close Window=fun ction(n){v ar t,i;n!= null&&aler t(n);t=Xrm .Page.data .entity.at tributes.g et();for(i in t)t[i] .setSubmit Mode("neve r");Xrm.Pa ge.ui.clos e()};MCS.c vt_Common. collapseTa b=function (n,t){var u=Xrm.Page .getContro l(t),f=u.g etAttribut e(),i=f.ge tValue(),r =Xrm.Page. ui.tabs.ge t(n);i!="" &&i!=null? r.setDispl ayState("e xpanded"): r.setDispl ayState("c ollapsed") };MCS.cvt_ Common.com pareGUIDS= function(n ,t){var i, r;return n ==null&&t= =null?!0:n ==null||t= =null?!1:( i=n.replac e(/\W/g,"" ),i=i.toSt ring().toU pperCase() ,r=t.repla ce(/\W/g," "),r=r.toS tring().to UpperCase( ),i==r?!0: !1)};MCS.c vt_Common. CreateFetc h=function (n,t,i,r){ var e="",f ="",o="",u ;if(t!=nul l&&t.lengt h>0)for(co lumn in t) e+='<attri bute name= "'+t[colum n]+'" />'; if(i!=null &&i.length >0){f="<fi lter type= 'and'>";fo r(conditio n in i)f+= i[conditio n]}return r!=null&&r .length==2 &&(o='<ord er attribu te="'+r[0] +'" descen ding="'+r[ 1]+'" />') ,u="<fetch version=' 1.0' outpu t-format=' xml-platfo rm' mappin g='logical ' distinct ='true' ag gregate='f alse'>",u+ ="<entity name='"+n+ "'>",u+=e, u+=o,u+=f, u+="<\/fil ter>",u+=" <\/entity> ",u+"<\/fe tch>"};MCS .cvt_Commo n.DateTime =function( n,t,i){var r=Xrm.Pag e.getAttri bute(n);r. getValue() ==null&&r. setValue(n ew Date);r .setValue( r.getValue ().setHour s(t,i,0))} ;MCS.cvt_C ommon.Enab leDependen tLookup=fu nction(n,t ){var i=Xr m.Page.get Attribute( n),r=i!=nu ll?i.getVa lue():null ,u=r!=null ?r[0].name :null;u!=n ull?(Xrm.P age.getCon trol(t).se tVisible(! 0),Xrm.Pag e.getContr ol(t).setF ocus()):(X rm.Page.ge tControl(t ).setVisib le(!1),Xrm .Page.getA ttribute(t ).setValue (null))};M CS.cvt_Com mon.Enable OtherDetai ls=functio n(n,t,i){v ar u=Xrm.P age.ui.con trols.get( t),r=Xrm.P age.getAtt ribute(t), f=Xrm.Page .getAttrib ute(n).get Value();f! =null&&f.t oString()= =i?(u.setD isabled(!1 ),u.setVis ible(!0),r .setRequir edLevel("r equired"), r.setSubmi tMode("dir ty")):(r.g etValue()! =""&&(r.se tValue("") ,r.setSubm itMode("al ways")),u. setDisable d(!0),u.se tVisible(! 1),r.setRe quiredLeve l("none")) };MCS.cvt_ Common.for matXML=fun ction(n){i f(n)return n.replace (/&/g,"&am p;")};MCS. cvt_Common .getObject TypeCode=f unction(n) {var i=new parent.Re moteComman d("LookupS ervice","R etrieveTyp eCode"),t; return i.S etParamete r("entityN ame",n),t= i.Execute( ),t.Succes s&&typeof t.ReturnVa lue=="numb er"?t.Retu rnValue:nu ll};MCS.cv t_Common.M VIConfig=f unction(){ var t="",n =!1,i;retu rn calls=C rmRestKit. ByQuery("m cs_setting ",["cvt_Us eMVI","cvt _MVIRoles" ],"mcs_nam e eq 'Acti ve Setting s'",!1),ca lls.fail(f unction(){ return n}) .done(func tion(i){i& &i.d&&i.d. results!=n ull&&i.d.r esults.len gth!=0&&(n =i.d.resul ts[0].cvt_ UseMVI!=nu ll?i.d.res ults[0].cv t_UseMVI:! 1,t=i.d.re sults[0].c vt_MVIRole s)}),i=MCS .cvt_Commo n.userHasR oleInList( t),n&&i};M CS.cvt_Com mon.Notifi cations=fu nction(n,t ,i){var r= Sys.Applic ation.find Component( "crmNotifi cations"); switch(n){ case"Add": r&&t&&i&&r .AddNotifi cation("no teId1",t," namespace" ,i);break; case"Hide" :r.SetVisi ble(!1)}}; MCS.cvt_Co mmon.openD ialogOnCur rentRecord =function( n){return EntityName =Xrm.Page. data.entit y.getEntit yName(),ob jectId=Xrm .Page.data .entity.ge tId(),MCS. cvt_Common .openDialo gProcess(n ,EntityNam e,objectId )};MCS.cvt _Common.op enDialogPr ocess=func tion(n,t,i ){(t==null ||t=="")&& (t=Xrm.Pag e.data.ent ity.getEnt ityName()) ;(i==null| |i=="")&&( i=Xrm.Page .data.enti ty.getId() );var f=Xr m.Page.con text.getCl ientUrl()+ "/cs/dialo g/rundialo g.aspx?Dia logId="+n+ "&EntityNa me="+t+"&O bjectId="+ i,r=400,u= 400,e=(scr een.width- r)/2,o=(sc reen.heigh t-u)/2;ret urn window .open(f,"" ,"location =0,menubar =1,resizab le=1,width ="+r+",hei ght="+u+", top="+o+", left="+e+" ")};MCS.cv t_Common.R estError=f unction(n) {return JS ON.parse(n .responseT ext).error .message.v alue};MCS. cvt_Common .SetFacili tyFromSite =function( n,t){var r =Xrm.Page. getAttribu te(n),i=Xr m.Page.get Attribute( t),e=i.get Value()!=n ull?i.getV alue()[0]. id:null,u= r.getValue ()!=null?r .getValue( )[0].id:nu ll,f;u!=nu ll?(f=CrmR estKit.Ret rieve("mcs _site",u,[ "mcs_Facil ityId"],!1 ),f.fail(f unction(){ }).done(fu nction(n){ if(n&&n.d& &n.d.mcs_F acilityId) {var t=[]; t[0]={};t[ 0].id="{"+ n.d.mcs_Fa cilityId.I d+"}";t[0] .name=n.d. mcs_Facili tyId.Name; t[0].entit yType="mcs _facility" ;i.setValu e(t)}})):i .setValue( null);MCS. cvt_Common .compareGU IDS(e,i.ge tValue()!= null?i.get Value()[0] .id:null)! =!0&&i.set SubmitMode ("always") };MCS.cvt_ Common.Tri mBookendBr ackets=fun ction(n){r eturn n!=n ull&&n.len gth>0?n.ch arAt(0)==" {"?n.slice (1,n.lengt h-1):n:""} ;MCS.cvt_C ommon.user HasRoleInL ist=functi on(n){for( var r=Xrm. Page.conte xt.getUser Roles(),t= !1,i=0;i<r .length;i+ +){if(t)re turn!0;Crm RestKit.Re trieve("Ro le",r[i],[ "Name"],!1 ).fail(fun ction(){re turn}).don e(function (i){if(i!= null&&i.d! =null){var r=i.d.Nam e.trim().t oLowerCase ();if(n.to LowerCase( ).indexOf( r)!=-1){t= !0;return} }})}return t};typeof MCS=="und efined"&&( MCS={__nam espace:!0} );MCS.Glob alFunction s={GetRequ estObject: function() {if(window .XMLHttpRe quest)retu rn new win dow.XMLHtt pRequest;t ry{return new Active XObject("M SXML2.XMLH TTP.3.0")} catch(n){r eturn null }},GuidsAr eEqual:fun ction(n,t) {return n= =null||t== null?!1:n. replace(/[ {}]/g,""). toLowerCas e()==t.rep lace(/[{}] /g,"").toL owerCase() },getOData UTCDateFil ter:functi on(n){var f,u=(n.get UTCMonth() +1).toStri ng(),e,r,i ,t;return f=u.length ==1?"0"+u: u,r=n.getU TCDate().t oString(), e=r.length ==1?"0"+r: r,i="datet ime'",i+=n .getUTCFul lYear()+"- ",i+=f+"-" ,i+=e,i+=" T",t=n.get UTCHours() ,t.toStrin g().length ==1&&(t="0 "+t),i+=t+ ":",t=n.ge tUTCMinute s(),t.toSt ring().len gth==1&&(t ="0"+t),i+ =t+":",t=n .getUTCSec onds(),t.t oString(). length==1& &(t="0"+t) ,i+(t+"'") },getAuthe nticationH eader:func tion(){var n=Xrm.Pag e.context. getAuthent icationHea der()},_ge tClientUrl :function( n){var i=" /xrmservic es/2011/or ganization .svc/web", t,r;if(n== "ODATA"&&( i="/xrmser vices/2011 /organizat iondata.sv c"),t="",t ypeof GetG lobalConte xt=="funct ion")r=Get GlobalCont ext(),t=r. getClientU rl();else if(typeof Xrm.Page.c ontext=="o bject")t=X rm.Page.co ntext.getC lientUrl() ;else thro w new Erro r("Unable to access the server URL");ret urn t.matc h(/\/$/)&& (t=t.subst ring(0,t.l ength-1)), t+i},runWo rkflow:fun ction(n,t, i){var r=' <Execute x mlns="http ://schemas .microsoft .com/xrm/2 011/Contra cts/Servic es" xmlns: i="http:// www.w3.org /2001/XMLS chema-inst ance">',u; r+='<reque st i:type= "b:Execute WorkflowRe quest" xml ns:a="http ://schemas .microsoft .com/xrm/2 011/Contra cts" xmlns :b="http:/ /schemas.m icrosoft.c om/crm/201 1/Contract s">';r+='< a:Paramete rs xmlns:c ="http://s chemas.dat acontract. org/2004/0 7/System.C ollections .Generic"> ';r+="<a:K eyValuePai rOfstringa nyType>";r +="<c:key> EntityId<\ /c:key>";r +='<c:valu e i:type=" d:guid" xm lns:d="htt p://schema s.microsof t.com/2003 /10/Serial ization/"> '+n+"<\/c: value>";r+ ="<\/a:Key ValuePairO fstringany Type>";r+= "<a:KeyVal uePairOfst ringanyTyp e>";r+="<c :key>Workf lowId<\/c: key>";r+=' <c:value i :type="d:g uid" xmlns :d="http:/ /schemas.m icrosoft.c om/2003/10 /Serializa tion/">'+t +"<\/c:val ue>";r+="< \/a:KeyVal uePairOfst ringanyTyp e>";r+="<\ /a:Paramet ers>";r+=' <a:Request Id i:nil=" true" />'; r+="<a:Req uestName>E xecuteWork flow<\/a:R equestName >";r+="<\/ request>"; r+="<\/Exe cute>";r=t his._getSO APWrapper( r);u=new X MLHttpRequ est;u.open ("POST",th is._getCli entUrl("SO AP"),!0);u .setReques tHeader("A ccept","ap plication/ xml, text/ xml, */*") ;u.setRequ estHeader( "Content-T ype","text /xml; char set=utf-8" );u.setReq uestHeader ("SOAPActi on",this._ Action.Run Workflow); u.onreadys tatechange =function( ){i(u)};u. send(r)},r unWorkflow Response:f unction(){ return new MCS.Globa lFunctions ._response (200,funct ion(){retu rn"OK"})}, createSOAP Request:fu nction(n,t ,i){var r= '<Create x mlns="http ://schemas .microsoft .com/xrm/2 011/Contra cts/Servic es">',u;r+ ='<entity xmlns:b="h ttp://sche mas.micros oft.com/xr m/2011/Con tracts"';r +=' xmlns: i="http:// www.w3.org /2001/XMLS chema-inst ance">';r+ =this._get AttributeW rapper(t); r+='<b:Ent ityState i :nil="true "/>';r+='< b:Formatte dValues xm lns:c="htt p://schema s.datacont ract.org/2 004/07/Sys tem.Collec tions.Gene ric"/>';r+ ="<b:Id>00 000000-000 0-0000-000 0-00000000 0000<\/b:I d>";r+="<b :LogicalNa me>"+n+"<\ /b:Logical Name>";r+= '<b:Relate dEntities xmlns:c="h ttp://sche mas.dataco ntract.org /2004/07/S ystem.Coll ections.Ge neric"/>'; r+="<\/ent ity>";r+=" <\/Create> ";r=this._ getSOAPWra pper(r);u= new XMLHtt pRequest;u .open("POS T",this._g etClientUr l("SOAP"), !0);u.setR equestHead er("Accept ","applica tion/xml, text/xml, */*");u.se tRequestHe ader("Cont ent-Type", "text/xml; charset=u tf-8");u.s etRequestH eader("SOA PAction",t his._Actio n.Create); u.onreadys tatechange =function( ){i.parseR esponse(u) };u.send(r )},createR esponse:fu nction(){r eturn new MCS.Global Functions. _response( 200,functi on(n){retu rn n.selec tSingleNod e("//Creat eResult"). text})},re trieveRequ est:functi on(n,t,i,r ){var f='< Retrieve x mlns="http ://schemas .microsoft .com/xrm/2 011/Contra cts/Servic es">',u;f+ ="<entityN ame>"+n+"< \/entityNa me>";f+="< id>"+t+"<\ /id>";f+=M CS.GlobalF unctions._ getColumnS et(i);f+=" <\/Retriev e>";f=this ._getSOAPW rapper(f); u=new XMLH ttpRequest ;u.open("P OST",this. _getClient Url("SOAP" )+"/web",! 0);u.setRe questHeade r("Accept" ,"applicat ion/xml, t ext/xml, * /*");u.set RequestHea der("Conte nt-Type"," text/xml; charset=ut f-8");u.se tRequestHe ader("SOAP Action",th is._Action .Retrieve) ;u.onready statechang e=function (){r._pars eResponse( u)};u.send (f)},retri eveRespons e:function (){return new MCS.Gl obalFuncti ons._respo nse(200,fu nction(n){ for(var i, r=n.select Nodes("//a :KeyValueP airOfstrin ganyType") ,f={},t=0; t<r.length ;t++){var e=r[t].sel ectSingleN ode("b:key ").text,o= r[t].selec tSingleNod e("b:value ").attribu tes.getNam edItem("i: type").tex t,u=r[t].s electSingl eNode("b:v alue");swi tch(o){cas e"c:guid": case"c:str ing":f[e]= u.text;bre ak;case"a: EntityRefe rence":i={ };i.Id=u.s electSingl eNode("a:I d").text;i .LogicalNa me=u.selec tSingleNod e("a:Logic alName").t ext;i.Name =u.selectS ingleNode( "a:Name"). text;f[e]= i;break;de fault:thro w new Erro r("Parsing "+o+" att ributes no t Implemen ted.");}}r eturn f})} ,updateReq uest:funct ion(){},up dateRespon se:functio n(){},dele teRequest: function() {},deleteR esponse:fu nction(){} ,_getSOAPW rapper:fun ction(n){v ar t='<s:E nvelope xm lns:s="htt p://schema s.xmlsoap. org/soap/e nvelope/"> <s:Body>'; return t+= n,t+"<\/s: Body><\/s: Envelope>" },_getAttr ibuteWrapp er:functio n(n){for(v ar i,r='<b :Attribute s xmlns:c= "http://sc hemas.data contract.o rg/2004/07 /System.Co llections. Generic">' ,t=0;t<n.l ength;t++) {i="<b:Key ValuePairO fstringany Type>"+("< c:key>"+n[ t].name+"< \/c:key>") ;switch(n[ t].type){c ase"string ":i+='<c:v alue i:typ e="d:'+n[t ].type+'" ';i+=' xml ns:d="http ://www.w3. org/2001/X MLSchema"> '+n[t].val ue+"<\/c:v alue>";bre ak;case"En tityRefere nce":i+='< c:value i: type="b:En tityRefere nce">';i+= "<b:Id>"+n [t].value. Id+"<\/b:I d>";i+="<b :LogicalNa me>"+n[t]. value.Logi calName+"< \/b:Logica lName>";i+ =n[t].valu e.Name==nu ll?'<b:Nam e i:nil="t rue"/>':"< b:Name>"+n [t].value. Name+"<\/b :Name>";i+ ="<\/c:val ue>"}i+="< \/b:KeyVal uePairOfst ringanyTyp e>";r+=i}r eturn r+"< \/b:Attrib utes>"},co lumnSet:fu nction(n){ var t,i,u, r;if(n==nu ll)return{ allColumns :!1,column s:[]};t="T he columns parameter must be a comma sep arated lis t of strin gs or an a rray of st rings.";i= [];switch( typeof n){ case"strin g":i=n.spl it(",");br eak;case"o bject":if( n instance of Array){ for(u=!0,r =0;r<n.len gth;r++)if (typeof n[ r]!="strin g"){u=!1;b reak}if(u) i=n;else t hrow new E rror(t);}e lse throw new Error( t);break;d efault:thr ow new Err or(t);}ret urn{allCol umns:!1,co lumns:i}}, _getColumn Set:functi on(n){var t='<column Set xmlns: b="http:// schemas.mi crosoft.co m/xrm/2011 /Contracts "',i;if(t+ =' xmlns:i ="http://w ww.w3.org/ 2001/XMLSc hema-insta nce">',n.a llColumns= =!0)t+="<b :AllColumn s>true<\/b :AllColumn s>";else{f or(t+="<b: AllColumns >false<\/b :AllColumn s>",t+='<b :Columns x mlns:c="ht tp://schem as.microso ft.com/200 3/10/Seria lization/A rrays">',i =0;i<n.col umns.lengt h;i++)t+=" <c:string> "+n.column s[i]+"<\/c :string>"; t+="<\/b:C olumns>"}r eturn t+"< \/columnSe t>"},_Acti on:{Execut e:"http:// schemas.mi crosoft.co m/xrm/2011 /Contracts /Services/ IOrganizat ionService /Execute", Create:"ht tp://schem as.microso ft.com/xrm /2011/Cont racts/Serv ices/IOrga nizationSe rvice/Crea te",Retrie ve:"http:/ /schemas.m icrosoft.c om/xrm/201 1/Contract s/Services /IOrganiza tionServic e/Retrieve ",Update:" http://sch emas.micro soft.com/x rm/2011/Co ntracts/Se rvices/IOr ganization Service/Up date",Dele te:"http:/ /schemas.m icrosoft.c om/xrm/201 1/Contract s/Services /IOrganiza tionServic e/Delete", RunWorkflo w:"http:// schemas.mi crosoft.co m/xrm/2011 /Contracts /Services/ IOrganizat ionService /Execute"} ,_getError :function( n){var e=" Unknown Er ror (Unabl e to parse the fault )",u,t,i,r ,f;if(type of n=="obj ect")try{f or(u=n.fir stChild.fi rstChild,t =0;t<u.chi ldNodes.le ngth;t++)i f(i=u.chil dNodes[t], "s:Fault"= =i.nodeNam e){for(r=0 ;r<i.child Nodes.leng th;r++)if( f=i.childN odes[r],"f aultstring "==f.nodeN ame){e=f.t ext;break} break}}cat ch(o){}ret urn new Er ror(e)},_r esponse:fu nction(n,t ){return{_ state:"sen t",_data:n ull,_error :null,_par seData:t,o nComplete: null,_pars eResponse: function(i ){i.readyS tate==4&&( this._stat e="recieve d",i.statu s==n?(this ._data=t(i .responseX ML),this._ state="com plete",thi s.onComple te!=null&& this.onCom plete()):( this._stat e="error", this._erro r=new MCS. GlobalFunc tions._get Error(i.re sponseXML) ,this.onCo mplete!=nu ll&&this.o nComplete( )))},getEr ror:functi on(){if(th is._error! =null)retu rn this._e rror;throw new Error ("No error exists.") ;},getStat e:function (){return this._stat e},getData :function( ){if(this. _state=="c omplete")r eturn this ._data;thr ow new Err or("Data i s not read y yet.");} }},createR estRecord: function(n ,t,i){var u=window.J SON.string ify(n),r=n ew XMLHttp Request;r. open("POST ",this._ge tClientUrl ("ODATA")+ "/"+i,!0); r.setReque stHeader(" Accept","a pplication /json");r. setRequest Header("Co ntent-Type ","applica tion/json; charset=u tf-8");r.o nreadystat echange=fu nction(){M CS.GlobalF unctions.c reateRestR eqCallBack (this,t)}; r.send(u)} ,createRes tReqCallBa ck:functio n(n,t){if( n.readySta te==4)if(n .status==2 01){var i= JSON.parse (n.respons eText).d;t (i)}else M CS.GlobalF unctions.e rrorHandle r(n)},Retr ieveRecord s:function (n,t){var i=new XMLH ttpRequest ;i.open("G ET",this._ getClientU rl("ODATA" )+n,!0);i. setRequest Header("Ac cept","app lication/j son");i.se tRequestHe ader("Cont ent-Type", "applicati on/json; c harset=utf -8");i.onr eadystatec hange=func tion(){MCS .GlobalFun ctions.Ret rieveRecor dsCallBack (this,t)}; i.send()}, dateRevive r:function (n,t){var i;return t ypeof t==" string"&&( i=/^(\d{4} )-(\d{2})- (\d{2})T(\ d{2}):(\d{ 2}):(\d{2} (?:\.\d*)? )Z$/.exec( t),i)?new Date(Date. UTC(+i[1], +i[2]-1,+i [3],+i[4], +i[5],+i[6 ])):t},Ret rieveRecor dsCallBack :function( n,t){var i ,r;n.ready State==4&& (n.status= =200?(i=JS ON.parse(n .responseT ext,MCS.Gl obalFuncti ons.dateRe viver).d,t (i.results ),null!=i. __next&&(r =i.__next. replace(MC S.GlobalFu nctions.Ge tODataPath (),""),MCS .GlobalFun ctions.Ret rieveRecor ds(r,t))): MCS.Global Functions. errorHandl er(n))},er rorHandler :function( n){n?n.sta tus!=null? XMLHttpReq uest.statu sText!=nul l?alert("E rror : "+n .status+": "+n.statu sText+": " +JSON.pars e(n.respon seText).er ror.messag e.value):a lert(XMLHt tpRequest) :alert(XML HttpReques t):alert(" Unknown er ror occurr ed")},__na mespace:!0 };XrmSvcTo olkit=func tion(n,t){ | |
| 24 | /** | |
| 25 | * XrmS vcToolkit v0.2, a sm all JavaSc ript libra ry that he lps access | |
| 26 | * Micr osoft Dyna mics CRM 2 011 web se rvice inte rfaces (SO AP and RES T) | |
| 27 | * | |
| 28 | * @cop yright Copyright (c) 2011 - 2013, Kin gswaySoft (http://ww w.kingsway soft.com) | |
| 29 | * @lic ense Microsoft Public Lic ense (Ms-P L) | |
| 30 | * @dev eloper Daniel Cai (http://d anielcai.b logspot.co m) | |
| 31 | * @con tributors George Dou binski, Mi tch Milam, Carsten G roth | |
| 32 | * | |
| 33 | * THIS SOFTWARE IS PROVIDE D BY Kings waySoft '' AS IS'' AN D ANY | |
| 34 | * EXPR ESS OR IMP LIED WARRA NTIES, INC LUDING, BU T NOT LIMI TED TO, TH E IMPLIED | |
| 35 | * WARR ANTIES OF MERCHANTAB ILITY AND FITNESS FO R A PARTIC ULAR PURPO SE ARE | |
| 36 | * DISC LAIMED. IN NO EVENT SHALL King swaySoft B E LIABLE F OR ANY | |
| 37 | * DIRE CT, INDIRE CT, INCIDE NTAL, SPEC IAL, EXEMP LARY, OR C ONSEQUENTI AL DAMAGES | |
| 38 | * (INC LUDING, BU T NOT LIMI TED TO, PR OCUREMENT OF SUBSTIT UTE GOODS OR SERVICE S; | |
| 39 | * LOSS OF USE, D ATA, OR PR OFITS; OR BUSINESS I NTERRUPTIO N) HOWEVER CAUSED AN D | |
| 40 | * ON A NY THEORY OF LIABILI TY, WHETHE R IN CONTR ACT, STRIC T LIABILIT Y, OR TORT | |
| 41 | * (INC LUDING NEG LIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF TH E USE OF T HIS | |
| 42 | * SOFT WARE, EVEN IF ADVISE D OF THE P OSSIBILITY OF SUCH D AMAGE. | |
| 43 | * | |
| 44 | */ | |
| 45 | var o="/XR MServices/ 2011/Organ izationDat a.svc",tt= "/XRMServi ces/2011/O rganizatio n.svc/web" ,c=Object. prototype. toString,i =function( n){return c.call(n)= =="[object Function] "},it=func tion(n){re turn!isNaN (parseInt( n))},l=fun ction(n){r eturn c.ca ll(n)==="[ object Str ing]"},rt= function(n ){return c .call(n)== ="[object Array]"},r =function( n){return! l(n)||n.le ngth===0?! 1:/[^\s]+/ .test(n)}, v=/^(\d{4} )-(\d{2})- (\d{2})T(\ d{2}):(\d{ 2}):(\d{2} )\.?(\d*)? (Z|[+-]\d{ 2}?(:\d{2} )?)?$/,y=/ ^\/Date\(( [-+]?\d+)\ )\/$/,h=fu nction(){i f(i(n.GetG lobalConte xt))return GetGlobal Context(); if(Xrm!=t) return Xrm .Page.cont ext;throw new Error( "CRM conte xt is not available. ");}(),e=f unction(){ var r,i;re turn h.get ClientUrl! ==t?h.getC lientUrl() :(r=n.loca tion.proto col+"//"+n .location. host,h.isO utlookClie nt()&&!h.i sOutlookOn line())?r: (i=h.getCl ientUrl(), i=i.replac e(/^(http| https):\/\ /([_a-zA-Z 0-9\-\.]+) (:([0-9]{1 ,5}))?/,r) ,i=i.repla ce(/\/$/," "),i)}(),u t=function (n){var t; try{t=JSON .parse(n.r esponseTex t).error.m essage.val ue}catch(i ){t=n.resp onseText}r eturn t=t. length>0?" Error: "+n .status+": "+n.statu sText+": " +t:"Error: "+n.statu s+": "+n.s tatusText, new Error( t)},ft=fun ction(n){v ar t=n.res ponseText. length>0?" Error: "+n .status+": "+n.statu sText+": " +n.respons eText:"Err or: "+n.st atus+": "+ n.statusTe xt;return new Error( t)},et=fun ction(n,t) {if(typeof t=="strin g"&&t.matc h(y)){var i=t.replac e(y,"$1"); return new Date(pars eInt(i,10) )}return t },ot=funct ion(n){var t,i,r;if( n==null)re turn null; if(n=="")r eturn"";fo r(i="",r=0 ;r<n.lengt h;r++)t=n. charCodeAt (r),i=t>96 &&t<123||t >64&&t<91| |t>47&&t<5 8||t==32|| t==44||t== 46||t==45| |t==95?i+S tring.from CharCode(t ):i+"&#"+t +";";retur n i},st=fu nction(n){ if(n==null ||!n.match (v))return null;var t=v.exec(n );return n ew Date(Da te.UTC(par seInt(t[1] ,10),parse Int(t[2],1 0)-1,parse Int(t[3],1 0),parseIn t(t[4],10) -(t[8]=="" ||t[8]=="Z "?0:parseI nt(t[8])), parseInt(t [5],10),pa rseInt(t[6 ],10)))},p =function( n,t){for(v ar r,i=0;i <n.attribu tes.length ;i++)if(r= n.attribut es[i],r.na me==t)retu rn r.value },u=functi on(n){retu rn n.text! ==t?n.text :n.textCon tent},w=fu nction(n,t ){switch(n ){case"c:s tring":cas e"c:guid": return u(t );case"c:b oolean":re turn u(t)= =="true";c ase"c:int" :return pa rseInt(u(t ));case"c: decimal":c ase"c:doub le":return parseFloa t(u(t));ca se"c:dateT ime":retur n st(u(t)) ;case"a:Op tionSetVal ue":return t=f(t,"a: Value"),{V alue:parse Int(u(t))} ;case"a:Mo ney":retur n t=f(t,"a :Value"),{ Value:u(t) };case"a:E ntityRefer ence":retu rn ht(t);c ase"a:Enti tyCollecti on":return k(t);case "a:Aliased Value":ret urn t=f(t, "a:Value") ,n=p(t,"i: type"),w(n ,t);defaul t:throw ne w Error('U nhandled f ield type: "'+n+'", please rep ort the pr oblem to t he develop er. ');}}, b=function (n,i){if(r t(n)&&n.le ngth>0)ret urn n.join (",");if(l (n))return n;if(i!=t )throw new Error(i+" parameter must be e ither a de limited st ring or an array. ") ;else retu rn""},k=fu nction(n){ for(var t, h,i,r,l,e, a,v,y,b,k, o,s=0;s<n. childNodes .length;s+ +){t=n.chi ldNodes[s] ;switch(t. nodeName){ case"a:Ent ityName":v =u(t);brea k;case"a:M oreRecords ":y=u(t)== ="true";br eak;case"a :PagingCoo kie":b=u(t );break;ca se"a:Total RecordCoun t":k=parse Int(u(t)); break;case "a:Entitie s":o=t}}fo r(h={entit yName:v,mo reRecords: y,pagingCo okie:b,tot alRecordCo unt:k,enti ties:[]},i =0;i<o.chi ldNodes.le ngth;i++){ var c={for mattedValu es:[]},d=o .childNode s[i],g=f(d ,"a:Attrib utes");for (r=0;r<g.c hildNodes. length;r++ ){var nt=g .childNode s[r],it=u( f(nt,"b:ke y")),tt=f( nt,"b:valu e"),rt=p(t t,"i:type" );c[it]=w( rt,tt)}for (l=f(d,"a: FormattedV alues"),e= 0;e<l.chil dNodes.len gth;e++)a= l.childNod es[e],c.fo rmattedVal ues[u(f(a, "b:key"))] =u(f(a,"b: value"));h .entities. push(c)}re turn h},ht =function( n){for(var t,r,f,e,i =0;i<n.chi ldNodes.le ngth;i++){ t=n.childN odes[i];sw itch(t.nod eName){cas e"a:Id":r= u(t);break ;case"a:Lo gicalName" :f=u(t);br eak;case"a :Name":e=u (t)}}retur n{Id:r,Log icalName:f ,Name:e}}, f=function (n,t){for( var r,i=0; i<n.childN odes.lengt h;i++)if(r =n.childNo des[i],r.n odeName==t )return r} ,ct=functi on(n){try{ var t=n.fi rstChild.f irstChild, i=f(t,"s:F ault"),r=f (i,"faults tring");re turn new E rror(u(r)) }catch(e){ return new Error("An error occ urred when parsing t he error r eturned fr om CRM ser ver: "+e.m essage)}}, d=function (n,t,i){tr y{var r=n. firstChild .firstChil d.firstChi ld.firstCh ild}catch( u){i(u);re turn}retur n t(r)},lt =function( n){var t=f (n,"a:Resu lts"),i=f( t.firstChi ld,"b:valu e");return k(i)},g=f unction(n, t,i){if(n. status>=20 0&&n.statu s<300||n.s tatus===30 4||n.statu s===1223){ try{var r= !n.respons eText?null :JSON.pars e(n.respon seText,et) .d}catch(u ){i(u);ret urn}return t(r)}i(ut (n))},s=fu nction(n,t ,i){var r= new XMLHtt pRequest,u ;if(r.open (n.type,n. url,n.asyn c),r.setRe questHeade r("Accept" ,"applicat ion/json") ,r.setRequ estHeader( "Content-T ype","appl ication/js on; charse t=utf-8"), !n.method| |r.setRequ estHeader( "X-HTTP-Me thod",n.me thod),u=!1 ,n.async)r .onreadyst atechange= function() {r.readySt ate==4&&g( r,t,i)},n. data?r.sen d(n.data): r.send();e lse try{re turn n.dat a?r.send(n .data):r.s end(),g(r, t,i)}catch (f){i(f)}} ,a=functio n(n,t,i,r) {var u=new XMLHttpRe quest,f,s, o;if(u.ope n("POST",e +tt,t),u.s etRequestH eader("Acc ept","appl ication/xm l, text/xm l, */*"),u .setReques tHeader("C ontent-Typ e","text/x ml; charse t=utf-8"), u.setReque stHeader(" SOAPAction ","http:// schemas.mi crosoft.co m/xrm/2011 /Contracts /Services/ IOrganizat ionService /Execute") ,f=['<s:En velope xml ns:s="http ://schemas .xmlsoap.o rg/soap/en velope/">< s:Body>',n ,"<\/s:Bod y><\/s:Env elope>"].j oin(""),t) u.onreadys tatechange =function( ){u.readyS tate==4&&( u.status== 200?d(u.re sponseXML, i,r):r(ft( u)))},u.se nd(f);else {try{if(u. send(f),u. status==20 0)return d (u.respons eXML,i,r); o=ct(u.res ponseXML); r(o);retur n}catch(h) {r(h);retu rn}i(s)}}, at=functio n(n){if(!r (n.execute Xml))throw new Error ("executeX ml paramet er was not provided. ");var t= !!n.async; return a(n .executeXm l,t,functi on(r){retu rn i(n.suc cessCallba ck)&&n.suc cessCallba ck(r),t?vo id 0:r},fu nction(t){ if(i(n.err orCallback ))n.errorC allback(t) ;else thro w t;})},vt =function( n){if(!r(n .id))throw new Error ("id param eter was n ot provide d. ");if(! r(n.entity Name))thro w new Erro r("entityN ame parame ter was no t provided . ");if(!i t(n.stateC ode))throw new Error ("stateCod e paramete r must be an integer . ");n.sta tusCode==n ull&&(n.st atusCode=- 1);var u=[ '<Execute xmlns="htt p://schema s.microsof t.com/xrm/ 2011/Contr acts/Servi ces">','<r equest i:t ype="b:Set StateReque st"',' xml ns:a="http ://schemas .microsoft .com/xrm/2 011/Contra cts" ',' x mlns:b="ht tp://schem as.microso ft.com/crm /2011/Cont racts" ',' xmlns:c=" http://sch emas.datac ontract.or g/2004/07/ System.Col lections.G eneric" ', ' xmlns:i= "http://ww w.w3.org/2 001/XMLSch ema-instan ce">',"<a: Parameters >","<a:Key ValuePairO fstringany Type>","<c :key>Entit yMoniker<\ /c:key>",' <c:value i :type="a:E ntityRefer ence">',"< a:Id>",n.i d,"<\/a:Id >","<a:Log icalName>" ,n.entityN ame,"<\/a: LogicalNam e>",'<a:Na me i:nil=" true" />', "<\/c:valu e>","<\/a: KeyValuePa irOfstring anyType>", "<a:KeyVal uePairOfst ringanyTyp e>","<c:ke y>State<\/ c:key>",'< c:value i: type="a:Op tionSetVal ue">',"<a: Value>",n. stateCode, "<\/a:Valu e>","<\/c: value>","< \/a:KeyVal uePairOfst ringanyTyp e>","<a:Ke yValuePair Ofstringan yType>","< c:key>Stat us<\/c:key >",'<c:val ue i:type= "a:OptionS etValue">' ,"<a:Value >",n.statu sCode,"<\/ a:Value>", "<\/c:valu e>","<\/a: KeyValuePa irOfstring anyType>", "<\/a:Para meters>",' <a:Request Id i:nil=" true"/>'," <a:Request Name>SetSt ate<\/a:Re questName> ","<\/requ est>","<\/ Execute>"] .join(""), t=!!n.asyn c;return a (u,t,funct ion(r){ret urn i(n.su ccessCallb ack)&&n.su ccessCallb ack(r),t?v oid 0:r},f unction(t) {if(i(n.er rorCallbac k))n.error Callback(t );else thr ow t;})},y t=function (n){if(!r( n.fetchXml ))throw ne w Error("f etchXml pa rameter wa s not prov ided. ");v ar u=['<Ex ecute xmln s="http:// schemas.mi crosoft.co m/xrm/2011 /Contracts /Services" >','<reque st i:type= "a:Retriev eMultipleR equest"',' xmlns:a=" http://sch emas.micro soft.com/x rm/2011/Co ntracts" ' ,' xmlns:i ="http://w ww.w3.org/ 2001/XMLSc hema-insta nce">','<a :Parameter s xmlns:c= "http://sc hemas.data contract.o rg/2004/07 /System.Co llections. Generic">' ,"<a:KeyVa luePairOfs tringanyTy pe>","<c:k ey>Query<\ /c:key>",' <c:value i :type="a:F etchExpres sion">',"< a:Query>", ot(n.fetch Xml),"<\/a :Query>"," <\/c:value >","<\/a:K eyValuePai rOfstringa nyType>"," <\/a:Param eters>",'< a:RequestI d i:nil="t rue"/>',"< a:RequestN ame>Retrie veMultiple <\/a:Reque stName>"," <\/request >","<\/Exe cute>"].jo in(""),t=! !n.async;r eturn a(u, t,function (r){var u= lt(r);retu rn i(n.suc cessCallba ck)&&n.suc cessCallba ck(u),t?vo id 0:u},fu nction(t){ if(i(n.err orCallback ))n.errorC allback(t) ;else thro w t;})},pt =function( n){var h;i f(!r(n.ent ityName))t hrow new E rror("enti tyName par ameter was not provi ded. ");if (!r(n.id)) throw new Error("id parameter was not pr ovided. ") ;var f=n.s elect==nul l?"":b(n.s elect,"sel ect"),u=n. expand==nu ll?"":b(n. expand,"ex pand"),t=" ";return(f .length>0| |u.length> 0)&&(t="?" ,f.length> 0&&(t+="$s elect="+f, u.length>0 &&(t+="&") ),u.length >0&&(t+="$ expand="+u )),h={url: e+o+"/"+n. entityName +"Set(guid '"+n.id+"' )"+t,type: "GET",asyn c:!!n.asyn c},s(h,fun ction(t){r eturn i(n. successCal lback)&&n. successCal lback(t),n .async?voi d 0:t},fun ction(t){i f(i(n.erro rCallback) )n.errorCa llback(t); else throw t;})},nt= function(n ){var t,u; if(!r(n.en tityName)) throw new Error("ent ityName pa rameter wa s not prov ided. ");i f(t="",n.o dataQuery! =null){if( !l(n.odata Query))thr ow new Err or("odataQ uery param eter must be a strin g. ");t=n. odataQuery .charAt(0) !="?"?"?"+ n.odataQue ry:n.odata Query}retu rn u={url: e+o+"/"+n. entityName +"Set"+t,t ype:"GET", async:!!n. async},s(u ,function( t){if(i(n. successCal lback)&&n. successCal lback(t.re sults),!n. async)retu rn t.resul ts;t.__nex t!=null?(n .odataQuer y=t.__next .substring ((e+o+"/"+ n.entityNa me+"Set"). length),nt (n)):i(n.c ompletionC allback)&& n.completi onCallback ()},functi on(t){if(i (n.errorCa llback))n. errorCallb ack(t);els e throw t; })},wt=fun ction(u){i f(!r(u.ent ityName))t hrow new E rror("enti tyName par ameter was not provi ded. ");if (u.entity= ==null||u. entity===t )throw new Error("en tity param eter was n ot provide d. ");var f={url:e+o +"/"+u.ent ityName+"S et",type:" POST",data :n.JSON.st ringify(u. entity),as ync:!!u.as ync};retur n s(f,func tion(n){re turn i(u.s uccessCall back)&&u.s uccessCall back(n),u. async?void 0:n},func tion(n){if (i(u.error Callback)) u.errorCal lback(n);e lse throw n;})},bt=f unction(u) {if(!r(u.e ntityName) )throw new Error("en tityName p arameter w as not pro vided. "); if(!r(u.id ))throw ne w Error("i d paramete r was not provided. ");if(u.en tity===nul l||u.entit y===t)thro w new Erro r("entity parameter was not pr ovided. ") ;var f={ur l:e+o+"/"+ u.entityNa me+"Set(gu id'"+u.id+ "')",type: "POST",met hod:"MERGE ",data:n.J SON.string ify(u.enti ty),async: !!u.async} ;return s( f,function (n){return i(u.succe ssCallback )&&u.succe ssCallback (n),u.asyn c?void 0:n },function (n){if(i(u .errorCall back))u.er rorCallbac k(n);else throw n;}) },kt=funct ion(n){if( !r(n.entit yName))thr ow new Err or("entity Name param eter was n ot provide d. ");if(! r(n.id))th row new Er ror("id pa rameter wa s not prov ided. ");v ar t={url: e+o+"/"+n. entityName +"Set(guid '"+n.id+"' )",type:"P OST",metho d:"DELETE" ,async:!!n .async};re turn s(t,f unction(t) {return i( n.successC allback)&& n.successC allback(t) ,n.async?v oid 0:t},f unction(t) {if(i(n.er rorCallbac k))n.error Callback(t );else thr ow t;})},d t=function (t){if(!r( t.entity1I d))throw n ew Error(" entity1Id parameter was not pr ovided. ") ;if(!r(t.e ntity1Name ))throw ne w Error("e ntity1Name parameter was not p rovided. " );if(!r(t. entity2Id) )throw new Error("en tity2Id pa rameter wa s not prov ided. ");i f(!r(t.ent ity2Name)) throw new Error("ent ity2Name p arameter w as not pro vided. "); if(!r(t.re lationship Name))thro w new Erro r("relatio nshipName parameter was not pr ovided. ") ;var u={ur i:e+o+"/"+ t.entity2N ame+"Set(g uid'"+t.en tity2Id+"' )"},f={url :e+o+"/"+t .entity1Na me+"Set(gu id'"+t.ent ity1Id+"') /$links/"+ t.relation shipName,t ype:"POST" ,data:n.JS ON.stringi fy(u),asyn c:!!t.asyn c};return s(f,functi on(n){retu rn i(t.suc cessCallba ck)&&t.suc cessCallba ck(n),t.as ync?void 0 :n},functi on(n){if(i (t.errorCa llback))t. errorCallb ack(n);els e throw n; })},gt=fun ction(n){i f(!r(n.ent ity1Id))th row new Er ror("entit y1Id param eter was n ot provide d. ");if(! r(n.entity 1Name))thr ow new Err or("entity 1Name para meter was not provid ed. ");if( !r(n.entit y2Id))thro w new Erro r("entity2 Id paramet er was not provided. ");if(!r( n.relation shipName)) throw new Error("rel ationshipN ame parame ter was no t provided . ");var t ={url:e+o+ "/"+n.enti ty1Name+"S et(guid'"+ n.entity1I d+"')/$lin ks/"+n.rel ationshipN ame+"(guid '"+n.entit y2Id+"')", type:"POST ",method:" DELETE",as ync:!!n.as ync};retur n s(t,func tion(t){re turn i(n.s uccessCall back)&&n.s uccessCall back(t),n. async?void 0:t},func tion(t){if (i(n.error Callback)) n.errorCal lback(t);e lse throw t;})};retu rn{context :h,serverU rl:e,retri eve:pt,ret rieveMulti ple:nt,cre ateRecord: wt,updateR ecord:bt,d eleteRecor d:kt,assoc iate:dt,di sassociate :gt,setSta te:vt,exec ute:at,fet ch:yt}}(wi ndow);MCS= MCS||{};MC S.Scripts= MCS.Script s||{};MCS. Scripts.Pr ocess=func tion(){var n=null,t= {Bool:"boo lean",Int: "int",Stri ng:"string ",DateTime :"dateTime ",EntityRe ference:"E ntityRefer ence",Opti onSet:"Opt ionSetValu e",Money:" Money",Gui d:"guid"}, r=function (n,t,i){va r c=functi on(n){var i=function (n,t,i){re turn n>t&& n<i},u,r,t ;if(typeof n=="undef ined"||n== =null||n== "")return" ";for(u="" ,r=0;r<n.l ength;r++) t=n.charCo deAt(r),u+ =i(t,96,12 3)||i(t,64 ,91)||i(t, 47,58)||i( t,43,47)|| t==95||t== 32?String. fromCharCo de(t):"&#" +t+";";ret urn u},e=" ",f="",o;i f(n)for(o= 0;o<n.leng th;o++){va r u=n[o],s =!1,r=":"+ u.Type,h=" http://www .w3.org/20 01/XMLSche ma";switch (u.Type){c ase"dateTi me":f=u.Va lue.toISOS tring();r= i+r;s=!0;b reak;case" EntityRefe rence":r=" a"+r;f="<a :Id>"+u.Va lue.id+"<\ /a:Id><a:L ogicalName >"+u.Value .entityTyp e+"<\/a:Lo gicalName> <a:Name i: nil='true' />";break ;case"Opti onSetValue ":case"Mon ey":r="a"+ r;f="<a:Va lue>"+u.Va lue+"<\/a: Value>";br eak;case"g uid":r=i+r ;f=u.Value ;includNS= !0;h="http ://schemas .microsoft .com/2003/ 10/Seriali zation/";b reak;case" string":r= i+r;f=c(u. Value);s=! 0;break;de fault:r=i+ r;f=u.Valu e;s=!0}e+= "<a:KeyVal uePairOfst ringanyTyp e><"+t+":k ey>"+u.Key +"<\/"+t+" :key><"+t+ ":value i: type='"+r+ "'";s&&(e+ =" xmlns:" +i+"='"+h+ "'");e+="> "+f+"<\/"+ t+":value> <\/a:KeyVa luePairOfs tringanyTy pe>"}retur n"<a:Param eters xmln s:"+t+"='h ttp://sche mas.dataco ntract.org /2004/07/S ystem.Coll ections.Ge neric'>"+e +"<\/a:Par ameters>"} ,u=functio n(n){retur n"<Execute xmlns='ht tp://schem as.microso ft.com/xrm /2011/Cont racts/Serv ices' xmln s:i='http: //www.w3.o rg/2001/XM LSchema-in stance'>"+ n+"<\/Exec ute>"},f=f unction(n) {return"<s :Envelope xmlns:s='h ttp://sche mas.xmlsoa p.org/soap /envelope/ '><s:Body> "+n+"<\/s: Body><\/s: Envelope>" },o=functi on(n,t){re turn"<requ est xmlns: a='http:// schemas.mi crosoft.co m/xrm/2011 /Contracts '>"+r(t,"b ","c")+"<a :RequestId i:nil='tr ue' /><a:R equestName >"+n+"<\/a :RequestNa me><\/requ est>"},s=f unction(n, i){return" <request i :type='b:E xecuteWork flowReques t' xmlns:a ='http://s chemas.mic rosoft.com /xrm/2011/ Contracts' xmlns:b=' http://sch emas.micro soft.com/c rm/2011/Co ntracts'>" +r([{Key:" EntityId", Type:t.Gui d,Value:i} ,{Key:"Wor kflowId",T ype:t.Guid ,Value:n}] ,"c","d")+ "<a:Reques tId i:nil= 'true' />< a:RequestN ame>Execut eWorkflow< \/a:Reques tName><\/r equest>"}, e=function (t){n==nul l&&(n=Xrm. Page.conte xt.getClie ntUrl(),n+ ="/XRMServ ices/2011/ Organizati on.svc/web ",n=n.repl ace("//XRM Services", "/XRMServi ces"));var i={url:n, type:"POST ",dataType :"xml",dat a:t,proces sData:!1,g lobal:!1,b eforeSend: function(n ){n.setReq uestHeader ("SOAPActi on","http: //schemas. microsoft. com/xrm/20 11/Contrac ts/Service s/IOrganiz ationServi ce/Execute ");n.setRe questHeade r("Accept" ,"applicat ion/xml, t ext/xml */ *");n.setR equestHead er("Conten t-Type","t ext/xml; c harset=utf -8")}};ret urn $.ajax (i)},h=fun ction(n,t) {var r=$.D eferred(); return e(f (u(o(n,t)) )).done(fu nction(n,t ,u){var f= i(u.respon seXML);r.r esolve(f,t ,u)}).fail (function( n){r.rejec t(n)}),r.p romise()}, i=function (n){var c= function(n ){var r,t; try{r={log icalName:n .getElemen tsByTagNam e("a:Logic alName")[0 ].text(),i d:n.getEle mentsByTag Name("a:Id ")[0].text (),attribu tes:i(n.ge tElementsB yTagName(" a:Attribut es")[0])}} catch(u){r eturn null }try{t=n.g etElements ByTagName( "a:Formatt edValues") ;t!=null&& t.length>0 &&(r.forma ttedValues =i(t))}cat ch(u){}ret urn r},l=f unction(n) {for(var i =n.getElem entsByTagN ame("a:Ent ity"),r=[] ,t=0;t<i.l ength;t++) r[t]=c(i[t ]);return r},r=n.get ElementsBy TagName("a :KeyValueP airOfstrin ganyType") ,s,e,u,f,o ;for((type of r=="und efined"||r ===null||r .length==0 )&&(r=n.ge tElementsB yTagName(" KeyValuePa irOfstring anyType")) ,r=typeof r=="undefi ned"||r=== null||r.le ngth==0?[] :r[0].pare ntNode.chi ldNodes,s= {},e=0;e<r .length;e+ +){var a=$ (r[e].chil dNodes[0]) .text(),t= $(r[e].chi ldNodes[1] ),h=t.attr ("i:type") ;if(typeof h!="undef ined"&&h!= null){if(u =t.attr("i :type").to LowerCase( ),u=u.subs tring(u.in dexOf(":") +1),f="",u =="aliased value"){fo r(o=0;o<t[ 0].childNo des.length ;o++)if(t[ 0].childNo des[o].tag Name=="a:V alue"){t=$ (t.childNo des[o]);br eak}u=t.at tr("i:type ").toLower Case();u=u .substring (u.indexOf (":")+1)}s witch(u){c ase"entity ":f=XmltoE ntity(t);b reak;case" entitycoll ection":f= l(t[0]);br eak;case"e ntityrefer ence":f={i d:$(t[0].c hildNodes[ 0]).text() ,entityTyp e:$(t[0].c hildNodes[ 1]).text() };t[0].chi ldNodes[2] &&(f.name= $(t[0].chi ldNodes[2] ).text()); break;case "datetime" :f=new Dat e(t.text() );break;ca se"decimal ":case"dou ble":case" int":case" money":cas e"optionse tvalue":f= Number(t.t ext());bre ak;case"bo olean":f=t .text().to LowerCase( )=="true"; break;defa ult:f=t.te xt()}s[a]= f}}return s},c=funct ion(n,t){r eturn e(f( u(s(n,t))) )};return{ DataType:t ,ExecuteAc tion:h,Exe cuteWorkfl ow:c}}();t ypeof MCS= ="undefine d"&&(MCS={ });MCS.mcs _Service_A ctivity_On Save={};MC S.mcs_Serv ice_Activi ty_OnSave. SetSchedul ed=functio n(){var n= Xrm.Page.g etAttribut e("resourc es").getVa lue();n!=n ull&&Xrm.P age.getAtt ribute("cv t_schedule d").setVal ue(1)};typ eof MCS==" undefined" &&(MCS={}) ;MCS.mcs_S ervice_Act ivity_OnLo ad={};tota lPatients= [];totalGr oupPatient s=[];MCS.P atients=[] ;MCS.mcs_S ervice_Act ivity_OnLo ad.OnLoad= function() {Xrm.Page. getAttribu te("cvt_ty pe").addOn Change(MCS .mcs_Servi ce_Activit y.CVTtoHom e);Xrm.Pag e.getAttri bute("mcs_ groupappoi ntment").a ddOnChange (MCS.mcs_S ervice_Act ivity.Grou pAppt);Xrm .Page.getA ttribute(" mcs_groupa ppointment ").addOnCh ange(MCS.m cs_Service _Activity. EnableTSA) ;Xrm.Page. getAttribu te("mcs_gr oupappoint ment").add OnChange(M CS.mcs_Ser vice_Activ ity.Handle OnChangeTS ALookup);X rm.Page.ge tAttribute ("mcs_grou pappointme nt").addOn Change(MCS .mcs_Servi ce_Activit y.CreateNa me);Xrm.Pa ge.getAttr ibute("cvt _telehealt hmodality" ).addOnCha nge(MCS.mc s_Service_ Activity.H andleOnCha ngeTSALook up);Xrm.Pa ge.getAttr ibute("mcs _relatedsi te").addOn Change(MCS .mcs_Servi ce_Activit y.EnableTS A);Xrm.Pag e.getAttri bute("mcs_ relatedsit e").addOnC hange(MCS. mcs_Servic e_Activity .HandleOnC hangeTSALo okup);Xrm. Page.getAt tribute("m cs_related providersi te").addOn Change(MCS .mcs_Servi ce_Activit y.EnableTS A);Xrm.Pag e.getAttri bute("mcs_ relatedpro vidersite" ).addOnCha nge(MCS.mc s_Service_ Activity.H andleOnCha ngeTSALook up);Xrm.Pa ge.getAttr ibute("mcs _servicety pe").addOn Change(MCS .mcs_Servi ce_Activit y.EnableSe rviceSubTy pe);Xrm.Pa ge.getAttr ibute("mcs _servicety pe").addOn Change(MCS .mcs_Servi ce_Activit y.HandleOn ChangeTSAL ookup);Xrm .Page.getA ttribute(" mcs_servic etype").ad dOnChange( MCS.mcs_Se rvice_Acti vity.Creat eName);Xrm .Page.getA ttribute(" mcs_servic esubtype") .addOnChan ge(MCS.mcs _Service_A ctivity.En ableTSA);X rm.Page.ge tAttribute ("mcs_serv icesubtype ").addOnCh ange(MCS.m cs_Service _Activity. HandleOnCh angeTSALoo kup);Xrm.P age.getAtt ribute("mc s_services ubtype").a ddOnChange (MCS.mcs_S ervice_Act ivity.Crea teName);Xr m.Page.get Attribute( "cvt_relat edprovider id").addOn Change(MCS .mcs_Servi ce_Activit y.HandleOn ChangeTSAL ookup);Xrm .Page.getA ttribute(" mcs_relate dtsa").add OnChange(M CS.mcs_Ser vice_Activ ity.GetTSA Data);Xrm. Page.getAt tribute("m cs_related tsa").addO nChange(MC S.mcs_Serv ice_Activi ty.HandleO nChangeTSA Lookup);Xr m.Page.get Attribute( "mcs_relat edtsa").ad dOnChange( MCS.mcs_Se rvice_Acti vity.Clear Resources) ;Xrm.Page. getAttribu te("mcs_re latedtsa") .addOnChan ge(MCS.mcs _Service_A ctivity.fi lterSubGri d);Xrm.Pag e.getAttri bute("mcs_ relatedtsa ").addOnCh ange(MCS.V IALogin.Sa ml);Xrm.Pa ge.getAttr ibute("cvt _samltoken ").addOnCh ange(MCS.V IALogin.Lo gin);Xrm.P age.getAtt ribute("cu stomers"). addOnChang e(MCS.mcs_ Service_Ac tivity.Blo ckAddPatie nt);MCS.mc s_Service_ Activity.E nableServi ceSubType( );MCS.mcs_ Service_Ac tivity.Ena bleTSA();M CS.mcs_Ser vice_Activ ity.GroupA ppt();MCS. mcs_Servic e_Activity _OnLoad.Se tDefaultDa teTime();M CS.mcs_Ser vice_Activ ity.GetTSA Data();MCS .mcs_Servi ce_Activit y.HandleOn ChangeTSAL ookup();MC S.mcs_Serv ice_Activi ty.CVTtoHo me();MCS.m cs_Service _Activity_ OnLoad.Rem oveNotific ation();MC S.mcs_Serv ice_Activi ty_OnLoad. ShowMVI(); MCS.mcs_Se rvice_Acti vity_OnLoa d.LoadPati ents();MCS .mcs_Servi ce_Activit y_OnLoad.R esetPatien ts();Xrm.P age.getAtt ribute("cv t_patuserd uz").setVa lue(null); Xrm.Page.g etAttribut e("cvt_pro userduz"). setValue(n ull)};MCS. mcs_Servic e_Activity _OnLoad.Se tDefaultDa teTime=fun ction(){Xr m.Page.get Attribute( "serviceid ").getValu e()==null& &(MCS.cvt_ Common.Dat eTime("sch eduledstar t",8,30),M CS.cvt_Com mon.DateTi me("schedu ledend",9, 30),Xrm.Pa ge.getAttr ibute("sch eduleddura tionminute s").setVal ue(60))};M CS.mcs_Ser vice_Activ ity_OnLoad .RemoveNot ification= function() {if(Xrm.Pa ge.getAttr ibute("mcs _groupappo intment"). getValue() ==!0&&Xrm. Page.ui.ge tFormType( )!=1){var n=Sys.Appl ication.fi ndComponen t("crmNoti fications" );n&&n.Set Visible(!1 )}};MCS.mc s_Service_ Activity_O nLoad.Show MVI=functi on(){var r =Xrm.Page. getAttribu te("custom ers"),i=r. getValue() !=null,t=X rm.Page.ui .tabs.get( "tab_7"),n =MCS.cvt_C ommon.MVIC onfig();n= n&&!MCS.cv t_Common.A ppointment OccursInPa st();t.set Visible(n) ;Xrm.Page. getControl ("customer s").setDis abled(!n); n&&!i?t.se tFocus():X rm.Page.ge tControl(" cvt_type") .setFocus( );i&&t.set DisplaySta te("collap sed")};MCS .mcs_Servi ce_Activit y_OnLoad.L oadPatient s=function (){var n=X rm.Page.ge tAttribute ("customer s"),t=n!=n ull?n.getV alue():[]; MCS.Patien ts=t};MCS. mcs_Servic e_Activity _OnLoad.Re setPatient s=function (){var n=X rm.Page.ge tAttribute ("customer s").getVal ue();Xrm.P age.getAtt ribute("cu stomers"). setValue(n )};EditSer viceActivi tySeries=f unction(){ var n=Xrm. Page.getAt tribute("c vt_recurri ngappointm entsmaster ").getValu e();n!=nul l&&Xrm.Uti lity.openE ntityForm( "recurring appointmen tmaster",n [0].id)};R eOpenServi ceActivity =function( ){var n=MC S.cvt_Comm on.userHas RoleInList ("TSS Data Administr ator|Syste m Administ rator|TSS Applicatio n Administ rator");n| |Xrm.Page. getAttribu te("owneri d").getVal ue()[0].id ==Xrm.Page .context.g etUserId() ?Mscrm.Com mandBarAct ions.activ ate(Xrm.Pa ge.data.en tity.getId (),Xrm.Pag e.data.ent ity.getEnt ityName()) :MCS.cvt_C ommon.open DialogOnCu rrentRecor d("0052040 9-98FB-4A1 E-B67C-D3D 6783ACB84" )};CancelS erviceActi vity=funct ion(){var e=MCS.VIAL ogin.Check VistaSwitc hes(),n="" ,u,f;if(e? (u=MCS.VIA Login.IsVa lidUserDuz (),u?n="B8 A805D8-01B 1-4922-80C A-D4E46F2E C836":(f=M CS.VIALogi n.IsValidS amlToken() ,f?(MCS.VI ALogin.Log in(),alert ("Unable t o cancel a ppointment in Vista until you have logge d into Vis ta.")):(MC S.VIALogin .Saml(),al ert("Unabl e to cance l appointm ent in Vis ta until y ou have lo gged into Vista."))) ):n="789CD 165-5CAD-4 9B3-ACF3-4 2C3D5B3158 4",openRec ords=Check GroupChild Records(), openRecord s>0&&(n="" ,alert("Fo r (clinic based) Gro up Appoint ments, you must canc el all Vis ta Appoint ments from the Block Resources before ca nceling th e whole ap ppointment . Found: "+openReco rds+" Book ed Vista A ppointment s")),n!="" ){var t={} ,i=Xrm.Pag e.getAttri bute("cvt_ patuserduz ").getValu e(),r=Xrm. Page.getAt tribute("c vt_prouser duz").getV alue();(i! =null||i!= "")&&(t.cv t_PatUserD uz=i);(r!= null||r!=" ")&&(t.cvt _ProUserDu z=r);CrmRe stKit.Upda te("Servic eAppointme nt",Xrm.Pa ge.data.en tity.getId (),t,!1).f ail(functi on(n){aler t(MCS.cvt_ Common.Res tError(n)) }).done(fu nction(){M CS.cvt_Com mon.openDi alogOnCurr entRecord( n)})}};Com pleteServi ceActivity =function( ){var n=[{ Key:"Targe t",Type:MC S.Scripts. Process.Da taType.Ent ityReferen ce,Value:{ id:Xrm.Pag e.data.ent ity.getId( ),entityTy pe:"servic eappointme nt"}}];MCS .Scripts.P rocess.Exe cuteAction ("cvt_Comp leteAppoin tment",n). done(funct ion(){Xrm. Page.ui.cl ose()}).fa il(functio n(n){alert ("Failed t o Complete this appo intment. Details: " +n.Respons eText)})}; CheckGroup ChildRecor ds=functio n(){var n, i=Xrm.Page .getAttrib ute("mcs_g roupappoin tment").ge tValue(),r =Xrm.Page. getAttribu te("cvt_ty pe").getVa lue(),t;re turn i&&!r &&(t="cvt_ VistAStatu s eq 'BOOK ED' and cv t_ServiceA ctivity/Id eq (Guid' "+Xrm.Page .data.enti ty.getId() +"')",CrmR estKit.ByQ uery("cvt_ vistainteg rationresu lt",["cvt_ name"],t,! 1).fail(fu nction(t){ alert("una ble to ret rieve grou p: "+MCS.c vt_Common. RestError( t));n=0;re turn}).don e(function (t){t&&t.d &&t.d.resu lts!=null& &(n=t.d.re sults.leng th)})),n}; OnDialogCl ose=functi on(n,t){(! n||n.close d)&&(clear Interval(t ),CrmRestK it.Retriev e("Service Appointmen t",Xrm.Pag e.data.ent ity.getId( ),["StateC ode"],!1). fail(funct ion(){wind ow.locatio n.reload(! 0)}).done( function(n ){saRecord =n.d;saRec ord.StateC ode!=null& &(saRecord .StateCode .Value==1| |saRecord. StateCode. Value==2)& &window.lo cation.rel oad(!0)})) };SaveSA=f unction(){ SaveRecord (null)};Sa veAndClose SA=functio n(){SaveRe cord("save andclose") };SaveAndN ewSA=funct ion(){Save Record("sa veandnew") };SaveReco rd=functio n(n){var h =MCS.VIALo gin.IsVali dUserDuz() ,f,t,i,r,o ,u;if(!h){ alert("Vis ta login h as expired , attempti ng to get new login" );MCS.VIAL ogin.Saml( );return}v ar c=Xrm.P age.getAtt ribute("mc s_groupapp ointment") .getValue( ),s=Xrm.Pa ge.getAttr ibute("cvt _type").ge tValue(),e =!1;if(c&& !s){Xrm.Pa ge.data.en tity.save( n);return} if(f=Xrm.P age.getAtt ribute("cu stomers"), t=f!=null? f.getValue ()!=null?f .getValue( ):null:nul l,t==null| |t.length= =0){alert( "You must add a pati ent to all individua l or Home/ Mobile Gro up appoint ments");re turn}for(r =!1,o=0,u= 0;u<t.leng th;u++)if( r=!1,CrmRe stKit.Retr ieve("Cont act",t[u]. id,["Conta ctId","EMa ilAddress1 ","DoNotEM ail","cvt_ BLTablet"] ,!1).fail( function() {alert("Pa tient coul d not be f ound: "+t[ u].id);ret urn}).done (function( n){i=n.d;v ar t=i.DoN otEMail!=n ull?i.DoNo tEMail:!1; (i.cvt_BLT ablet==nul l||i.cvt_B LTablet==" ")&&(e=s); i.EMailAdd ress1!=nul l&&i.EMail Address1!= ""&&(r=!0) ;t&&!e&&(r =!0)}),!r) {o=u;break }r?Xrm.Pag e.data.ent ity.save(n ):EnterEma il(t[o].id ,e)};Enter Email=func tion(n,t){ t?(alert(" All vetera ns using V MRs must h ave email addresses before the y can be b ooked. En ter patien t's email and try to save agai n or else inform the veteran t hat he/she will need to find a nother vid eo visit o ption."),M CS.cvt_Com mon.openDi alogProces s("52e2a47 a-becc-449 f-821a-0b9 5916e1cb1" ,"contact" ,n)):(aler t("Please Enter the patient's email addr ess or els e opt them out of em ails and t hen try to save agai n."),MCS.c vt_Common. openDialog Process("A B9FF42A-AD AC-4C01-AD E7-01C1A1F 7E320","co ntact",n)) };typeof M CS=="undef ined"&&(MC S={});type of MCS.mcs _Service_A ctivity==" undefined" &&(MCS.mcs _Service_A ctivity={} );MCS.mcs_ Service_Ac tivity.FOR M_TYPE_CRE ATE=1;MCS. mcs_Servic e_Activity .FORM_TYPE _UPDATE=2; MCS.mcs_Se rvice_Acti vity.FORM_ TYPE_READ_ ONLY=3;MCS .mcs_Servi ce_Activit y.FORM_TYP E_DISABLED =4;MCS.mcs _Service_A ctivity.Ge tTSAData=f unction(){ var n=Xrm. Page.getAt tribute("m cs_related tsa").getV alue();n!= null?(MCS. mcs_Servic e_Activity .getmcs_re latedtsaLo okupData(n [0].id),MC S.mcs_Serv ice_Activi ty.GroupPa t()):(Xrm. Page.getAt tribute("s erviceid") .setValue( null),Xrm. Page.getAt tribute("m cs_service type").set Value(null ),Xrm.Page .getAttrib ute("mcs_s ervicesubt ype").setV alue(null) )};MCS.mcs _Service_A ctivity.ge tmcs_relat edtsaLooku pData=func tion(n){Cr mRestKit.R etrieve("m cs_service s",n,["cvt _servicesu btype","cv t_servicet ype","mcs_ RelatedSer viceId","c vt_Type"," cvt_Availa bleTelehea lthModalit ies","cvt_ relatedpat ientsiteid ","cvt_rel atedprovid ersiteid", "cvt_group appointmen t","cvt_Sc hedulingIn structions "],!0).fai l(function (){alert(" Please ver ify that t his TSA is in Produc tion, and if so, con tact your system adm inistrator ");return} ).done(fun ction(n){M CS.mcs_Ser vice_Activ ity.SetLoo kup(n.d.mc s_RelatedS erviceId,X rm.Page.ge tAttribute ("servicei d"));MCS.m cs_Service _Activity. SetLookup( n.d.cvt_se rvicetype, Xrm.Page.g etAttribut e("mcs_ser vicetype") );MCS.mcs_ Service_Ac tivity.Set Lookup(n.d .cvt_servi cesubtype, Xrm.Page.g etAttribut e("mcs_ser vicesubtyp e"));MCS.m cs_Service _Activity. SetLookup( n.d.cvt_re latedpatie ntsiteid,X rm.Page.ge tAttribute ("mcs_rela tedsite")) ;MCS.mcs_S ervice_Act ivity.SetL ookup(n.d. cvt_relate dproviders iteid,Xrm. Page.getAt tribute("m cs_related providersi te"));Xrm. Page.getAt tribute("m cs_service type").fir eOnChange( );n.d.cvt_ Type!=null &&Xrm.Page .getAttrib ute("cvt_t ype").setV alue(n.d.c vt_Type);n .d.cvt_gro upappointm ent!=null& &Xrm.Page. getAttribu te("mcs_gr oupappoint ment").set Value(n.d. cvt_groupa ppointment );Xrm.Page .getAttrib ute("cvt_t elehealthm odality"). setValue(n .d.cvt_Ava ilableTele healthModa lities.Val ue==917290 001);n.d.c vt_Schedul ingInstruc tions!=nul l&&Xrm.Pag e.getAttri bute("cvt_ scheduling instructio ns").setVa lue(n.d.cv t_Scheduli ngInstruct ions)})};M CS.mcs_Ser vice_Activ ity.SetLoo kup=functi on(n,t){if (t!=null){ var i={id: n.Id,entit yType:n.Lo gicalName, name:n.Nam e};i.name= =null?t.se tValue(nul l):t.setVa lue([i])}} ;MCS.mcs_S ervice_Act ivity.Enab leTSA=func tion(){var n=null,r= null,t=nul l,u=null,f =Xrm.Page. getAttribu te("mcs_re latedsite" ),i;f!=nul l&&(n=f.ge tValue()); n!=null&&( r=n[0].nam e);i=Xrm.P age.getAtt ribute("mc s_relatedp rovidersit e");i!=nul l&&(t=i.ge tValue()); t!=null&&( u=t[0].nam e);r!=null ||u!=null? (Xrm.Page. ui.control s.get("mcs _relatedts a").setVis ible(!0),X rm.Page.ui .controls. get("mcs_r elatedtsa" ).setFocus ()):(Xrm.P age.ui.con trols.get( "mcs_relat edtsa").se tVisible(! 1),Xrm.Pag e.getAttri bute("mcs_ relatedtsa ").setValu e(null))}; MCS.mcs_Se rvice_Acti vity.Enabl eServiceSu bType=func tion(){var n=null,t= null;Xrm.P age.getAtt ribute("mc s_servicet ype")!=nul l&&(n=Xrm. Page.getAt tribute("m cs_service type").get Value());n !=null&&(t =n[0].name );t!=null? Xrm.Page.g etControl( "mcs_servi cesubtype" ).setVisib le(!0):(Xr m.Page.get Control("m cs_service subtype"). setVisible (!1),Xrm.P age.getAtt ribute("mc s_services ubtype").s etValue(nu ll))};MCS. mcs_Servic e_Activity .HandleOnC hangeTSALo okup=funct ion(){var o=Xrm.Page .ui.contro ls.get("mc s_relatedt sa"),i,f,e ,r,u,a,v,y ;if(o.getV isible()){ r=[];u=[]; r=Xrm.Page .getAttrib ute("mcs_s ervicetype ").getValu e();u=Xrm. Page.getAt tribute("m cs_service subtype"). getValue() ;var s=Xrm .Page.getA ttribute(" cvt_type") .getValue( ),h=Xrm.Pa ge.getAttr ibute("mcs _groupappo intment")= =null?0:Xr m.Page.get Attribute( "mcs_group appointmen t").getVal ue(),c=Xrm .Page.getA ttribute(" cvt_relate dprovideri d").getVal ue();if(h= =0?s==!0?( i=Xrm.Page .getAttrib ute("mcs_r elatedprov idersite") ,e="cvt_re latedprovi dersiteid" ):(i=Xrm.P age.getAtt ribute("mc s_relateds ite"),e="c vt_related patientsit eid"):(i=X rm.Page.ge tAttribute ("mcs_rela tedprovide rsite"),e= "cvt_relat edprovider siteid"),i !=null&&(f =i.getValu e()),f==nu ll)return; var t="Fil tered by S ite",l=f[0 ].id,n='<f etch versi on="1.0" o utput-form at="xml-pl atform" ma pping="log ical" dist inct="fals e"><entity name="mcs _services" ><attribut e name="mc s_services id"/><attr ibute name ="mcs_name "/><attrib ute name=" createdon" /><order a ttribute=" mcs_name" descending ="false"/> <filter ty pe="and">< condition attribute= "statecode " operator ="eq" valu e="0"/><co ndition at tribute="' +e+'" oper ator="eq" uiname="'+ MCS.cvt_Co mmon.forma tXML(f[0]. name)+'" u itype="mcs _site" val ue="'+l+'" />';c!=nul l&&(t+=" & Provider" ,n+='<cond ition attr ibute="cvt _providers " value="% '+MCS.cvt_ Common.for matXML(c[0 ].name)+'% " operator ="like"/>' );r!=null& &(t+=" & S pecialty", a=r[0].id, n+='<condi tion attri bute="cvt_ servicetyp e" operato r="eq" uin ame="'+MCS .cvt_Commo n.formatXM L(r[0].nam e)+'" uity pe="mcs_se rvicetype" value="'+ a+'"/>',u! =null&&(t+ =" & Servi ce Sub-Typ e",v=u[0]. id,n+='<co ndition at tribute="c vt_service subtype" o perator="e q" uiname= "'+MCS.cvt _Common.fo rmatXML(u[ 0].name)+' " uitype=" mcs_servic esubtype" value="'+v +'"/>'));s ==!0?(t+=" & Home/Mo bile",n+=' <condition attribute ="cvt_type " value="t rue" opera tor="eq"/> '):(t+=" & Clinic Ba sed",n+='< filter typ e="or"><co ndition at tribute="c vt_type" v alue="fals e" operato r="eq"/><c ondition a ttribute=" cvt_type" operator=" null"/><\/ filter>'); Xrm.Page.g etAttribut e("cvt_tel ehealthmod ality").ge tValue()== !0?(t+=" & SFT",n+=' <condition attribute ="cvt_avai lableteleh ealthmodal ities" val ue="917290 001" opera tor="eq"/> '):(t+=" & CVT",n+=' <filter ty pe="or"><c ondition a ttribute=" cvt_availa bletelehea lthmodalit ies" value ="91729000 0" operato r="eq"/><c ondition a ttribute=" cvt_availa bletelehea lthmodalit ies" opera tor="null" /><\/filte r>');n+='< condition attribute= "statuscod e" value=" 251920000" operator= "eq"/><con dition att ribute="cv t_groupapp ointment" value="'+h +'" operat or="eq"/>< \/filter>< \/entity>< \/fetch>'; y='<grid n ame="resul tset" obje ct="10010" jump="mcs _name" sel ect="1" ic on="0" pre view="0">< row name=" result" id ="mcs_serv icesid"><c ell name=" cvt_provsi tevistacli nics" widt h="300"/>< cell name= "cvt_patsi tevistacli nics" widt h="300"/>< cell name= "cvt_provi ders" widt h="300"/>< cell name= "mcs_name" width="30 0"/><cell name="cvt_ groupappoi ntment" wi dth="125"/ ><cell nam e="cvt_pat ientsites" width="30 0"/><cell name="cvt_ servicetyp e" width=" 100"/><cel l name="cv t_services ubtype" wi dth="100"/ ><cell nam e="created on" width= "125"/><\/ row><\/gri d>';o.addC ustomView( l,"mcs_ser vices",t,n ,y,!0)}};M CS.mcs_Ser vice_Activ ity.Create Name=funct ion(){var t=Xrm.Page .getAttrib ute("mcs_s ervicetype ").getValu e(),i=Xrm. Page.getAt tribute("m cs_service subtype"). getValue() ,r=Xrm.Pag e.getAttri bute("mcs_ groupappoi ntment").g etValue(), n="";t!=nu ll&&(n+=t[ 0].name+" ");i!=null &&(n+=" : "+i[0].nam e+" ");r== 1&&(n+="Gr oup Appoin tment");Xr m.Page.get Attribute( "subject") .setValue( n)};MCS.mc s_Service_ Activity.G roupAppt=f unction(){ var e=Xrm. Page.getAt tribute("m cs_groupap pointment" ).getValue (),t=Xrm.P age.ui.con trols.get( "mcs_relat edsite"),i =Xrm.Page. ui.control s.get("mcs _relatedpr ovidersite "),r=Xrm.P age.ui.tab s.get("tab _groupsche duling"),n =Xrm.Page. getAttribu te("cvt_te lehealthmo dality"),u =Xrm.Page. getControl ("cvt_tele healthmoda lity"),f=X rm.Page.ge tAttribute ("cvt_type ").getValu e();e==!0? (i.setVisi ble(!0),t. setVisible (!1),r.set Visible(!f ),Xrm.Page .getContro l("custome rs").setDi sabled(!f) ,Xrm.Page. getAttribu te("mcs_re latedsite" ).setValue (null),Xrm .Page.getA ttribute(" mcs_relate dproviders ite").setR equiredLev el("requir ed"),Xrm.P age.getAtt ribute("mc s_relateds ite").setR equiredLev el("none") ,n.setValu e(!1),n.fi reOnChange (),u.setVi sible(!1)) :(i.setVis ible(!1),t .setVisibl e(!0),r.se tVisible(! 1),Xrm.Pag e.getAttri bute("mcs_ relatedpro vidersite" ).setRequi redLevel(" none"),Xrm .Page.getA ttribute(" mcs_relate dsite").se tRequiredL evel("requ ired"),Xrm .Page.getA ttribute(" cvt_type") .getValue( )!=!0&&Xrm .Page.getA ttribute(" mcs_relate dproviders ite").setV alue(null) ,u.setVisi ble(!0),n. fireOnChan ge())};MCS .mcs_Servi ce_Activit y.GroupPat =function( ){if(Xrm.P age.getAtt ribute("mc s_groupapp ointment") .getValue( )==!0&&Xrm .Page.ui.g etFormType ()==1){var n="";Xrm. Page.getAt tribute("m cs_related tsa").getV alue()!=nu ll&&(n=Xrm .Page.getA ttribute(" mcs_relate dtsa").get Value()[0] .id);CrmRe stKit.Retr ieve("mcs_ services", n,["cvt_gr ouppatient branch"],! 0).fail(fu nction(){} ).done(fun ction(n){v ar t,i;n.d .cvt_group patientbra nch!=null& &(t=n.d.cv t_grouppat ientbranch .split("|" ),t.length ==3&&(i=[] ,i[0]={id: t[0],resou ceSpecId:t [2],typeNa me:t[1],en tityType:t [1],name:" Search for All Resou rces"},Xrm .Page.getA ttribute(" resources" ).setValue (i)))})}}; MCS.mcs_Se rvice_Acti vity.Clear Resources= function() {var n=Xrm .Page.getA ttribute(" mcs_relate dtsa").get Value();n= =null&&(Xr m.Page.get Attribute( "resources ").setValu e(null),Xr m.Page.get Attribute( "resources ").setSubm itMode())} ;MCS.mcs_S ervice_Act ivity.Sche dulingInfo =function( ){var n=Xr m.Page.get Attribute( "resources ").getValu e(),t=Xrm. Page.ui.ta bs.get("ta b_scheduli ng").setVi sible(n.le ngth>0)};M CS.mcs_Ser vice_Activ ity.filter SubGrid=fu nction(){v ar n=docum ent.getEle mentById(" PatientRoo ms"),t,i,r ;if(n==nul l){setTime out(functi on(){MCS.m cs_Service _Activity. filterSubG rid()},500 );return}t =Xrm.Page. getAttribu te("mcs_re latedtsa") .getValue( );i="00000 000-0000-0 000-0000-0 0000000000 0";t!=null &&(i=t[0]. id);r="<?x ml version ='1.0'?><f etch disti nct='false ' mapping= 'logical' output-for mat='xml-p latform' v ersion='1. 0'><entity name='cvt _patientre sourcegrou p'><attrib ute name=' cvt_roomca pacity'/>< attribute name='cvt_ type'/><at tribute na me='cvt_na me'/><attr ibute name ='cvt_pati entresourc egroupid'/ ><order de scending=' false' att ribute='cv t_name'/>< filter typ e='and'><c ondition a ttribute=' cvt_type' value='251 920001' op erator='eq '/><condit ion attrib ute='cvt_r elatedtsai d' value=' "+i+"' ope rator='eq' /><conditi on attribu te='statec ode' value ='0' opera tor='eq'/> <\/filter> <\/entity> <\/fetch>" ;n.control .SetParame ter("fetch Xml",r);n. control.Re fresh()};M CS.mcs_Ser vice_Activ ity.Enforc eChanges=f unction(){ Xrm.Page.g etAttribut e("resourc es").setSu bmitMode(" always");X rm.Page.ge tAttribute ("servicei d").setSub mitMode("a lways");Xr m.Page.get Attribute( "scheduled start").se tSubmitMod e("always" );Xrm.Page .getAttrib ute("sched uledend"). setSubmitM ode("alway s");Xrm.Pa ge.getAttr ibute("sch eduleddura tionminute s").setSub mitMode("a lways")};M CS.mcs_Ser vice_Activ ity.CVTtoH ome=functi on(){var s =Xrm.Page. getAttribu te("cvt_ty pe").getVa lue(),h=Xr m.Page.get Control("c vt_type"); Xrm.Page.u i.getFormT ype()==MCS .mcs_Servi ce_Activit y.FORM_TYP E_CREATE&& h.setDisab led(!1);va r n=Xrm.Pa ge.getAttr ibute("mcs _groupappo intment"), u=Xrm.Page .getContro l("mcs_gro upappointm ent"),t=Xr m.Page.get Attribute( "mcs_relat edsite"),f =Xrm.Page. getControl ("mcs_rela tedsite"), i=Xrm.Page .getAttrib ute("mcs_r elatedprov idersite") ,e=Xrm.Pag e.getContr ol("mcs_re latedprovi dersite"), l=Xrm.Page .getContro l("custome rs"),c=Xrm .Page.ui.t abs.get("t ab_groupsc heduling") ,a=Xrm.Pag e.ui.tabs. get("tab_g rouppatien ts"),r=Xrm .Page.getA ttribute(" cvt_telehe althmodali ty"),o=Xrm .Page.getC ontrol("cv t_teleheal thmodality ");s==!0?( u.setVisib le(!0),n.g etValue()& &Xrm.Page. getControl ("customer s").setDis abled(!1), r.setValue (!1),r.fir eOnChange( ),o.setVis ible(!1),e .setVisibl e(!0),i.se tRequiredL evel("requ ired"),t.s etValue(nu ll),t.setR equiredLev el("none") ,f.setVisi ble(!1),c. setVisible (!1)):(n.g etValue()! =!0&&i.set Value(null ),e.setVis ible(!1),i .setRequir edLevel("n one"),f.se tVisible(! 0),t.setRe quiredLeve l("require d"),u.setV isible(!0) ,n.fireOnC hange(),o. setVisible (!0),r.fir eOnChange( ))};MCS.mc s_Service_ Activity.B lockAddPat ient=funct ion(){var n=Xrm.Page .getAttrib ute("custo mers"),i=n !=null?n.g etValue(): [],t=MCS.m cs_Service _Activity. compareArr ays(MCS.Pa tients,i); t.length!= 0&&(alert( "You can o nly add pa tients thr ough the P atient Sea rch. Not adding: "+ t),n.setVa lue(MCS.Pa tients))}; MCS.mcs_Se rvice_Acti vity.compa reArrays=f unction(n, t){var r=[ ],i="",o,f ,u,s,h,e,c ,l;if(t==n ull)return "";for(o i n t){if(f= !1,u=t[o], u!=null){s =MCS.cvt_C ommon.Trim BookendBra ckets(u.id .toLowerCa se());for( h in n)if( e=n[h],c=M CS.cvt_Com mon.TrimBo okendBrack ets(e.id.t oLowerCase ()),e!=nul l&&s==c){f =!0;break} }f||r.push (u.name)}i f(r.length >0){for(l in r)i+=r[ l]+"; ";i= i.substr(0 ,i.length- 2)}return i};typeof MCS=="unde fined"&&(M CS={});typ eof(MCS.VI ALogin=="u ndefined") &&(MCS.VIA Login={}); MCS.VIALog in.KeepAli veWindowNa me="crmsso i";MCS.VIA Login.Refr eshes=0;MC S.VIALogin .LoginButt on=functio n(){var n= MCS.VIALog in.IsValid SamlToken( );n?MCS.VI ALogin.Log in():MCS.V IALogin.Sa ml()};MCS. VIALogin.I sValidSaml Token=func tion(){var n,i,t,r,u ;return MC S.VIALogin .RunVistaI ntegration ()?(n=Xrm. Page.getAt tribute("c vt_samltok en")!=null ?Xrm.Page. getAttribu te("cvt_sa mltoken"). getValue() :null,n==n ull)?!1:(i =n.indexOf ("<wst:Rea son>"),i!= -1)?!1:(t= n.indexOf( "NotOnOrAf ter"),t!=- 1?(r=n.sub string(t+1 2+2,t+12+2 +20),u=new Date(r).g etTime(),( new Date). getTime()+ 3e4>u?!1:! 0):!1):!0} ;MCS.VIALo gin.IsVali dUserDuz=f unction(){ if(!MCS.VI ALogin.Run VistaInteg ration())r eturn!0;va r n=MCS.VI ALogin.Duz Side(),t=! 1;return(n =="both"|| n=="pat")& &(t=Xrm.Pa ge.getAttr ibute("cvt _patuserdu z").getVal ue()==null ),(n=="bot h"||n=="pr o")&&(t=t? !0:Xrm.Pag e.getAttri bute("cvt_ prouserduz ").getValu e()==null) ,!t};MCS.V IALogin.Sa ml=functio n(){var n= MCS.VIALog in.RunVist aIntegrati on();n&&MC S.VIALogin .GetSamlTo ken()};MCS .VIALogin. DuzSide=fu nction(){v ar i=Xrm.P age.contex t.getQuery StringPara meters().e tc,n=!0,t= !0;return i==4214&&( t=Xrm.Page .getAttrib ute("cvt_t ype").getV alue()==!1 ,n=Xrm.Pag e.getAttri bute("cvt_ telehealth modality") .getValue( )==!1),t&& n?"both":t ?"pat":n?" pro":null} ;MCS.VIALo gin.Login= function() {var t=MCS .VIALogin. RunVistaIn tegration( ),n;t&&(Xr m.Page.ui. tabs.get(" service"). sections.g et("VistaL ogin").set Visible(!0 ),Xrm.Page .getAttrib ute("cvt_s amltoken") .getValue( )!=null)&& (n=MCS.VIA Login.DuzS ide(),MCS. VIALogin.G etSetting( "VIA Login Endpoint" )!=""?MCS. VIALogin.L oginToViaB ah(n):MCS. VIALogin.V iaLoginVim t(n))};MCS .VIALogin. RunVistaIn tegration= function() {var n=Xrm .Page.cont ext.getQue ryStringPa rameters() .etc,t;ret urn n==420 1&&Xrm.Pag e.getAttri bute("cvt_ serviceact ivityid"). getValue() ==null?!1: n==4214&&( Xrm.Page.g etAttribut e("mcs_rel atedtsa")= =null||Xrm .Page.getA ttribute(" mcs_relate dtsa").get Value()==n ull)?!1:n= =4214&&!Xr m.Page.get Attribute( "cvt_type" ).getValue ()&&Xrm.Pa ge.getAttr ibute("mcs _groupappo intment"). getValue() ?!1:(t=Xrm .Page.getA ttribute(" statecode" ).getValue (),t!=3&&X rm.Page.ui .getFormTy pe()!=1)?! 1:MCS.VIAL ogin.Check VistaSwitc hes()?!0:! 1};MCS.VIA Login.GetS amlToken=f unction(){ var i=MCS. VIALogin.G etKeepAliv eUrl(),r=M CS.VIALogi n.GetKeepA liveLoginU rl(),n=MCS .VIALogin. GetStsUrl( ),t;i!=""& &r!=""?MCS .VIALogin. RefreshTok en():n!="" ?MCS.VIALo gin.CallIa mSts(n):(a lert("No P IV Authent ication ha s been set up"),t='< ?xml versi on="1.0" e ncoding="U TF- 8"?>< soapenv:En velope xml ns: wsa = "http://ww w.w3.org/2 005/08/add ressing" x mlns: xsi = "http:// www.w3.org /2001/XMLS chema-inst ance" xmln s: xsd = " http://www .w3.org/20 01/XMLSche ma" xmlns: Soapenv = "http://s chemas.xml soap.org/s oap/envelo pe/" xmlns : wst = "h ttp://sche mas.xmlsoa p.org/ws/2 005/02/tru st" > <soa penv:Heade r><ns1:Sec urity soap env:mustUn derstand=" 0" xmlns:n s1="http:/ /docs.oasi s-open.org /wss/2004/ 01/oasis-2 00401-wss- wssecurity -secext-1. 0.xsd"><ns 2:Timestam p xmlns:ns 2="http:// docs.oasis -open.org/ wss/2004/0 1/oasis-20 0401-wss-w ssecurity- utility-1. 0.xsd"><ns 2:Created> 2017-11-27 T19:37:26Z <\/ns2:Cre ated ><\/n s2: Timest amp ><\/ns 1: Securit y ><\/soap env: Heade r > <soape nv:Body><w st:Request SecurityTo kenRespons e><wst:Req uestType>h ttp://sche mas.xmlsoa p.org/ws/2 005/02/tru st/Issue<\ /wst:Reque stType > < wst:TokenT ype>http:/ /docs.oasi s-open.org /wss/oasis -wss-saml- token-prof ile-1.1#SA MLV2.0<\/w st:TokenTy pe > <wst: Status><ws t:Code>htt p://docs.o asis-open. org/ws-sx/ ws-trust/2 00512/stat us/Invalid <\/wst:Cod e > <wst:R eason>BACK _END_CONNE CTION_FAIL ED: Back E nd Auth Pr ovider Con nection Fa iled.<\/ws t:Reason > <\/wst: St atus ><\/w st: Reques tSecurityT okenRespon se ><\/soa penv: Body ><\/soape nv: Envelo pe >',Xrm. Page.getAt tribute("c vt_samltok en").setVa lue(t),Xrm .Page.getA ttribute(" cvt_samlto ken").fire OnChange() )};MCS.VIA Login.Call IamSts=fun ction(n){v ar t='<soa penv:Envel ope xmlns: soapenv="h ttp://sche mas.xmlsoa p.org/soap /envelope/ " xmlns:ns ="http://d ocs.oasis- open.org/w s-sx/ws-tr ust/200512 "><soapenv :Header/>< soapenv:Bo dy><ns:Req uestSecuri tyToken><n s:Base><ws s:TLS xmln s:wss="htt p://docs.o asis-open. org/wss/20 04/01/oasi s-200401-w ss-wssecur ity-secext -1.0.xsd"/ ><\/ns:Bas e><wsp:App liesTo xml ns:wsp="ht tp://schem as.xmlsoap .org/ws/20 04/09/poli cy"><wsa:E ndpointRef erence xml ns:wsa="ht tp://schem as.xmlsoap .org/ws/20 04/08/addr essing"><w sa:Address >https:// DNS/TMP<\/ wsa:Addres s><\/wsa:E ndpointRef erence><\/ wsp:Applie sTo><ns:Is suer><wsa: Address xm lns:wsa="h ttp://sche mas.xmlsoa p.org/ws/2 004/08/add ressing">h ttps://DNS /Issuer/s mtoken/SAM L2<\/wsa:A ddress><\/ ns:Issuer> <ns:Reques tType>http ://schemas .xmlsoap.o rg/ws/2005 /02/trust/ Validate<\ /ns:Reques tType><\/n s:RequestS ecurityTok en><\/soap env:Body>< \/soapenv: Envelope>' ;url=n==nu ll?MCS.VIA Login.GetS tsUrl():n; $.get(url) .done(func tion(){$.a jax({url:u rl,type:"P OST",cross Domain:!0, data:t,con tentType:" text/plain ",dataType :"text",su ccess:func tion(n){Xr m.Page.get Attribute( "cvt_samlt oken").set Value(n);X rm.Page.ge tAttribute ("cvt_saml token").fi reOnChange ()},error: function(n ){alert("U nable to G et SAML to ken to log into Vist a\nStatus: "+n.statu s+" "+n.st atusText+" . Response : "+n.resp onseText)} })}).fail( function(n ){alert("F ailure to Get SAML t oken to lo g into Vis ta\nStatus : "+n.stat us+" "+n.s tatusText+ ". Respons e: "+n.res ponseText) })};MCS.VI ALogin.Ref reshToken= function() {MCS.VIALo gin.Refres hes++;var t=MCS.VIAL ogin.GetKe epAliveUrl (),n="";$. ajax({url: t,success: function(t ){t!=null& &(n=t.SAML Token);n!= null&&n!=" "?(Xrm.Pag e.getAttri bute("cvt_ samltoken" ).setValue (n),Xrm.Pa ge.getAttr ibute("cvt _samltoken ").fireOnC hange()):M CS.VIALogi n.Refreshe s==1&&aler t("Please login with your PIN in the new window to sign into Vista.")} ,error:fun ction(n){a lert("Toke n Refresh call faile d: "+n.res ponseText+ "; info: " +n.statusT ext)},comp lete:funct ion(){Xrm. Page.getAt tribute("c vt_samltok en").getVa lue()==nul l&&MCS.VIA Login.Refr eshes<4&&( setTimeout (MCS.VIALo gin.Refres hToken,15e 3),MCS.VIA Login.Keep SessionAli ve())}})}; MCS.VIALog in.KeepSes sionAlive= function() {var n=MCS .VIALogin. GetKeepAli veLoginUrl ();ssoiWin dow=window .open(n,MC S.VIALogin .KeepAlive WindowName ,"height=5 00, width= 865, locat ion=yes, r esizable=y es, scroll bars=yes, status=yes , titlebar =yes, top= 100, left= 100",!0);s soiWindow. focus();re turn};MCS. VIALogin.L oginToViaB ah=functio n(n){var l =MCS.VIALo gin.ViaLog inUrl(),t= Xrm.Page.g etAttribut e("cvt_sam ltoken").g etValue(), e,r;if(t== null||t==" "){alert(" No VIA Log in complet ed because SAML toke n not foun d. ");ret urn}if(n== "both"){va r u=MCS.VI ALogin.Get FacilityNu mber("pat" ),f=MCS.VI ALogin.Get FacilityNu mber("pro" ),s=MCS.VI ALogin.Set upViaMessa ge(u,t),i= MCS.VIALog in.CallBah Login(s);X rm.Page.ge tAttribute ("cvt_patu serduz").s etValue(i) ;u!=f?(e=M CS.VIALogi n.SetupVia Message(f, t),r=MCS.V IALogin.Ca llBahLogin (e),r!=""? (Xrm.Page. getAttribu te("cvt_pr ouserduz") .setValue( r),MCS.VIA Login.Trig gerGetCons ults()):al ert("No VI A Login co mpleted fo r pro side ")):i!=""? (Xrm.Page. getAttribu te("cvt_pr ouserduz") .setValue( i),MCS.VIA Login.Trig gerGetCons ults()):al ert("No VI A Login co mpleted fo r pat side ")}else{va r h=MCS.VI ALogin.Get FacilityNu mber(n),c= MCS.VIALog in.SetupVi aMessage(h ,t),o=MCS. VIALogin.C allBahLogi n(c);o!="" ?(Xrm.Page .getAttrib ute("cvt_" +n+"userdu z").setVal ue(o),MCS. VIALogin.T riggerGetC onsults()) :alert("No VIA Login completed for "+n+" side")}};M CS.VIALogi n.TriggerG etConsults =function( ){var n=Xr m.Page.con text.getQu eryStringP arameters( ).etc;n==4 214&&Xrm.P age.getAtt ribute("cv t_rungetco nsults").f ireOnChang e()};MCS.V IALogin.Se tupViaMess age=functi on(n,t){va r i={};ret urn i.Acce ssCode="do notuse",i. VerifyCode ="donotuse ",i.SiteId =n,i.SamlT oken=t,i}; MCS.VIALog in.CallBah Login=func tion(n,t){ var i="";r eturn $.aj ax({async: !1,type:"P OST",url:t ,beforeSen d:function (t){t.setR equestHead er("CRMSSO iSessionSa ml",window .btoa(n.Sa mlToken))} ,dataType: "json",con tentType:" applicatio n/json",da ta:JSON.st ringify(n) ,success:f unction(n) {n==null|| n.Data==nu ll||n.Data [0]==null| |n.Data[0] .Duz==null ?n==null?a lert("No d ata return ed"):n.Dat a==null||n .Data[0]== null?alert ("Empty Da ta"+n.Erro rMessage): n.Data[0]. Fault!=nul l&&alert(" Failed to login: "+n .Data[0].F ault.Messa ge):n.Data [0].Duz!=n ull&&(i=n. Data[0].Du z)},error: function(n ,t,i){retu rn alert(t +". Error : "+i),""} }),i};MCS. VIALogin.V iaLoginVim t=function (n,t,i){va r r=Xrm.Pa ge.getAttr ibute("cvt _samltoken ").getValu e(),f,u,e; n=="both"? (f=MCS.VIA Login.GetF acilityNum ber("pat") ,u=MCS.VIA Login.GetF acilityNum ber("pro") ,f!=u?(MCS .VIALogin. LoginWithA ction(r,f, "pat",t,i) ,MCS.VIALo gin.LoginW ithAction( r,u,"pro", t,i)):MCS. VIALogin.L oginWithAc tion(r,u,n ,t,i)):(e= MCS.VIALog in.GetFaci lityNumber (n),MCS.VI ALogin.Log inWithActi on(r,e,n,t ,i))};MCS. VIALogin.L oginWithAc tion=funct ion(n,t,i, r,u){var f =[{Key:"St ationNumbe r",Type:MC S.Scripts. Process.Da taType.Str ing,Value: t},{Key:"S amlToken", Type:MCS.S cripts.Pro cess.DataT ype.String ,Value:n}, {Key:"Acce ssCode",Ty pe:MCS.Scr ipts.Proce ss.DataTyp e.String,V alue:typeo f r=="unde fined"?"": r},{Key:"V erifyCode" ,Type:MCS. Scripts.Pr ocess.Data Type.Strin g,Value:ty peof u=="u ndefined"? "":u}];MCS .Scripts.P rocess.Exe cuteAction ("cvt_ViaL oginAction ",f).done( function(r ){var u=r. UserDuz,e= r.Successf ulLogin,o= r.ErrorMes sage,f;e?( i=="both"? (Xrm.Page. getAttribu te("cvt_pr ouserduz") .setValue( u),Xrm.Pag e.getAttri bute("cvt_ patuserduz ").setValu e(u)):Xrm. Page.getAt tribute("c vt_"+i+"us erduz").se tValue(u), MCS.VIALog in.Trigger GetConsult s()):(f=co nfirm("Fai led to log in with P IV, attemp ting Acces s Verify C odes for " +i+" side. Error De tails: "+o ),f&&MCS.V IALogin.Lo ginWithAcc essVerify( i,n,t))}). fail(funct ion(n){ale rt("Login Action Fai led: "+n.r esponseTex t)})};MCS. VIALogin.L oginWithAc cessVerify =function( n,t,i){var f=n=="bot h"?"the":" the "+n,u= prompt("Pl ease enter your acce ss code fo r "+f+" fa cility ("+ i+").","") ,r;u!=null &&u!=""&&( r=prompt(" Please ent er your ve rify code for "+f+" facility ( "+i+")."," "),r!=null &&r!=""&&M CS.VIALogi n.LoginWit hAction(t, i,n,u,r))} ;MCS.VIALo gin.GetSts Url=functi on(){var n =MCS.VIALo gin.GetSet ting("IAM SAML Token Endpoint" );return n !=""?n:""} ;MCS.VIALo gin.GetKee pAliveLogi nUrl=funct ion(){var n=MCS.VIAL ogin.GetSe tting("Kee p Alive Lo gin Endpoi nt");retur n n!=""?n: ""};MCS.VI ALogin.Get KeepAliveU rl=functio n(){var n= MCS.VIALog in.GetSett ing("Refre sh SAML To ken Endpoi nt");retur n n!=""?n: ""};MCS.VI ALogin.Via LoginUrl=f unction(){ var n=MCS. VIALogin.G etSetting( "VIA Login Endpoint" );return n !=""?n:""} ;MCS.VIALo gin.GetSet ting=funct ion(n){var t="",i="m cs_name eq '"+n+"'"; return cal ls=CrmRest Kit.ByQuer y("mcs_int egrationse tting",["m cs_value"] ,i,!1),cal ls.fail(fu nction(){r eturn t}). done(funct ion(n){n&& n.d&&n.d.r esults!=nu ll&&n.d.re sults.leng th!=0&&(t= n.d.result s[0].mcs_v alue)}),t} ;MCS.VIALo gin.GetTsa Id=functio n(){var n= Xrm.Page.g etAttribut e("mcs_rel atedtsa"), t,i;return n!=null?n .getValue( )[0].id:(i =Xrm.Page. getAttribu te("cvt_se rviceactiv ityid").ge tValue()[0 ].id,CrmRe stKit.Retr ieve("Serv iceAppoint ment",i,[" mcs_relate dtsa"],!1) .fail(func tion(n){al ert("faile d TSA chec k, Unable to perform VIA login : "+MCS.cv t_Common.R estError(n ))}).done( function(n ){n!=null& &n.d!=null &&(t=n.d.m cs_related tsa.Id)}), t)};MCS.VI ALogin.Get FacilityNu mber=funct ion(n){var f=MCS.VIA Login.GetT saId(),t=n ull,i=null ,e=!1,r,u; return Crm RestKit.Re trieve("mc s_services ",f,["cvt_ PatientFac ility","cv t_Provider Facility", "cvt_Servi ceScope"], !1).fail(f unction(n) {alert("fa iled TSA c heck, Unab le to perf orm VIA lo gin: "+MCS .cvt_Commo n.RestErro r(n))}).do ne(functio n(n){n!=nu ll&&n.d!=n ull&&(n.d. cvt_Patien tFacility! =null&&(t= n.d.cvt_Pa tientFacil ity.Id),n. d.cvt_Prov iderFacili ty!=null&& (i=n.d.cvt _ProviderF acility.Id ),n.d.cvt_ ServiceSco pe!=null&& (e=n.d.cvt _ServiceSc ope.Value= =91729e4)) }),r=n=="p at"?t:i,Cr mRestKit.R etrieve("m cs_facilit y",r,["mcs _StationNu mber"],!1) .fail(func tion(n){al ert("Faile d to get T SA, Unable to Perfor m VIA Logi n: "+MCS.c vt_Common. RestError( n))}).done (function( n){n!=null &&n.d!=nul l?u=n.d.mc s_StationN umber:aler t("Failed to get TSA station n umber, Una ble to Per form VIA L ogin")}),u };MCS.VIAL ogin.Check VistaSwitc hes=functi on(){var u =!0,n=!0,t =!0,i=!0,r =!0;return (calls=Crm RestKit.By Query("mcs _setting", ["cvt_UseV istaIntegr ation","cv t_UseVVSHo meMobile", "cvt_UseVV SInterfaci lity","cvt _UseVVSSin gleEncount erNonHomeM obile"],"m cs_name eq 'Active S ettings'", !1),calls. fail(funct ion(){retu rn u}).don e(function (u){if(u&& u.d&&u.d.r esults!=nu ll&&u.d.re sults.leng th!=0){var f=u.d.res ults[0];n= f.cvt_UseV istaIntegr ation!=nul l?f.cvt_Us eVistaInte gration:!0 ;t=f.cvt_U seVVSHomeM obile!=nul l?f.cvt_Us eVVSHomeMo bile:!0;i= f.cvt_UseV VSInterfac ility!=nul l?f.cvt_Us eVVSInterf acility:!0 ;r=f.cvt_U seVVSSingl eEncounter NonHomeMob ile!=null? f.cvt_UseV VSSingleEn counterNon HomeMobile :!0}}),n== =!1)?!1:MC S.VIALogin .Appointme ntTypeSwit chCheck(t, i,r)};MCS. VIALogin.A ppointment TypeSwitch Check=func tion(n,t,i ){var f=pa rent.Xrm,p =MCS.VIALo gin.GetTsa Id(),r=nul l,e=null,o =null,c=nu ll,l=!1,a, v,y,u,s,h; if(CrmRest Kit.Retrie ve("mcs_se rvices",p, ["cvt_Pati entFacilit y","cvt_Pr oviderFaci lity","cvt _ServiceSc ope","cvt_ servicetyp e","cvt_se rvicesubty pe","cvt_r elatedprov idersiteid ","cvt_rel atedpatien tsiteid"], !1).fail(f unction(n) {alert("fa iled TSA c heck, defa ulting to display Co nsults"+MC S.cvt_Comm on.RestErr or(n))}).d one(functi on(n){n!=n ull&&n.d!= null&&(n.d .cvt_Patie ntFacility !=null&&(r =n.d.cvt_P atientFaci lity.Id),n .d.cvt_Pro viderFacil ity!=null& &(e=n.d.cv t_Provider Facility.I d),n.d.cvt _ServiceSc ope!=null& &(l=n.d.cv t_ServiceS cope.Value ==91729e4) ,n.d.cvt_s ervicetype !=null&&(c =n.d.cvt_s ervicetype .Id),n.d.c vt_service subtype!=n ull&&(o=n. d.cvt_serv icesubtype .Id),n.d.c vt_related providersi teid!=null &&(TsaProv iderSiteId =n.d.cvt_r elatedprov idersiteid .Id),n.d.c vt_related providersi teid!=null &&(TsaPati entSiteId= n.d.cvt_re latedpatie ntsiteid.I d))}),a=f. Page.getAt tribute("m cs_related tsa"),a!=n ull){if(v= f.Page.get Attribute( "cvt_type" ).getValue (),v)retur n n;if(y=f .Page.getA ttribute(" cvt_telehe althmodali ty").getVa lue(),y)re turn i}ret urn(u=null ,o!=null&& CrmRestKit .Retrieve( "mcs_servi cesubtype" ,o,["cvt_U seVVS"],!1 ).fail(fun ction(n){a lert("fail ed sub-spe cialty typ e check, l ooking for specialty switch: " +MCS.cvt_C ommon.Rest Error(n))} ).done(fun ction(n){u =n.d.cvt_U seVVS}),u= ==!1)?!1:( s=!0,u==nu ll&&CrmRes tKit.Retri eve("mcs_s ervicetype ",c,["cvt_ UseVVS"],! 1).fail(fu nction(n){ alert("fai led specia lty type c heck, defa ulting to display Co nsults"+MC S.cvt_Comm on.RestErr or(n))}).d one(functi on(n){s=n. d.cvt_UseV VS}),s===! 1)?!1:l?t: (h=!0,r!=n ull&&e!=nu ll&&r==e&& CrmRestKit .Retrieve( "mcs_facil ity",r,["c vt_UseVist aIntrafaci lity"],!1) .fail(func tion(n){al ert("faile d Intrafac ility chec k, default ing to dis play Consu lts"+MCS.c vt_Common. RestError( n))}).done (function( n){n!=null &&n.d!=nul l&&(h=n.d. cvt_UseVis taIntrafac ility!=nul l?n.d.cvt_ UseVistaIn trafacilit y:!0)}),h= ==!1?!1:!0 )};
|
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.