/*!
 * Raphael 1.5.2 - JavaScript Vector Library
 * NB: Atlassian patched version - see line 1101 in unminified version
 * minified using uglifyJS at http://marijnhaverbeke.nl/uglifyjs
 *
 * Copyright (c) 2010 Dmitry Baranovskiy (http://raphaeljs.com)
 * Licensed under the MIT (http://raphaeljs.com/license.html) license.
 */
(function(){function cD(a,b,c,d,e,f){function o(a,b){var c,d,e,f,j,k;for(e=a,k=0;k<8;k++){f=m(e)-a;if(B(f)<b)return e;j=(3*i*e+2*h)*e+g;if(B(j)<1e-6)break;e=e-f/j}c=0,d=1,e=a;if(e<c)return c;if(e>d)return d;while(c<d){f=m(e);if(B(f-a)<b)return e;a>f?c=e:d=e,e=(d-c)/2+c}return e}function n(a,b){var c=o(a,b);return((l*c+k)*c+j)*c}function m(a){return((i*a+h)*a+g)*a}var g=3*b,h=3*(d-b)-g,i=1-g-h,j=3*c,k=3*(e-c)-j,l=1-j-k;return n(a,1/(200*f))}function cC(b){return function(c,d,e,f){var g={back:b};a.is(e,"function")?f=e:g.rot=e,c&&c.constructor==bO&&(c=c.attrs.path),c&&(g.along=c);return this.animate(g,d,f)}}function cq(){return this.x+q+this.y}function bn(a,b,c){function d(){var g=Array[e].slice.call(arguments,0),h=g[v]("►"),i=d.cache=d.cache||{},j=d.count=d.count||[];if(i[f](h))return c?c(i[h]):i[h];j[w]>=1e3&&delete i[j.shift()],j[L](h),i[h]=a[m](b,g);return c?c(i[h]):i[h]}return d}function bi(){var a=[],b=0;for(;b<32;b++)a[b]=(~~(y.random()*16))[H](16);a[12]=4,a[16]=(a[16]&3|8)[H](16);return"r-"+a[v]("")}function a(){if(a.is(arguments[0],G)){var b=arguments[0],d=bW[m](a,b.splice(0,3+a.is(b[0],E))),e=d.set();for(var g=0,h=b[w];g<h;g++){var i=b[g]||{};c[f](i.type)&&e[L](d[i.type]().attr(i))}return e}return bW[m](a,arguments)}a.version="1.5.2";var b=/[, ]+/,c={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},d=/\{(\d+)\}/g,e="prototype",f="hasOwnProperty",g=document,h=window,i={was:Object[e][f].call(h,"Raphael"),is:h.Raphael},j=function(){this.customAttributes={}},k,l="appendChild",m="apply",n="concat",o="createTouch"in g,p="",q=" ",r=String,s="split",t="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend orientationchange touchcancel gesturestart gesturechange gestureend"[s](q),u={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},v="join",w="length",x=r[e].toLowerCase,y=Math,z=y.max,A=y.min,B=y.abs,C=y.pow,D=y.PI,E="number",F="string",G="array",H="toString",I="fill",J=Object[e][H],K={},L="push",M=/^url\(['"]?([^\)]+?)['"]?\)$/i,N=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,O={NaN:1,Infinity:1,"-Infinity":1},P=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,Q=y.round,R="setAttribute",S=parseFloat,T=parseInt,U=" progid:DXImageTransform.Microsoft",V="webkitTapHighlightColor",W=r[e].toUpperCase,X={blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/",opacity:1,path:"M0,0",r:0,rotation:0,rx:0,ry:0,scale:"1 1",src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",translation:"0 0",width:0,x:0,y:0},Y={along:"along",blur:E,"clip-rect":"csv",cx:E,cy:E,fill:"colour","fill-opacity":E,"font-size":E,height:E,opacity:E,path:"path",r:E,rotation:"csv",rx:E,ry:E,scale:"csv",stroke:"colour","stroke-opacity":E,"stroke-width":E,translation:"csv",width:E,x:E,y:E},Z="replace",$=/^(from|to|\d+%?)/,_=/\s*,\s*/,ba={hs:1,rg:1},bb=/,?([achlmqrstvxz]),?/gi,bc=/([achlmqstvz])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?\s*,?\s*)+)/ig,bd=/(-?\d*\.?\d*(?:e[-+]?\d+)?)\s*,?\s*/ig,be=/^r(?:\(([^,]+?)\s*,\s*([^\)]+?)\))?/,bf=function(a,b){return a.key-b.key};a.type=h.SVGAngle||g.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML";if(a.type=="VML"){var bg=g.createElement("div"),bh;bg.innerHTML='<v:shape adj="1"/>',bh=bg.firstChild,bh.style.behavior="url(#default#VML)";if(!bh||typeof bh.adj!="object")return a.type=null;bg=null}a.svg=!(a.vml=a.type=="VML"),j[e]=a[e],k=j[e],a._id=0,a._oid=0,a.fn={},a.is=function(a,b){b=x.call(b);if(b=="finite")return!O[f](+a);return b=="null"&&a===null||b==typeof a||b=="object"&&a===Object(a)||b=="array"&&Array.isArray&&Array.isArray(a)||J.call(a).slice(8,-1).toLowerCase()==b},a.angle=function(b,c,d,e,f,g){if(f==null){var h=b-d,i=c-e;if(!h&&!i)return 0;return((h<0)*180+y.atan(-i/-h)*180/D+360)%360}return a.angle(b,c,f,g)-a.angle(d,e,f,g)},a.rad=function(a){return a%360*D/180},a.deg=function(a){return a*180/D%360},a.snapTo=function(b,c,d){d=a.is(d,"finite")?d:10;if(a.is(b,G)){var e=b.length;while(e--)if(B(b[e]-c)<=d)return b[e]}else{b=+b;var f=c%b;if(f<d)return c-f;if(f>b-d)return c-f+b}return c},a.setWindow=function(a){h=a,g=h.document};var bj=function(b){if(a.vml){var c=/^\s+|\s+$/g,d;try{var e=new ActiveXObject("htmlfile");e.write("<body>"),e.close(),d=e.body}catch(f){d=createPopup().document.body}var h=d.createTextRange();bj=bn(function(a){try{d.style.color=r(a)[Z](c,p);var b=h.queryCommandValue("ForeColor");b=(b&255)<<16|b&65280|(b&16711680)>>>16;return"#"+("000000"+b[H](16)).slice(-6)}catch(e){return"none"}})}else{var i=g.createElement("i");i.title="Raphaël Colour Picker",i.style.display="none",g.body[l](i),bj=bn(function(a){i.style.color=a;return g.defaultView.getComputedStyle(i,p).getPropertyValue("color")})}return bj(b)},bk=function(){return"hsb("+[this.h,this.s,this.b]+")"},bl=function(){return"hsl("+[this.h,this.s,this.l]+")"},bm=function(){return this.hex};a.hsb2rgb=function(b,c,d,e){a.is(b,"object")&&"h"in b&&"s"in b&&"b"in b&&(d=b.b,c=b.s,b=b.h,e=b.o);return a.hsl2rgb(b,c,d/2,e)},a.hsl2rgb=function(b,c,d,e){a.is(b,"object")&&"h"in b&&"s"in b&&"l"in b&&(d=b.l,c=b.s,b=b.h);if(b>1||c>1||d>1)b/=360,c/=100,d/=100;var f={},g=["r","g","b"],h,i,j,k,l,m;if(!c)f={r:d,g:d,b:d};else{d<.5?h=d*(1+c):h=d+c-d*c,i=2*d-h;for(var n=0;n<3;n++)j=b+1/3*-(n-1),j<0&&j++,j>1&&j--,j*6<1?f[g[n]]=i+(h-i)*6*j:j*2<1?f[g[n]]=h:j*3<2?f[g[n]]=i+(h-i)*(2/3-j)*6:f[g[n]]=i}f.r*=255,f.g*=255,f.b*=255,f.hex="#"+(16777216|f.b|f.g<<8|f.r<<16).toString(16).slice(1),a.is(e,"finite")&&(f.opacity=e),f.toString=bm;return f},a.rgb2hsb=function(b,c,d){c==null&&a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b&&(d=b.b,c=b.g,b=b.r);if(c==null&&a.is(b,F)){var e=a.getRGB(b);b=e.r,c=e.g,d=e.b}if(b>1||c>1||d>1)b/=255,c/=255,d/=255;var f=z(b,c,d),g=A(b,c,d),h,i,j=f;if(g==f)return{h:0,s:0,b:f,toString:bk};var k=f-g;i=k/f,b==f?h=(c-d)/k:c==f?h=2+(d-b)/k:h=4+(b-c)/k,h/=6,h<0&&h++,h>1&&h--;return{h:h,s:i,b:j,toString:bk}},a.rgb2hsl=function(b,c,d){c==null&&a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b&&(d=b.b,c=b.g,b=b.r);if(c==null&&a.is(b,F)){var e=a.getRGB(b);b=e.r,c=e.g,d=e.b}if(b>1||c>1||d>1)b/=255,c/=255,d/=255;var f=z(b,c,d),g=A(b,c,d),h,i,j=(f+g)/2,k;if(g==f)k={h:0,s:0,l:j};else{var l=f-g;i=j<.5?l/(f+g):l/(2-f-g),b==f?h=(c-d)/l:c==f?h=2+(d-b)/l:h=4+(b-c)/l,h/=6,h<0&&h++,h>1&&h--,k={h:h,s:i,l:j}}k.toString=bl;return k},a._path2string=function(){return this.join(",")[Z](bb,"$1")},a.getRGB=bn(function(b){if(!b||!!((b=r(b)).indexOf("-")+1))return{r:-1,g:-1,b:-1,hex:"none",error:1};if(b=="none")return{r:-1,g:-1,b:-1,hex:"none"};!ba[f](b.toLowerCase().substring(0,2))&&b.charAt()!="#"&&(b=bj(b));var c,d,e,g,h,i,j,k=b.match(N);if(k){k[2]&&(g=T(k[2].substring(5),16),e=T(k[2].substring(3,5),16),d=T(k[2].substring(1,3),16)),k[3]&&(g=T((i=k[3].charAt(3))+i,16),e=T((i=k[3].charAt(2))+i,16),d=T((i=k[3].charAt(1))+i,16)),k[4]&&(j=k[4][s](_),d=S(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=S(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),g=S(j[2]),j[2].slice(-1)=="%"&&(g*=2.55),k[1].toLowerCase().slice(0,4)=="rgba"&&(h=S(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100));if(k[5]){j=k[5][s](_),d=S(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=S(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),g=S(j[2]),j[2].slice(-1)=="%"&&(g*=2.55),(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360),k[1].toLowerCase().slice(0,4)=="hsba"&&(h=S(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsb2rgb(d,e,g,h)}if(k[6]){j=k[6][s](_),d=S(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=S(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),g=S(j[2]),j[2].slice(-1)=="%"&&(g*=2.55),(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360),k[1].toLowerCase().slice(0,4)=="hsla"&&(h=S(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsl2rgb(d,e,g,h)}k={r:d,g:e,b:g},k.hex="#"+(16777216|g|e<<8|d<<16).toString(16).slice(1),a.is(h,"finite")&&(k.opacity=h);return k}return{r:-1,g:-1,b:-1,hex:"none",error:1}},a),a.getColor=function(a){var b=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||.75},c=this.hsb2rgb(b.h,b.s,b.b);b.h+=.075,b.h>1&&(b.h=0,b.s-=.2,b.s<=0&&(this.getColor.start={h:0,s:1,b:b.b}));return c.hex},a.getColor.reset=function(){delete this.start},a.parsePathString=bn(function(b){if(!b)return null;var c={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},d=[];a.is(b,G)&&a.is(b[0],G)&&(d=bp(b)),d[w]||r(b)[Z](bc,function(a,b,e){var f=[],g=x.call(b);e[Z](bd,function(a,b){b&&f[L](+b)}),g=="m"&&f[w]>2&&(d[L]([b][n](f.splice(0,2))),g="l",b=b=="m"?"l":"L");while(f[w]>=c[g]){d[L]([b][n](f.splice(0,c[g])));if(!c[g])break}}),d[H]=a._path2string;return d}),a.findDotsAtSegment=function(a,b,c,d,e,f,g,h,i){var j=1-i,k=C(j,3)*a+C(j,2)*3*i*c+j*3*i*i*e+C(i,3)*g,l=C(j,3)*b+C(j,2)*3*i*d+j*3*i*i*f+C(i,3)*h,m=a+2*i*(c-a)+i*i*(e-2*c+a),n=b+2*i*(d-b)+i*i*(f-2*d+b),o=c+2*i*(e-c)+i*i*(g-2*e+c),p=d+2*i*(f-d)+i*i*(h-2*f+d),q=(1-i)*a+i*c,r=(1-i)*b+i*d,s=(1-i)*e+i*g,t=(1-i)*f+i*h,u=90-y.atan((m-o)/(n-p))*180/D;(m>o||n<p)&&(u+=180);return{x:k,y:l,m:{x:m,y:n},n:{x:o,y:p},start:{x:q,y:r},end:{x:s,y:t},alpha:u}};var bo=bn(function(a){if(!a)return{x:0,y:0,width:0,height:0};a=bx(a);var b=0,c=0,d=[],e=[],f;for(var g=0,h=a[w];g<h;g++){f=a[g];if(f[0]=="M")b=f[1],c=f[2],d[L](b),e[L](c);else{var i=bw(b,c,f[1],f[2],f[3],f[4],f[5],f[6]);d=d[n](i.min.x,i.max.x),e=e[n](i.min.y,i.max.y),b=f[5],c=f[6]}}var j=A[m](0,d),k=A[m](0,e);return{x:j,y:k,width:z[m](0,d)-j,height:z[m](0,e)-k}}),bp=function(b){var c=[];if(!a.is(b,G)||!a.is(b&&b[0],G))b=a.parsePathString(b);for(var d=0,e=b[w];d<e;d++){c[d]=[];for(var f=0,g=b[d][w];f<g;f++)c[d][f]=b[d][f]}c[H]=a._path2string;return c},bq=bn(function(b){if(!a.is(b,G)||!a.is(b&&b[0],G))b=a.parsePathString(b);var c=[],d=0,e=0,f=0,g=0,h=0;b[0][0]=="M"&&(d=b[0][1],e=b[0][2],f=d,g=e,h++,c[L](["M",d,e]));for(var i=h,j=b[w];i<j;i++){var k=c[i]=[],l=b[i];if(l[0]!=x.call(l[0])){k[0]=x.call(l[0]);switch(k[0]){case"a":k[1]=l[1],k[2]=l[2],k[3]=l[3],k[4]=l[4],k[5]=l[5],k[6]=+(l[6]-d).toFixed(3),k[7]=+(l[7]-e).toFixed(3);break;case"v":k[1]=+(l[1]-e).toFixed(3);break;case"m":f=l[1],g=l[2];default:for(var m=1,n=l[w];m<n;m++)k[m]=+(l[m]-(m%2?d:e)).toFixed(3)}}else{k=c[i]=[],l[0]=="m"&&(f=l[1]+d,g=l[2]+e);for(var o=0,p=l[w];o<p;o++)c[i][o]=l[o]}var q=c[i][w];switch(c[i][0]){case"z":d=f,e=g;break;case"h":d+=+c[i][q-1];break;case"v":e+=+c[i][q-1];break;default:d+=+c[i][q-2],e+=+c[i][q-1]}}c[H]=a._path2string;return c},0,bp),br=bn(function(b){if(!a.is(b,G)||!a.is(b&&b[0],G))b=a.parsePathString(b);var c=[],d=0,e=0,f=0,g=0,h=0;b[0][0]=="M"&&(d=+b[0][1],e=+b[0][2],f=d,g=e,h++,c[0]=["M",d,e]);for(var i=h,j=b[w];i<j;i++){var k=c[i]=[],l=b[i];if(l[0]!=W.call(l[0])){k[0]=W.call(l[0]);switch(k[0]){case"A":k[1]=l[1],k[2]=l[2],k[3]=l[3],k[4]=l[4],k[5]=l[5],k[6]=+(l[6]+d),k[7]=+(l[7]+e);break;case"V":k[1]=+l[1]+e;break;case"H":k[1]=+l[1]+d;break;case"M":f=+l[1]+d,g=+l[2]+e;default:for(var m=1,n=l[w];m<n;m++)k[m]=+l[m]+(m%2?d:e)}}else for(var o=0,p=l[w];o<p;o++)c[i][o]=l[o];switch(k[0]){case"Z":d=f,e=g;break;case"H":d=k[1];break;case"V":e=k[1];break;case"M":f=c[i][c[i][w]-2],g=c[i][c[i][w]-1];default:d=c[i][c[i][w]-2],e=c[i][c[i][w]-1]}}c[H]=a._path2string;return c},null,bp),bs=function(a,b,c,d){return[a,b,c,d,c,d]},bt=function(a,b,c,d,e,f){var g=1/3,h=2/3;return[g*a+h*c,g*b+h*d,g*e+h*c,g*f+h*d,e,f]},bu=function(a,b,c,d,e,f,g,h,i,j){var k=D*120/180,l=D/180*(+e||0),m=[],o,p=bn(function(a,b,c){var d=a*y.cos(c)-b*y.sin(c),e=a*y.sin(c)+b*y.cos(c);return{x:d,y:e}});if(!j){o=p(a,b,-l),a=o.x,b=o.y,o=p(h,i,-l),h=o.x,i=o.y;var q=y.cos(D/180*e),r=y.sin(D/180*e),t=(a-h)/2,u=(b-i)/2,x=t*t/(c*c)+u*u/(d*d);x>1&&(x=y.sqrt(x),c=x*c,d=x*d);var z=c*c,A=d*d,C=(f==g?-1:1)*y.sqrt(B((z*A-z*u*u-A*t*t)/(z*u*u+A*t*t))),E=C*c*u/d+(a+h)/2,F=C*-d*t/c+(b+i)/2,G=y.asin(((b-F)/d).toFixed(9)),H=y.asin(((i-F)/d).toFixed(9));G=a<E?D-G:G,H=h<E?D-H:H,G<0&&(G=D*2+G),H<0&&(H=D*2+H),g&&G>H&&(G=G-D*2),!g&&H>G&&(H=H-D*2)}else G=j[0],H=j[1],E=j[2],F=j[3];var I=H-G;if(B(I)>k){var J=H,K=h,L=i;H=G+k*(g&&H>G?1:-1),h=E+c*y.cos(H),i=F+d*y.sin(H),m=bu(h,i,c,d,e,0,g,K,L,[H,J,E,F])}I=H-G;var M=y.cos(G),N=y.sin(G),O=y.cos(H),P=y.sin(H),Q=y.tan(I/4),R=4/3*c*Q,S=4/3*d*Q,T=[a,b],U=[a+R*N,b-S*M],V=[h+R*P,i-S*O],W=[h,i];U[0]=2*T[0]-U[0],U[1]=2*T[1]-U[1];if(j)return[U,V,W][n](m);m=[U,V,W][n](m)[v]()[s](",");var X=[];for(var Y=0,Z=m[w];Y<Z;Y++)X[Y]=Y%2?p(m[Y-1],m[Y],l).y:p(m[Y],m[Y+1],l).x;return X},bv=function(a,b,c,d,e,f,g,h,i){var j=1-i;return{x:C(j,3)*a+C(j,2)*3*i*c+j*3*i*i*e+C(i,3)*g,y:C(j,3)*b+C(j,2)*3*i*d+j*3*i*i*f+C(i,3)*h}},bw=bn(function(a,b,c,d,e,f,g,h){var i=e-2*c+a-(g-2*e+c),j=2*(c-a)-2*(e-c),k=a-c,l=(-j+y.sqrt(j*j-4*i*k))/2/i,n=(-j-y.sqrt(j*j-4*i*k))/2/i,o=[b,h],p=[a,g],q;B(l)>"1e12"&&(l=.5),B(n)>"1e12"&&(n=.5),l>0&&l<1&&(q=bv(a,b,c,d,e,f,g,h,l),p[L](q.x),o[L](q.y)),n>0&&n<1&&(q=bv(a,b,c,d,e,f,g,h,n),p[L](q.x),o[L](q.y)),i=f-2*d+b-(h-2*f+d),j=2*(d-b)-2*(f-d),k=b-d,l=(-j+y.sqrt(j*j-4*i*k))/2/i,n=(-j-y.sqrt(j*j-4*i*k))/2/i,B(l)>"1e12"&&(l=.5),B(n)>"1e12"&&(n=.5),l>0&&l<1&&(q=bv(a,b,c,d,e,f,g,h,l),p[L](q.x),o[L](q.y)),n>0&&n<1&&(q=bv(a,b,c,d,e,f,g,h,n),p[L](q.x),o[L](q.y));return{min:{x:A[m](0,p),y:A[m](0,o)},max:{x:z[m](0,p),y:z[m](0,o)}}}),bx=bn(function(a,b){var c=br(a),d=b&&br(b),e={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},g=function(a,b){var c,d;if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];!(a[0]in{T:1,Q:1})&&(b.qx=b.qy=null);switch(a[0]){case"M":b.X=a[1],b.Y=a[2];break;case"A":a=["C"][n](bu[m](0,[b.x,b.y][n](a.slice(1))));break;case"S":c=b.x+(b.x-(b.bx||b.x)),d=b.y+(b.y-(b.by||b.y)),a=["C",c,d][n](a.slice(1));break;case"T":b.qx=b.x+(b.x-(b.qx||b.x)),b.qy=b.y+(b.y-(b.qy||b.y)),a=["C"][n](bt(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1],b.qy=a[2],a=["C"][n](bt(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"][n](bs(b.x,b.y,a[1],a[2]));break;case"H":a=["C"][n](bs(b.x,b.y,a[1],b.y));break;case"V":a=["C"][n](bs(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"][n](bs(b.x,b.y,b.X,b.Y))}return a},h=function(a,b){if(a[b][w]>7){a[b].shift();var e=a[b];while(e[w])a.splice(b++,0,["C"][n](e.splice(0,6)));a.splice(b,1),k=z(c[w],d&&d[w]||0)}},i=function(a,b,e,f,g){a&&b&&a[g][0]=="M"&&b[g][0]!="M"&&(b.splice(g,0,["M",f.x,f.y]),e.bx=0,e.by=0,e.x=a[g][1],e.y=a[g][2],k=z(c[w],d&&d[w]||0))};for(var j=0,k=z(c[w],d&&d[w]||0);j<k;j++){c[j]=g(c[j],e),h(c,j),d&&(d[j]=g(d[j],f)),d&&h(d,j),i(c,d,e,f,j),i(d,c,f,e,j);var l=c[j],o=d&&d[j],p=l[w],q=d&&o[w];e.x=l[p-2],e.y=l[p-1],e.bx=S(l[p-4])||e.x,e.by=S(l[p-3])||e.y,f.bx=d&&(S(o[q-4])||f.x),f.by=d&&(S(o[q-3])||f.y),f.x=d&&o[q-2],f.y=d&&o[q-1]}return d?[c,d]:c},null,bp),by=bn(function(b){var c=[];for(var d=0,e=b[w];d<e;d++){var f={},g=b[d].match(/^([^:]*):?([\d\.]*)/);f.color=a.getRGB(g[1]);if(f.color.error)return null;f.color=f.color.hex,g[2]&&(f.offset=g[2]+"%"),c[L](f)}for(d=1,e=c[w]-1;d<e;d++)if(!c[d].offset){var h=S(c[d-1].offset||0),i=0;for(var j=d+1;j<e;j++)if(c[j].offset){i=c[j].offset;break}i||(i=100,j=e),i=S(i);var k=(i-h)/(j-d+1);for(;d<j;d++)h+=k,c[d].offset=h+"%"}return c}),bz=function(b,c,d,e){var f;if(!a.is(b,F)&&!a.is(b,"object"))return{container:1,x:b,y:c,width:d,height:e};f=a.is(b,F)?g.getElementById(b):b;if(f.tagName)return c==null?{container:f,width:f.style.pixelWidth||f.offsetWidth,height:f.style.pixelHeight||f.offsetHeight}:{container:f,width:c,height:d}},bA=function(a,b){var c=this;for(var d in b)if(b[f](d)&&!(d in a))switch(typeof b[d]){case"function":(function(b){a[d]=a===c?b:function(){return b[m](c,arguments)}})(b[d]);break;case"object":a[d]=a[d]||{},bA.call(this,a[d],b[d]);break;default:a[d]=b[d]}},bB=function(a,b){a==b.top&&(b.top=a.prev),a==b.bottom&&(b.bottom=a.next),a.next&&(a.next.prev=a.prev),a.prev&&(a.prev.next=a.next)},bC=function(a,b){b.top!==a&&(bB(a,b),a.next=null,a.prev=b.top,b.top.next=a,b.top=a)},bD=function(a,b){b.bottom!==a&&(bB(a,b),a.next=b.bottom,a.prev=null,b.bottom.prev=a,b.bottom=a)},bE=function(a,b,c){bB(a,c),b==c.top&&(c.top=a),b.next&&(b.next.prev=a),a.next=b.next,a.prev=b,b.next=a},bF=function(a,b,c){bB(a,c),b==c.bottom&&(c.bottom=a),b.prev&&(b.prev.next=a),a.prev=b.prev,b.prev=a,a.next=b},bG=function(a){return function(){throw new Error("Raphaël: you are calling to method “"+a+"” of removed object")}};a.pathToRelative=bq;if(a.svg){k.svgns="http://www.w3.org/2000/svg",k.xlink="http://www.w3.org/1999/xlink",Q=function(a){return+a+(~~a===a)*.5};var bH=function(a,b){if(!b){a=g.createElementNS(k.svgns,a),a.style&&(a.style.webkitTapHighlightColor="rgba(0,0,0,0)");return a}for(var c in b)b[f](c)&&a[R](c,r(b[c]))};a[H]=function(){return"Your browser supports SVG.\nYou are running Raphaël "+this.version};var bI=function(a,b){var c=bH("path");b.canvas&&b.canvas[l](c);var d=new bO(c,b);d.type="path",bL(d,{fill:"none",stroke:"#000",path:a});return d},bJ=function(a,b,c){var d="linear",e=.5,f=.5,h=a.style;b=r(b)[Z](be,function(a,b,c){d="radial";if(b&&c){e=S(b),f=S(c);var g=(f>.5)*2-1;C(e-.5,2)+C(f-.5,2)>.25&&(f=y.sqrt(.25-C(e-.5,2))*g+.5)&&f!=.5&&(f=f.toFixed(5)-1e-5*g)}return p}),b=b[s](/\s*\-\s*/);if(d=="linear"){var i=b.shift();i=-S(i);if(isNaN(i))return null;var j=[0,0,y.cos(i*D/180),y.sin(i*D/180)],k=1/(z(B(j[2]),B(j[3]))||1);j[2]*=k,j[3]*=k,j[2]<0&&(j[0]=-j[2],j[2]=0),j[3]<0&&(j[1]=-j[3],j[3]=0)}var m=by(b);if(!m)return null;var n=a.getAttribute(I);n=n.match(/^url\(#(.*)\)$/),n&&c.defs.removeChild(g.getElementById(n[1]));var o=bH(d+"Gradient");o.id=bi(),bH(o,d=="radial"?{fx:e,fy:f}:{x1:j[0],y1:j[1],x2:j[2],y2:j[3]}),c.defs[l](o);for(var q=0,t=m[w];q<t;q++){var u=bH("stop");bH(u,{offset:m[q].offset?m[q].offset:q?"100%":"0%","stop-color":m[q].color||"#fff"}),o[l](u)}bH(a,{fill:"url(#"+o.id+")",opacity:1,"fill-opacity":1}),h.fill=p,h.opacity=1,h.fillOpacity=1;return 1},bK=function(b){var c=b.getBBox();bH(b.pattern,{patternTransform:a.format("translate({0},{1})",c.x,c.y)})},bL=function(c,d){var e={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},h=c.node,i=c.attrs,j=c.rotate(),k=function(a,b){b=e[x.call(b)];if(b){var c=a.attrs["stroke-width"]||"1",f=({round:c,square:c,butt:0})[a.attrs["stroke-linecap"]||d["stroke-linecap"]]||0,g=[],i=b[w];while(i--)g[i]=b[i]*c+(i%2?1:-1)*f;bH(h,{"stroke-dasharray":g[v](",")})}};d[f]("rotation")&&(j=d.rotation);var m=r(j)[s](b);m.length-1?(m[1]=+m[1],m[2]=+m[2]):m=null,S(j)&&c.rotate(0,!0);for(var n in d)if(d[f](n)){if(!X[f](n))continue;var o=d[n];i[n]=o;switch(n){case"blur":c.blur(o);break;case"rotation":c.rotate(o,!0);break;case"href":case"title":case"target":var t=h.parentNode;if(x.call(t.tagName)!="a"){var u=bH("a");t.insertBefore(u,h),u[l](h),t=u}n=="target"&&o=="blank"?t.setAttributeNS(c.paper.xlink,"show","new"):t.setAttributeNS(c.paper.xlink,n,o);break;case"cursor":h.style.cursor=o;break;case"clip-rect":var y=r(o)[s](b);if(y[w]==4){c.clip&&c.clip.parentNode.parentNode.removeChild(c.clip.parentNode);var z=bH("clipPath"),A=bH("rect");z.id=bi(),bH(A,{x:y[0],y:y[1],width:y[2],height:y[3]}),z[l](A),c.paper.defs[l](z),bH(h,{"clip-path":"url(#"+z.id+")"}),c.clip=A}if(!o){var B=g.getElementById(h.getAttribute("clip-path")[Z](/(^url\(#|\)$)/g,p));B&&B.parentNode.removeChild(B),bH(h,{"clip-path":p}),delete c.clip}break;case"path":c.type=="path"&&bH(h,{d:o?i.path=br(o):"M0,0"});break;case"width":h[R](n,o);if(i.fx)n="x",o=i.x;else break;case"x":i.fx&&(o=-i.x-(i.width||0));case"rx":if(n=="rx"&&c.type=="rect")break;case"cx":m&&(n=="x"||n=="cx")&&(m[1]+=o-i[n]),h[R](n,o),c.pattern&&bK(c);break;case"height":h[R](n,o);if(i.fy)n="y",o=i.y;else break;case"y":i.fy&&(o=-i.y-(i.height||0));case"ry":if(n=="ry"&&c.type=="rect")break;case"cy":m&&(n=="y"||n=="cy")&&(m[2]+=o-i[n]),h[R](n,o),c.pattern&&bK(c);break;case"r":c.type=="rect"?bH(h,{rx:o,ry:o}):h[R](n,o);break;case"src":c.type=="image"&&h.setAttributeNS(c.paper.xlink,"href",o);break;case"stroke-width":h.style.strokeWidth=o,h[R](n,o),i["stroke-dasharray"]&&k(c,i["stroke-dasharray"]);break;case"stroke-dasharray":k(c,o);break;case"translation":var C=r(o)[s](b);C[0]=+C[0]||0,C[1]=+C[1]||0,m&&(m[1]+=C[0],m[2]+=C[1]),cB.call(c,C[0],C[1]);break;case"scale":C=r(o)[s](b),c.scale(+C[0]||1,+C[1]||+C[0]||1,isNaN(S(C[2]))?null:+C[2],isNaN(S(C[3]))?null:+C[3]);break;case I:var D=r(o).match(M);if(D){z=bH("pattern");var E=bH("image");z.id=bi(),bH(z,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),bH(E,{x:0,y:0}),E.setAttributeNS(c.paper.xlink,"href",D[1]),z[l](E);var F=g.createElement("img");F.style.cssText="position:absolute;left:-9999em;top-9999em",F.onload=function(){bH(z,{width:this.offsetWidth,height:this.offsetHeight}),bH(E,{width:this.offsetWidth,height:this.offsetHeight}),g.body.removeChild(this),c.paper.safari()},g.body[l](F),F.src=D[1],c.paper.defs[l](z),h.style.fill="url(#"+z.id+")",bH(h,{fill:"url(#"+z.id+")"}),c.pattern=z,c.pattern&&bK(c);break}var G=a.getRGB(o);if(!G.error)delete d.gradient,delete i.gradient,!a.is(i.opacity,"undefined")&&a.is(d.opacity,"undefined")&&bH(h,{opacity:i.opacity}),!a.is(i["fill-opacity"],"undefined")&&a.is(d["fill-opacity"],"undefined")&&bH(h,{"fill-opacity":i["fill-opacity"]});else if((({circle:1,ellipse:1})[f](c.type)||r(o).charAt()!="r")&&bJ(h,o,c.paper)){i.gradient=o,i.fill="none";break}G[f]("opacity")&&bH(h,{"fill-opacity":G.opacity>1?G.opacity/100:G.opacity});case"stroke":G=a.getRGB(o),h[R](n,G.hex),n=="stroke"&&G[f]("opacity")&&bH(h,{"stroke-opacity":G.opacity>1?G.opacity/100:G.opacity});break;case"gradient":(({circle:1,ellipse:1})[f](c.type)||r(o).charAt()!="r")&&bJ(h,o,c.paper);break;case"opacity":i.gradient&&!i[f]("stroke-opacity")&&bH(h,{"stroke-opacity":o>1?o/100:o});case"fill-opacity":if(i.gradient){var H=g.getElementById(h.getAttribute(I)[Z](/^url\(#|\)$/g,p));if(H){var J=H.getElementsByTagName("stop");J[J[w]-1][R]("stop-opacity",o)}break};default:n=="font-size"&&(o=T(o,10)+"px");var K=n[Z](/(\-.)/g,function(a){return W.call(a.substring(1))});h.style[K]=o,h[R](n,o)}}bN(c,d),m?c.rotate(m.join(q)):S(j)&&c.rotate(j,!0)},bM=1.2,bN=function(b,c){if(b.type=="text"&&!!(c[f]("text")||c[f]("font")||c[f]("font-size")||c[f]("x")||c[f]("y"))){var d=b.attrs,e=b.node,h=e.firstChild?T(g.defaultView.getComputedStyle(e.firstChild,p).getPropertyValue("font-size"),10):10;if(c[f]("text")){d.text=c.text;while(e.firstChild)e.removeChild(e.firstChild);var i=r(c.text)[s]("\n");for(var j=0,k=i[w];j<k;j++)if(i[j]){var m=bH("tspan");j&&bH(m,{dy:h*bM,x:d.x}),m[l](g.createTextNode(i[j])),e[l](m)}}else{i=e.getElementsByTagName("tspan");for(j=0,k=i[w];j<k;j++)j&&bH(i[j],{dy:h*bM,x:d.x})}bH(e,{y:d.y});var n=b.getBBox(),o=d.y-(n.y+n.height/2);o&&a.is(o,"finite")&&bH(e,{y:d.y+o})}},bO=function(b,c){var d=0,e=0;this[0]=b,this.id=a._oid++,this.node=b,b.raphael=this,this.paper=c,this.attrs=this.attrs||{},this.transformations=[],this._={tx:0,ty:0,rt:{deg:0,cx:0,cy:0},sx:1,sy:1},!c.bottom&&(c.bottom=this),this.prev=c.top,c.top&&(c.top.next=this),c.top=this,this.next=null},bP=bO[e];bO[e].rotate=function(c,d,e){if(this.removed)return this;if(c==null){if(this._.rt.cx)return[this._.rt.deg,this._.rt.cx,this._.rt.cy][v](q);return this._.rt.deg}var f=this.getBBox();c=r(c)[s](b),c[w]-1&&(d=S(c[1]),e=S(c[2])),c=S(c[0]),d!=null&&d!==!1?this._.rt.deg=c:this._.rt.deg+=c,e==null&&(d=null),this._.rt.cx=d,this._.rt.cy=e,d=d==null?f.x+f.width/2:d,e=e==null?f.y+f.height/2:e,this._.rt.deg?(this.transformations[0]=a.format("rotate({0} {1} {2})",this._.rt.deg,d,e),this.clip&&bH(this.clip,{transform:a.format("rotate({0} {1} {2})",-this._.rt.deg,d,e)})):(this.transformations[0]=p,this.clip&&bH(this.clip,{transform:p})),bH(this.node,{transform:this.transformations[v](q)});return this},bO[e].hide=function(){!this.removed&&(this.node.style.display="none");return this},bO[e].show=function(){!this.removed&&(this.node.style.display="");return this},bO[e].remove=function(){if(!this.removed){bB(this,this.paper),this.node.parentNode.removeChild(this.node);for(var a in this)delete this[a];this.removed=!0}},bO[e].getBBox=function(){if(this.removed)return this;if(this.type=="path")return bo(this.attrs.path);if(this.node.style.display=="none"){this.show();var a=!0}var b={};try{b=this.node.getBBox()}catch(c){}finally{b=b||{}}if(this.type=="text"){b={x:b.x,y:Infinity,width:0,height:0};for(var d=0,e=this.node.getNumberOfChars();d<e;d++){var f=this.node.getExtentOfChar(d);f.y<b.y&&(b.y=f.y),f.y+f.height-b.y>b.height&&(b.height=f.y+f.height-b.y),f.x+f.width-b.x>b.width&&(b.width=f.x+f.width-b.x)}}a&&this.hide();return b},bO[e].attr=function(b,c){if(this.removed)return this;if(b==null){var d={};for(var e in this.attrs)this.attrs[f](e)&&(d[e]=this.attrs[e]);this._.rt.deg&&(d.rotation=this.rotate()),(this._.sx!=1||this._.sy!=1)&&(d.scale=this.scale()),d.gradient&&d.fill=="none"&&(d.fill=d.gradient)&&delete d.gradient;return d}if(c==null&&a.is(b,F)){if(b=="translation")return cB.call(this);if(b=="rotation")return this.rotate();if(b=="scale")return this.scale();if(b==I&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;return this.attrs[b]}if(c==null&&a.is(b,G)){var g={};for(var h=0,i=b.length;h<i;h++)g[b[h]]=this.attr(b[h]);return g}if(c!=null){var j={};j[b]=c}else b!=null&&a.is(b,"object")&&(j=b);for(var k in this.paper.customAttributes)if(this.paper.customAttributes[f](k)&&j[f](k)&&a.is(this.paper.customAttributes[k],"function")){var l=this.paper.customAttributes[k].apply(this,[][n](j[k]));this.attrs[k]=j[k];for(var m in l)l[f](m)&&(j[m]=l[m])}bL(this,j);return this},bO[e].toFront=function(){if(this.removed)return this;this.node.parentNode[l](this.node);var a=this.paper;a.top!=this&&bC(this,a);return this},bO[e].toBack=function(){if(this.removed)return this;if(this.node.parentNode.firstChild!=this.node){this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),bD(this,this.paper);var a=this.paper}return this},bO[e].insertAfter=function(a){if(this.removed)return this;var b=a.node||a[a.length-1].node;b.nextSibling?b.parentNode.insertBefore(this.node,b.nextSibling):b.parentNode[l](this.node),bE(this,a,this.paper);return this},bO[e].insertBefore=function(a){if(this.removed)return this;var b=a.node||a[0].node;b.parentNode.insertBefore(this.node,b),bF(this,a,this.paper);return this},bO[e].blur=function(a){var b=this;if(+a!==0){var c=bH("filter"),d=bH("feGaussianBlur");b.attrs.blur=a,c.id=bi(),bH(d,{stdDeviation:+a||1.5}),c.appendChild(d),b.paper.defs.appendChild(c),b._blur=c,bH(b.node,{filter:"url(#"+c.id+")"})}else b._blur&&(b._blur.parentNode.removeChild(b._blur),delete b._blur,delete b.attrs.blur),b.node.removeAttribute("filter")};var bQ=function(a,b,c,d){var e=bH("circle");a.canvas&&a.canvas[l](e);var f=new bO(e,a);f.attrs={cx:b,cy:c,r:d,fill:"none",stroke:"#000"},f.type="circle",bH(e,f.attrs);return f},bR=function(a,b,c,d,e,f){var g=bH("rect");a.canvas&&a.canvas[l](g);var h=new bO(g,a);h.attrs={x:b,y:c,width:d,height:e,r:f||0,rx:f||0,ry:f||0,fill:"none",stroke:"#000"},h.type="rect",bH(g,h.attrs);return h},bS=function(a,b,c,d,e){var f=bH("ellipse");a.canvas&&a.canvas[l](f);var g=new bO(f,a);g.attrs={cx:b,cy:c,rx:d,ry:e,fill:"none",stroke:"#000"},g.type="ellipse",bH(f,g.attrs);return g},bT=function(a,b,c,d,e,f){var g=bH("image");bH(g,{x:c,y:d,width:e,height:f,preserveAspectRatio:"none"}),g.setAttributeNS(a.xlink,"href",b),a.canvas&&a.canvas[l](g);var h=new bO(g,a);h.attrs={x:c,y:d,width:e,height:f,src:b},h.type="image";return h},bU=function(a,b,c,d){var e=bH("text");bH(e,{x:b,y:c,"text-anchor":"middle"}),a.canvas&&a.canvas[l](e);var f=new bO(e,a);f.attrs={x:b,y:c,"text-anchor":"middle",text:d,font:X.font,stroke:"none",fill:"#000"},f.type="text",bL(f,f.attrs);return f},bV=function(a,b){this.width=a||this.width,this.height=b||this.height,this.canvas[R]("width",this.width),this.canvas[R]("height",this.height);return this},bW=function(){var b=bz[m](0,arguments),c=b&&b.container,d=b.x,e=b.y,f=b.width,h=b.height;if(!c)throw new Error("SVG container not found.");var i=bH("svg");d=d||0,e=e||0,f=f||512,h=h||342,bH(i,{xmlns:"http://www.w3.org/2000/svg",version:1.1,width:f,height:h}),c==1?(i.style.cssText="position:absolute;left:"+d+"px;top:"+e+"px",g.body[l](i)):c.firstChild?c.insertBefore(i,c.firstChild):c[l](i),c=new j,c.width=f,c.height=h,c.canvas=i,bA.call(c,c,a.fn),c.clear();return c};k.clear=function(){var a=this.canvas;while(a.firstChild)a.removeChild(a.firstChild);this.bottom=this.top=null,(this.desc=bH("desc"))[l](g.createTextNode("Created with Raphaël")),a[l](this.desc),a[l](this.defs=bH("defs"))},k.remove=function(){this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]=bG(a)}}if(a.vml){var bX={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},bY=/([clmz]),?([^clmz]*)/gi,bZ=/ progid:\S+Blur\([^\)]+\)/g,b$=/-?[^,\s-]+/g,b_=1e3+q+1e3,ca=10,cb={path:1,rect:1},cc=function(a){var b=/[ahqstv]/ig,c=br;r(a).match(b)&&(c=bx),b=/[clmz]/g;if(c==br&&!r(a).match(b)){var d=r(a)[Z](bY,function(a,b,c){var d=[],e=x.call(b)=="m",f=bX[b];c[Z](b$,function(a){e&&d[w]==2&&(f+=d+bX[b=="m"?"l":"L"],d=[]),d[L](Q(a*ca))});return f+d});return d}var e=c(a),f,g;d=[];for(var h=0,i=e[w];h<i;h++){f=e[h],g=x.call(e[h][0]),g=="z"&&(g="x");for(var j=1,k=f[w];j<k;j++)g+=Q(f[j]*ca)+(j!=k-1?",":p);d[L](g)}return d[v](q)};a[H]=function(){return"Your browser doesn’t support SVG. Falling down to VML.\nYou are running Raphaël "+this.version},bI=function(a,b){var c=ce("group");c.style.cssText="position:absolute;left:0;top:0;width:"+b.width+"px;height:"+b.height+"px",c.coordsize=b.coordsize,c.coordorigin=b.coordorigin;var d=ce("shape"),e=d.style;e.width=b.width+"px",e.height=b.height+"px",d.coordsize=b_,d.coordorigin=b.coordorigin,c[l](d);var f=new bO(d,c,b),g={fill:"none",stroke:"#000"};a&&(g.path=a),f.type="path",f.path=[],f.Path=p,bL(f,g),b.canvas[l](c);return f},bL=function(c,d){c.attrs=c.attrs||{};var e=c.node,h=c.attrs,i=e.style,j,k=(d.x!=h.x||d.y!=h.y||d.width!=h.width||d.height!=h.height||d.r!=h.r)&&c.type=="rect",m=c;for(var n in d)d[f](n)&&(h[n]=d[n]);k&&(h.path=cd(h.x,h.y,h.width,h.height,h.r),c.X=h.x,c.Y=h.y,c.W=h.width,c.H=h.height),d.href&&(e.href=d.href),d.title&&(e.title=d.title),d.target&&(e.target=d.target),d.cursor&&(i.cursor=d.cursor),"blur"in d&&c.blur(d.blur);if(d.path&&c.type=="path"||k)e.path=cc(h.path);d.rotation!=null&&c.rotate(d.rotation,!0),d.translation&&(j=r(d.translation)[s](b),cB.call(c,j[0],j[1]),c._.rt.cx!=null&&(c._.rt.cx+=+j[0],c._.rt.cy+=+j[1],c.setBox(c.attrs,j[0],j[1]))),d.scale&&(j=r(d.scale)[s](b),c.scale(+j[0]||1,+j[1]||+j[0]||1,+j[2]||null,+j[3]||null));if("clip-rect"in d){var o=r(d["clip-rect"])[s](b);if(o[w]==4){o[2]=+o[2]+ +o[0],o[3]=+o[3]+ +o[1];var q=e.clipRect||g.createElement("div"),t=q.style,u=e.parentNode;t.clip=a.format("rect({1}px {2}px {3}px {0}px)",o),e.clipRect||(t.position="absolute",t.top=0,t.left=0,t.width=c.paper.width+"px",t.height=c.paper.height+"px",u.parentNode.insertBefore(q,u),q[l](u),e.clipRect=q)}d["clip-rect"]||e.clipRect&&(e.clipRect.style.clip=p)}c.type=="image"&&d.src&&(e.src=d.src),c.type=="image"&&d.opacity&&(e.filterOpacity=U+".Alpha(opacity="+d.opacity*100+")",i.filter=(e.filterMatrix||p)+(e.filterOpacity||p)),d.font&&(i.font=d.font),d["font-family"]&&(i.fontFamily='"'+d["font-family"][s](",")[0][Z](/^['"]+|['"]+$/g,p)+'"'),d["font-size"]&&(i.fontSize=d["font-size"]),d["font-weight"]&&(i.fontWeight=d["font-weight"]),d["font-style"]&&(i.fontStyle=d["font-style"]);if(d.opacity!=null||d["stroke-width"]!=null||d.fill!=null||d.stroke!=null||d["stroke-width"]!=null||d["stroke-opacity"]!=null||d["fill-opacity"]!=null||d["stroke-dasharray"]!=null||d["stroke-miterlimit"]!=null||d["stroke-linejoin"]!=null||d["stroke-linecap"]!=null){e=c.shape||e;var v=e.getElementsByTagName(I)&&e.getElementsByTagName(I)[0],x=!1;!v&&(x=v=ce(I));if("fill-opacity"in d||"opacity"in d){var y=((+h["fill-opacity"]+1||2)-1)*((+h.opacity+1||2)-1)*((+a.getRGB(d.fill).o+1||2)-1);y=A(z(y,0),1),v.opacity=y}d.fill&&(v.on=!0);if(v.on==null||d.fill=="none")v.on=!1;if(v.on&&d.fill){var B=d.fill.match(M);B?(v.src=B[1],v.type="tile"):(v.color=a.getRGB(d.fill).hex,v.src=p,v.type="solid",a.getRGB(d.fill).error&&(m.type in{circle:1,ellipse:1}||r(d.fill).charAt()!="r")&&bJ(m,d.fill)&&(h.fill="none",h.gradient=d.fill))}x&&e[l](v);var C=e.getElementsByTagName("stroke")&&e.getElementsByTagName("stroke")[0],D=!1;!C&&(D=C=ce("stroke"));if(d.stroke&&d.stroke!="none"||d["stroke-width"]||d["stroke-opacity"]!=null||d["stroke-dasharray"]||d["stroke-miterlimit"]||d["stroke-linejoin"]||d["stroke-linecap"])C.on=!0;(d.stroke=="none"||C.on==null||d.stroke==0||d["stroke-width"]==0)&&(C.on=!1);var E=a.getRGB(d.stroke);C.on&&d.stroke&&(C.color=E.hex),y=((+h["stroke-opacity"]+1||2)-1)*((+h.opacity+1||2)-1)*((+E.o+1||2)-1);var F=(S(d["stroke-width"])||1)*.75;y=A(z(y,0),1),d["stroke-width"]==null&&(F=h["stroke-width"]),d["stroke-width"]&&(C.weight=F),F&&F<1&&(y*=F)&&(C.weight=1),C.opacity=y,d["stroke-linejoin"]&&(C.joinstyle=d["stroke-linejoin"]||"miter"),C.miterlimit=d["stroke-miterlimit"]||8,d["stroke-linecap"]&&(C.endcap=d["stroke-linecap"]=="butt"?"flat":d["stroke-linecap"]=="square"?"square":"round");if(d["stroke-dasharray"]){var G={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};C.dashstyle=G[f](d["stroke-dasharray"])?G[d["stroke-dasharray"]]:p}D&&e[l](C)}if(m.type=="text"){i=m.paper.span.style,h.font&&(i.font=h.font),h["font-family"]&&(i.fontFamily=h["font-family"]),h["font-size"]&&(i.fontSize=h["font-size"]),h["font-weight"]&&(i.fontWeight=h["font-weight"]),h["font-style"]&&(i.fontStyle=h["font-style"]),m.node.string&&(m.paper.span.innerHTML=r(m.node.string)[Z](/</g,"&#60;")[Z](/&/g,"&#38;")[Z](/\n/g,"<br>")),m.W=h.w=m.paper.span.offsetWidth,m.H=h.h=m.paper.span.offsetHeight,m.X=h.x,m.Y=h.y+Q(m.H/2);switch(h["text-anchor"]){case"start":m.node.style["v-text-align"]="left",m.bbx=Q(m.W/2);break;case"end":m.node.style["v-text-align"]="right",m.bbx=-Q(m.W/2);break;default:m.node.style["v-text-align"]="center"}}},bJ=function(a,b){a.attrs=a.attrs||{};var c=a.attrs,d,e="linear",f=".5 .5";a.attrs.gradient=b,b=r(b)[Z](be,function(a,b,c){e="radial",b&&c&&(b=S(b),c=S(c),C(b-.5,2)+C(c-.5,2)>.25&&(c=y.sqrt(.25-C(b-.5,2))*((c>.5)*2-1)+.5),f=b+q+c);return p}),b=b[s](/\s*\-\s*/);if(e=="linear"){var g=b.shift();g=-S(g);if(isNaN(g))return null}var h=by(b);if(!h)return null;a=a.shape||a.node,d=a.getElementsByTagName(I)[0]||ce(I),!d.parentNode&&a.appendChild(d);if(h[w]){d.on=!0,d.method="none",d.color=h[0].color,d.color2=h[h[w]-1].color;var i=[];for(var j=0,k=h[w];j<k;j++)h[j].offset&&i[L](h[j].offset+q+h[j].color);d.colors&&(d.colors.value=i[w]?i[v]():"0% "+d.color),e=="radial"?(d.type="gradientradial",d.focus="100%",d.focussize=f,d.focusposition=f):(d.type="gradient",d.angle=(270-g)%360)}return 1},bO=function(b,c,d){var e=0,f=0,g=0,h=1;this[0]=b,this.id=a._oid++,this.node=b,b.raphael=this,this.X=0,this.Y=0,this.attrs={},this.Group=c,this.paper=d,this._={tx:0,ty:0,rt:{deg:0},sx:1,sy:1},!d.bottom&&(d.bottom=this),this.prev=d.top,d.top&&(d.top.next=this),d.top=this,this.next=null},bP=bO[e],bP.rotate=function(a,c,d){if(this.removed)return this;if(a==null){if(this._.rt.cx)return[this._.rt.deg,this._.rt.cx,this._.rt.cy][v](q);return this._.rt.deg}a=r(a)[s](b),a[w]-1&&(c=S(a[1]),d=S(a[2])),a=S(a[0]),c!=null?this._.rt.deg=a:this._.rt.deg+=a,d==null&&(c=null),this._.rt.cx=c,this._.rt.cy=d,this.setBox(this.attrs,c,d),this.Group.style.rotation=this._.rt.deg;return this},bP.setBox=function(a,b,c){if(this.removed)return this;var d=this.Group.style,e=this.shape&&this.shape.style||this.node.style;a=a||{};for(var g in a)a[f](g)&&(this.attrs[g]=a[g]);b=b||this._.rt.cx,c=c||this._.rt.cy;var h=this.attrs,i,j,k,l;switch(this.type){case"circle":i=h.cx-h.r,j=h.cy-h.r,k=l=h.r*2;break;case"ellipse":i=h.cx-h.rx,j=h.cy-h.ry,k=h.rx*2,l=h.ry*2;break;case"image":i=+h.x,j=+h.y,k=h.width||0,l=h.height||0;break;case"text":this.textpath.v=["m",Q(h.x),", ",Q(h.y-2),"l",Q(h.x)+1,", ",Q(h.y-2)][v](p),i=h.x-Q(this.W/2),j=h.y-this.H/2,k=this.W,l=this.H;break;case"rect":case"path":if(!this.attrs.path)i=0,j=0,k=this.paper.width,l=this.paper.height;else{var m=bo(this.attrs.path);i=m.x,j=m.y,k=m.width,l=m.height}break;default:i=0,j=0,k=this.paper.width,l=this.paper.height}b=b==null?i+k/2:b,c=c==null?j+l/2:c;var n=b-this.paper.width/2,o=c-this.paper.height/2,q;d.left!=(q=n+"px")&&(d.left=q),d.top!=(q=o+"px")&&(d.top=q),this.X=cb[f](this.type)?-n:i,this.Y=cb[f](this.type)?-o:j,this.W=k,this.H=l,cb[f](this.type)?(e.left!=(q=-n*ca+"px")&&(e.left=q),e.top!=(q=-o*ca+"px")&&(e.top=q)):this.type=="text"?(e.left!=(q=-n+"px")&&(e.left=q),e.top!=(q=-o+"px")&&(e.top=q)):(d.width!=(q=this.paper.width+"px")&&(d.width=q),d.height!=(q=this.paper.height+"px")&&(d.height=q),e.left!=(q=i-n+"px")&&(e.left=q),e.top!=(q=j-o+"px")&&(e.top=q),e.width!=(q=k+"px")&&(e.width=q),e.height!=(q=l+"px")&&(e.height=q))},bP.hide=function(){!this.removed&&(this.Group.style.display="none");return this},bP.show=function(){!this.removed&&(this.Group.style.display="block");return this},bP.getBBox=function(){if(this.removed)return this;if(cb[f](this.type))return bo(this.attrs.path);return{x:this.X+(this.bbx||0),y:this.Y,width:this.W,height:this.H}},bP.remove=function(){if(!this.removed){bB(this,this.paper),this.node.parentNode.removeChild(this.node),this.Group.parentNode.removeChild(this.Group),this.shape&&this.shape.parentNode.removeChild(this.shape);for(var a in this)delete this[a];this.removed=!0}},bP.attr=function(b,c){if(this.removed)return this;if(b==null){var d={};for(var e in this.attrs)this.attrs[f](e)&&(d[e]=this.attrs[e]);this._.rt.deg&&(d.rotation=this.rotate()),(this._.sx!=1||this._.sy!=1)&&(d.scale=this.scale()),d.gradient&&d.fill=="none"&&(d.fill=d.gradient)&&delete d.gradient;return d}if(c==null&&a.is(b,"string")){if(b=="translation")return cB.call(this);if(b=="rotation")return this.rotate();if(b=="scale")return this.scale();if(b==I&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;return this.attrs[b]}if(this.attrs&&c==null&&a.is(b,G)){var g,h={};for(e=0,g=b[w];e<g;e++)h[b[e]]=this.attr(b[e]);return h}var i;c!=null&&(i={},i[b]=c),c==null&&a.is(b,"object")&&(i=b);if(i){for(var j in this.paper.customAttributes)if(this.paper.customAttributes[f](j)&&i[f](j)&&a.is(this.paper.customAttributes[j],"function")){var k=this.paper.customAttributes[j].apply(this,[][n](i[j]));this.attrs[j]=i[j];for(var l in k)k[f](l)&&(i[l]=k[l])}i.text&&this.type=="text"&&(this.node.string=i.text),bL(this,i),i.gradient&&(({circle:1,ellipse:1})[f](this.type)||r(i.gradient).charAt()!="r")&&bJ(this,i.gradient),(!cb[f](this.type)||this._.rt.deg)&&this.setBox(this.attrs)}return this},bP.toFront=function(){!this.removed&&this.Group.parentNode[l](this.Group),this.paper.top!=this&&bC(this,this.paper);return this},bP.toBack=function(){if(this.removed)return this;this.Group.parentNode.firstChild!=this.Group&&(this.Group.parentNode.insertBefore(this.Group,this.Group.parentNode.firstChild),bD(this,this.paper));return this},bP.insertAfter=function(a){if(this.removed)return this;a.constructor==cE&&(a=a[a.length-1]),a.Group.nextSibling?a.Group.parentNode.insertBefore(this.Group,a.Group.nextSibling):a.Group.parentNode[l](this.Group),bE(this,a,this.paper);return this},bP.insertBefore=function(a){if(this.removed)return this;a.constructor==cE&&(a=a[0]),a.Group.parentNode.insertBefore(this.Group,a.Group),bF(this,a,this.paper);return this},bP.blur=function(b){var c=this.node.runtimeStyle,d=c.filter;d=d.replace(bZ,p),+b!==0?(this.attrs.blur=b,c.filter=d+q+U+".Blur(pixelradius="+(+b||1.5)+")",c.margin=a.format("-{0}px 0 0 -{0}px",Q(+b||1.5))):(c.filter=d,c.margin=0,delete this.attrs.blur)},bQ=function(a,b,c,d){var e=ce("group"),f=ce("oval"),g=f.style;e.style.cssText="position:absolute;left:0;top:0;width:"+a.width+"px;height:"+a.height+"px",e.coordsize=b_,e.coordorigin=a.coordorigin,e[l](f);var h=new bO(f,e,a);h.type="circle",bL(h,{stroke:"#000",fill:"none"}),h.attrs.cx=b,h.attrs.cy=c,h.attrs.r=d,h.setBox({x:b-d,y:c-d,width:d*2,height:d*2}),a.canvas[l](e);return h};function cd(b,c,d,e,f){return f?a.format("M{0},{1}l{2},0a{3},{3},0,0,1,{3},{3}l0,{5}a{3},{3},0,0,1,{4},{3}l{6},0a{3},{3},0,0,1,{4},{4}l0,{7}a{3},{3},0,0,1,{3},{4}z",b+f,c,d-f*2,f,-f,e-f*2,f*2-d,f*2-e):a.format("M{0},{1}l{2},0,0,{3},{4},0z",b,c,d,e,-d)}bR=function(a,b,c,d,e,f){var g=cd(b,c,d,e,f),h=a.path(g),i=h.attrs;h.X=i.x=b,h.Y=i.y=c,h.W=i.width=d,h.H=i.height=e,i.r=f,i.path=g,h.type="rect";return h},bS=function(a,b,c,d,e){var f=ce("group"),g=ce("oval"),h=g.style;f.style.cssText="position:absolute;left:0;top:0;width:"+a.width+"px;height:"+a.height+"px",f.coordsize=b_,f.coordorigin=a.coordorigin,f[l](g);var i=new bO(g,f,a);i.type="ellipse",bL(i,{stroke:"#000"}),i.attrs.cx=b,i.attrs.cy=c,i.attrs.rx=d,i.attrs.ry=e,i.setBox({x:b-d,y:c-e,width:d*2,height:e*2}),a.canvas[l](f);return i},bT=function(a,b,c,d,e,f){var g=ce("group"),h=ce("image");g.style.cssText="position:absolute;left:0;top:0;width:"+a.width+"px;height:"+a.height+"px",g.coordsize=b_,g.coordorigin=a.coordorigin,h.src=b,g[l](h);var i=new bO(h,g,a);i.type="image",i.attrs.src=b,i.attrs.x=c,i.attrs.y=d,i.attrs.w=e,i.attrs.h=f,i.setBox({x:c,y:d,width:e,height:f}),a.canvas[l](g);return i},bU=function(b,c,d,e){var f=ce("group"),g=ce("shape"),h=g.style,i=ce("path"),j=i.style,k=ce("textpath");f.style.cssText="position:absolute;left:0;top:0;width:"+b.width+"px;height:"+b.height+"px",f.coordsize=b_,f.coordorigin=b.coordorigin,i.v=a.format("m{0},{1}l{2},{1}",Q(c*10),Q(d*10),Q(c*10)+1),i.textpathok=!0,h.width=b.width,h.height=b.height,k.string=r(e),k.on=!0,g[l](k),g[l](i),f[l](g);var m=new bO(k,f,b);m.shape=g,m.textpath=i,m.type="text",m.attrs.text=e,m.attrs.x=c,m.attrs.y=d,m.attrs.w=1,m.attrs.h=1,bL(m,{font:X.font,stroke:"none",fill:"#000"}),m.setBox(),b.canvas[l](f);return m},bV=function(a,b){var c=this.canvas.style;a==+a&&(a+="px"),b==+b&&(b+="px"),c.width=a,c.height=b,c.clip="rect(0 "+a+" "+b+" 0)";return this};var ce;g.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{!g.namespaces.rvml&&g.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),ce=function(a){return g.createElement("<rvml:"+a+' class="rvml">')}}catch(cf){ce=function(a){return g.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}bW=function(){var b=bz[m](0,arguments),c=b.container,d=b.height,e,f=b.width,h=b.x,i=b.y;if(!c)throw new Error("VML container not found.");var k=new j,n=k.canvas=g.createElement("div"),o=n.style;h=h||0,i=i||0,f=f||512,d=d||342,f==+f&&(f+="px"),d==+d&&(d+="px"),k.width=1e3,k.height=1e3,k.coordsize=ca*1e3+q+ca*1e3,k.coordorigin="0 0",k.span=g.createElement("span"),k.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",n[l](k.span),o.cssText=a.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",f,d),c==1?(g.body[l](n),o.left=h+"px",o.top=i+"px",o.position="absolute"):c.firstChild?c.insertBefore(n,c.firstChild):c[l](n),bA.call(k,k,a.fn);return k},k.clear=function(){this.canvas.innerHTML=p,this.span=g.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas[l](this.span),this.bottom=this.top=null},k.remove=function(){this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]=bG(a);return!0}}var cg=navigator.userAgent.match(/Version\/(.*?)\s/);navigator.vendor=="Apple Computer, Inc."&&(cg&&cg[1]<4||navigator.platform.slice(0,2)=="iP")?k.safari=function(){var a=this.rect(-99,-99,this.width+99,this.height+99).attr({stroke:"none"});h.setTimeout(function(){a.remove()})}:k.safari=function(){};var ch=function(){this.returnValue=!1},ci=function(){return this.originalEvent.preventDefault()},cj=function(){this.cancelBubble=!0},ck=function(){return this.originalEvent.stopPropagation()},cl=function(){if(g.addEventListener)return function(a,b,c,d){var e=o&&u[b]?u[b]:b,g=function(e){if(o&&u[f](b))for(var g=0,h=e.targetTouches&&e.targetTouches.length;g<h;g++)if(e.targetTouches[g].target==a){var i=e;e=e.targetTouches[g],e.originalEvent=i,e.preventDefault=ci,e.stopPropagation=ck;break}return c.call(d,e)};a.addEventListener(e,g,!1);return function(){a.removeEventListener(e,g,!1);return!0}};if(g.attachEvent)return function(a,b,c,d){var e=function(a){a=a||h.event,a.preventDefault=a.preventDefault||ch,a.stopPropagation=a.stopPropagation||cj;return c.call(d,a)};a.attachEvent("on"+b,e);var f=function(){a.detachEvent("on"+b,e);return!0};return f}}(),cm=[],cn=function(a){var b=a.clientX,c=a.clientY,d=g.documentElement.scrollTop||g.body.scrollTop,e=g.documentElement.scrollLeft||g.body.scrollLeft,f,h=cm.length;while(h--){f=cm[h];if(o){var i=a.touches.length,j;while(i--){j=a.touches[i];if(j.identifier==f.el._drag.id){b=j.clientX,c=j.clientY,(a.originalEvent?a.originalEvent:a).preventDefault();break}}}else a.preventDefault();b+=e,c+=d,f.move&&f.move.call(f.move_scope||f.el,b-f.el._drag.x,c-f.el._drag.y,b,c,a)}},co=function(b){a.unmousemove(cn).unmouseup(co);var c=cm.length,d;while(c--)d=cm[c],d.el._drag={},d.end&&d.end.call(d.end_scope||d.start_scope||d.move_scope||d.el,b);cm=[]};for(var cp=t[w];cp--;)(function(b){a[b]=bO[e][b]=function(c,d){a.is(c,"function")&&(this.events=this.events||[],this.events.push({name:b,f:c,unbind:cl(this.shape||this.node||g,b,c,d||this)}));return this},a["un"+b]=bO[e]["un"+b]=function(a){var c=this.events,d=c[w];while(d--)if(c[d].name==b&&c[d].f==a){c[d].unbind(),c.splice(d,1),!c.length&&delete this.events;return this}return this}})(t[cp]);bP.hover=function(a,b,c,d){return this.mouseover(a,c).mouseout(b,d||c)},bP.unhover=function(a,b){return this.unmouseover(a).unmouseout(b)},bP.drag=function(b,c,d,e,f,h){this._drag={},this.mousedown(function(i){(i.originalEvent||i).preventDefault();var j=g.documentElement.scrollTop||g.body.scrollTop,k=g.documentElement.scrollLeft||g.body.scrollLeft;this._drag.x=i.clientX+k,this._drag.y=i.clientY+j,this._drag.id=i.identifier,c&&c.call(f||e||this,i.clientX+k,i.clientY+j,i),!cm.length&&a.mousemove(cn).mouseup(co),cm.push({el:this,move:b,end:d,move_scope:e,start_scope:f,end_scope:h})});return this},bP.undrag=function(b,c,d){var e=cm.length;while(e--)cm[e].el==this&&cm[e].move==b&&cm[e].end==d&&cm.splice(e++,1);!cm.length&&a.unmousemove(cn).unmouseup(co)},k.circle=function(a,b,c){return bQ(this,a||0,b||0,c||0)},k.rect=function(a,b,c,d,e){return bR(this,a||0,b||0,c||0,d||0,e||0)},k.ellipse=function(a,b,c,d){return bS(this,a||0,b||0,c||0,d||0)},k.path=function(b){b&&!a.is(b,F)&&!a.is(b[0],G)&&(b+=p);return bI(a.format[m](a,arguments),this)},k.image=function(a,b,c,d,e){return bT(this,a||"about:blank",b||0,c||0,d||0,e||0)},k.text=function(a,b,c){return bU(this,a||0,b||0,r(c))},k.set=function(a){arguments[w]>1&&(a=Array[e].splice.call(arguments,0,arguments[w]));return new cE(a)},k.setSize=bV,k.top=k.bottom=null,k.raphael=a,bP.resetScale=function(){if(this.removed)return this;this._.sx=1,this._.sy=1,this.attrs.scale="1 1"},bP.scale=function(a,b,c,d){if(this.removed)return this;if(a==null&&b==null)return{x:this._.sx,y:this._.sy,toString:cq};b=b||a,!+b&&(b=a);var e,f,g,h,i=this.attrs;if(a!=0){var j=this.getBBox(),k=j.x+j.width/2,l=j.y+j.height/2,m=B(a/this._.sx),o=B(b/this._.sy);c=+c||c==0?c:k,d=+d||d==0?d:l;var r=this._.sx>0,s=this._.sy>0,t=~~(a/B(a)),u=~~(b/B(b)),x=m*t,y=o*u,z=this.node.style,A=c+B(k-c)*x*(k>c==r?1:-1),C=d+B(l-d)*y*(l>d==s?1:-1),D=a*t>b*u?o:m;switch(this.type){case"rect":case"image":var E=i.width*m,F=i.height*o;this.attr({height:F,r:i.r*D,width:E,x:A-E/2,y:C-F/2});break;case"circle":case"ellipse":this.attr({rx:i.rx*m,ry:i.ry*o,r:i.r*D,cx:A,cy:C});break;case"text":this.attr({x:A,y:C});break;case"path":var G=bq(i.path),H=!0,I=r?x:m,J=s?y:o;for(var K=0,L=G[w];K<L;K++){var M=G[K],N=W.call(M[0]);if(N=="M"&&H)continue;H=!1;if(N=="A")M[G[K][w]-2]*=I,M[G[K][w]-1]*=J,M[1]*=m,M[2]*=o,M[5]=+(t+u?!!+M[5]:!+M[5]);else if(N=="H")for(var O=1,P=M[w];O<P;O++)M[O]*=I;else if(N=="V")for(O=1,P=M[w];O<P;O++)M[O]*=J;else for(O=1,P=M[w];O<P;O++)M[O]*=O%2?I:J}var Q=bo(G);e=A-Q.x-Q.width/2,f=C-Q.y-Q.height/2,G[0][1]+=e,G[0][2]+=f,this.attr({path:G})}this.type in{text:1,image:1}&&(t!=1||u!=1)?this.transformations?(this.transformations[2]="scale("[n](t,",",u,")"),this.node[R]("transform",this.transformations[v](q)),e=t==-1?-i.x-(E||0):i.x,f=u==-1?-i.y-(F||0):i.y,this.attr({x:e,y:f}),i.fx=t-1,i.fy=u-1):(this.node.filterMatrix=U+".Matrix(M11="[n](t,", M12=0, M21=0, M22=",u,", Dx=0, Dy=0, sizingmethod='auto expand', filtertype='bilinear')"),z.filter=(this.node.filterMatrix||p)+(this.node.filterOpacity||p)):this.transformations?(this.transformations[2]=p,this.node[R]("transform",this.transformations[v](q)),i.fx=0,i.fy=0):(this.node.filterMatrix=p,z.filter=(this.node.filterMatrix||p)+(this.node.filterOpacity||p)),i.scale=[a,b,c,d][v](q),this._.sx=a,this._.sy=b}return this},bP.clone=function(){if(this.removed)return null;var a=this.attr();delete a.scale,delete a.translation;return this.paper[this.type]().attr(a)};var cr={},cs=function(b,c,d,e,f,g,h,i,j){var k=0,l=100,m=[b,c,d,e,f,g,h,i].join(),n=cr[m],o,p;!n&&(cr[m]=n={data:[]}),n.timer&&clearTimeout(n.timer),n.timer=setTimeout(function(){delete cr[m]},2e3);if(j!=null){var q=cs(b,c,d,e,f,g,h,i);l=~~q*10}for(var r=0;r<l+1;r++){n.data[j]>r?p=n.data[r*l]:(p=a.findDotsAtSegment(b,c,d,e,f,g,h,i,r/l),n.data[r]=p),r&&(k+=C(C(o.x-p.x,2)+C(o.y-p.y,2),.5));if(j!=null&&k>=j)return p;o=p}if(j==null)return k},ct=function(b,c){return function(d,e,f){d=bx(d);var g,h,i,j,k="",l={},m,n=0;for(var o=0,p=d.length;o<p;o++){i=d[o];if(i[0]=="M")g=+i[1],h=+i[2];else{j=cs(g,h,i[1],i[2],i[3],i[4],i[5],i[6]);if(n+j>e){if(c&&!l.start){m=cs(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),k+=["C",m.start.x,m.start.y,m.m.x,m.m.y,m.x,m.y];if(f)return k;l.start=k,k=["M",m.x,m.y+"C",m.n.x,m.n.y,m.end.x,m.end.y,i[5],i[6]][v](),n+=j,g=+i[5],h=+i[6];continue}if(!b&&!c){m=cs(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n);return{x:m.x,y:m.y,alpha:m.alpha}}}n+=j,g=+i[5],h=+i[6]}k+=i}l.end=k,m=b?n:c?l:a.findDotsAtSegment(g,h,i[1],i[2],i[3],i[4],i[5],i[6],1),m.alpha&&(m={x:m.x,y:m.y,alpha:m.alpha});return m}},cu=ct(1),cv=ct(),cw=ct(0,1);bP.getTotalLength=function(){if(this.type=="path"){if(this.node.getTotalLength)return this.node.getTotalLength();return cu(this.attrs.path)}},bP.getPointAtLength=function(a){if(this.type=="path")return cv(this.attrs.path,a)},bP.getSubpath=function(a,b){if(this.type=="path"){if(B(this.getTotalLength()-b)<"1e-6")return cw(this.attrs.path,a).end;var c=cw(this.attrs.path,b,1);return a?cw(c,a).end:c}},a.easing_formulas={linear:function(a){return a},"<":function(a){return C(a,3)},">":function(a){return C(a-1,3)+1},"<>":function(a){a=a*2;if(a<1)return C(a,3)/2;a-=2;return(C(a,3)+2)/2},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a=a-1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){if(a==0||a==1)return a;var b=.3,c=b/4;return C(2,-10*a)*y.sin((a-c)*2*D/b)+1},bounce:function(a){var b=7.5625,c=2.75,d;a<1/c?d=b*a*a:a<2/c?(a-=1.5/c,d=b*a*a+.75):a<2.5/c?(a-=2.25/c,d=b*a*a+.9375):(a-=2.625/c,d=b*a*a+.984375);return d}};var cx=[],cy=function(){var b=+(new Date);for(var c=0;c<cx[w];c++){var d=cx[c];if(d.stop||d.el.removed)continue;var e=b-d.start,g=d.ms,h=d.easing,i=d.from,j=d.diff,k=d.to,l=d.t,m=d.el,n={},o;if(e<g){var r=h(e/g);for(var s in i)if(i[f](s)){switch(Y[s]){case"along":o=r*g*j[s],k.back&&(o=k.len-o);var t=cv(k[s],o);m.translate(j.sx-j.x||0,j.sy-j.y||0),j.x=t.x,j.y=t.y,m.translate(t.x-j.sx,t.y-j.sy),k.rot&&m.rotate(j.r+t.alpha,t.x,t.y);break;case E:o=+i[s]+r*g*j[s];break;case"colour":o="rgb("+[cA(Q(i[s].r+r*g*j[s].r)),cA(Q(i[s].g+r*g*j[s].g)),cA(Q(i[s].b+r*g*j[s].b))][v](",")+")";break;case"path":o=[];for(var u=0,x=i[s][w];u<x;u++){o[u]=[i[s][u][0]];for(var y=1,z=i[s][u][w];y<z;y++)o[u][y]=+i[s][u][y]+r*g*j[s][u][y];o[u]=o[u][v](q)}o=o[v](q);break;case"csv":switch(s){case"translation":var A=r*g*j[s][0]-l.x,B=r*g*j[s][1]-l.y;l.x+=A,l.y+=B,o=A+q+B;break;case"rotation":o=+i[s][0]+r*g*j[s][0],i[s][1]&&(o+=","+i[s][1]+","+i[s][2]);break;case"scale":o=[+i[s][0]+r*g*j[s][0],+i[s][1]+r*g*j[s][1],2 in k[s]?k[s][2]:p,3 in k[s]?k[s][3]:p][v](q);break;case"clip-rect":o=[],u=4;while(u--)o[u]=+i[s][u]+r*g*j[s][u]}break;default:var C=[].concat(i[s]);o=[],u=m.paper.customAttributes[s].length;while(u--)o[u]=+C[u]+r*g*j[s][u]}n[s]=o}m.attr(n),m._run&&m._run.call(m)}else k.along&&(t=cv(k.along,k.len*!k.back),m.translate(j.sx-(j.x||0)+t.x-j.sx,j.sy-(j.y||0)+t.y-j.sy),k.rot&&m.rotate(j.r+t.alpha,t.x,t.y)),(l.x||l.y)&&m.translate(-l.x,-l.y),k.scale&&(k.scale+=p),m.attr(k),cx.splice(c--,1)}a.svg&&m&&m.paper&&m.paper.safari(),cx[w]&&setTimeout(cy)},cz=function(b,c,d,e,f){var g=d-e;c.timeouts.push(setTimeout(function(){a.is(f,"function")&&f.call(c),c.animate(b,g,b.easing)},e))},cA=function(a){return z(A(a,255),0)},cB=function(a,b){if(a==null)return{x:this._.tx,y:this._.ty,toString:cq};this._.tx+=+a,this._.ty+=+b;switch(this.type){case"circle":case"ellipse":this.attr({cx:+a+this.attrs.cx,cy:+b+this.attrs.cy});break;case"rect":case"image":case"text":this.attr({x:+a+this.attrs.x,y:+b+this.attrs.y});break;case"path":var c=bq(this.attrs.path);c[0][1]+=+a,c[0][2]+=+b,this.attr({path:c})}return this};bP.animateWith=function(a,b,c,d,e){for(var f=0,g=cx.length;f<g;f++)cx[f].el.id==a.id&&(b.start=cx[f].start);return this.animate(b,c,d,e)},bP.animateAlong=cC(),bP.animateAlongBack=cC(1),bP.onAnimation=function(a){this._run=a||0;return this},bP.animate=function(c,d,e,g){var h=this;h.timeouts=h.timeouts||[];if(a.is(e,"function")||!e)g=e||null;if(h.removed){g&&g.call(h);return h}var i={},j={},k=!1,l={};for(var m in c)if(c[f](m))if(Y[f](m)||h.paper.customAttributes[f](m)){k=!0,i[m]=h.attr(m),i[m]==null&&(i[m]=X[m]),j[m]=c[m];switch(Y[m]){case"along":var n=cu(c[m]),o=cv(c[m],n*!!c.back),p=h.getBBox();l[m]=n/d,l.tx=p.x,l.ty=p.y,l.sx=o.x,l.sy=o.y,j.rot=c.rot,j.back=c.back,j.len=n,c.rot&&(l.r=S(h.rotate())||0);break;case E:l[m]=(j[m]-i[m])/d;break;case"colour":i[m]=a.getRGB(i[m]);var q=a.getRGB(j[m]);l[m]={r:(q.r-i[m].r)/d,g:(q.g-i[m].g)/d,b:(q.b-i[m].b)/d};break;case"path":var t=bx(i[m],j[m]);i[m]=t[0];var u=t[1];l[m]=[];for(var v=0,x=i[m][w];v<x;v++){l[m][v]=[0];for(var y=1,z=i[m][v][w];y<z;y++)l[m][v][y]=(u[v][y]-i[m][v][y])/d}break;case"csv":var A=r(c[m])[s](b),B=r(i[m])[s](b);switch(m){case"translation":i[m]=[0,0],l[m]=[A[0]/d,A[1]/d];break;case"rotation":i[m]=B[1]==A[1]&&B[2]==A[2]?B:[0,A[1],A[2]],l[m]=[(A[0]-i[m][0])/d,0,0];break;case"scale":c[m]=A,i[m]=r(i[m])[s](b),l[m]=[(A[0]-i[m][0])/d,(A[1]-i[m][1])/d,0,0];break;case"clip-rect":i[m]=r(i[m])[s](b),l[m]=[],v=4;while(v--)l[m][v]=(A[v]-i[m][v])/d}j[m]=A;break;default:A=[].concat(c[m]),B=[].concat(i[m]),l[m]=[],v=h.paper.customAttributes[m][w];while(v--)l[m][v]=((A[v]||0)-(B[v]||0))/d}}if(!k){var C=[],D;for(var F in c)c[f](F)&&$.test(F)&&(m={value:c[F]},F=="from"&&(F=0),F=="to"&&(F=100),m.key=T(F,10),C.push(m));C.sort(bf),C[0].key&&C.unshift({key:0,value:h.attrs});for(v=0,x=C[w];v<x;v++)cz(C[v].value,h,d/100*C[v].key,d/100*(C[v-1]&&C[v-1].key||0),C[v-1]&&C[v-1].value.callback);D=C[C[w]-1].value.callback,D&&h.timeouts.push(setTimeout(function(){D.call(h)},d))}else{var G=a.easing_formulas[e];if(!G){G=r(e).match(P);if(G&&G[w]==5){var H=G;G=function(a){return cD(a,+H[1],+H[2],+H[3],+H[4],d)}}else G=function(a){return a}}cx.push({start:c.start||+(new Date),ms:d,easing:G,from:i,diff:l,to:j,el:h,t:{x:0,y:0}}),a.is(g,"function")&&(h._ac=setTimeout(function(){g.call(h)},d)),cx[w]==1&&setTimeout(cy)}return this},bP.stop=function(){for(var a=0;a<cx.length;a++)cx[a].el.id==this.id&&cx.splice(a--,1);for(a=0,ii=this.timeouts&&this.timeouts.length;a<ii;a++)clearTimeout(this.timeouts[a]);this.timeouts=[],clearTimeout(this._ac),delete this._ac;return this},bP.translate=function(a,b){return this.attr({translation:a+" "+b})},bP[H]=function(){return"Raphaël’s object"},a.ae=cx;var cE=function(a){this.items=[],this[w]=0,this.type="set";if(a)for(var b=0,c=a[w];b<c;b++)a[b]&&(a[b].constructor==bO||a[b].constructor==cE)&&(this[this.items[w]]=this.items[this.items[w]]=a[b],this[w]++)};cE[e][L]=function(){var a,b;for(var c=0,d=arguments[w];c<d;c++)a=arguments[c],a&&(a.constructor==bO||a.constructor==cE)&&(b=this.items[w],this[b]=this.items[b]=a,this[w]++);return this},cE[e].pop=function(){delete this[this[w]--];return this.items.pop()};for(var cF in bP)bP[f](cF)&&(cE[e][cF]=function(a){return function(){for(var b=0,c=this.items[w];b<c;b++)this.items[b][a][m](this.items[b],arguments);return this}}(cF));cE[e].attr=function(b,c){if(b&&a.is(b,G)&&a.is(b[0],"object"))for(var d=0,e=b[w];d<e;d++)this.items[d].attr(b[d]);else for(var f=0,g=this.items[w];f<g;f++)this.items[f].attr(b,c);return this},cE[e].animate=function(b,c,d,e){(a.is(d,"function")||!d)&&(e=d||null);var f=this.items[w],g=f,h,i=this,j;e&&(j=function(){!--f&&e.call(i)}),d=a.is(d,F)?d:j,h=this.items[--g].animate(b,c,d,j);while(g--)this.items[g]&&!this.items[g].removed&&this.items[g].animateWith(h,b,c,d,j);return this},cE[e].insertAfter=function(a){var b=this.items[w];while(b--)this.items[b].insertAfter(a);return this},cE[e].getBBox=function(){var a=[],b=[],c=[],d=[];for(var e=this.items[w];e--;){var f=this.items[e].getBBox();a[L](f.x),b[L](f.y),c[L](f.x+f.width),d[L](f.y+f.height)}a=A[m](0,a),b=A[m](0,b);return{x:a,y:b,width:z[m](0,c)-a,height:z[m](0,d)-b}},cE[e].clone=function(a){a=new cE;for(var b=0,c=this.items[w];b<c;b++)a[L](this.items[b].clone());return a},a.registerFont=function(a){if(!a.face)return a;this.fonts=this.fonts||{};var b={w:a.w,face:{},glyphs:{}},c=a.face["font-family"];for(var d in a.face)a.face[f](d)&&(b.face[d]=a.face[d]);this.fonts[c]?this.fonts[c][L](b):this.fonts[c]=[b];if(!a.svg){b.face["units-per-em"]=T(a.face["units-per-em"],10);for(var e in a.glyphs)if(a.glyphs[f](e)){var g=a.glyphs[e];b.glyphs[e]={w:g.w,k:{},d:g.d&&"M"+g.d[Z](/[mlcxtrv]/g,function(a){return({l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"})[a]||"M"})+"z"};if(g.k)for(var h in g.k)g[f](h)&&(b.glyphs[e].k[h]=g.k[h])}}return a},k.getFont=function(b,c,d,e){e=e||"normal",d=d||"normal",c=+c||({normal:400,bold:700,lighter:300,bolder:800})[c]||400;if(!!a.fonts){var g=a.fonts[b];if(!g){var h=new RegExp("(^|\\s)"+b[Z](/[^\w\d\s+!~.:_-]/g,p)+"(\\s|$)","i");for(var i in a.fonts)if(a.fonts[f](i)&&h.test(i)){g=a.fonts[i];break}}var j;if(g)for(var k=0,l=g[w];k<l;k++){j=g[k];if(j.face["font-weight"]==c&&(j.face["font-style"]==d||!j.face["font-style"])&&j.face["font-stretch"]==e)break}return j}},k.print=function(c,d,e,f,g,h,i){h=h||"middle",i=z(A(i||0,1),-1);var j=this.set(),k=r(e)[s](p),l=0,m=p,n;a.is(f,e)&&(f=this.getFont(f));if(f){n=(g||16)/f.face["units-per-em"];var o=f.face.bbox.split(b),q=+o[0],t=+o[1]+(h=="baseline"?o[3]-o[1]+ +f.face.descent:(o[3]-o[1])/2);for(var u=0,v=k[w];u<v;u++){var x=u&&f.glyphs[k[u-1]]||{},y=f.glyphs[k[u]];l+=u?(x.w||f.w)+(x.k&&x.k[k[u]]||0)+f.w*i:0,y&&y.d&&j[L](this.path(y.d).attr({fill:"#000",stroke:"none",translation:[l,0]}))}j.scale(n,n,q,t).translate(c-q,d-t)}return j},a.format=function(b,c){var e=a.is(c,G)?[0][n](c):arguments;b&&a.is(b,F)&&e[w]-1&&(b=b[Z](d,function(a,b){return e[++b]==null?p:e[b]}));return b||p},a.ninja=function(){i.was?h.Raphael=i.is:delete Raphael;return a},a.el=bP,a.st=cE[e],i.was?h.Raphael=a:Raphael=a})()
if(window.Raphael){Raphael.shadow=function(J,I,L,D,Q){Q=Q||{};var G=Q.target||null,A=Q.shadow||Q.color||"#000",P=Q.size*10||-4,O=Q.offsetSize||5,N=Q.zindex||0,F=Q.radius||0,B,H,M=AJS.$('<div class="aui-shadow"></div>'),E=".5",C="3",K="absolute";L=L+P;D=D+P;if(G&&J==I&&J==0){J=AJS.$(G).offset().top;I=AJS.$(G).offset().left}if(AJS.$.browser.msie&&~~(AJS.$.browser.version)<9){A="#f0f0f0";O=3;E=".2"}M.css({position:K,left:I,top:J,zIndex:N,width:L,height:D});if(navigator.appVersion.indexOf("AppleWebKit")>-1&&navigator.appVersion.indexOf("Chrome")<0&&G){O=(Q.offsetSize||3)+"px";G.style.cssText+="-webkit-box-shadow: "+O+" "+O+" 5px "+A+";"}else{if(G){M.insertBefore(G);B=this(M[0],L+O+5,D+O+5,F)}else{B=this(J,I,L,D,F)}H=B.rect(O,O,L,D).attr({fill:A,stroke:A,blur:C,opacity:E});B.canvas.style.position="absolute"}return M}};
(function(a,b){function ci(a){return d.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cf(a){if(!b_[a]){var b=d("<"+a+">").appendTo("body"),c=b.css("display");b.remove();if(c==="none"||c==="")c="block";b_[a]=c}return b_[a]}function ce(a,b){var c={};d.each(cd.concat.apply([],cd.slice(0,b)),function(){c[this]=a});return c}function b$(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function bZ(){try{return new a.XMLHttpRequest}catch(b){}}function bY(){d(a).unload(function(){for(var a in bW)bW[a](0,1)})}function bS(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var e=a.dataTypes,f={},g,h,i=e.length,j,k=e[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(f[h.toLowerCase()]=a.converters[h]);l=k,k=e[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=f[m]||f["* "+k];if(!n){p=b;for(o in f){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=f[j[1]+" "+k];if(p){o=f[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&d.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function bR(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bQ(a,b,c,e){if(d.isArray(b)&&b.length)d.each(b,function(b,f){c||bs.test(a)?e(a,f):bQ(a+"["+(typeof f=="object"||d.isArray(f)?b:"")+"]",f,c,e)});else if(!c&&b!=null&&typeof b=="object")if(d.isArray(b)||d.isEmptyObject(b))e(a,"");else for(var f in b)bQ(a+"["+f+"]",b[f],c,e);else e(a,b)}function bP(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bJ,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bP(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bP(a,c,d,e,"*",g));return l}function bO(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(d.isFunction(c)){var e=b.toLowerCase().split(bD),f=0,g=e.length,h,i,j;for(;f<g;f++)h=e[f],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bq(a,b,c){var e=b==="width"?bk:bl,f=b==="width"?a.offsetWidth:a.offsetHeight;if(c==="border")return f;d.each(e,function(){c||(f-=parseFloat(d.css(a,"padding"+this))||0),c==="margin"?f+=parseFloat(d.css(a,"margin"+this))||0:f-=parseFloat(d.css(a,"border"+this+"Width"))||0});return f}function bc(a,b){b.src?d.ajax({url:b.src,async:!1,dataType:"script"}):d.globalEval(b.text||b.textContent||b.innerHTML||""),b.parentNode&&b.parentNode.removeChild(b)}function bb(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function ba(a,b){if(b.nodeType===1){var c=b.nodeName.toLowerCase();b.clearAttributes(),b.mergeAttributes(a);if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(d.expando)}}function _(a,b){if(b.nodeType===1&&!!d.hasData(a)){var c=d.expando,e=d.data(a),f=d.data(b,e);if(e=e[c]){var g=e.events;f=f[c]=d.extend({},e);if(g){delete f.handle,f.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)d.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function $(a,b){return d.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Q(a,b,c){if(d.isFunction(b))return d.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return d.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var e=d.grep(a,function(a){return a.nodeType===1});if(L.test(b))return d.filter(b,e,!c);b=d.filter(b,e)}return d.grep(a,function(a,e){return d.inArray(a,b)>=0===c})}function P(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function H(a,b){return(a&&a!=="*"?a+".":"")+b.replace(t,"`").replace(u,"&")}function G(a){var b,c,e,f,g,h,i,j,k,l,m,n,o,p=[],q=[],s=d._data(this,"events");if(!(a.liveFired===this||!s||!s.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var t=s.live.slice(0);for(i=0;i<t.length;i++)g=t[i],g.origType.replace(r,"")===a.type?q.push(g.selector):t.splice(i--,1);f=d(a.target).closest(q,a.currentTarget);for(j=0,k=f.length;j<k;j++){m=f[j];for(i=0;i<t.length;i++){g=t[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,e=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,e=d(a.relatedTarget).closest(g.selector)[0];(!e||e!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){f=p[j];if(c&&f.level>c)break;a.currentTarget=f.elem,a.data=f.handleObj.data,a.handleObj=f.handleObj,o=f.handleObj.origHandler.apply(f.elem,arguments);if(o===!1||a.isPropagationStopped()){c=f.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function E(a,c,e){var f=d.extend({},e[0]);f.type=a,f.originalEvent={},f.liveFired=b,d.event.handle.call(c,f),f.isDefaultPrevented()&&e[0].preventDefault()}function y(){return!0}function x(){return!1}function i(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function h(a,c,e){if(e===b&&a.nodeType===1){e=a.getAttribute("data-"+c);if(typeof e=="string"){try{e=e==="true"?!0:e==="false"?!1:e==="null"?null:d.isNaN(e)?g.test(e)?d.parseJSON(e):e:parseFloat(e)}catch(f){}d.data(a,c,e)}else e=b}return e}var c=a.document,d=function(){function G(){if(!d.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(G,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,g,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,l=/\d/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=navigator.userAgent,w,x,y,z=Object.prototype.toString,A=Object.prototype.hasOwnProperty,B=Array.prototype.push,C=Array.prototype.slice,D=String.prototype.trim,E=Array.prototype.indexOf,F={};d.fn=d.prototype={constructor:d,init:function(a,e,f){var g,i,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!e&&c.body){this.context=c,this[0]=c.body,this.selector="body",this.length=1;return this}if(typeof a=="string"){g=h.exec(a);if(g&&(g[1]||!e)){if(g[1]){e=e instanceof d?e[0]:e,k=e?e.ownerDocument||e:c,j=m.exec(a),j?d.isPlainObject(e)?(a=[c.createElement(j[1])],d.fn.attr.call(a,e,!0)):a=[k.createElement(j[1])]:(j=d.buildFragment([g[1]],[k]),a=(j.cacheable?d.clone(j.fragment):j.fragment).childNodes);return d.merge(this,a)}i=c.getElementById(g[2]);if(i&&i.parentNode){if(i.id!==g[2])return f.find(a);this.length=1,this[0]=i}this.context=c,this.selector=a;return this}return!e||e.jquery?(e||f).find(a):this.constructor(e).find(a)}if(d.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.5.2",length:0,size:function(){return this.length},toArray:function(){return C.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();d.isArray(a)?B.apply(e,a):d.merge(e,a),e.prevObject=this,e.context=this.context,b==="find"?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")");return e},each:function(a,b){return d.each(this,a,b)},ready:function(a){d.bindReady(),x.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(C.apply(this,arguments),"slice",C.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:B,sort:[].sort,splice:[].splice},d.fn.init.prototype=d.fn,d.extend=d.fn.extend=function(){var a,c,e,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!d.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){e=i[c],f=a[c];if(i===f)continue;l&&f&&(d.isPlainObject(f)||(g=d.isArray(f)))?(g?(g=!1,h=e&&d.isArray(e)?e:[]):h=e&&d.isPlainObject(e)?e:{},i[c]=d.extend(l,h,f)):f!==b&&(i[c]=f)}return i},d.extend({noConflict:function(b){a.$=f,b&&(a.jQuery=e);return d},isReady:!1,readyWait:1,ready:function(a){a===!0&&d.readyWait--;if(!d.readyWait||a!==!0&&!d.isReady){if(!c.body)return setTimeout(d.ready,1);d.isReady=!0;if(a!==!0&&--d.readyWait>0)return;x.resolveWith(c,[d]),d.fn.trigger&&d(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!x){x=d._Deferred();if(c.readyState==="complete")return setTimeout(d.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",y,!1),a.addEventListener("load",d.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",y),a.attachEvent("onload",d.ready);var b=!1;try{b=a.frameElement==null}catch(e){}c.documentElement.doScroll&&b&&G()}}},isFunction:function(a){return d.type(a)==="function"},isArray:Array.isArray||function(a){return d.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!l.test(a)||isNaN(a)},type:function(a){return a==null?String(a):F[z.call(a)]||"object"},isPlainObject:function(a){if(!a||d.type(a)!=="object"||a.nodeType||d.isWindow(a))return!1;if(a.constructor&&!A.call(a,"constructor")&&!A.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||A.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=d.trim(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(b):(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(b,c,e){a.DOMParser?(e=new DOMParser,c=e.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),e=c.documentElement,(!e||!e.nodeName||e.nodeName==="parsererror")&&d.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(a){if(a&&i.test(a)){var b=c.head||c.getElementsByTagName("head")[0]||c.documentElement,e=c.createElement("script");d.support.scriptEval()?e.appendChild(c.createTextNode(a)):e.text=a,b.insertBefore(e,b.firstChild),b.removeChild(e)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,h=a.length,i=h===b||d.isFunction(a);if(e){if(i){for(f in a)if(c.apply(a[f],e)===!1)break}else for(;g<h;)if(c.apply(a[g++],e)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(var j=a[0];g<h&&c.call(j,g,j)!==!1;j=a[++g]);return a},trim:D?function(a){return a==null?"":D.call(a)}:function(a){return a==null?"":a.toString().replace(j,"").replace(k,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var e=d.type(a);a.length==null||e==="string"||e==="function"||e==="regexp"||d.isWindow(a)?B.call(c,a):d.merge(c,a)}return c},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,b,c){var d=[],e;for(var f=0,g=a.length;f<g;f++)e=b(a[f],f,c),e!=null&&(d[d.length]=e);return d.concat.apply([],d)},guid:1,proxy:function(a,c,e){arguments.length===2&&(typeof c=="string"?(e=a,a=e[c],c=b):c&&!d.isFunction(c)&&(e=c,c=b)),!c&&a&&(c=function(){return a.apply(e||this,arguments)}),a&&(c.guid=a.guid=a.guid||c.guid||d.guid++);return c},access:function(a,c,e,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)d.access(a,j,c[j],f,g,e);return a}if(e!==b){f=!h&&f&&d.isFunction(e);for(var k=0;k<i;k++)g(a[k],c,f?e.call(a[k],k,g(a[k],c)):e,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}d.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.subclass=this.subclass,a.fn.init=function(b,c){c&&c instanceof d&&!(c instanceof a)&&(c=a(c));return d.fn.init.call(this,b,c,e)},a.fn.init.prototype=a.fn;var e=a(c);return a},browser:{}}),d.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){F["[object "+b+"]"]=b.toLowerCase()}),w=d.uaMatch(v),w.browser&&(d.browser[w.browser]=!0,d.browser.version=w.version),d.browser.webkit&&(d.browser.safari=!0),E&&(d.inArray=function(a,b){return E.call(b,a)}),i.test("\u00a0")&&(j=/^[\s\xA0]+/,k=/[\s\xA0]+$/),g=d(c),c.addEventListener?y=function(){c.removeEventListener("DOMContentLoaded",y,!1),d.ready()}:c.attachEvent&&(y=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",y),d.ready())});return d}(),e="then done fail isResolved isRejected promise".split(" "),f=[].slice;d.extend({_Deferred:function(){var a=[],b,c,e,f={done:function(){if(!e){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=d.type(i),j==="array"?f.done.apply(f,i):j==="function"&&a.push(i);k&&f.resolveWith(k[0],k[1])}return this},resolveWith:function(d,f){if(!e&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(d,f)}finally{b=[d,f],c=0}}return this},resolve:function(){f.resolveWith(this,arguments);return this},isResolved:function(){return!!c||!!b},cancel:function(){e=1,a=[];return this}};return f},Deferred:function(a){var b=d._Deferred(),c=d._Deferred(),f;d.extend(b,{then:function(a,c){b.done(a).fail(c);return this},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,promise:function(a){if(a==null){if(f)return f;f=a={}}var c=e.length;while(c--)a[e[c]]=b[e[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?f.call(arguments,0):c,--g||h.resolveWith(h,f.call(b,0))}}var b=arguments,c=0,e=b.length,g=e,h=e<=1&&a&&d.isFunction(a.promise)?a:d.Deferred();if(e>1){for(;c<e;c++)b[c]&&d.isFunction(b[c].promise)?b[c].promise().then(i(c),h.reject):--g;g||h.resolveWith(h,b)}else h!==a&&h.resolveWith(h,e?[a]:[]);return h.promise()}}),function(){d.support={};var b=c.createElement("div");b.style.display="none",b.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=b.getElementsByTagName("*"),f=b.getElementsByTagName("a")[0],g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=b.getElementsByTagName("input")[0];if(!(!e||!e.length||!f)){d.support={leadingWhitespace:b.firstChild.nodeType===3,tbody:!b.getElementsByTagName("tbody").length,htmlSerialize:!!b.getElementsByTagName("link").length,style:/red/.test(f.getAttribute("style")),hrefNormalized:f.getAttribute("href")==="/a",opacity:/^0.55$/.test(f.style.opacity),cssFloat:!!f.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,deleteExpando:!0,optDisabled:!1,checkClone:!1,noCloneEvent:!0,noCloneChecked:!0,boxModel:null,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableHiddenOffsets:!0,reliableMarginRight:!0},i.checked=!0,d.support.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,d.support.optDisabled=!h.disabled;var j=null;d.support.scriptEval=function(){if(j===null){var b=c.documentElement,e=c.createElement("script"),f="script"+d.now();try{e.appendChild(c.createTextNode("window."+f+"=1;"))}catch(g){}b.insertBefore(e,b.firstChild),a[f]?(j=!0,delete a[f]):j=!1,b.removeChild(e)}return j};try{delete b.test}catch(k){d.support.deleteExpando=!1}!b.addEventListener&&b.attachEvent&&b.fireEvent&&(b.attachEvent("onclick",function l(){d.support.noCloneEvent=!1,b.detachEvent("onclick",l)}),b.cloneNode(!0).fireEvent("onclick")),b=c.createElement("div"),b.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var m=c.createDocumentFragment();m.appendChild(b.firstChild),d.support.checkClone=m.cloneNode(!0).cloneNode(!0).lastChild.checked,d(function(){var a=c.createElement("div"),b=c.getElementsByTagName("body")[0];if(!!b){a.style.width=a.style.paddingLeft="1px",b.appendChild(a),d.boxModel=d.support.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,d.support.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",d.support.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";var e=a.getElementsByTagName("td");d.support.reliableHiddenOffsets=e[0].offsetHeight===0,e[0].style.display="",e[1].style.display="none",d.support.reliableHiddenOffsets=d.support.reliableHiddenOffsets&&e[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(a.style.width="1px",a.style.marginRight="0",d.support.reliableMarginRight=(parseInt(c.defaultView.getComputedStyle(a,null).marginRight,10)||0)===0),b.removeChild(a).style.display="none",a=e=null}});var n=function(a){var b=c.createElement("div");a="on"+a;if(!b.attachEvent)return!0;var d=a in b;d||(b.setAttribute(a,"return;"),d=typeof b[a]=="function");return d};d.support.submitBubbles=n("submit"),d.support.changeBubbles=n("change"),b=e=f=null}}();var g=/^(?:\{.*\}|\[.*\])$/;d.extend({cache:{},uuid:0,expando:"jQuery"+(d.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?d.cache[a[d.expando]]:a[d.expando];return!!a&&!i(a)},data:function(a,c,e,f){if(!!d.acceptData(a)){var g=d.expando,h=typeof c=="string",i,j=a.nodeType,k=j?d.cache:a,l=j?a[d.expando]:a[d.expando]&&d.expando;if((!l||f&&l&&!k[l][g])&&h&&e===b)return;l||(j?a[d.expando]=l=++d.uuid:l=d.expando),k[l]||(k[l]={},j||(k[l].toJSON=d.noop));if(typeof c=="object"||typeof c=="function")f?k[l][g]=d.extend(k[l][g],c):k[l]=d.extend(k[l],c);i=k[l],f&&(i[g]||(i[g]={}),i=i[g]),e!==b&&(i[c]=e);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[c]:i}},removeData:function(a,b,c){if(!!d.acceptData(a)){var e=d.expando,f=a.nodeType,g=f?d.cache:a,h=f?a[d.expando]:d.expando;if(!g[h])return;if(b){var j=c?g[h][e]:g[h];if(j){delete j[b];if(!i(j))return}}if(c){delete g[h][e];if(!i(g[h]))return}var k=g[h][e];d.support.deleteExpando||!d.isWindow(g)?delete g[h]:g[h]=null,k?(g[h]={},f||(g[h].toJSON=d.noop),g[h][e]=k):f&&(d.support.deleteExpando?delete a[d.expando]:a.removeAttribute?a.removeAttribute(d.expando):a[d.expando]=null)}},_data:function(a,b,c){return d.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=d.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),d.fn.extend({data:function(a,c){var e=null;if(typeof a=="undefined"){if(this.length){e=d.data(this[0]);if(this[0].nodeType===1){var f=this[0].attributes,g;for(var i=0,j=f.length;i<j;i++)g=f[i].name,g.indexOf("data-")===0&&(g=g.substr(5),h(this[0],g,e[g]))}}return e}if(typeof a=="object")return this.each(function(){d.data(this,a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(c===b){e=this.triggerHandler("getData"+k[1]+"!",[k[0]]),e===b&&this.length&&(e=d.data(this[0],a),e=h(this[0],a,e));return e===b&&k[1]?this.data(k[0]):e}return this.each(function(){var b=d(this),e=[k[0],c];b.triggerHandler("setData"+k[1]+"!",e),d.data(this,a,c),b.triggerHandler("changeData"+k[1]+"!",e)})},removeData:function(a){return this.each(function(){d.removeData(this,a)})}}),d.extend({queue:function(a,b,c){if(!!a){b=(b||"fx")+"queue";var e=d._data(a,b);if(!c)return e||[];!e||d.isArray(c)?e=d._data(a,b,d.makeArray(c)):e.push(c);return e}},dequeue:function(a,b){b=b||"fx";var c=d.queue(a,b),e=c.shift();e==="inprogress"&&(e=c.shift()),e&&(b==="fx"&&c.unshift("inprogress"),e.call(a,function(){d.dequeue(a,b)})),c.length||d.removeData(a,b+"queue",!0)}}),d.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return d.queue(this[0],a);return this.each(function(b){var e=d.queue(this,a,c);a==="fx"&&e[0]!=="inprogress"&&d.dequeue(this,a)})},dequeue:function(a){return this.each(function(){d.dequeue(this,a)})},delay:function(a,b){a=d.fx?d.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){d.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var j=/[\n\t\r]/g,k=/\s+/,l=/\r/g,m=/^(?:href|src|style)$/,n=/^(?:button|input)$/i,o=/^(?:button|input|object|select|textarea)$/i,p=/^a(?:rea)?$/i,q=/^(?:radio|checkbox)$/i;d.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"},d.fn.extend({attr:function(a,b){return d.access(this,a,b,!0,d.attr)},removeAttr:function(a,b){return this.each(function(){d.attr(this,a,""),this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.addClass(a.call(this,b,c.attr("class")))});if(a&&typeof a=="string"){var b=(a||"").split(k);for(var c=0,e=this.length;c<e;c++){var f=this[c];if(f.nodeType===1)if(!f.className)f.className=a;else{var g=" "+f.className+" ",h=f.className;for(var i=0,j=b.length;i<j;i++)g.indexOf(" "+b[i]+" ")<0&&(h+=" "+b[i]);f.className=d.trim(h)}}}return this},removeClass:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.removeClass(a.call(this,b,c.attr("class")))});if(a&&typeof a=="string"||a===b){var c=(a||"").split(k);for(var e=0,f=this.length;e<f;e++){var g=this[e];if(g.nodeType===1&&g.className)if(a){var h=(" "+g.className+" ").replace(j," ");for(var i=0,l=c.length;i<l;i++)h=h.replace(" "+c[i]+" "," ");g.className=d.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,e=typeof b=="boolean";if(d.isFunction(a))return this.each(function(c){var e=d(this);e.toggleClass(a.call(this,c,e.attr("class"),b),b)});return this.each(function(){if(c==="string"){var f,g=0,h=d(this),i=b,j=a.split(k);while(f=j[g++])i=e?i:!h.hasClass(f),h[i?"addClass":"removeClass"](f)}else if(c==="undefined"||c==="boolean")this.className&&d._data(this,"__className__",this.className),this.className=this.className||a===!1?"":d._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(j," ").indexOf(b)>-1)return!0;return!1},val:function(a){if(!arguments.length){var c=this[0];if(c){if(d.nodeName(c,"option")){var e=c.attributes.value;return!e||e.specified?c.value:c.text}if(d.nodeName(c,"select")){var f=c.selectedIndex,g=[],h=c.options,i=c.type==="select-one";if(f<0)return null;for(var j=i?f:0,k=i?f+1:h.length;j<k;j++){var m=h[j];if(m.selected&&(d.support.optDisabled?!m.disabled:m.getAttribute("disabled")===null)&&(!m.parentNode.disabled||!d.nodeName(m.parentNode,"optgroup"))){a=d(m).val();if(i)return a;g.push(a)}}if(i&&!g.length&&h.length)return d(h[f]).val();return g}if(q.test(c.type)&&!d.support.checkOn)return c.getAttribute("value")===null?"on":c.value;return(c.value||"").replace(l,"")}return b}var n=d.isFunction(a);return this.each(function(b){var c=d(this),e=a;if(this.nodeType===1){n&&(e=a.call(this,b,c.val())),e==null?e="":typeof e=="number"?e+="":d.isArray(e)&&(e=d.map(e,function(a){return a==null?"":a+""}));if(d.isArray(e)&&q.test(this.type))this.checked=d.inArray(c.val(),e)>=0;else if(d.nodeName(this,"select")){var f=d.makeArray(e);d("option",this).each(function(){this.selected=d.inArray(d(this).val(),f)>=0}),f.length||(this.selectedIndex=-1)}else this.value=e}})}}),d.extend({attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,e,f){if(!a||a.nodeType===3||a.nodeType===8||a.nodeType===2)return b;if(f&&c in d.attrFn)return d(a)[c](e);var g=a.nodeType!==1||!d.isXMLDoc(a),h=e!==b;c=g&&d.props[c]||c;if(a.nodeType===1){var i=m.test(c);if(c==="selected"&&!d.support.optSelected){var j=a.parentNode;j&&(j.selectedIndex,j.parentNode&&j.parentNode.selectedIndex)}if((c in a||a[c]!==b)&&g&&!i){h&&(c==="type"&&n.test(a.nodeName)&&a.parentNode&&d.error("type property can't be changed"),e===null?a.nodeType===1&&a.removeAttribute(c):a[c]=e);if(d.nodeName(a,"form")&&a.getAttributeNode(c))return a.getAttributeNode(c).nodeValue;if(c==="tabIndex"){var k=a.getAttributeNode("tabIndex");return k&&k.specified?k.value:o.test(a.nodeName)||p.test(a.nodeName)&&a.href?0:b}return a[c]}if(!d.support.style&&g&&c==="style"){h&&(a.style.cssText=""+e);return a.style.cssText}h&&a.setAttribute(c,""+e);if(!a.attributes[c]&&a.hasAttribute&&!a.hasAttribute(c))return b;var l=!d.support.hrefNormalized&&g&&i?a.getAttribute(c,2):a.getAttribute(c);return l===null?b:l}h&&(a[c]=e);return a[c]}});var r=/\.(.*)$/,s=/^(?:textarea|input|select)$/i,t=/\./g,u=/ /g,v=/[^\w\s.|`]/g,w=function(a){return a.replace(v,"\\$&")};d.event={add:function(c,e,f,g){if(c.nodeType!==3&&c.nodeType!==8){try{d.isWindow(c)&&c!==a&&!c.frameElement&&(c=a)}catch(h){}if(f===!1)f=x;else if(!f)return;var i,j;f.handler&&(i=f,f=i.handler),f.guid||(f.guid=d.guid++);var k=d._data(c);if(!k)return;var l=k.events,m=k.handle;l||(k.events=l={}),m||(k.handle=m=function(a){return typeof d!="undefined"&&d.event.triggered!==a.type?d.event.handle.apply(m.elem,arguments):b}),m.elem=c,e=e.split(" ");var n,o=0,p;while(n=e[o++]){j=i?d.extend({},i):{handler:f,data:g},n.indexOf(".")>-1?(p=n.split("."),n=p.shift(),j.namespace=p.slice(0).sort().join(".")):(p=[],j.namespace=""),j.type=n,j.guid||(j.guid=f.guid);var q=l[n],r=d.event.special[n]||{};if(!q){q=l[n]=[];if(!r.setup||r.setup.call(c,g,p,m)===!1)c.addEventListener?c.addEventListener(n,m,!1):c.attachEvent&&c.attachEvent("on"+n,m)}r.add&&(r.add.call(c,j),j.handler.guid||(j.handler.guid=f.guid)),q.push(j),d.event.global[n]=!0}c=null}},global:{},remove:function(a,c,e,f){if(a.nodeType!==3&&a.nodeType!==8){e===!1&&(e=x);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=d.hasData(a)&&d._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(e=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)d.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+d.map(m.slice(0).sort(),w).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!e){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))d.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=d.event.special[h]||{};for(j=f||0;j<p.length;j++){q=p[j];if(e.guid===q.guid){if(l||n.test(q.namespace))f==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(f!=null)break}}if(p.length===0||f!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&d.removeEvent(a,h,s.handle),g=null,delete t[h]}if(d.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,d.isEmptyObject(s)&&d.removeData(a,b,!0)}}},trigger:function(a,c,e){var f=a.type||a,g=arguments[3];if(!g){a=typeof a=="object"?a[d.expando]?a:d.extend(d.Event(f),a):d.Event(f),f.indexOf("!")>=0&&(a.type=f=f.slice(0,-1),a.exclusive=!0),e||(a.stopPropagation(),d.event.global[f]&&d.each(d.cache,function(){var b=d.expando,e=this[b];e&&e.events&&e.events[f]&&d.event.trigger(a,c,e.handle.elem)}));if(!e||e.nodeType===3||e.nodeType===8)return b;a.result=b,a.target=e,c=d.makeArray(c),c.unshift(a)}a.currentTarget=e;var h=d._data(e,"handle");h&&h.apply(e,c);var i=e.parentNode||e.ownerDocument;try{e&&e.nodeName&&d.noData[e.nodeName.toLowerCase()]||e["on"+f]&&e["on"+f].apply(e,c)===!1&&(a.result=!1,a.preventDefault())}catch(j){}if(!a.isPropagationStopped()&&i)d.event.trigger(a,c,i,!0);else if(!a.isDefaultPrevented()){var k,l=a.target,m=f.replace(r,""),n=d.nodeName(l,"a")&&m==="click",o=d.event.special[m]||{};if((!o._default||o._default.call(e,a)===!1)&&!n&&!(l&&l.nodeName&&d.noData[l.nodeName.toLowerCase()])){try{l[m]&&(k=l["on"+m],k&&(l["on"+m]=null),d.event.triggered=a.type,l[m]())}catch(p){}k&&(l["on"+m]=k),d.event.triggered=b}}},handle:function(c){var e,f,g,h,i,j=[],k=d.makeArray(arguments);c=k[0]=d.event.fix(c||a.event),c.currentTarget=this,e=c.type.indexOf(".")<0&&!c.exclusive,e||(g=c.type.split("."),c.type=g.shift(),j=g.slice(0).sort(),h=new RegExp("(^|\\.)"+j.join("\\.(?:.*\\.)?")+"(\\.|$)")),c.namespace=c.namespace||j.join("."),i=d._data(this,"events"),f=(i||{})[c.type];if(i&&f){f=f.slice(0);for(var l=0,m=f.length;l<m;l++){var n=f[l];if(e||h.test(n.namespace)){c.handler=n.handler,c.data=n.data,c.handleObj=n;var o=n.handler.apply(this,k);o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[d.expando])return a;var e=a;a=d.Event(e);for(var f=this.props.length,g;f;)g=this.props[--f],a[g]=e[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=c.documentElement,i=c.body;a.pageX=a.clientX+(h&&h.scrollLeft||i&&i.scrollLeft||0)-(h&&h.clientLeft||i&&i.clientLeft||0),a.pageY=a.clientY+(h&&h.scrollTop||i&&i.scrollTop||0)-(h&&h.clientTop||i&&i.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:d.proxy,special:{ready:{setup:d.bindReady,teardown:d.noop},live:{add:function(a){d.event.add(this,H(a.origType,a.selector),d.extend({},a,{handler:G,guid:a.handler.guid}))},remove:function(a){d.event.remove(this,H(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){d.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},d.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},d.Event=function(a){if(!this.preventDefault)return new d.Event(a);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?y:x):this.type=a,this.timeStamp=d.now(),this[d.expando]=!0},d.Event.prototype={preventDefault:function(){this.isDefaultPrevented=y;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=y;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=y,this.stopPropagation()},isDefaultPrevented:x,isPropagationStopped:x,isImmediatePropagationStopped:x};var z=function(a){var b=a.relatedTarget;try{if(b&&b!==c&&!b.parentNode)return;while(b&&b!==this)b=b.parentNode;b!==this&&(a.type=a.data,d.event.handle.apply(this,arguments))}catch(e){}},A=function(a){a.type=a.data,d.event.handle.apply(this,arguments)};d.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){d.event.special[a]={setup:function(c){d.event.add(this,b,c&&c.selector?A:z,a)},teardown:function(a){d.event.remove(this,b,a&&a.selector?A:z)}}}),d.support.submitBubbles||(d.event.special.submit={setup:function(a,b){if(this.nodeName&&this.nodeName.toLowerCase()!=="form")d.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&d(b).closest("form").length&&E("submit",this,arguments)}),d.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&d(b).closest("form").length&&a.keyCode===13&&E("submit",this,arguments)});else return!1},teardown:function(a){d.event.remove(this,".specialSubmit")}});if(!d.support.changeBubbles){var B,C=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?d.map(a.options,function(a){return a.selected}).join("-"):"":a.nodeName.toLowerCase()==="select"&&(c=a.selectedIndex);return c},D=function D(a){var c=a.target,e,f;if(!!s.test(c.nodeName)&&!c.readOnly){e=d._data(c,"_change_data"),f=C(c),(a.type!=="focusout"||c.type!=="radio")&&d._data(c,"_change_data",f);if(e===b||f===e)return;if(e!=null||f)a.type="change",a.liveFired=b,d.event.trigger(a,arguments[1],c)}};d.event.special.change={filters:{focusout:D,beforedeactivate:D,click:function(a){var b=a.target,c=b.type;(c==="radio"||c==="checkbox"||b.nodeName.toLowerCase()==="select")&&D.call(this,a)},keydown:function(a){var b=a.target,c=b.type;(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&D.call(this,a)},beforeactivate:function(a){var b=a.target;d._data(b,"_change_data",C(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in B)d.event.add(this,c+".specialChange",B[c]);return s.test(this.nodeName)},teardown:function(a){d.event.remove(this,".specialChange");return s.test(this.nodeName)}},B=d.event.special.change.filters,B.focus=B.beforeactivate}c.addEventListener&&d.each({focus:"focusin",blur:"focusout"},function(a,b){function f(a){var c=d.event.fix(a);c.type=b,c.originalEvent={},d.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var e=0;d.event.special[b]={setup:function(){e++===0&&c.addEventListener(a,f,!0)},teardown:function(){--e===0&&c.removeEventListener(a,f,!0)}}}),d.each(["bind","one"],function(a,c){d.fn[c]=function(a,e,f){if(typeof a=="object"){for(var g in a)this[c](g,e,a[g],f);return this}if(d.isFunction(e)||e===!1)f=e,e=b;var h=c==="one"?d.proxy(f,function(a){d(this).unbind(a,h);return f.apply(this,arguments)}):f;if(a==="unload"&&c!=="one")this.one(a,e,f);else for(var i=0,j=this.length;i<j;i++)d.event.add(this[i],a,h,e);return this}}),d.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else for(var e=0,f=this.length;e<f;e++)d.event.remove(this[e],a,b);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){d.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var c=d.Event(a);c.preventDefault(),c.stopPropagation(),d.event.trigger(c,b,this[0]);return c.result}},toggle:function(a){var b=arguments,c=1;while(c<b.length)d.proxy(a,b[c++]);return this.click(d.proxy(a,function(e){var f=(d._data(this,"lastToggle"+a.guid)||0)%c;d._data(this,"lastToggle"+a.guid,f+1),e.preventDefault();return b[f].apply(this,arguments)||!1}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var F={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};d.each(["live","die"],function(a,c){d.fn[c]=function(a,e,f,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:d(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a)n[c](o,e,a[o],m);return this}d.isFunction(e)&&(f=e,e=b),a=(a||"").split(" ");while((h=a[i++])!=null){j=r.exec(h),k="",j&&(k=j[0],h=h.replace(r,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,h==="focus"||h==="blur"?(a.push(F[h]+k),h=h+k):h=(F[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)d.event.add(n[p],"live."+H(h,m),{data:e,selector:m,handler:f,origType:h,origHandler:f,preType:l});else n.unbind("live."+H(h,m),f)}return this}}),d.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){d.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},d.attrFn&&(d.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,e,g){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(f.call(n)==="[object Array]")if(!u)e.push.apply(e,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&e.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&e.push(j[t]);else p(n,e);o&&(k(o,h,e,g),k.uniqueSort(e));return e};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f)g=o=!0;else if(f===!0)continue}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),d=b,g=t),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),d=b,g=t),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return"text"===c&&(b===c||b===null)},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(f.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(a===b){g=!0;return 0}if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};d.find=k,d.expr=k.selectors,d.expr[":"]=d.expr.filters,d.unique=k.uniqueSort,d.text=k.getText,d.isXMLDoc=k.isXML,d.contains=k.contains}();var I=/Until$/,J=/^(?:parents|prevUntil|prevAll)/,K=/,/,L=/^.[^:#\[\.,]*$/,M=Array.prototype.slice,N=d.expr.match.POS,O={children:!0,contents:!0,next:!0,prev:!0};d.fn.extend({find:function(a){var b=this.pushStack("","find",a),c=0;for(var e=0,f=this.length;e<f;e++){c=b.length,d.find(a,this[e],b);if(e>0)for(var g=c;g<b.length;g++)for(var h=0;h<c;h++)if(b[h]===b[g]){b.splice(g--,1);break}}return b},has:function(a){var b=d(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(d.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(Q(this,a,!1),"not",a)},filter:function(a){return this.pushStack(Q(this,a,!0),"filter",a)},is:function(a){return!!a&&d.filter(a,this).length>0},closest:function(a,b){var c=[],e,f,g=this[0];if(d.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(e=0,f=a.length;e<f;e++)i=a[e],j[i]||(j[i]=d.expr.match.POS.test(i)?d(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:d(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=N.test(a)?d(a,b||this.context):null;for(e=0,f=this.length;e<f;e++){g=this[e];while(g){if(l?l.index(g)>-1:d.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b)break}}c=c.length>1?d.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return d.inArray(this[0],a?d(a):this.parent().children());return d.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?d(a,b):d.makeArray(a),e=d.merge(this.get(),c);return this.pushStack(P(c[0])||P(e[0])?e:d.unique(e))},andSelf:function(){return this.add(this.prevObject)}}),d.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return d.dir(a,"parentNode")},parentsUntil:function(a,b,c){return d.dir(a,"parentNode",c)},next:function(a){return d.nth(a,2,"nextSibling")},prev:function(a){return d.nth(a,2,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},nextUntil:function(a,b,c){return d.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return d.dir(a,"previousSibling",c)},siblings:function(a){return d.sibling(a.parentNode.firstChild,a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.makeArray(a.childNodes)}},function(a,b){d.fn[a]=function(c,e){var f=d.map(this,b,c),g=M.call(arguments);I.test(a)||(e=c),e&&typeof e=="string"&&(f=d.filter(e,f)),f=this.length>1&&!O[a]?d.unique(f):f,(this.length>1||K.test(e))&&J.test(a)&&(f=f.reverse());return this.pushStack(f,a,g.join(","))}}),d.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?d.find.matchesSelector(b[0],a)?[b[0]]:[]:d.find.matches(a,b)},dir:function(a,c,e){var f=[],g=a[c];while(g&&g.nodeType!==9&&(e===b||g.nodeType!==1||!d(g).is(e)))g.nodeType===1&&f.push(g),g=g[c];return f},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var R=/ jQuery\d+="(?:\d+|null)"/g,S=/^\s+/,T=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,U=/<([\w:]+)/,V=/<tbody/i,W=/<|&#?\w+;/,X=/<(?:script|object|embed|option|style)/i,Y=/checked\s*(?:[^=]|=\s*.checked.)/i,Z={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};Z.optgroup=Z.option,Z.tbody=Z.tfoot=Z.colgroup=Z.caption=Z.thead,Z.th=Z.td,d.support.htmlSerialize||(Z._default=[1,"div<div>","</div>"]),d.fn.extend({text:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return d.text(this)},wrapAll:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapAll(a.call(this,b))});if(this[0]){var b=d(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapInner(a.call(this,b))});return this.each(function(){var b=d(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){d(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){d.nodeName(this,"body")||d(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=d(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,d(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,e;(e=this[c])!=null;c++)if(!a||d.filter(a,[e]).length)!b&&e.nodeType===1&&(d.cleanData(e.getElementsByTagName("*")),d.cleanData([e])),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&d.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return d.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(R,""):null;if(typeof a=="string"&&!X.test(a)&&(d.support.leadingWhitespace||!S.test(a))&&!Z[(U.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(T,"<$1></$2>");try{for(var c=0,e=this.length;c<e;c++)this[c].nodeType===1&&(d.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(f){this.empty().append(a)}}else d.isFunction(a)?this.each(function(b){var c=d(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(d.isFunction(a))return this.each(function(b){var c=d(this),e=c.html();c.replaceWith(a.call(this,b,e))});typeof a!="string"&&(a=d(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;d(this).remove(),b?d(b).before(a):d(c).append(a)})}return this.length?this.pushStack(d(d.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,e){var f,g,h,i,j=a[0],k=[];if(!d.support.checkClone&&arguments.length===3&&typeof j=="string"&&Y.test(j))return this.each(function(){d(this).domManip(a,c,e,!0)});if(d.isFunction(j))return this.each(function(f){var g=d(this);a[0]=j.call(this,f,c?g.html():b),g.domManip(a,c,e)});if(this[0]){i=j&&j.parentNode,d.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?f={fragment:i}:f=d.buildFragment(a,this,k),h=f.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&d.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)e.call(c?$(this[l],g):this[l],f.cacheable||m>1&&l<n?d.clone(h,!0,!0):h)}k.length&&d.each(k,bc)}return this}}),d.buildFragment=function(a,b,e){var f,g,h,i=b&&b[0]?b[0].ownerDocument||b[0]:c;a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!X.test(a[0])&&(d.support.checkClone||!Y.test(a[0]))&&(g=!0,h=d.fragments[a[0]],h&&h!==1&&(f=h)),f||(f=i.createDocumentFragment(),d.clean(a,i,f,e)),g&&(d.fragments[a[0]]=h?f:1);return{fragment:f,cacheable:g}},d.fragments={},d.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){d.fn[a]=function(c){var e=[],f=d(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&f.length===1){f[b](this[0]);return this}for(var h=0,i=f.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();d(f[h])[b](j),e=e.concat(j)}return this.pushStack(e,a,f.selector)}}),d.extend({clone:function(a,b,c){var e=a.cloneNode(!0),f,g,h;if((!d.support.noCloneEvent||!d.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!d.isXMLDoc(a)){ba(a,e),f=bb(a),g=bb(e);for(h=0;f[h];++h)ba(f[h],g[h])}if(b){_(a,e);if(c){f=bb(a),g=bb(e);for(h=0;f[h];++h)_(f[h],g[h])}}f=g=null;return e},clean:function(a,b,e,f){b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var g=[];for(var h=0,i;(i=a[h])!=null;h++){typeof i=="number"&&(i+="");if(!i)continue;if(typeof i=="string"&&!W.test(i))i=b.createTextNode(i);else if(typeof i=="string"){i=i.replace(T,"<$1></$2>");var j=(U.exec(i)||["",""])[1].toLowerCase(),k=Z[j]||Z._default,l=k[0],m=b.createElement("div");m.innerHTML=k[1]+i+k[2];while(l--)m=m.lastChild;if(!d.support.tbody){var n=V.test(i),o=j==="table"&&!n?m.firstChild&&m.firstChild.childNodes:k[1]==="<table>"&&!n?m.childNodes:[];for(var p=o.length-1;p>=0;--p)d.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!d.support.leadingWhitespace&&S.test(i)&&m.insertBefore(b.createTextNode(S.exec(i)[0]),m.firstChild),i=m.childNodes}i.nodeType?g.push(i):g=d.merge(g,i)}if(e)for(h=0;g[h];h++)f&&d.nodeName(g[h],"script")&&(!g[h].type||g[h].type.toLowerCase()==="text/javascript")?f.push(g[h].parentNode?g[h].parentNode.removeChild(g[h]):g[h]):(g[h].nodeType===1&&g.splice.apply(g,[h+1,0].concat(d.makeArray(g[h].getElementsByTagName("script")))),e.appendChild(g[h]));return g},cleanData:function(a){var b,c,e=d.cache,f=d.expando,g=d.event.special,h=d.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&d.noData[j.nodeName.toLowerCase()])continue;c=j[d.expando];if(c){b=e[c]&&e[c][f];if(b&&b.events){for(var k in b.events)g[k]?d.event.remove(j,k):d.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[d.expando]:j.removeAttribute&&j.removeAttribute(d.expando),delete e[c]}}}});var bd=/alpha\([^)]*\)/i,be=/opacity=([^)]*)/,bf=/-([a-z])/ig,bg=/([A-Z]|^ms)/g,bh=/^-?\d+(?:px)?$/i,bi=/^-?\d/,bj={position:"absolute",visibility:"hidden",display:"block"},bk=["Left","Right"],bl=["Top","Bottom"],bm,bn,bo,bp=function(a,b){return b.toUpperCase()};d.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return d.access(this,a,c,!0,function(a,c,e){return e!==b?d.style(a,c,e):d.css(a,c)})},d.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bm(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},cssProps:{"float":d.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,e,f){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h=d.camelCase(c),i=a.style,j=d.cssHooks[h];c=d.cssProps[h]||h;if(e===b){if(j&&"get"in j&&(g=j.get(a,!1,f))!==b)return g;return i[c]}if(typeof e=="number"&&isNaN(e)||e==null)return;typeof e=="number"&&!d.cssNumber[h]&&(e+="px");if(!j||!("set"in j)||(e=j.set(a,e))!==b)try{i[c]=e}catch(k){}}},css:function(a,c,e){var f,g=d.camelCase(c),h=d.cssHooks[g];c=d.cssProps[g]||g;if(h&&"get"in h&&(f=h.get(a,!0,e))!==b)return f;if(bm)return bm(a,c,g)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(bf,bp)}}),d.curCSS=d.css,d.each(["height","width"],function(a,b){d.cssHooks[b]={get:function(a,c,e){var f;if(c){a.offsetWidth!==0?f=bq(a,b,e):d.swap(a,bj,function(){f=bq(a,b,e)});if(f<=0){f=bm(a,b,b),f==="0px"&&bo&&(f=bo(a,b,b));if(f!=null)return f===""||f==="auto"?"0px":f}if(f<0||f==null){f=a.style[b];return f===""||f==="auto"?"0px":f}return typeof f=="string"?f:f+"px"}},set:function(a,b){if(!bh.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),d.support.opacity||(d.cssHooks.opacity={get:function(a,b){return be.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style;c.zoom=1;var e=d.isNaN(b)?"":"alpha(opacity="+b*100+")",f=c.filter||"";c.filter=bd.test(f)?f.replace(bd,e):c.filter+" "+e}}),d(function(){d.support.reliableMarginRight||(d.cssHooks.marginRight={get:function(a,b){var c;d.swap(a,{display:"inline-block"},function(){b?c=bm(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bn=function(a,c,e){var f,g,h;e=e.replace(bg,"-$1").toLowerCase();if(!(g=a.ownerDocument.defaultView))return b;if(h=g.getComputedStyle(a,null))f=h.getPropertyValue(e),f===""&&!d.contains(a.ownerDocument.documentElement,a)&&(f=d.style(a,e));return f}),c.documentElement.currentStyle&&(bo=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bh.test(d)&&bi.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bm=bn||bo,d.expr&&d.expr.filters&&(d.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!d.support.reliableHiddenOffsets&&(a.style.display||d.css(a,"display"))==="none"},d.expr.filters.visible=function(a){return!d.expr.filters.hidden(a)});var br=/%20/g,bs=/\[\]$/,bt=/\r?\n/g,bu=/#.*$/,bv=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bw=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bx=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,by=/^(?:GET|HEAD)$/,bz=/^\/\//,bA=/\?/,bB=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bC=/^(?:select|textarea)/i,bD=/\s+/,bE=/([?&])_=[^&]*/,bF=/(^|\-)([a-z])/g,bG=function(a,b,c){return b+c.toUpperCase()},bH=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bI=d.fn.load,bJ={},bK={},bL,bM;try{bL=c.location.href}catch(bN){bL=c.createElement("a"),bL.href="",bL=bL.href}bM=bH.exec(bL.toLowerCase())||[],d.fn.extend({load:function(a,c,e){if(typeof a!="string"&&bI)return bI.apply(this,arguments);if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var g=a.slice(f,a.length);a=a.slice(0,f)}var h="GET";c&&(d.isFunction(c)?(e=c,c=b):typeof c=="object"&&(c=d.param(c,d.ajaxSettings.traditional),h="POST"));var i=this;d.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?d("<div>").append(c.replace(bB,"")).find(g):c)),e&&i.each(e,[c,b,a])}});return this},serialize:function(){return d.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?d.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bC.test(this.nodeName)||bw.test(this.type))}).map(function(a,b){var c=d(this).val();return c==null?null:d.isArray(c)?d.map(c,function(a,c){return{name:b.name,value:a.replace(bt,"\r\n")}}):{name:b.name,value:c.replace(bt,"\r\n")}}).get()}}),d.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){d.fn[b]=function(a){return this.bind(b,a)}}),d.each(["get","post"],function(a,c){d[c]=function(a,e,f,g){d.isFunction(e)&&(g=g||f,f=e,e=b);return d.ajax({type:c,url:a,data:e,success:f,dataType:g})}}),d.extend({getScript:function(a,c){return d.get(a,b,c,"script")},getJSON:function(a,b,c){return d.get(a,b,c,"json")},ajaxSetup:function(a,b){b?d.extend(!0,a,d.ajaxSettings,b):(b=a,a=d.extend(!0,d.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in d.ajaxSettings&&(a[c]=d.ajaxSettings[c]);return a},ajaxSettings:{url:bL,isLocal:bx.test(bM[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":d.parseJSON,"text xml":d.parseXML}},ajaxPrefilter:bO(bJ),ajaxTransport:bO(bK),ajax:function(a,c){function v(a,c,l,n){if(r!==2){r=2,p&&clearTimeout(p),o=b,m=n||"",u.readyState=a?4:0;var q,t,v,w=l?bR(e,u,l):b,x,y;if(a>=200&&a<300||a===304){if(e.ifModified){if(x=u.getResponseHeader("Last-Modified"))d.lastModified[k]=x;if(y=u.getResponseHeader("Etag"))d.etag[k]=y}if(a===304)c="notmodified",q=!0;else try{t=bS(e,w),c="success",q=!0}catch(z){c="parsererror",v=z}}else{v=c;if(!c||a)c="error",a<0&&(a=0)}u.status=a,u.statusText=c,q?h.resolveWith(f,[t,c,u]):h.rejectWith(f,[u,c,v]),u.statusCode(j),j=b,s&&g.trigger("ajax"+(q?"Success":"Error"),[u,e,q?t:v]),i.resolveWith(f,[u,c]),s&&(g.trigger("ajaxComplete",[u,e]),--d.active||d.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var e=d.ajaxSetup({},c),f=e.context||e,g=f!==e&&(f.nodeType||f instanceof d)?d(f):d.event,h=d.Deferred(),i=d._Deferred(),j=e.statusCode||{},k,l={},m,n,o,p,q,r=0,s,t,u={readyState:0,setRequestHeader:function(a,b){r||(l[a.toLowerCase().replace(bF,bG)]=b);return this},getAllResponseHeaders:function(){return r===2?m:null},getResponseHeader:function(a){var c;if(r===2){if(!n){n={};while(c=bv.exec(m))n[c[1].toLowerCase()]=c[2]}c=n[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){r||(e.mimeType=a);return this},abort:function(a){a=a||"abort",o&&o.abort(a),v(0,a);return this}};h.promise(u),u.success=u.done,u.error=u.fail,u.complete=i.done,u.statusCode=function(a){if(a){var b;if(r<2)for(b in a)j[b]=[j[b],a[b]];else b=a[u.status],u.then(b,b)}return this},e.url=((a||e.url)+"").replace(bu,"").replace(bz,bM[1]+"//"),e.dataTypes=d.trim(e.dataType||"*").toLowerCase().split(bD),e.crossDomain==null&&(q=bH.exec(e.url.toLowerCase()),e.crossDomain=!(!q||q[1]==bM[1]&&q[2]==bM[2]&&(q[3]||(q[1]==="http:"?80:443))==(bM[3]||(bM[1]==="http:"?80:443)))),e.data&&e.processData&&typeof e.data!="string"&&(e.data=d.param(e.data,e.traditional)),bP(bJ,e,c,u);if(r===2)return!1;s=e.global,e.type=e.type.toUpperCase(),e.hasContent=!by.test(e.type),s&&d.active++===0&&d.event.trigger("ajaxStart");if(!e.hasContent){e.data&&(e.url+=(bA.test(e.url)?"&":"?")+e.data),k=e.url;if(e.cache===!1){var w=d.now(),x=e.url.replace(bE,"$1_="+w);e.url=x+(x===e.url?(bA.test(e.url)?"&":"?")+"_="+w:"")}}if(e.data&&e.hasContent&&e.contentType!==!1||c.contentType)l["Content-Type"]=e.contentType;e.ifModified&&(k=k||e.url,d.lastModified[k]&&(l["If-Modified-Since"]=d.lastModified[k]),d.etag[k]&&(l["If-None-Match"]=d.etag[k])),l.Accept=e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+(e.dataTypes[0]!=="*"?", */*; q=0.01":""):e.accepts["*"];for(t in e.headers)u.setRequestHeader(t,e.headers[t]);if(e.beforeSend&&(e.beforeSend.call(f,u,e)===!1||r===2)){u.abort();return!1}for(t in{success:1,error:1,complete:1})u[t](e[t]);o=bP(bK,e,c,u);if(!o)v(-1,"No Transport");else{u.readyState=1,s&&g.trigger("ajaxSend",[u,e]),e.async&&e.timeout>0&&(p=setTimeout(function(){u.abort("timeout")},e.timeout));try{r=1,o.send(l,v)}catch(y){status<2?v(-1,y):d.error(y)}}return u},param:function(a,c){var e=[],f=function(a,b){b=d.isFunction(b)?b():b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=d.ajaxSettings.traditional);if(d.isArray(a)||a.jquery&&!d.isPlainObject(a))d.each(a,function(){f(this.name,this.value)});else for(var g in a)bQ(g,a[g],c,f);return e.join("&").replace(br,"+")}}),d.extend({active:0,lastModified:{},etag:{}});var bT=d.now(),bU=/(\=)\?(&|$)|\?\?/i;d.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return d.expando+"_"+bT++}}),d.ajaxPrefilter("json jsonp",function(b,c,e){var f=typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||c.jsonpCallback||c.jsonp!=null||b.jsonp!==!1&&(bU.test(b.url)||f&&bU.test(b.data))){var g,h=b.jsonpCallback=d.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2",m=function(){a[h]=i,g&&d.isFunction(i)&&a[h](g[0])};b.jsonp!==!1&&(j=j.replace(bU,l),b.url===j&&(f&&(k=k.replace(bU,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},e.then(m,m),b.converters["script json"]=function(){g||d.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),d.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){d.globalEval(a);return a}}}),d.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),d.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var bV=d.now(),bW,bX;d.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&bZ()||b$()}:bZ,bX=d.ajaxSettings.xhr(),d.support.ajax=!!bX,d.support.cors=bX&&"withCredentials"in bX,bX=b,d.support.ajax&&d.ajaxTransport(function(a){if(!a.crossDomain||d.support.cors){var c;return{send:function(e,f){var g=a.xhr(),h,i;a.username?g.open(a.type,a.url,a.async,a.username,a.password):g.open(a.type,a.url,a.async);if(a.xhrFields)for(i in a.xhrFields)g[i]=a.xhrFields[i];a.mimeType&&g.overrideMimeType&&g.overrideMimeType(a.mimeType),!a.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(i in e)g.setRequestHeader(i,e[i])}catch(j){}g.send(a.hasContent&&a.data||null),c=function(e,i){var j,k,l,m,n;try{if(c&&(i||g.readyState===4)){c=b,h&&(g.onreadystatechange=d.noop,delete bW[h]);if(i)g.readyState!==4&&g.abort();else{j=g.status,l=g.getAllResponseHeaders(),m={},n=g.responseXML,n&&n.documentElement&&(m.xml=n),m.text=g.responseText;try{k=g.statusText}catch(o){k=""}!j&&a.isLocal&&!a.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){i||f(-1,p)}m&&f(j,k,m,l)},!a.async||g.readyState===4?c():(bW||(bW={},bY()),h=bV++,g.onreadystatechange=bW[h]=c)},abort:function(){c&&c(0,1)}}}});var b_={},ca=/^(?:toggle|show|hide)$/,cb=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cc,cd=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];d.fn.extend({show:function(a,b,c){var e,f;if(a||a===0)return this.animate(ce("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)e=this[g],f=e.style.display,!d._data(e,"olddisplay")&&f==="none"&&(f=e.style.display=""),f===""&&d.css(e,"display")==="none"&&d._data(e,"olddisplay",cf(e.nodeName));for(g=0;g<h;g++){e=this[g],f=e.style.display;if(f===""||f==="none")e.style.display=d._data(e,"olddisplay")||""}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ce("hide",3),a,b,c);for(var e=0,f=this.length;e<f;e++){var g=d.css(this[e],"display");g!=="none"&&!d._data(this[e],"olddisplay")&&d._data(this[e],"olddisplay",g)}for(e=0;e<f;e++)this[e].style.display="none";return this},_toggle:d.fn.toggle,toggle:function(a,b,c){var e=typeof a=="boolean";d.isFunction(a)&&d.isFunction(b)?this._toggle.apply(this,arguments):a==null||e?this.each(function(){var b=e?a:d(this).is(":hidden");d(this)[b?"show":"hide"]()}):this.animate(ce("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,e){var f=d.speed(b,c,e);if(d.isEmptyObject(a))return this.each(f.complete);return this[f.queue===!1?"each":"queue"](function(){var b=d.extend({},f),c,e=this.nodeType===1,g=e&&d(this).is(":hidden"),h=this;for(c in a){var i=d.camelCase(c);c!==i&&(a[i]=a[c],delete a[c],c=i);if(a[c]==="hide"&&g||a[c]==="show"&&!g)return b.complete.call(this);if(e&&(c==="height"||c==="width")){b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(d.css(this,"display")==="inline"&&d.css(this,"float")==="none")if(!d.support.inlineBlockNeedsLayout)this.style.display="inline-block";else{var j=cf(this.nodeName);j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)}}d.isArray(a[c])&&((b.specialEasing=b.specialEasing||{})[c]=a[c][1],a[c]=a[c][0])}b.overflow!=null&&(this.style.overflow="hidden"),b.curAnim=d.extend({},a),d.each(a,function(c,e){var f=new d.fx(h,b,c);if(ca.test(e))f[e==="toggle"?g?"show":"hide":e](a);else{var i=cb.exec(e),j=f.cur();if(i){var k=parseFloat(i[2]),l=i[3]||(d.cssNumber[c]?"":"px");l!=="px"&&(d.style(h,c,(k||1)+l),j=(k||1)/f.cur()*j,d.style(h,c,j+l)),i[1]&&(k=(i[1]==="-="?-1:1)*k+j),f.custom(j,k,l)}else f.custom(j,e,"")}});return!0})},stop:function(a,b){var c=d.timers;a&&this.queue([]),this.each(function(){for(var a=c.length-1;a>=0;a--)c[a].elem===this&&(b&&c[a](!0),c.splice(a,1))}),b||this.dequeue();return this}}),d.each({slideDown:ce("show",1),slideUp:ce("hide",1),slideToggle:ce("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){d.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),d.extend({speed:function(a,b,c){var e=a&&typeof a=="object"?d.extend({},a):{complete:c||!c&&b||d.isFunction(a)&&a,duration:a,easing:c&&b||b&&!d.isFunction(b)&&b};e.duration=d.fx.off?0:typeof e.duration=="number"?e.duration:e.duration in d.fx.speeds?d.fx.speeds[e.duration]:d.fx.speeds._default,e.old=e.complete,e.complete=function(){e.queue!==!1&&d(this).dequeue(),d.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig||(b.orig={})}}),d.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(d.fx.step[this.prop]||d.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=d.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function g(a){return e.step(a)}var e=this,f=d.fx;this.startTime=d.now(),this.start=a,this.end=b,this.unit=c||this.unit||(d.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,g.elem=this.elem,g()&&d.timers.push(g)&&!cc&&(cc=setInterval(f.tick,f.interval))},show:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),d(this.elem).show()},hide:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=d.now(),c=!0;if(a||b>=this.options.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),this.options.curAnim[this.prop]=!0;for(var e in this.options.curAnim)this.options.curAnim[e]!==!0&&(c=!1);if(c){if(this.options.overflow!=null&&!d.support.shrinkWrapBlocks){var f=this.elem,g=this.options;d.each(["","X","Y"],function(a,b){f.style["overflow"+b]=g.overflow[a]})}this.options.hide&&d(this.elem).hide();if(this.options.hide||this.options.show)for(var h in this.options.curAnim)d.style(this.elem,h,this.options.orig[h]);this.options.complete.call(this.elem)}return!1}var i=b-this.startTime;this.state=i/this.options.duration;var j=this.options.specialEasing&&this.options.specialEasing[this.prop],k=this.options.easing||(d.easing.swing?"swing":"linear");this.pos=d.easing[j||k](this.state,i,0,1,this.options.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update();return!0}},d.extend(d.fx,{tick:function(){var a=d.timers;for(var b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||d.fx.stop()},interval:13,stop:function(){clearInterval(cc),cc=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){d.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),d.expr&&d.expr.filters&&(d.expr.filters.animated=function(a){return d.grep(d.timers,function(b){return a===b.elem}).length});var cg=/^t(?:able|d|h)$/i,ch=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?d.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){d.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return d.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,g=f.documentElement;if(!c||!d.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=f.body,i=ci(f),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||d.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||d.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:d.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){d.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return d.offset.bodyOffset(b);d.offset.initialize();var c,e=b.offsetParent,f=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(d.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===e&&(l+=b.offsetTop,m+=b.offsetLeft,d.offset.doesNotAddBorder&&(!d.offset.doesAddBorderForTableAndCells||!cg.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),f=e,e=b.offsetParent),d.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;d.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},d.offset={initialize:function(){var a=c.body,b=c.createElement("div"),e,f,g,h,i=parseFloat(d.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";d.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),e=b.firstChild,f=e.firstChild,h=e.nextSibling.firstChild.firstChild,this.doesNotAddBorder=f.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,f.style.position="fixed",f.style.top="20px",this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15,f.style.position=f.style.top="",e.style.overflow="hidden",e.style.position="relative",this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),d.offset.initialize=d.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;d.offset.initialize(),d.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(d.css(a,"marginTop"))||0,c+=parseFloat(d.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var e=d.css(a,"position");e==="static"&&(a.style.position="relative");var f=d(a),g=f.offset(),h=d.css(a,"top"),i=d.css(a,"left"),j=(e==="absolute"||e==="fixed")&&d.inArray("auto",[h,i])>-1,k={},l={},m,n;j&&(l=f.position()),m=j?l.top:parseInt(h,10)||0,n=j?l.left:parseInt(i,10)||0,d.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):f.css(k)}},d.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),e=ch.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(d.css(a,"marginTop"))||0,c.left-=parseFloat(d.css(a,"marginLeft"))||0,e.top+=parseFloat(d.css(b[0],"borderTopWidth"))||0,e.left+=parseFloat(d.css(b[0],"borderLeftWidth"))||0;return{top:c.top-e.top,left:c.left-e.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!ch.test(a.nodeName)&&d.css(a,"position")==="static")a=a.offsetParent;return a})}}),d.each(["Left","Top"],function(a,c){var e="scroll"+c;d.fn[e]=function(c){var f=this[0],g;if(!f)return null;if(c!==b)return this.each(function(){g=ci(this),g?g.scrollTo(a?d(g).scrollLeft():c,a?c:d(g).scrollTop()):this[e]=c});g=ci(f);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:d.support.boxModel&&g.document.documentElement[e]||g.document.body[e]:f[e]}}),d.each(["Height","Width"],function(a,c){var e=c.toLowerCase();d.fn["inner"+c]=function(){return this[0]?parseFloat(d.css(this[0],e,"padding")):null},d.fn["outer"+c]=function(a){return this[0]?parseFloat(d.css(this[0],e,a?"margin":"border")):null},d.fn[e]=function(a){var f=this[0];if(!f)return a==null?null:this;if(d.isFunction(a))return this.each(function(b){var c=d(this);c[e](a.call(this,b,c[e]()))});if(d.isWindow(f)){var g=f.document.documentElement["client"+c];return f.document.compatMode==="CSS1Compat"&&g||f.document.body["client"+c]||g}if(f.nodeType===9)return Math.max(f.documentElement["client"+c],f.body["scroll"+c],f.documentElement["scroll"+c],f.body["offset"+c],f.documentElement["offset"+c]);if(a===b){var h=d.css(f,e),i=parseFloat(h);return d.isNaN(i)?h:i}return this.css(e,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=d})(window)
jQuery.noConflict();
/**
 * Atlassian custom download containing:
 * CORE - Core, Widget, Mouse
 * INTERACTIONS - Draggable, Sortable
 * Load jquery-ui-other for droppable and other resources.
 * This load profile will be updated to something more logical in a future version.
 */
/*!
 * jQuery UI 1.8.11
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI
 */
(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.11",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,
NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,
"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");
if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f,
"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,
d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}});
c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&
b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);
;/*!
 * jQuery UI Widget 1.8.11
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,
a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h;
e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,
this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},
widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},
enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
;/*!
 * jQuery UI Mouse 1.8.11
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Mouse
 *
 * Depends:
 *	jquery.ui.widget.js
 */
(function(b){b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.target,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent=
a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var c=this,e=a.which==1,f=typeof this.options.cancel=="string"?b(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=
this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();return true}}true===b.data(a.target,this.widgetName+".preventClickEvent")&&b.removeData(a.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(d){return c._mouseMove(d)};this._mouseUpDelegate=function(d){return c._mouseUp(d)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return a.originalEvent.mouseHandled=
true}},_mouseMove:function(a){if(b.browser.msie&&!(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);
if(this._mouseStarted){this._mouseStarted=false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
;/*
 * jQuery UI Draggable 1.8.11
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Draggables
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper==
"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b=
this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-
this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();
d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||
this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&
this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==
a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||
0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],
this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-
(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),
height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[(a.containment=="document"?0:d(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(a.containment=="document"?0:d(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?
document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),
10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),a.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),
10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom]}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&
d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],
this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])e=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=
this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;e=this.originalPageX+Math.round((e-this.originalPageX)/b.grid[0])*b.grid[0];e=this.containment?!(e-this.offset.click.left<this.containment[0]||e-this.offset.click.left>this.containment[2])?
e:!(e-this.offset.click.left<this.containment[0])?e-b.grid[0]:e+b.grid[0]:e}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left:e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():
f?0:c.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c]);if(a=="drag")this.positionAbs=this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b,c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,
offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.11"});d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var g=d.data(this,"sortable");if(g&&!g.options.disabled){c.sortables.push({instance:g,shouldRevert:g.options.revert});g.refreshPositions();g._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},
b,{item:c.element});d.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper;c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=
d(this).data("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs=c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=d(f).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return b.helper[0]};
a.target=this.instance.currentItem[0];this.instance._mouseCapture(a,true);this.instance._mouseStart(a,true,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top;c._trigger("toSortable",a);c.dropped=this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.instance.currentItem&&
this.instance._mouseDrag(a)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",a,this.instance._uiHash(this.instance));this.instance._mouseStop(a,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();c._trigger("fromSortable",a);c.dropped=false}})}});d.ui.plugin.add("draggable","cursor",
{start:function(){var a=d("body"),b=d(this).data("draggable").options;if(a.css("cursor"))b._cursor=a.css("cursor");a.css("cursor",b.cursor)},stop:function(){var a=d(this).data("draggable").options;a._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","iframeFix",{start:function(){var a=d(this).data("draggable").options;d(a.iframeFix===true?"iframe":a.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+
"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})},stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",
a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop+
c.scrollSpeed;else if(a.pageY-b.overflowOffset.top<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop-c.scrollSpeed;if(!c.axis||c.axis!="y")if(b.overflowOffset.left+b.scrollParent[0].offsetWidth-a.pageX<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft+c.scrollSpeed;else if(a.pageX-b.overflowOffset.left<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(!c.axis||c.axis!="x")if(a.pageY-d(document).scrollTop()<
c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()-c.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()+c.scrollSpeed);if(!c.axis||c.axis!="y")if(a.pageX-d(document).scrollLeft()<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()-c.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()+
c.scrollSpeed)}f!==false&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(b,a)}});d.ui.plugin.add("draggable","snap",{start:function(){var a=d(this).data("draggable"),b=a.options;a.snapElements=[];d(b.snap.constructor!=String?b.snap.items||":data(draggable)":b.snap).each(function(){var c=d(this),f=c.offset();this!=a.element[0]&&a.snapElements.push({item:this,width:c.outerWidth(),height:c.outerHeight(),top:f.top,left:f.left})})},drag:function(a,b){for(var c=d(this).data("draggable"),
f=c.options,e=f.snapTolerance,g=b.offset.left,n=g+c.helperProportions.width,m=b.offset.top,o=m+c.helperProportions.height,h=c.snapElements.length-1;h>=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e<g&&g<k+e&&j-e<m&&m<l+e||i-e<g&&g<k+e&&j-e<o&&o<l+e||i-e<n&&n<k+e&&j-e<m&&m<l+e||i-e<n&&n<k+e&&j-e<o&&o<l+e){if(f.snapMode!="inner"){var p=Math.abs(j-o)<=e,q=Math.abs(l-m)<=e,r=Math.abs(i-n)<=e,s=Math.abs(k-g)<=e;if(p)b.position.top=
c._convertPositionTo("relative",{top:j-c.helperProportions.height,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:l,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i-c.helperProportions.width}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k}).left-c.margins.left}var t=p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(j-m)<=e;q=Math.abs(l-o)<=e;r=Math.abs(i-g)<=e;s=Math.abs(k-n)<=e;if(p)b.position.top=
c._convertPositionTo("relative",{top:j,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:l-c.helperProportions.height,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k-c.helperProportions.width}).left-c.margins.left}if(!c.snapElements[h].snapping&&(p||q||r||s||t))c.options.snap.snap&&c.options.snap.snap.call(c.element,a,d.extend(c._uiHash(),
{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=p||q||r||s||t}else{c.snapElements[h].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=false}}}});d.ui.plugin.add("draggable","stack",{start:function(){var a=d(this).data("draggable").options;a=d.makeArray(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"),10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(a.length){var b=
parseInt(a[0].style.zIndex)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex");a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery);
;/*
 * jQuery UI Sortable 1.8.11
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Sortables
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
(function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable");
this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]=
b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;
d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem=c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-
this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};
this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=
document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);
return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop+b.scrollSpeed;else if(a.pageY-this.overflowOffset.top<
b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop-b.scrollSpeed;if(this.overflowOffset.left+this.scrollParent[0].offsetWidth-a.pageX<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft+b.scrollSpeed;else if(a.pageX-this.overflowOffset.left<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft-b.scrollSpeed}else{if(a.pageY-d(document).scrollTop()<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()-
b.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()+b.scrollSpeed);if(a.pageX-d(document).scrollLeft()<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()-b.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()+b.scrollSpeed)}c!==false&&d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,
a)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(b=this.items.length-1;b>=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],
e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a,c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();
c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):
this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,
dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")},
toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+j<k&&b+l>g&&b+l<h;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||
this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?j:g<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<h&&i<e+this.helperProportions.height/2&&f-this.helperProportions.height/2<k},_intersectsWithPointer:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left,a.width);b=b&&a;a=this._getDragVerticalDirection();
var c=this._getDragHorizontalDirection();if(!b)return false;return this.floating?c&&c=="right"||a=="down"?2:1:a&&(a=="down"?2:1)},_intersectsWithSides:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top+a.height/2,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left+a.width/2,a.width);var c=this._getDragVerticalDirection(),e=this._getDragHorizontalDirection();return this.floating&&e?e=="right"&&a||e=="left"&&!a:c&&(c=="down"&&b||c=="up"&&!b)},
_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();
if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),
this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(a){this.items=[];this.containers=[this];var b=this.items,c=[[d.isFunction(this.options.items)?this.options.items.call(this.element[0],a,{item:this.currentItem}):d(this.options.items,this.element),
this]],e=this._connectWith();if(e)for(var f=e.length-1;f>=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h<g;h++){i=d(e[h]);i.data("sortable-item",a);b.push({item:i,instance:a,width:0,height:0,left:0,top:0})}}},refreshPositions:function(a){if(this.offsetParent&&
this.helper)this.offset.parent=this._getParentOffset();for(var b=this.items.length-1;b>=0;b--){var c=this.items[b],e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=
e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];
if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);
c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===
1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-f)<b){b=Math.abs(h-f);e=this.items[g]}}if(e||this.options.dropOnEmpty){this.currentContainer=
this.containers[c];e?this._rearrange(a,e,null,true):this._rearrange(a,null,this.containers[c].element,true);this._trigger("change",a,this._uiHash());this.containers[c]._trigger("change",a,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}}},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a,this.currentItem])):
b.helper=="clone"?this.currentItem.clone():this.currentItem;a.parents("body").length||d(b.appendTo!="parent"?b.appendTo:this.currentItem[0].parentNode)[0].appendChild(a[0]);if(a[0]==this.currentItem[0])this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};if(a[0].style.width==""||b.forceHelperSize)a.width(this.currentItem.width());if(a[0].style.height==
""||b.forceHelperSize)a.height(this.currentItem.height());return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=
this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),
10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions=
{width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||
document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)){var b=d(a.containment)[0];a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,
b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=
document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():
e?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();var f=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-
this.offset.click.left<this.containment[0])f=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<
this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;f=this.originalPageX+Math.round((f-this.originalPageX)/b.grid[0])*b.grid[0];f=this.containment?!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:!(f-this.offset.click.left<this.containment[0])?f-b.grid[0]:f+b.grid[0]:f}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&
this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())}},_rearrange:function(a,b,c,e){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling);this.counter=
this.counter?++this.counter:1;var f=this,g=this.counter;window.setTimeout(function(){g==f.counter&&f.refreshPositions(!e)},0)},_clear:function(a,b){this.reverting=false;var c=[];!this._noFinalSort&&this.currentItem[0].parentNode&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var e in this._storedCSS)if(this._storedCSS[e]=="auto"||this._storedCSS[e]=="static")this._storedCSS[e]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();
this.fromOutside&&!b&&c.push(function(f){this._trigger("receive",f,this._uiHash(this.fromOutside))});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!b)c.push(function(f){this._trigger("update",f,this._uiHash())});if(!d.ui.contains(this.element[0],this.currentItem[0])){b||c.push(function(f){this._trigger("remove",f,this._uiHash())});for(e=this.containers.length-1;e>=0;e--)if(d.ui.contains(this.containers[e].element[0],
this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",
g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",a,this._uiHash());for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}return false}b||
this._trigger("beforeStop",a,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!b){for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){d.Widget.prototype._trigger.apply(this,arguments)===false&&this.cancel()},_uiHash:function(a){var b=a||this;return{helper:b.helper,placeholder:b.placeholder||d([]),position:b.position,
originalPosition:b.originalPosition,offset:b.positionAbs,item:b.currentItem,sender:a?a.element:null}}});d.extend(d.ui.sortable,{version:"1.8.11"})})(jQuery);
;
jQuery.ui.draggable.prototype._mouseCapture=(function(A){return function(C){var B=A.call(this,C);if(B&&jQuery.browser.msie){C.stopPropagation()}return B}})(jQuery.ui.draggable.prototype._mouseCapture);
(function(){var _after=1;var _afterThrow=2;var _afterFinally=3;var _before=4;var _around=5;var _intro=6;var _regexEnabled=true;var _arguments="arguments";var _undef="undefined";var getType=(function(){var toString=Object.prototype.toString,toStrings={},nodeTypes={1:"element",3:"textnode",9:"document",11:"fragment"},types="Arguments Array Boolean Date Document Element Error Fragment Function NodeList Null Number Object RegExp String TextNode Undefined Window".split(" ");for(var i=types.length;i--;){var type=types[i],constructor=window[type];if(constructor){try{toStrings[toString.call(new constructor)]=type.toLowerCase()}catch(e){}}}return function(item){return item==null&&(item===undefined?_undef:"null")||item.nodeType&&nodeTypes[item.nodeType]||typeof item.length=="number"&&(item.callee&&_arguments||item.alert&&"window"||item.item&&"nodelist")||toStrings[toString.call(item)]}})();var isFunc=function(obj){return getType(obj)=="function"};var weaveOne=function(source,method,advice){var old=source[method];if(advice.type!=_intro&&!isFunc(old)){var oldObject=old;old=function(){var code=arguments.length>0?_arguments+"[0]":"";for(var i=1;i<arguments.length;i++){code+=","+_arguments+"["+i+"]"}return eval("oldObject("+code+");")}}var aspect;if(advice.type==_after||advice.type==_afterThrow||advice.type==_afterFinally){aspect=function(){var returnValue,exceptionThrown=null;try{returnValue=old.apply(this,arguments)}catch(e){exceptionThrown=e}if(advice.type==_after){if(exceptionThrown==null){returnValue=advice.value.apply(this,[returnValue,method])}else{throw exceptionThrown}}else{if(advice.type==_afterThrow&&exceptionThrown!=null){returnValue=advice.value.apply(this,[exceptionThrown,method])}else{if(advice.type==_afterFinally){returnValue=advice.value.apply(this,[returnValue,exceptionThrown,method])}}}return returnValue}}else{if(advice.type==_before){aspect=function(){advice.value.apply(this,[arguments,method]);return old.apply(this,arguments)}}else{if(advice.type==_intro){aspect=function(){return advice.value.apply(this,arguments)}}else{if(advice.type==_around){aspect=function(){var invocation={object:this,args:Array.prototype.slice.call(arguments)};return advice.value.apply(invocation.object,[{arguments:invocation.args,method:method,proceed:function(){return old.apply(invocation.object,invocation.args)}}])}}}}}aspect.unweave=function(){source[method]=old;pointcut=source=aspect=old=null};source[method]=aspect;return aspect};var search=function(source,pointcut,advice){var methods=[];for(var method in source){var item=null;try{item=source[method]}catch(e){}if(item!=null&&method.match(pointcut.method)&&isFunc(item)){methods[methods.length]={source:source,method:method,advice:advice}}}return methods};var weave=function(pointcut,advice){var source=typeof (pointcut.target.prototype)!=_undef?pointcut.target.prototype:pointcut.target;var advices=[];if(advice.type!=_intro&&typeof (source[pointcut.method])==_undef){var methods=search(pointcut.target,pointcut,advice);if(methods.length==0){methods=search(source,pointcut,advice)}for(var i in methods){advices[advices.length]=weaveOne(methods[i].source,methods[i].method,methods[i].advice)}}else{advices[0]=weaveOne(source,pointcut.method,advice)}return _regexEnabled?advices:advices[0]};jQuery.aop={after:function(pointcut,advice){return weave(pointcut,{type:_after,value:advice})},afterThrow:function(pointcut,advice){return weave(pointcut,{type:_afterThrow,value:advice})},afterFinally:function(pointcut,advice){return weave(pointcut,{type:_afterFinally,value:advice})},before:function(pointcut,advice){return weave(pointcut,{type:_before,value:advice})},around:function(pointcut,advice){return weave(pointcut,{type:_around,value:advice})},introduction:function(pointcut,advice){return weave(pointcut,{type:_intro,value:advice})},setup:function(settings){_regexEnabled=settings.regexMatch}}})();
/*
 * jQuery Form Plugin
 * version: 2.67 (12-MAR-2011)
 * @requires jQuery v1.3.2 or later
 *
 * Examples and documentation at: http://malsup.com/jquery/form/
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
(function(B){B.fn.ajaxSubmit=function(Q){if(!this.length){A("ajaxSubmit: skipping submit process - no element selected");return this}if(typeof Q=="function"){Q={success:Q}}var H=this.attr("action");var D=(typeof H==="string")?B.trim(H):"";if(D){D=(D.match(/^([^#]+)/)||[])[1]}D=D||window.location.href||"";Q=B.extend(true,{url:D,type:this[0].getAttribute("method")||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},Q);var R={};this.trigger("form-pre-serialize",[this,Q,R]);if(R.veto){A("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(Q.beforeSerialize&&Q.beforeSerialize(this,Q)===false){A("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var F,N,L=this.formToArray(Q.semantic);if(Q.data){Q.extraData=Q.data;for(F in Q.data){if(Q.data[F] instanceof Array){for(var I in Q.data[F]){L.push({name:F,value:Q.data[F][I]})}}else{N=Q.data[F];N=B.isFunction(N)?N():N;L.push({name:F,value:N})}}}if(Q.beforeSubmit&&Q.beforeSubmit(L,this,Q)===false){A("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[L,this,Q,R]);if(R.veto){A("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var C=B.param(L);if(Q.type.toUpperCase()=="GET"){Q.url+=(Q.url.indexOf("?")>=0?"&":"?")+C;Q.data=null}else{Q.data=C}var P=this,K=[];if(Q.resetForm){K.push(function(){P.resetForm()})}if(Q.clearForm){K.push(function(){P.clearForm()})}if(!Q.dataType&&Q.target){var O=Q.success||function(){};K.push(function(T){var S=Q.replaceTarget?"replaceWith":"html";B(Q.target)[S](T).each(O,arguments)})}else{if(Q.success){K.push(Q.success)}}Q.success=function(W,T,X){var V=Q.context||Q;for(var U=0,S=K.length;U<S;U++){K[U].apply(V,[W,T,X||P,P])}};var G=B("input:file",this).length>0;var E="multipart/form-data";var J=(P.attr("enctype")==E||P.attr("encoding")==E);if(Q.iframe!==false&&(G||Q.iframe||J)){if(Q.closeKeepAlive){B.get(Q.closeKeepAlive,M)}else{M()}}else{B.ajax(Q)}this.trigger("form-submit-notify",[this,Q]);return this;function M(){var U=P[0];if(B(":input[name=submit],:input[id=submit]",U).length){alert('Error: Form elements must not have name or id of "submit".');return }var a=B.extend(true,{},B.ajaxSettings,Q);a.context=a.context||a;var d="jqFormIO"+(new Date().getTime()),Y="_"+d;var V=B('<iframe id="'+d+'" name="'+d+'" src="'+a.iframeSrc+'" />');var Z=V[0];V.css({position:"absolute",top:"-1000px",left:"-1000px"});var W={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){A("aborting upload...");var g="aborted";this.aborted=1;V.attr("src",a.iframeSrc);W.error=g;a.error&&a.error.call(a.context,W,"error",g);i&&B.event.trigger("ajaxError",[W,a,g]);a.complete&&a.complete.call(a.context,W,"error")}};var i=a.global;if(i&&!B.active++){B.event.trigger("ajaxStart")}if(i){B.event.trigger("ajaxSend",[W,a])}if(a.beforeSend&&a.beforeSend.call(a.context,W,a)===false){if(a.global){B.active--}return }if(W.aborted){return }var h=0;var X=U.clk;if(X){var e=X.name;if(e&&!X.disabled){a.extraData=a.extraData||{};a.extraData[e]=X.value;if(X.type=="image"){a.extraData[e+".x"]=U.clk_x;a.extraData[e+".y"]=U.clk_y}}}function f(){var o=P.attr("target"),g=P.attr("action");U.setAttribute("target",d);if(U.getAttribute("method")!="POST"){U.setAttribute("method","POST")}if(U.getAttribute("action")!=a.url){U.setAttribute("action",a.url)}if(!a.skipEncodingOverride){P.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(a.timeout){setTimeout(function(){h=true;c()},a.timeout)}var m=[];try{if(a.extraData){for(var p in a.extraData){m.push(B('<input type="hidden" name="'+p+'" value="'+a.extraData[p]+'" />').appendTo(U)[0])}}V.appendTo("body");Z.attachEvent?Z.attachEvent("onload",c):Z.addEventListener("load",c,false);U.submit()}finally{U.setAttribute("action",g);if(o){U.setAttribute("target",o)}else{P.removeAttr("target")}B(m).remove()}}if(a.forceSync){f()}else{setTimeout(f,10)}var k,l,j=50;function c(){if(W.aborted){return }var r=Z.contentWindow?Z.contentWindow.document:Z.contentDocument?Z.contentDocument:Z.document;if(!r||r.location.href==a.iframeSrc){return }Z.detachEvent?Z.detachEvent("onload",c):Z.removeEventListener("load",c,false);var n=true;try{if(h){throw"timeout"}var s=a.dataType=="xml"||r.XMLDocument||B.isXMLDoc(r);A("isXml="+s);if(!s&&window.opera&&(r.body==null||r.body.innerHTML=="")){if(--j){A("requeing onLoad callback, DOM not available");setTimeout(c,250);return }}W.responseText=r.body?r.body.innerHTML:r.documentElement?r.documentElement.innerHTML:null;W.responseXML=r.XMLDocument?r.XMLDocument:r;W.getResponseHeader=function(u){var t={"content-type":a.dataType};return t[u]};var q=/(json|script)/.test(a.dataType);if(q||a.textarea){var m=r.getElementsByTagName("textarea")[0];if(m){W.responseText=m.value}else{if(q){var p=r.getElementsByTagName("pre")[0];var g=r.getElementsByTagName("body")[0];if(p){W.responseText=p.textContent}else{if(g){W.responseText=g.innerHTML}}}}}else{if(a.dataType=="xml"&&!W.responseXML&&W.responseText!=null){W.responseXML=b(W.responseText)}}k=S(W,a.dataType,a)}catch(o){A("error caught:",o);n=false;W.error=o;a.error&&a.error.call(a.context,W,"error",o);i&&B.event.trigger("ajaxError",[W,a,o])}if(W.aborted){A("upload aborted");n=false}if(n){a.success&&a.success.call(a.context,k,"success",W);i&&B.event.trigger("ajaxSuccess",[W,a])}i&&B.event.trigger("ajaxComplete",[W,a]);if(i&&!--B.active){B.event.trigger("ajaxStop")}a.complete&&a.complete.call(a.context,W,n?"success":"error");setTimeout(function(){V.removeData("form-plugin-onload");V.remove();W.responseXML=null},100)}var b=B.parseXML||function(g,m){if(window.ActiveXObject){m=new ActiveXObject("Microsoft.XMLDOM");m.async="false";m.loadXML(g)}else{m=(new DOMParser()).parseFromString(g,"text/xml")}return(m&&m.documentElement&&m.documentElement.nodeName!="parsererror")?m:null};var T=B.parseJSON||function(g){return window["eval"]("("+g+")")};var S=function(q,o,n){var m=q.getResponseHeader("content-type")||"",g=o==="xml"||!o&&m.indexOf("xml")>=0,p=g?q.responseXML:q.responseText;if(g&&p.documentElement.nodeName==="parsererror"){B.error&&B.error("parsererror")}if(n&&n.dataFilter){p=n.dataFilter(p,o)}if(typeof p==="string"){if(o==="json"||!o&&m.indexOf("json")>=0){p=T(p)}else{if(o==="script"||!o&&m.indexOf("javascript")>=0){B.globalEval(p)}}}return p}}};B.fn.ajaxForm=function(C){if(this.length===0){var D={s:this.selector,c:this.context};if(!B.isReady&&D.s){A("DOM not ready, queuing ajaxForm");B(function(){B(D.s,D.c).ajaxForm(C)});return this}A("terminating; zero elements found by selector"+(B.isReady?"":" (DOM not ready)"));return this}return this.ajaxFormUnbind().bind("submit.form-plugin",function(E){if(!E.isDefaultPrevented()){E.preventDefault();B(this).ajaxSubmit(C)}}).bind("click.form-plugin",function(I){var H=I.target;var F=B(H);if(!(F.is(":submit,input:image"))){var E=F.closest(":submit");if(E.length==0){return }H=E[0]}var G=this;G.clk=H;if(H.type=="image"){if(I.offsetX!=undefined){G.clk_x=I.offsetX;G.clk_y=I.offsetY}else{if(typeof B.fn.offset=="function"){var J=F.offset();G.clk_x=I.pageX-J.left;G.clk_y=I.pageY-J.top}else{G.clk_x=I.pageX-H.offsetLeft;G.clk_y=I.pageY-H.offsetTop}}}setTimeout(function(){G.clk=G.clk_x=G.clk_y=null},100)})};B.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};B.fn.formToArray=function(N){var M=[];if(this.length===0){return M}var D=this[0];var G=N?D.getElementsByTagName("*"):D.elements;if(!G){return M}var I,H,F,O,E,K,C;for(I=0,K=G.length;I<K;I++){E=G[I];F=E.name;if(!F){continue}if(N&&D.clk&&E.type=="image"){if(!E.disabled&&D.clk==E){M.push({name:F,value:B(E).val()});M.push({name:F+".x",value:D.clk_x},{name:F+".y",value:D.clk_y})}continue}O=B.fieldValue(E,true);if(O&&O.constructor==Array){for(H=0,C=O.length;H<C;H++){M.push({name:F,value:O[H]})}}else{if(O!==null&&typeof O!="undefined"){M.push({name:F,value:O})}}}if(!N&&D.clk){var J=B(D.clk),L=J[0];F=L.name;if(F&&!L.disabled&&L.type=="image"){M.push({name:F,value:J.val()});M.push({name:F+".x",value:D.clk_x},{name:F+".y",value:D.clk_y})}}return M};B.fn.formSerialize=function(C){return B.param(this.formToArray(C))};B.fn.fieldSerialize=function(D){var C=[];this.each(function(){var H=this.name;if(!H){return }var F=B.fieldValue(this,D);if(F&&F.constructor==Array){for(var G=0,E=F.length;G<E;G++){C.push({name:H,value:F[G]})}}else{if(F!==null&&typeof F!="undefined"){C.push({name:this.name,value:F})}}});return B.param(C)};B.fn.fieldValue=function(H){for(var G=[],E=0,C=this.length;E<C;E++){var F=this[E];var D=B.fieldValue(F,H);if(D===null||typeof D=="undefined"||(D.constructor==Array&&!D.length)){continue}D.constructor==Array?B.merge(G,D):G.push(D)}return G};B.fieldValue=function(C,I){var E=C.name,N=C.type,O=C.tagName.toLowerCase();if(I===undefined){I=true}if(I&&(!E||C.disabled||N=="reset"||N=="button"||(N=="checkbox"||N=="radio")&&!C.checked||(N=="submit"||N=="image")&&C.form&&C.form.clk!=C||O=="select"&&C.selectedIndex==-1)){return null}if(O=="select"){var J=C.selectedIndex;if(J<0){return null}var L=[],D=C.options;var G=(N=="select-one");var K=(G?J+1:D.length);for(var F=(G?J:0);F<K;F++){var H=D[F];if(H.selected){var M=H.value;if(!M){M=(H.attributes&&H.attributes.value&&!(H.attributes.value.specified))?H.text:H.value}if(G){return M}L.push(M)}}return L}return B(C).val()};B.fn.clearForm=function(){return this.each(function(){B("input,select,textarea",this).clearFields()})};B.fn.clearFields=B.fn.clearInputs=function(){return this.each(function(){var D=this.type,C=this.tagName.toLowerCase();if(D=="text"||D=="password"||C=="textarea"){this.value=""}else{if(D=="checkbox"||D=="radio"){this.checked=false}else{if(C=="select"){this.selectedIndex=-1}}}})};B.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};B.fn.enable=function(C){if(C===undefined){C=true}return this.each(function(){this.disabled=!C})};B.fn.selected=function(C){if(C===undefined){C=true}return this.each(function(){var D=this.type;if(D=="checkbox"||D=="radio"){this.checked=C}else{if(this.tagName.toLowerCase()=="option"){var E=B(this).parent("select");if(C&&E[0]&&E[0].type=="select-one"){E.find("option").selected(false)}this.selected=C}}})};function A(){if(B.fn.ajaxSubmit.debug){var C="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(C)}else{if(window.opera&&window.opera.postError){window.opera.postError(C)}}}}})(jQuery);
(function(D){function C(G,E){function F(){E.tm=window.setTimeout(function(){E.loadedChars=""},700)}E.loadedChars=E.loadedChars+G;if(!E.tm){F()}else{clearTimeout(E.tm);F()}}function A(E){return !(this!==E.target&&(/textarea|select/i.test(E.target.nodeName)||E.target.type==="text"||E.target.type==="password"))}D.hotKeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",91:"meta",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",188:",",190:".",191:"/",224:"meta",219:"[",221:"]"},keypressKeys:["<",">","?"],shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":":","'":'"',",":"<",".":">","/":"?","\\":"|"}};D.each(D.hotKeys.keypressKeys,function(E,F){D.hotKeys.shiftNums[F]=F});function B(F){var E,G;if(typeof F.data!=="string"){return }E=F.handler;G=F.data.toLowerCase().split(" ");F.loadedChars="";D(this).bind("keydown",function(I){var H;if(!A(I)){return }H=D.hotKeys.specialKeys[I.which];if((H==="alt"||I.altKey)){C("alt+",F)}if((H==="ctrl"||I.ctrlKey)&&!/ctrl\+/.test(F.loadedChars)){C("ctrl+",F)}if(((H!=="ctrl"&&!I.ctrlKey)&&(H==="meta"||I.metaKey))&&!/meta\+/.test(F.loadedChars)){C("meta+",F)}});F.handler=function(K){var J,I,L,H;if(!A(K)){return }I=D.hotKeys.specialKeys[K.which];L=String.fromCharCode(K.which).toLowerCase();H={};if(I){H[I]=true}if(K.shiftKey){H[F.loadedChars+D.hotKeys.shiftNums[L]||I]=true}else{H[F.loadedChars+L]=true}for(J=0,l=G.length;J<l;J++){if(H[G[J]]){F.loadedChars="";return E.apply(this,arguments)}else{if(G[J].charAt(F.loadedChars.length)===L){C(L,F)}}}}}D.each(["keydown","keyup","keypress"],function(){D.event.special[this]={add:B}})})(jQuery);
if(typeof jQuery!="undefined"){var AJS=(function(){var E=[];function F(G){switch(G){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";case"'":return"&#39;";default:return"&quot;"}}var B=/[&"'<>]/g;var D={version:"3.4.2",params:{},$:jQuery,log:function(G){if(typeof console!="undefined"&&console.log){console.log(G)}},I18n:{getText:function(G){return G}},stopEvent:function(G){G.stopPropagation();return false},include:function(G){if(!this.contains(E,G)){E.push(G);var H=document.createElement("script");H.src=G;this.$("body").append(H)}},toggleClassName:function(G,H){if(!(G=this.$(G))){return }G.toggleClass(H)},setVisible:function(H,G){if(!(H=this.$(H))){return }var I=this.$;I(H).each(function(){var J=I(this).hasClass("hidden");if(J&&G){I(this).removeClass("hidden")}else{if(!J&&!G){I(this).addClass("hidden")}}})},setCurrent:function(G,H){if(!(G=this.$(G))){return }if(H){G.addClass("current")}else{G.removeClass("current")}},isVisible:function(G){return !this.$(G).hasClass("hidden")},populateParameters:function(){var G=this;this.$(".parameters input").each(function(){var H=this.value,I=this.title||this.id;if(G.$(this).hasClass("list")){if(G.params[I]){G.params[I].push(H)}else{G.params[I]=[H]}}else{G.params[I]=(H.match(/^(tru|fals)e$/i)?H.toLowerCase()=="true":H)}})},toInit:function(H){var G=this;this.$(function(){try{H.apply(this,arguments)}catch(I){G.log("Failed to run init function: "+I)}});return this},indexOf:function(K,J,H){var I=K.length;if(H==null){H=0}else{if(H<0){H=Math.max(0,I+H)}}for(var G=H;G<I;G++){if(K[G]===J){return G}}return -1},contains:function(H,G){return this.indexOf(H,G)>-1},format:function(I){var G=/^((?:(?:[^']*'){2})*?[^']*?)\{(\d+)\}/,H=/'(?!')/g;AJS.format=function(M){var K=arguments,L="",J=M.match(G);while(J){M=M.substring(J[0].length);L+=J[1].replace(H,"")+(K.length>++J[2]?K[J[2]]:"");J=M.match(G)}return L+=M.replace(H,"")};return AJS.format.apply(AJS,arguments)},firebug:function(){var G=this.$(document.createElement("script"));G.attr("src","http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js");this.$("head").append(G);(function(){if(window.firebug){firebug.init()}else{setTimeout(arguments.callee,0)}})()},clone:function(G){return AJS.$(G).clone().removeAttr("id")},alphanum:function(N,M){N=(N+"").toLowerCase();M=(M+"").toLowerCase();var I=/(\d+|\D+)/g,J=N.match(I),G=M.match(I),L=Math.max(J.length,G.length);for(var H=0;H<L;H++){if(H==J.length){return -1}if(H==G.length){return 1}var O=parseInt(J[H],10),K=parseInt(G[H],10);if(O==J[H]&&K==G[H]&&O!=K){return(O-K)/Math.abs(O-K)}if((O!=J[H]||K!=G[H])&&J[H]!=G[H]){return J[H]<G[H]?-1:1}}return 0},dim:function(){if(AJS.dim.dim){AJS.dim.dim.remove();AJS.dim.dim=null}else{AJS.dim.dim=AJS("div").css({width:"100%",height:AJS.$(document).height(),background:"#000",opacity:0.5,position:"absolute",top:0,left:0});AJS.$("body").append(AJS.dim.dim)}},onTextResize:function(H){if(typeof H=="function"){if(AJS.onTextResize["on-text-resize"]){AJS.onTextResize["on-text-resize"].push(function(I){H(I)})}else{var G=AJS("div");G.css({width:"1em",height:"1em",position:"absolute",top:"-9999em",left:"-9999em"});this.$("body").append(G);G.size=G.width();setInterval(function(){if(G.size!=G.width()){G.size=G.width();for(var I=0,J=AJS.onTextResize["on-text-resize"].length;I<J;I++){AJS.onTextResize["on-text-resize"][I](G.size)}}},0);AJS.onTextResize.em=G;AJS.onTextResize["on-text-resize"]=[function(I){H(I)}]}}},unbindTextResize:function(I){for(var G=0,H=AJS.onTextResize["on-text-resize"].length;G<H;G++){if(AJS.onTextResize["on-text-resize"][G]==I){return AJS.onTextResize["on-text-resize"].splice(G,1)}}},escape:function(G){return escape(G).replace(/%u\w{4}/gi,function(H){return unescape(H)})},escapeHtml:function(G){return G.replace(B,F)},filterBySearch:function(K,P,Q){if(P==""){return[]}var I=this.$;var N=(Q&&Q.keywordsField)||"keywords";var M=(Q&&Q.ignoreForCamelCase)?"i":"";var J=(Q&&Q.matchBoundary)?"\\b":"";var H=(Q&&Q.splitRegex)||(/\s+/);var L=P.split(H);var G=[];I.each(L,function(){var S=[new RegExp(J+this,"i")];if(/^([A-Z][a-z]*){2,}$/.test(this)){var R=this.replace(/([A-Z][a-z]*)/g,"\\b$1[^,]*");S.push(new RegExp(R,M))}G.push(S)});var O=[];I.each(K,function(){for(var T=0;T<G.length;T++){var R=false;for(var S=0;S<G[T].length;S++){if(G[T][S].test(this[N])){R=true;break}}if(!R){return }}O.push(this)});return O},drawLogo:function(J){options={};options=AJS.$.extend(J,options);var N=options.scaleFactor||1,M=options.fill||"#fff",L=options.stroke||"#000",I=400*N,G=40*N;strokeWidth=options.strokeWidth||1;if(AJS.$(".aui-logo").size()==0){AJS.$("body").append("<div id='aui-logo' class='aui-logo'><div>")}strokeWidth=options.strokeWidth||1,containerID=options.containerID||".aui-logo";var H=Raphael(containerID,I+50*N,G+100*N);var K=H.path("M 0,0 c 3.5433333,-4.7243333 7.0866667,-9.4486667 10.63,-14.173 -14.173,0 -28.346,0 -42.519,0 C -35.432667,-9.4486667 -38.976333,-4.7243333 -42.52,0 -28.346667,0 -14.173333,0 0,0 z m 277.031,28.346 c -14.17367,0 -28.34733,0 -42.521,0 C 245.14,14.173 255.77,0 266.4,-14.173 c -14.17267,0 -28.34533,0 -42.518,0 C 213.25167,0 202.62133,14.173 191.991,28.346 c -14.17333,0 -28.34667,0 -42.52,0 14.17333,-18.8976667 28.34667,-37.7953333 42.52,-56.693 -7.08667,-9.448667 -14.17333,-18.897333 -21.26,-28.346 -14.173,0 -28.346,0 -42.519,0 7.08667,9.448667 14.17333,18.897333 21.26,28.346 -14.17333,18.8976667 -28.34667,37.7953333 -42.52,56.693 -14.173333,0 -28.346667,0 -42.52,0 10.63,-14.173 21.26,-28.346 31.89,-42.519 -14.390333,0 -28.780667,0 -43.171,0 C 42.520733,1.330715e-4 31.889933,14.174867 21.26,28.347 c -42.520624,6.24e-4 -85.039187,-8.13e-4 -127.559,-0.001 11.220667,-14.961 22.441333,-29.922 33.662,-44.883 -6.496,-8.661 -12.992,-17.322 -19.488,-25.983 5.905333,0 11.810667,0 17.716,0 -10.63,-14.173333 -21.26,-28.346667 -31.89,-42.52 14.173333,0 28.346667,0 42.52,0 10.63,14.173333 21.26,28.346667 31.89,42.52 14.173333,0 28.3466667,0 42.52,0 -10.63,-14.173333 -21.26,-28.346667 -31.89,-42.52 14.1733333,0 28.3466667,0 42.52,0 10.63,14.173333 21.26,28.346667 31.89,42.52 14.390333,0 28.780667,0 43.171,0 -10.63,-14.173333 -21.26,-28.346667 -31.89,-42.52 42.51967,0 85.03933,0 127.559,0 10.63033,14.173333 21.26067,28.346667 31.891,42.52 14.17267,0 28.34533,0 42.518,0 -10.63,-14.173333 -21.26,-28.346667 -31.89,-42.52 14.17367,0 28.34733,0 42.521,0 14.17333,18.897667 28.34667,37.795333 42.52,56.693 -14.17333,18.8976667 -28.34667,37.7953333 -42.52,56.693 z");console.log(G);K.scale(N,-N,0,0);K.translate(120*N,G);K.attr("fill",M);K.attr("stroke",L);K.attr("stroke-width",strokeWidth)}};if(typeof AJS!="undefined"){for(var C in AJS){D[C]=AJS[C]}}var A=function(){var G=null;if(arguments.length&&typeof arguments[0]=="string"){G=arguments.callee.$(document.createElement(arguments[0]));if(arguments.length==2){G.html(arguments[1])}}return G};for(var C in D){A[C]=D[C]}return A})();AJS.$(function(){AJS.populateParameters()})}if(typeof console=="undefined"){console={messages:[],log:function(A){this.messages.push(A)},show:function(){alert(this.messages.join("\n"));this.messages=[]}}}else{console.show=function(){}}AJS.$.ajaxSettings.traditional=true;
AJS.bind=function(A,C,B){try{return jQuery(window).bind(A,C,B)}catch(D){AJS.log("error while binding: "+D.message)}};AJS.unbind=function(A,B){try{return jQuery(window).unbind(A,B)}catch(C){AJS.log("error while unbinding: "+C.message)}};AJS.trigger=function(A,C){try{return jQuery(window).trigger(A,C)}catch(B){AJS.log("error while triggering: "+B.message)}};
(function(){var E="AJS.conglomerate.cookie";function B(F,I){I=I||"";var H=new RegExp(F+"=([^|]+)"),G=I.match(H);return G&&G[1]}function A(F,H,J){var G=new RegExp("\\s*"+F+"=[^|]+(\\||$)");J=J||"";J=J.replace(G,"")+(J?"|":"");if(H){var I=F+"="+H;if(J.length+I.length<4020){J+=I}}return J}function D(F){var H=new RegExp(F+"=([^;]+)"),G=document.cookie.match(H);return G&&G[1]}function C(F,H,J){var G="";if(J){var I=new Date();I.setTime(+I+J*24*60*60*1000);G="; expires="+I.toGMTString()}document.cookie=F+"="+H+G+";path=/"}AJS.Cookie={save:function(G,H,F){var I=D(E);I=A(G,H,I);C(E,I,F||365)},read:function(G,F){var I=D(E);var H=B(G,I);if(H!=null){return H}return F},erase:function(F){this.save(F,"")}}})();
AJS.dim=function(A){if(!AJS.dim.dim){AJS.dim.dim=AJS("div").addClass("aui-blanket");if(AJS.$.browser.msie){AJS.dim.dim.css({width:"200%",height:Math.max(AJS.$(document).height(),AJS.$(window).height())+"px"})}AJS.$("body").append(AJS.dim.dim);if(AJS.$.browser.msie&&typeof AJS.hasFlash==="undefined"&&A===false){AJS.hasFlash=false;AJS.$("object, embed, iframe").each(function(){if(this.nodeName.toLowerCase()==="iframe"){if(AJS.$(this).contents().find("object, embed").length){AJS.hasFlash=true;return false}}else{AJS.hasFlash=true;return false}})}if(AJS.$.browser.msie&&(A!==false||AJS.hasFlash)){AJS.dim.shim=AJS.$('<iframe frameBorder="0" class="aui-blanket-shim" src="javascript:false;"/>');AJS.dim.shim.css({height:Math.max(AJS.$(document).height(),AJS.$(window).height())+"px"});AJS.$("body").append(AJS.dim.shim)}if(AJS.$.browser.msie&&parseInt(AJS.$.browser.version,10)<8){AJS.dim.cachedOverflow=AJS.$("html").css("overflow");AJS.$("html").css("overflow","hidden")}else{AJS.dim.cachedOverflow=AJS.$("body").css("overflow");AJS.$("body").css("overflow","hidden")}}};AJS.undim=function(){if(AJS.dim.dim){AJS.dim.dim.remove();AJS.dim.dim=null;if(AJS.dim.shim){AJS.dim.shim.remove()}if(AJS.$.browser.msie&&parseInt(AJS.$.browser.version,10)<8){AJS.$("html").css("overflow",AJS.dim.cachedOverflow)}else{AJS.$("body").css("overflow",AJS.dim.cachedOverflow)}if(AJS.$.browser.safari){var A=AJS.$(window).scrollTop();AJS.$(window).scrollTop(10+5*(A==10)).scrollTop(A)}}};AJS.popup=function(I){var D={width:800,height:600,closeOnOutsideClick:false,keypressListener:function(J){if(J.keyCode===27&&B.is(":visible")){F.hide()}}};if(typeof I!="object"){I={width:arguments[0],height:arguments[1],id:arguments[2]};I=AJS.$.extend({},I,arguments[3])}I=AJS.$.extend({},D,I);var B=AJS("div").addClass("aui-popup");if(I.id){B.attr("id",I.id)}var E=3000;AJS.$(".aui-dialog").each(function(){var J=AJS.$(this);E=(J.css("z-index")>E)?J.css("z-index"):E});var G=(function(K,J){I.width=(K=(K||I.width));I.height=(J=(J||I.height));B.css({marginTop:-Math.round(J/2)+"px",marginLeft:-Math.round(K/2)+"px",width:K,height:J,background:"#fff","z-index":parseInt(E,10)+2});return arguments.callee})(I.width,I.height);AJS.$("body").append(B);B.hide();B.enable();var C=AJS.$(".aui-blanket"),A=function(N){var O=false,K=AJS.$(":input:visible:enabled:first",N),J=N.children(":visible");if(K.length&&K[0].tabIndex>=0){K.focus();return O=true}if(N.length&&N[0].tabIndex>=0){N.focus();return O=true}for(var L=0,M=J.length;L<M;L++){O=A(jQuery(J[L]));if(O){break}}return O},H=function(J){if(A(AJS.$(".dialog-page-body",J))){return }if(A(AJS.$(".dialog-button-panel",J))){return }A(AJS.$(".dialog-page-menu",J))};var F={changeSize:function(J,K){if((J&&J!=I.width)||(K&&K!=I.height)){G(J,K)}this.show()},show:function(){var J=function(){var K=5;if(AJS.$.browser.msie&&~~(AJS.$.browser.version)<9){K=3}AJS.$(document).keydown(I.keypressListener);AJS.dim();C=AJS.$(".aui-blanket");if(C.size()!=0&&I.closeOnOutsideClick){C.click(function(){if(B.is(":visible")){F.hide()}})}B.show();if(!this.shadow){var L=B.offset();this.shadow=Raphael.shadow(L.top,L.left,I.width,I.height,{target:B[0],zindex:(B.css("z-index")-1)});this.shadow.css({position:"fixed",top:"50%",left:"50%",marginLeft:-(I.width/2-K)+"px",marginTop:-(I.height/2-K)+"px"})}AJS.popup.current=this;H(B);AJS.$(document).trigger("showLayer",["popup",this])};J.call(this);this.show=J},hide:function(){AJS.$(document).unbind("keydown",I.keypressListener);C.unbind();this.element.hide();if(this.shadow){this.shadow.remove();this.shadow=null}if(AJS.$(".aui-dialog:visible").size()==0){AJS.undim()}AJS.$(document).trigger("hideLayer",["popup",this]);AJS.popup.current=null;this.enable()},element:B,remove:function(){if(this.shadow){this.shadow.remove();this.shadow=null;this.shadowParent.remove();this.shadowParent=null}B.remove();this.element=null},disable:function(){if(!this.disabled){this.popupBlanket=AJS.$("<div class='dialog-blanket'> </div>").css({height:B.height(),width:B.width()});B.append(this.popupBlanket);this.disabled=true}},enable:function(){if(this.disabled){this.disabled=false;this.popupBlanket.remove();this.popupBlanket=null}}};return F};(function(){function A(J,H,G,I){if(!J.buttonpanel){J.addButtonPanel()}this.page=J;this.onclick=G;this._onclick=function(){return G.call(this,J.dialog,J)===true};this.item=AJS("button",H).addClass("button-panel-button");if(I){this.item.addClass(I)}if(typeof G=="function"){this.item.click(this._onclick)}J.buttonpanel.append(this.item);this.id=J.button.length;J.button[this.id]=this}function B(K,I,H,J,G){if(!K.buttonpanel){K.addButtonPanel()}if(!G){G="#"}this.page=K;this.onclick=H;this._onclick=function(){return H.call(this,K.dialog,K)===true};this.item=AJS("a",I).attr("href",G).addClass("button-panel-link");if(J){this.item.addClass(J)}if(typeof H=="function"){this.item.click(this._onclick)}K.buttonpanel.append(this.item);this.id=K.button.length;K.button[this.id]=this}function D(I,H){var G=I=="left"?-1:1;return function(M){var K=this.page[H];if(this.id!=((G==1)?K.length-1:0)){G*=(M||1);K[this.id+G].item[(G<0?"before":"after")](this.item);K.splice(this.id,1);K.splice(this.id+G,0,this);for(var J=0,L=K.length;J<L;J++){if(H=="panel"&&this.page.curtab==K[J].id){this.page.curtab=J}K[J].id=J}}return this}}function F(G){return function(){this.page[G].splice(this.id,1);for(var H=0,I=this.page[G].length;H<I;H++){this.page[G][H].id=H}this.item.remove()}}A.prototype.moveUp=A.prototype.moveLeft=D("left","button");A.prototype.moveDown=A.prototype.moveRight=D("right","button");A.prototype.remove=F("button");A.prototype.html=function(G){return this.item.html(G)};A.prototype.onclick=function(G){if(typeof G=="undefined"){return this.onclick}else{this.item.unbind("click",this._onclick);this._onclick=function(){return G.call(this,page.dialog,page)===true};if(typeof G=="function"){this.item.click(this._onclick)}}};var E=function(M,N,G,L,J){if(!(G instanceof AJS.$)){G=AJS.$(G)}this.dialog=M.dialog;this.page=M;this.id=M.panel.length;this.button=AJS("button").html(N).addClass("item-button");if(J){this.button[0].id=J}this.item=AJS("li").append(this.button).addClass("page-menu-item");this.body=AJS("div").append(G).addClass("dialog-panel-body").css("height",M.dialog.height+"px");this.padding=10;if(L){this.body.addClass(L)}var I=M.panel.length,K=this;M.menu.append(this.item);M.body.append(this.body);M.panel[I]=this;var H=function(){var O;if(M.curtab+1){O=M.panel[M.curtab];O.body.hide();O.item.removeClass("selected");(typeof O.onblur=="function")&&O.onblur()}M.curtab=K.id;K.body.show();K.item.addClass("selected");(typeof K.onselect=="function")&&K.onselect();(typeof M.ontabchange=="function")&&M.ontabchange(K,O)};if(!this.button.click){AJS.log("atlassian-dialog:Panel:constructor - this.button.click false");this.button.onclick=H}else{this.button.click(H)}H();if(I==0){M.menu.css("display","none")}else{M.menu.show()}};E.prototype.select=function(){this.button.click()};E.prototype.moveUp=E.prototype.moveLeft=D("left","panel");E.prototype.moveDown=E.prototype.moveRight=D("right","panel");E.prototype.remove=F("panel");E.prototype.html=function(G){if(G){this.body.html(G);return this}else{return this.body.html()}};E.prototype.setPadding=function(G){if(!isNaN(+G)){this.body.css("padding",+G);this.padding=+G;this.page.recalcSize()}return this};var C=function(G,H){this.dialog=G;this.id=G.page.length;this.element=AJS("div").addClass("dialog-components");this.body=AJS("div").addClass("dialog-page-body");this.menu=AJS("ul").addClass("dialog-page-menu").css("height",G.height+"px");this.body.append(this.menu);this.curtab;this.panel=[];this.button=[];if(H){this.body.addClass(H)}G.popup.element.append(this.element.append(this.menu).append(this.body));G.page[G.page.length]=this};C.prototype.recalcSize=function(){var G=this.header?43:0;var J=this.buttonpanel?43:0;for(var I=this.panel.length;I--;){var H=this.dialog.height-G-J;this.panel[I].body.css("height",H-this.panel[I].padding*2);this.menu.css("height",H-parseFloat(this.menu.css("padding-top")))}};C.prototype.addButtonPanel=function(){this.buttonpanel=AJS("div").addClass("dialog-button-panel");this.element.append(this.buttonpanel)};C.prototype.addPanel=function(J,G,I,H){new E(this,J,G,I,H);this.recalcSize();return this};C.prototype.addHeader=function(H,G){if(this.header){this.header.remove()}this.header=AJS("h2").html(H||"").addClass("dialog-title");G&&this.header.addClass(G);this.element.prepend(this.header);this.recalcSize();return this};C.prototype.addButton=function(H,G,I){new A(this,H,G,I);this.recalcSize();return this};C.prototype.addLink=function(I,H,J,G){new B(this,I,H,J,G);this.recalcSize();return this};C.prototype.gotoPanel=function(G){this.panel[G.id||G].select()};C.prototype.getCurrentPanel=function(){return this.panel[this.curtab]};C.prototype.hide=function(){this.element.hide()};C.prototype.show=function(){this.element.show()};C.prototype.remove=function(){this.element.remove()};AJS.Dialog=function(I,G,J){var H={};if(!+I){H=Object(I);I=H.width;G=H.height;J=H.id}this.height=G||480;this.width=I||640;this.id=J;H=AJS.$.extend({},H,{width:this.width,height:this.height,id:this.id});this.popup=AJS.popup(H);this.popup.element.addClass("aui-dialog");this.page=[];this.curpage=0;new C(this)};AJS.Dialog.prototype.addHeader=function(H,G){this.page[this.curpage].addHeader(H,G);return this};AJS.Dialog.prototype.addButton=function(H,G,I){this.page[this.curpage].addButton(H,G,I);return this};AJS.Dialog.prototype.addLink=function(I,H,J,G){this.page[this.curpage].addLink(I,H,J,G);return this};AJS.Dialog.prototype.addSubmit=function(H,G){this.page[this.curpage].addButton(H,G,"button-panel-submit-button");return this};AJS.Dialog.prototype.addCancel=function(H,G){this.page[this.curpage].addLink(H,G,"button-panel-cancel-link");return this};AJS.Dialog.prototype.addButtonPanel=function(){this.page[this.curpage].addButtonPanel();return this};AJS.Dialog.prototype.addPanel=function(J,G,I,H){this.page[this.curpage].addPanel(J,G,I,H);return this};AJS.Dialog.prototype.addPage=function(G){new C(this,G);this.page[this.curpage].hide();this.curpage=this.page.length-1;return this};AJS.Dialog.prototype.nextPage=function(){this.page[this.curpage++].hide();if(this.curpage>=this.page.length){this.curpage=0}this.page[this.curpage].show();return this};AJS.Dialog.prototype.prevPage=function(){this.page[this.curpage--].hide();if(this.curpage<0){this.curpage=this.page.length-1}this.page[this.curpage].show();return this};AJS.Dialog.prototype.gotoPage=function(G){this.page[this.curpage].hide();this.curpage=G;if(this.curpage<0){this.curpage=this.page.length-1}else{if(this.curpage>=this.page.length){this.curpage=0}}this.page[this.curpage].show();return this};AJS.Dialog.prototype.getPanel=function(H,I){var G=(I==null)?this.curpage:H;if(I==null){I=H}return this.page[G].panel[I]};AJS.Dialog.prototype.getPage=function(G){return this.page[G]};AJS.Dialog.prototype.getCurrentPanel=function(){return this.page[this.curpage].getCurrentPanel()};AJS.Dialog.prototype.gotoPanel=function(I,H){if(H!=null){var G=I.id||I;this.gotoPage(G)}this.page[this.curpage].gotoPanel(typeof H=="undefined"?I:H)};AJS.Dialog.prototype.show=function(){this.popup.show();return this};AJS.Dialog.prototype.hide=function(){this.popup.hide();return this};AJS.Dialog.prototype.remove=function(){this.popup.hide();this.popup.remove()};AJS.Dialog.prototype.disable=function(){this.popup.disable();return this};AJS.Dialog.prototype.enable=function(){this.popup.enable();return this};AJS.Dialog.prototype.get=function(O){var H=[],N=this;var P='#([^"][^ ]*|"[^"]*")';var Q=":(\\d+)";var I="page|panel|button|header";var J="(?:("+I+")(?:"+P+"|"+Q+")?|"+P+")";var L=new RegExp("(?:^|,)\\s*"+J+"(?:\\s+"+J+")?\\s*(?=,|$)","ig");(O+"").replace(L,function(b,R,a,S,Y,X,U,c,Z){R=R&&R.toLowerCase();var T=[];if(R=="page"&&N.page[S]){T.push(N.page[S]);R=X;R=R&&R.toLowerCase();a=U;S=c;Y=Z}else{T=N.page}a=a&&(a+"").replace(/"/g,"");U=U&&(U+"").replace(/"/g,"");Y=Y&&(Y+"").replace(/"/g,"");Z=Z&&(Z+"").replace(/"/g,"");if(R||Y){for(var W=T.length;W--;){if(Y||(R=="panel"&&(a||(!a&&S==null)))){for(var V=T[W].panel.length;V--;){if(T[W].panel[V].button.html()==Y||T[W].panel[V].button.html()==a||(R=="panel"&&!a&&S==null)){H.push(T[W].panel[V])}}}if(Y||(R=="button"&&(a||(!a&&S==null)))){for(var V=T[W].button.length;V--;){if(T[W].button[V].item.html()==Y||T[W].button[V].item.html()==a||(R=="button"&&!a&&S==null)){H.push(T[W].button[V])}}}if(T[W][R]&&T[W][R][S]){H.push(T[W][R][S])}if(R=="header"&&T[W].header){H.push(T[W].header)}}}else{H=H.concat(T)}});var M={length:H.length};for(var K=H.length;K--;){M[K]=H[K];for(var G in H[K]){if(!(G in M)){(function(R){M[R]=function(){for(var S=this.length;S--;){if(typeof this[S][R]=="function"){this[S][R].apply(this[S],arguments)}}}})(G)}}}return M};AJS.Dialog.prototype.updateHeight=function(){var G=0;for(var H=0;this.getPanel(H);H++){if(this.getPanel(H).body.css({height:"auto",display:"block"}).outerHeight()>G){G=this.getPanel(H).body.outerHeight()}if(H!==this.page[this.curpage].curtab){this.getPanel(H).body.css({display:"none"})}}for(H=0;this.getPanel(H);H++){this.getPanel(H).body.css({height:G||this.height})}this.page[0].menu.height(G);this.height=G+87;this.popup.changeSize(undefined,G+87)};AJS.Dialog.prototype.getCurPanel=function(){return this.getPanel(this.page[this.curpage].curtab)};AJS.Dialog.prototype.getCurPanelButton=function(){return this.getCurPanel().button}})();
AJS.dropDown=function(L,E){var U=null,I=[],Q=false,H=AJS.$(document),C={item:"li:has(a)",activeClass:"active",alignment:"right",displayHandler:function(W){return W.name},escapeHandler:function(){this.hide("escape");return false},hideHandler:function(){},moveHandler:function(X,W){}};AJS.$.extend(C,E);C.alignment={left:"left",right:"right"}[C.alignment.toLowerCase()]||"left";if(L&&L.jquery){U=L}else{if(typeof L=="string"){U=AJS.$(L)}else{if(L&&L.constructor==Array){U=AJS("div").addClass("aui-dropdown").toggleClass("hidden",!!C.isHiddenByDefault);for(var P=0,K=L.length;P<K;P++){var J=AJS("ol");for(var O=0,S=L[P].length;O<S;O++){var M=AJS("li");var G=L[P][O];if(G.href){M.append(AJS("a").html("<span>"+C.displayHandler(G)+"</span>").attr({href:G.href}).addClass(G.className));AJS.$.data(AJS.$("a > span",M)[0],"properties",G)}else{M.html(G.html).addClass(G.className)}if(G.icon){M.prepend(AJS("img").attr("src",G.icon))}if(G.insideSpanIcon){M.children("a").prepend(AJS("span").attr("class","icon"))}AJS.$.data(M[0],"properties",G);J.append(M)}if(P==K-1){J.addClass("last")}U.append(J)}AJS.$("body").append(U)}else{throw new Error("AJS.dropDown function was called with illegal parameter. Should be AJS.$ object, AJS.$ selector or array.")}}}var F=function(){N(+1)};var T=function(){N(-1)};var N=function(Z){var Y=!Q,W=AJS.dropDown.current.$[0],X=AJS.dropDown.current.links,a=W.focused;Q=true;W.focused=(typeof W.focused=="number"?W.focused:-1);if(!AJS.dropDown.current){AJS.log("move - not current, aborting");return true}W.focused=W.focused+Z;if(W.focused<0){W.focused=X.length-1}if(W.focused>X.length-1){W.focused=0}C.moveHandler(AJS.$(X[W.focused]),Z<0?"up":"down");if(Y&&X.length){AJS.$(X[W.focused]).addClass(C.activeClass);Q=false}else{if(!X.length){Q=false}}};var V=function(Y){if(!AJS.dropDown.current){return true}var Z=Y.which,W=AJS.dropDown.current.$[0],X=AJS.dropDown.current.links;AJS.dropDown.current.cleanActive();switch(Z){case 40:F();break;case 38:T();break;case 27:return C.escapeHandler.call(AJS.dropDown.current,Y);case 13:if(W.focused>=0){if(!C.selectionHandler){if(AJS.$(X[W.focused]).attr("nodeName")!="a"){return AJS.$("a",X[W.focused]).trigger("focus")}else{return AJS.$(X[W.focused]).trigger("focus")}}else{return C.selectionHandler.call(AJS.dropDown.current,Y,AJS.$(X[W.focused]))}}return true;default:if(X.length){AJS.$(X[W.focused]).addClass(C.activeClass)}return true}Y.stopPropagation();Y.preventDefault();return false};var A=function(W){if(!((W&&W.which&&(W.which==3))||(W&&W.button&&(W.button==2))||false)){if(AJS.dropDown.current){AJS.dropDown.current.hide("click")}}};var D=function(W){return function(){if(!AJS.dropDown.current){return }AJS.dropDown.current.cleanFocus();this.originalClass=this.className;AJS.$(this).addClass(C.activeClass);AJS.dropDown.current.$[0].focused=W}};var R=function(W){if(W.button||W.metaKey||W.ctrlKey||W.shiftKey){return true}if(AJS.dropDown.current&&C.selectionHandler){C.selectionHandler.call(AJS.dropDown.current,W,AJS.$(this))}};var B=function(X){var W=false;if(X.data("events")){AJS.$.each(X.data("events"),function(Y,Z){AJS.$.each(Z,function(b,a){if(R===a){W=true;return false}})})}return W};U.each(function(){var W=this,Y=AJS.$(this),Z;var X={reset:function(){Z=AJS.$.extend(Z||{},{$:Y,links:AJS.$(C.item||"li:has(a)",W),cleanActive:function(){if(W.focused+1&&Z.links.length){AJS.$(Z.links[W.focused]).removeClass(C.activeClass)}},cleanFocus:function(){Z.cleanActive();W.focused=-1},moveDown:F,moveUp:T,moveFocus:V,getFocusIndex:function(){return(typeof W.focused=="number")?W.focused:-1}});Z.links.each(function(a){var b=AJS.$(this);if(!B(b)){b.hover(D(a),Z.cleanFocus);b.click(R)}});return arguments.callee}(),appear:function(a){if(a){Y.removeClass("hidden");Y.addClass("aui-dropdown-"+C.alignment)}else{Y.addClass("hidden")}},fade:function(a){if(a){Y.fadeIn("fast")}else{Y.fadeOut("fast")}},scroll:function(a){if(a){Y.slideDown("fast")}else{Y.slideUp("fast")}}};Z.addCallback=function(b,a){return AJS.$.aop.after({target:this,method:b},a)};Z.reset=X.reset();Z.show=function(a){this.alignment=C.alignment;A();AJS.dropDown.current=this;this.method=a||this.method||"appear";this.timer=setTimeout(function(){H.click(A)},0);H.keydown(V);if(C.firstSelected&&this.links[0]){D(0).call(this.links[0])}AJS.$(W.offsetParent).css({zIndex:2000});X[this.method](true);AJS.$(document).trigger("showLayer",["dropdown",AJS.dropDown.current])};Z.hide=function(a){this.method=this.method||"appear";AJS.$(Y.get(0).offsetParent).css({zIndex:""});this.cleanFocus();X[this.method](false);H.unbind("click",A).unbind("keydown",V);AJS.$(document).trigger("hideLayer",["dropdown",AJS.dropDown.current]);AJS.dropDown.current=null;return a};Z.addCallback("reset",function(){if(C.firstSelected&&this.links[0]){D(0).call(this.links[0])}});if(!AJS.dropDown.iframes){AJS.dropDown.iframes=[]}AJS.dropDown.createShims=function(){AJS.$("iframe").each(function(a){var b=this;if(!b.shim){b.shim=AJS.$("<div />").addClass("shim hidden").appendTo("body");AJS.dropDown.iframes.push(b)}});return arguments.callee}();Z.addCallback("show",function(){AJS.$(AJS.dropDown.iframes).each(function(){var a=AJS.$(this);if(a.is(":visible")){var b=a.offset();b.height=a.height();b.width=a.width();this.shim.css({left:b.left+"px",top:b.top+"px",height:b.height+"px",width:b.width+"px"}).removeClass("hidden")}})});Z.addCallback("hide",function(){AJS.$(AJS.dropDown.iframes).each(function(){this.shim.addClass("hidden")});C.hideHandler()});(function(){var a=function(){var b=this.$.offset();if(this.shadow){this.shadow.remove()}if(this.$.is(":visible")){this.shadow=Raphael.shadow(0,0,this.$.outerWidth(true),this.$.outerHeight(true),{target:this.$[0]});this.shadow.css("top",this.$.css("top"));if(this.alignment=="right"){this.shadow.css("left","")}else{this.shadow.css("left","0px")}}};Z.addCallback("reset",a);Z.addCallback("show",a);Z.addCallback("hide",function(){if(this.shadow){this.shadow.remove()}})})();if(AJS.$.browser.msie){(function(){var a=function(){if(this.$.is(":visible")){if(!this.iframeShim){this.iframeShim=AJS.$('<iframe class="dropdown-shim" src="javascript:false;" frameBorder="0" />').insertBefore(this.$)}this.iframeShim.css({display:"block",top:this.$.css("top"),width:this.$.outerWidth()+"px",height:this.$.outerHeight()+"px"});if(C.alignment=="left"){this.iframeShim.css({left:"0px"})}else{this.iframeShim.css({right:"0px"})}}};Z.addCallback("reset",a);Z.addCallback("show",a);Z.addCallback("hide",function(){if(this.iframeShim){this.iframeShim.css({display:"none"})}})})()}I.push(Z)});return I};AJS.dropDown.getAdditionalPropertyValue=function(D,A){var C=D[0];if(!C||(typeof C.tagName!="string")||C.tagName.toLowerCase()!="li"){AJS.log("AJS.dropDown.getAdditionalPropertyValue : item passed in should be an LI element wrapped by jQuery")}var B=AJS.$.data(C,"properties");return B?B[A]:null};AJS.dropDown.removeAllAdditionalProperties=function(A){};AJS.dropDown.Standard=function(H){var C=[],G,B={selector:".aui-dd-parent",dropDown:".aui-dropdown",trigger:".aui-dd-trigger"};AJS.$.extend(B,H);var F=function(I,L,K,J){AJS.$.extend(J,{trigger:I});L.addClass("dd-allocated");K.addClass("hidden");if(B.isHiddenByDefault==false){J.show()}J.addCallback("show",function(){L.addClass("active")});J.addCallback("hide",function(){L.removeClass("active")})};var A=function(K,I,L,J){if(J!=AJS.dropDown.current){L.css({top:I.outerHeight()});J.show();K.stopImmediatePropagation()}K.preventDefault()};if(B.useLiveEvents){var D=[];var E=[];AJS.$(B.trigger).live("click",function(L){var I=AJS.$(this);var N,M,J;var K;if((K=AJS.$.inArray(this,D))>=0){var O=E[K];N=O.parent;M=O.dropdown;J=O.ddcontrol}else{N=I.closest(B.selector);M=N.find(B.dropDown);if(M.length===0){return }J=AJS.dropDown(M,B)[0];if(!J){return }D.push(this);O={parent:N,dropdown:M,ddcontrol:J};F(I,N,M,J);E.push(O)}A(L,I,M,J)})}else{if(this instanceof AJS.$){G=this}else{G=AJS.$(B.selector)}G=G.not(".dd-allocated").filter(":has("+B.dropDown+")").filter(":has("+B.trigger+")");G.each(function(){var L=AJS.$(this),K=AJS.$(B.dropDown,this),I=AJS.$(B.trigger,this),J=AJS.dropDown(K,B)[0];AJS.$.extend(J,{trigger:I});F(I,L,K,J);I.click(function(M){A(M,I,K,J)});C.push(J)})}return C};AJS.dropDown.Ajax=function(C){var B,A={cache:true};AJS.$.extend(A,C||{});B=AJS.dropDown.Standard.call(this,A);AJS.$(B).each(function(){var D=this;AJS.$.extend(D,{getAjaxOptions:function(E){var F=function(G){if(A.formatResults){G=A.formatResults(G)}if(A.cache){D.cache.set(D.getAjaxOptions(),G)}D.refreshSuccess(G)};if(A.ajaxOptions){if(AJS.$.isFunction(A.ajaxOptions)){return AJS.$.extend(A.ajaxOptions.call(D),{success:F})}else{return AJS.$.extend(A.ajaxOptions,{success:F})}}return AJS.$.extend(E,{success:F})},refreshSuccess:function(E){this.$.html(E)},cache:function(){var E={};return{get:function(F){var G=F.data||"";return E[(F.url+G).replace(/[\?\&]/gi,"")]},set:function(F,G){var H=F.data||"";E[(F.url+H).replace(/[\?\&]/gi,"")]=G},reset:function(){E={}}}}(),show:function(E){return function(F){if(A.cache&&!!D.cache.get(D.getAjaxOptions())){D.refreshSuccess(D.cache.get(D.getAjaxOptions()));E.call(D)}else{AJS.$(AJS.$.ajax(D.getAjaxOptions())).throbber({target:D.$,end:function(){D.reset()}});E.call(D);D.shadow.hide();if(D.iframeShim){D.iframeShim.hide()}}}}(D.show),resetCache:function(){D.cache.reset()}});D.addCallback("refreshSuccess",function(){D.reset()})});return B};AJS.$.fn.dropDown=function(B,A){B=(B||"Standard").replace(/^([a-z])/,function(C){return C.toUpperCase()});return AJS.dropDown[B].call(this,A)};
(function(){AJS.icons=AJS.icons||{};AJS.icons.addIcon=function(B,C){AJS.icons[B]=function(E,D){return A(C,E,D)}};AJS.icons.addIcon.init=function(){var D=this.className.split(" "),B=D.length,C=this.className.match(/(^|\s)size-(\d+)(\s|$)/);C=C&&+C[2];while(B--){if(D[B]!="addIcon"&&D[B] in AJS.icons){AJS.icons[D[B]](this,C)}}};function A(E,C,B){B=B||24;var D=Raphael([C,B+1,B+1].concat(E));D.scale(B/24,B/24,0,0)}})();AJS.$(function(){AJS.$(".svg-icon").each(AJS.icons.addIcon.init)});AJS.icons.addIcon("generic",[{stroke:"none",fill:"#999",type:"path",path:"M22.465,8.464c1.944,1.944,1.944,5.126,0,7.07l-6.93,6.93c-1.944,1.945-5.126,1.945-7.07,0l-6.929-6.93c-1.945-1.943-1.945-5.125,0-7.07l6.929-6.93c1.944-1.944,5.126-1.944,7.07,0L22.465,8.464z"},{type:"path",stroke:"none",fill:"90-#999996-#a1a19f:20-#b8b8b7:70-#ccc",path:"M9.172,2.242L9.172,2.242l-6.929,6.93C1.491,9.923,1.077,10.927,1.077,12c0,1.072,0.414,2.076,1.166,2.828l6.929,6.93c0.751,0.752,1.756,1.166,2.828,1.166s2.076-0.414,2.828-1.166l6.93-6.93c0.751-0.752,1.165-1.756,1.165-2.828c0-1.072-0.414-2.076-1.165-2.828l-6.93-6.93C13.269,0.682,10.731,0.682,9.172,2.242z"},{type:"path",stroke:"none",fill:"270-#999996-#a1a19f:20-#b8b8b7:70-#ccc",path:"M7.181,5.869 7.181,17.95 16.974,17.95 16.974,9.205 13.638,5.869"},{type:"path",stroke:"none",fill:"#fff",path:"M12.724,9.619v-2.75H8.181V16.95h7.793v-6.832h-2.75C12.946,10.119,12.724,9.894,12.724,9.619zM13.724,7.369c0,0.521,0,1.32,0,1.75c0.428,0,1.229,0,1.75,0L13.724,7.369z"}]);AJS.icons.addIcon("error",[{type:"path",stroke:"none",fill:"#c00",path:"M7.857,22L2,16.143 2,7.857 7.857,1.999 16.143,1.999 22,7.857 22,16.143 16.143,22z"},{type:"path",stroke:"none",fill:"90-#c00-#d50909-#ed2121-#f33",path:"M8.271,2.999C7.771,3.5,3.501,7.77,3,8.271c0,0.708,0,6.748,0,7.457c0.501,0.5,4.771,4.77,5.271,5.271c0.708,0,6.749,0,7.457,0c0.501-0.502,4.771-4.771,5.271-5.271c0-0.709,0-6.749,0-7.457c-0.501-0.501-4.771-4.771-5.271-5.272C15.021,2.999,8.979,2.999,8.271,2.999z"},{type:"rect",x:5.318,y:9.321,fill:"270-#c00-#d50909-#ed2121-#f33",stroke:"none",width:13.363,height:5.356},{type:"rect",x:6.318,y:10.321,fill:"#fff",stroke:"none",width:11.363,height:3.356}]);AJS.icons.addIcon("success",[{type:"path",stroke:"none",path:"M22,18.801C22,20.559,20.561,22,18.799,22H5.201C3.439,22,2,20.559,2,18.801V5.199C2,3.44,3.439,2,5.201,2h13.598C20.561,2,22,3.44,22,5.199V18.801z",fill:"#393"},{type:"path",path:"M5.201,3C3.987,3,3,3.986,3,5.199v13.602C3,20.014,3.987,21,5.201,21h13.598C20.013,21,21,20.014,21,18.801V5.199C21,3.986,20.013,3,18.799,3H5.201z",stroke:"none",fill:"90-#393-#33a23c-#3c6"},{type:"path",path:"M10.675,12.158c-0.503-0.57-1.644-1.862-1.644-1.862l-3.494,2.833l3.663,5.313l4.503,1.205L17.73,4.624l-4.361-0.056C13.369,4.568,11.424,10.047,10.675,12.158z",stroke:"none",fill:"270-#393-#33a23c-#3c6"},{type:"path",path:"M14.072,5.577 11.05,14.092 8.917,11.677 6.886,13.324 9.815,17.57 12.997,18.422 16.432,5.607",stroke:"none",fill:"#fff"}]);AJS.icons.addIcon("hint",[{type:"path",path:"M22.465,8.464c1.944,1.944,1.944,5.126,0,7.07l-6.93,6.93c-1.944,1.945-5.126,1.945-7.07,0l-6.929-6.93c-1.945-1.943-1.945-5.125,0-7.07l6.929-6.93c1.944-1.944,5.126-1.944,7.07,0L22.465,8.464z",stroke:"none",fill:"#009898"},{type:"path",path:"M9.172,2.242L9.172,2.242l-6.929,6.93C1.491,9.923,1.077,10.927,1.077,12c0,1.072,0.414,2.076,1.166,2.828l6.929,6.93c0.751,0.752,1.756,1.166,2.828,1.166s2.076-0.414,2.828-1.166l6.93-6.93c0.751-0.752,1.165-1.756,1.165-2.828c0-1.072-0.414-2.076-1.165-2.828l-6.93-6.93C13.269,0.682,10.731,0.682,9.172,2.242z",stroke:"none",fill:"270-#099-#00a2a2-#00baba-#0cc"},{type:"path",path:"M12,5.077c-2.679,0-4.857,2.179-4.857,4.857c0,1.897,0.741,2.864,1.337,3.639c0.385,0.502,0.662,0.863,0.761,1.443l0.045,0.264v2.25c0,0.854,0.693,1.547,1.546,1.547h2.338c0.852,0,1.545-0.693,1.545-1.547v-2.254l0.044-0.258c0.1-0.582,0.377-0.943,0.762-1.443c0.596-0.777,1.338-1.743,1.338-3.641C16.857,7.255,14.679,5.077,12,5.077z",stroke:"none",fill:"270-#099-#00a2a2-#00baba-#0cc"},{type:"path",path:"M10.227,14.849c-0.331-1.936-2.084-2.197-2.084-4.915c0-2.131,1.727-3.857,3.857-3.857c2.13,0,3.857,1.727,3.857,3.857c0,2.717-1.754,2.979-2.085,4.915H10.227z M10.285,15.849v1.682c0,0.301,0.246,0.547,0.546,0.547h2.338c0.3,0,0.545-0.246,0.545-0.547v-1.682H10.285z",stroke:"none",fill:"#fff"}]);AJS.icons.addIcon("info",[{type:"circle",cx:12,cy:12,r:10,stroke:"none",fill:"#06c"},{type:"path",path:"M3,12c0,4.962,4.037,9,9,9s9-4.038,9-9s-4.037-9-9-9S3,7.037,3,12z",stroke:"none",fill:"90-#06c-#006FD5-#0087ED-#0099FF"},{type:"path",path:"M9.409,7.472c0,0.694,0.282,1.319,0.729,1.785c-0.288,0-0.729,0-0.729,0v9.425h5.182V9.257c0,0-0.44,0-0.729,0c0.446-0.466,0.729-1.09,0.729-1.785c0-1.429-1.162-2.591-2.591-2.591S9.409,6.043,9.409,7.472z",stroke:"none",fill:"270-#06c-#006FD5-#0087ED-#0099FF"},{type:"path",path:"M13.591,10.257v7.425h-3.182v-7.425H13.591z M12,9.063c0.879,0,1.591-0.712,1.591-1.591S12.879,5.881,12,5.881s-1.591,0.712-1.591,1.591S11.121,9.063,12,9.063z",stroke:"none",fill:"#fff"}]);AJS.icons.addIcon("warning",[{type:"path",path:"M8.595,4.368c1.873-3.245,4.938-3.245,6.811,0c1.873,3.245,4.938,8.554,6.812,11.798c1.874,3.244,0.342,5.898-3.405,5.898c-3.746,0-9.876,0-13.624,0c-3.746,0-5.278-2.654-3.405-5.898C3.656,12.922,6.721,7.613,8.595,4.368z",stroke:"none",fill:"#f90"},{type:"path",path:"M9.461,4.868L2.649,16.666c-0.72,1.246-0.863,2.371-0.404,3.166s1.504,1.232,2.943,1.232h13.624c1.439,0,2.485-0.438,2.944-1.232s0.315-1.92-0.405-3.166L14.539,4.868C13.82,3.622,12.918,2.935,12,2.935S10.181,3.621,9.461,4.868z",stroke:"none",fill:"90-#f90-#ffa209-#ffba21-#fc3"},{type:"path",path:"M9.274,6.187c0,0,0.968,9.68,0.986,9.862c-0.532,0.476-0.881,1.148-0.881,1.916c0,1.433,1.165,2.598,2.597,2.598c1.433,0,2.598-1.165,2.598-2.598c0-0.77-0.351-1.441-0.883-1.918c0.018-0.184,0.988-9.86,0.988-9.86H9.274z",stroke:"none",fill:"270-#f90-#ffa209-#ffba21-#fc3"},{type:"path",path:"M11.177,15.171l-0.798-7.984h3.194l-0.8,7.984H11.177z M11.976,16.368c-0.882,0-1.597,0.716-1.597,1.597c0,0.883,0.715,1.598,1.597,1.598c0.881,0,1.598-0.715,1.598-1.598C13.573,17.084,12.856,16.368,11.976,16.368z",stroke:"none",fill:"#fff"}]);AJS.icons.addIcon("close",[{type:"path",path:"M15.535,12l4.95-4.95c0.977-0.977,0.977-2.559,0-3.536s-2.56-0.977-3.536,0L12,8.464l-4.95-4.95c-0.977-0.977-2.559-0.977-3.536,0s-0.977,2.559,0,3.536L8.464,12l-4.95,4.95c-0.977,0.977-0.977,2.559,0,3.535s2.559,0.977,3.536,0L12,15.535l4.949,4.949c0.977,0.977,2.56,0.977,3.536,0s0.977-2.559,0-3.535L15.535,12z",stroke:"none",fill:"#999"},{type:"path",path:"M18.718,20.217c-0.401,0-0.777-0.156-1.062-0.439L12,14.121l-5.657,5.656c-0.284,0.283-0.66,0.439-1.061,0.439c-0.4,0-0.777-0.156-1.061-0.439c-0.283-0.283-0.439-0.66-0.439-1.061s0.156-0.777,0.439-1.061L9.878,12L4.222,6.343c-0.283-0.284-0.439-0.66-0.439-1.061c0-0.4,0.156-0.777,0.439-1.061c0.284-0.283,0.66-0.439,1.061-0.439c0.401,0,0.777,0.156,1.061,0.439L12,9.878l5.656-5.657c0.284-0.283,0.66-0.439,1.062-0.439c0.4,0,0.776,0.156,1.061,0.439c0.283,0.284,0.439,0.66,0.439,1.061c0,0.401-0.156,0.777-0.439,1.061L14.121,12l5.657,5.657c0.283,0.283,0.439,0.66,0.439,1.061s-0.156,0.777-0.439,1.061C19.494,20.061,19.118,20.217,18.718,20.217L18.718,20.217z",stroke:"none",fill:"90-#999996-#a1a19f-#b8b8b7-#ccc"}]);
(function(A){AJS.InlineDialog=function(T,H,K,I){var R=A.extend(false,AJS.InlineDialog.opts,I);var E;var J;var b;var N=false;var S=false;var Z=false;var a;var P;var B=A('<div id="inline-dialog-'+H+'" class="aui-inline-dialog"><div class="contents"></div><div id="arrow-'+H+'" class="arrow"></div></div>');var G=A("#arrow-"+H,B);var Y=B.find(".contents");Y.css("width",R.width+"px");Y.mouseover(function(c){clearTimeout(J);B.unbind("mouseover")}).mouseout(function(){W()});var V=function(){if(!E){E={popup:B,hide:function(){W(0)},id:H,show:function(){Q()},reset:function(){var r;var g;var p;var h=-7;var k;var f;var q=P.target.offset();var l=parseInt(P.target.css("padding-left"))+parseInt(P.target.css("padding-right"));var n=P.target.width()+l;var d=q.left+n/2;var j=(window.pageYOffset||document.documentElement.scrollTop)+A(window).height();var c=10;function o(u,y,v,x,t,s,w){u.css({left:y,right:v,top:x});if(window.Raphael){if(!u.arrowCanvas){u.arrowCanvas=Raphael("arrow-"+H,16,16)}var z="M0,8L8,0,16,8";if(w){z="M0,8L8,16,16,8"}u.arrowCanvas.path(z).attr({fill:"#fff",stroke:"#bbb"})}G.css({position:"absolute",left:t,right:"auto",top:s})}p=q.top+P.target.height()+R.offsetY;r=q.left+R.offsetX;var e=q.top>B.height();var i=(p+B.height())<j;f=(!i&&e)||(R.onTop&&e);var m=A(window).width()-(r+R.width+c);if(f){p=q.top-B.height()-8;h=B.height()-9;if(AJS.$.browser.msie){h=B.height()-10}}k=d-r;if(R.isRelativeToMouse){if(m<0){g=c;r="auto";k=a.x-(A(window).width()-R.width)}else{r=a.x-20;g="auto";k=a.x-r}}else{if(m<0){g=c;r="auto";k=d-(A(window).width()-R.width)}else{if(R.width<=n/2){k=R.width/2;r=d-R.width/2}}}o(B,r,g,p,k,h,f);B.fadeIn(R.fadeTime,function(){});if(B.shadow){B.shadow.remove()}B.shadow=Raphael.shadow(0,0,Y.width(),Y.height(),{target:B[0]}).hide().fadeIn(R.fadeTime);if(AJS.$.browser.msie){if(A("#inline-dialog-shim-"+H).length==0){A(B).prepend(A('<iframe class = "inline-dialog-shim" id="inline-dialog-shim-'+H+'" frameBorder="0" src="javascript:false;"></iframe>'))}A("#inline-dialog-shim-"+H).css({width:Y.outerWidth(),height:Y.outerHeight()})}}}}return E};var Q=function(){if(B.is(":visible")){return }b=setTimeout(function(){if(!Z||!S){return }A(T).addClass("active");N=true;F();AJS.InlineDialog.current=V();AJS.$(document).trigger("showLayer",["inlineDialog",V()]);V().reset()},R.showDelay)};var W=function(c){S=false;if(N){c=(c==null)?R.hideDelay:c;clearTimeout(J);clearTimeout(b);if(c!=null){J=setTimeout(function(){U();A(T).removeClass("active");B.fadeOut(R.fadeTime,function(){R.hideCallback.call(B[0].popup)});B.shadow.remove();B.shadow=null;B.arrowCanvas.remove();B.arrowCanvas=null;N=false;S=false;AJS.$(document).trigger("hideLayer",["inlineDialog",V()]);AJS.InlineDialog.current=null;if(!R.cacheContent){Z=false;O=false}},c)}}};var X=function(f,c){R.upfrontCallback.call({popup:B,hide:function(){W(0)},id:H,show:function(){Q()}});B.each(function(){if(typeof this.popup!="undefined"){this.popup.hide()}});if(R.closeOthers){AJS.$(".aui-inline-dialog").each(function(){this.popup.hide()})}if(!f){a={x:T.offset().left,y:T.offset().top};P={target:T}}else{a={x:f.pageX,y:f.pageY};P={target:A(f.target)}}if(!N){clearTimeout(b)}S=true;var d=function(){O=false;Z=true;R.initCallback.call({popup:B,hide:function(){W(0)},id:H,show:function(){Q()}});Q()};if(!O){O=true;if(A.isFunction(K)){K(Y,c,d)}else{AJS.$.get(K,function(g,e,h){Y.html(R.responseHandler(g,e,h));Z=true;R.initCallback.call({popup:B,hide:function(){W(0)},id:H,show:function(){Q()}});Q()})}}clearTimeout(J);if(!N){Q()}return false};B[0].popup=V();var O=false;var M=false;var L=function(){if(!M){A(R.container).append(B);M=true}};if(R.onHover){if(R.useLiveEvents){A(T).live("mousemove",function(c){L();X(c,this)}).live("mouseout",function(){W()})}else{A(T).mousemove(function(c){L();X(c,this)}).mouseout(function(){W()})}}else{if(!R.noBind){if(R.useLiveEvents){A(T).live("click",function(c){L();X(c,this);return false}).live("mouseout",function(){W()})}else{A(T).click(function(c){L();X(c,this);return false}).mouseout(function(){W()})}}}var D=false;var C=H+".inline-dialog-check";var F=function(){if(!D){A("body").bind("click."+C,function(d){var c=A(d.target);if(c.closest("#inline-dialog-"+H+" .contents").length===0){W(0)}});D=true}};var U=function(){if(D){A("body").unbind("click."+C)}D=false};B.show=function(c){if(c){c.stopPropagation()}L();X(null,this)};B.hide=function(){W(0)};B.refresh=function(){if(N){V().reset()}};B.getOptions=function(){return R};return B};AJS.InlineDialog.opts={onTop:false,responseHandler:function(C,B,D){return C},closeOthers:true,isRelativeToMouse:false,onHover:false,useLiveEvents:false,noBind:false,fadeTime:100,hideDelay:10000,showDelay:0,width:300,offsetX:0,offsetY:10,container:"body",cacheContent:true,hideCallback:function(){},initCallback:function(){},upfrontCallback:function(){}}})(jQuery);
AJS.warnAboutFirebug=function(B){if(!AJS.Cookie.read("COOKIE_FB_WARNING")&&window.console&&window.console.firebug){if(!B){B="Firebug is known to cause performance problems with Atlassian products. Try disabling it, if you notice any issues."}var A=AJS.$("<div id='firebug-warning'><p>"+B+"</p><a class='close'>Close</a></div>");AJS.$(".close",A).click(function(){A.slideUp("fast");AJS.Cookie.save("COOKIE_FB_WARNING","true")});A.prependTo(AJS.$("body"))}};
AJS.inlineHelp=function(){AJS.$(".icon-inline-help").click(function(){var A=AJS.$(this).siblings(".field-help");if(A.hasClass("hidden")){A.removeClass("hidden")}else{A.addClass("hidden")}})};
(function(){AJS.messages={setup:function(){AJS.messages.createMessage("generic");AJS.messages.createMessage("error");AJS.messages.createMessage("warning");AJS.messages.createMessage("info");AJS.messages.createMessage("success");AJS.messages.createMessage("hint");AJS.messages.makeCloseable()},makeCloseable:function(A){AJS.$(A||"div.aui-message.closeable").each(function(){var C=AJS.$(this),B=AJS.$('<span class="aui-icon icon-close"></span>').click(function(){C.closeMessage()});C.append(B);B.each(AJS.icons.addIcon.init)})},template:'<div class="aui-message {type} {closeable} {shadowed}"><p class="title"><span class="aui-icon icon-{type}"></span><strong>{title}</strong></p>{body}</div><!-- .aui-message -->',createMessage:function(A){AJS.messages[A]=function(B,C){if(!C){C=B;B="#aui-message-bar"}C.closeable=(C.closeable==false)?false:true;C.shadowed=(C.shadowed==false)?false:true;AJS.$(B).append(AJS.template(this.template).fill({type:A,closeable:C.closeable?"closeable":"",shadowed:C.shadowed?"shadowed":"",title:C.title||"","body:html":C.body||""})).find(".svg-icon:empty").each(AJS.icons.addIcon.init);C.closeable&&AJS.messages.makeCloseable(AJS.$(B).find("div.aui-message.closeable"))}}};AJS.$.fn.closeMessage=function(){var A=AJS.$(this);if(A.hasClass("aui-message","closeable")){A.trigger("messageClose",[this]).remove()}};AJS.$(function(){AJS.messages.setup()})})();
(function(){AJS.tables=AJS.tables||{};AJS.tables.rowStriping=function(){var B=AJS.$("table.aui");for(var A=0,C=B.length;A<C;A++){AJS.$("tbody tr:odd",B[A]).addClass("zebra")}};AJS.$(AJS.tables.rowStriping)})();
(function(){var B,E,C=/#.*/,D="active-tab",A="active-pane";AJS.tabs={setup:function(){B=AJS.$("div.aui-tabs");for(var F=0,G=B.length;F<G;F++){E=AJS.$("ul.tabs-menu",B[F]);AJS.$("a",E).click(function(H){AJS.tabs.change(AJS.$(this),H);H&&H.preventDefault()})}},change:function(G,H){var F=AJS.$(G.attr("href").match(C)[0]);F.addClass(A).siblings().removeClass(A);G.parent("li.menu-item").addClass(D).siblings().removeClass(D);G.trigger("tabSelect",{tab:G,pane:F})}};AJS.$(AJS.tabs.setup)})();
AJS.template=(function(G){var J=/\{([^\}]+)\}/g,D=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,H=/([^\\])'/g,F=function(O,N,P,L){var M=P;N.replace(D,function(S,R,Q,U,T){R=R||U;if(M){if(R+":html" in M){M=M[R+":html"];L=true}else{if(R in M){M=M[R]}}if(T&&typeof M=="function"){M=M()}}});if(M==null||M==P){M=O}M=String(M);if(!L){M=E.escape(M)}return M},B=function(L){this.template=this.template.replace(J,function(N,M){return F(N,M,L,true)});return this},K=function(L){this.template=this.template.replace(J,function(N,M){return F(N,M,L)});return this},C=function(){return this.template};var E=function(M){function L(){return L.template}L.template=String(M);L.toString=L.valueOf=C;L.fill=K;L.fillHtml=B;return L},A={},I=[];E.load=function(L){L=String(L);if(!A.hasOwnProperty(L)){I.length>=1000&&delete A[I.shift()];I.push(L);A[L]=G("script[title='"+L.replace(H,"$1\\'")+"']")[0].text}return this(A[L])};E.escape=AJS.escapeHtml;return E})(window.jQuery);
AJS.whenIType=function(D){var A,E=function(F){F=F.toString();jQuery(document).bind("keypress",F,function(){if(!AJS.popup.current&&A){A()}});jQuery(document).bind("keypress keyup",F,function(G){G.preventDefault()})},B=function(F){var H=jQuery(F),I=H.attr("title")||"",G=D.split("");if(H.data("kbShortcutAppended")){C(H,G,I);return }I+=" ( "+AJS.params.keyType+" '"+G.shift()+"'";jQuery.each(G,function(){I+=" "+AJS.params.keyThen+" '"+this+"'"});I+=" )";H.attr("title",I);H.data("kbShortcutAppended",true)},C=function(G,F,H){H=H.replace(/\)$/," OR ");H+="'"+F.shift()+"'";jQuery.each(F,function(){H+=" "+AJS.params.keyThen+" '"+this+"'"});H+=" )";G.attr("title",H)};E(D);return{moveToNextItem:function(F){A=function(){var H,G=jQuery(F),I=jQuery(F+".focused");if(!A.blurHandler){jQuery(document).one("keypress",function(J){if(J.keyCode===jQuery.ui.keyCode.ESCAPE&&I){I.removeClass("focused")}})}if(I.length===0){I=jQuery(F).eq(0)}else{I.removeClass("focused");H=jQuery.inArray(I.get(0),G);if(H<G.length-1){H=H+1;I=G.eq(H)}else{I.removeClass("focused");I=jQuery(F).eq(0)}}if(I&&I.length>0){I.addClass("focused");I.moveTo();I.find("a:first").focus()}}},moveToPrevItem:function(F){A=function(){var H,G=jQuery(F),I=jQuery(F+".focused");if(!A.blurHandler){jQuery(document).one("keypress",function(J){if(J.keyCode===jQuery.ui.keyCode.ESCAPE&&I){I.removeClass("focused")}})}if(I.length===0){I=jQuery(F+":last")}else{I.removeClass("focused");H=jQuery.inArray(I.get(0),G);if(H>0){H=H-1;I=G.eq(H)}else{I.removeClass("focused");I=jQuery(F+":last")}}if(I&&I.length>0){I.addClass("focused");I.moveTo();I.find("a:first").focus()}}},click:function(F){B(F);A=function(){var G=jQuery(F);if(G.length>0){G.click()}}},goTo:function(F){A=function(){window.location.href=F}},followLink:function(F){B(F);A=function(){var G=jQuery(F);if(G.length>0&&G.attr("nodeName").toLowerCase()==="a"){window.location.href=G.attr("href")}}},execute:function(F){A=function(){F()}},moveToAndClick:function(F){B(F);A=function(){var G=jQuery(F);if(G.length>0){G.click();G.moveTo()}}},moveToAndFocus:function(F){B(F);A=function(){var G=jQuery(F);if(G.length>0){G.focus();G.moveTo()}}},or:function(F){E(F);return this}}};jQuery(document).bind("iframeAppended",function(B,A){jQuery(A).load(function(){var C=jQuery(A).contents();C.bind("keyup keydown keypress",function(D){if(jQuery.browser.safari&&D.type==="keypress"){return }if(!jQuery(D.target).is(":input")){jQuery(document).trigger(D)}})})});AJS.whenIType.fromJSON=function(A){if(A){jQuery.each(A,function(C,D){var B=D.op,E=D.param;jQuery.each(D.keys,function(){if(B==="execute"){E=new Function(E)}AJS.whenIType(this)[B](E)})})}};
AJS.toInit(function(D){if(D.browser.msie){var F=D(".aui-toolbar .toolbar-group");F.each(function(G,H){D(H).children(":first").addClass("first");D(H).children(":last").addClass("last")});if(parseInt(D.browser.version,10)==7){function B(){D(".aui-toolbar button").closest(".toolbar-item").addClass("contains-button")}function C(){D(".aui-toolbar .toolbar-split-right").each(function(J,M){var K=D(M),N=K.closest(".aui-toolbar"),G=N.find(".toolbar-split-left"),I=N.data("leftWidth"),L=N.data("rightWidth");if(!I){I=G.outerWidth();N.data("leftWidth",I)}if(!L){L=0;D(".toolbar-item",M).each(function(P,Q){L+=D(Q).outerWidth()});N.data("rightWidth",L)}var O=N.width(),H=O-I;if(O>L&&L>H){G.addClass("force-split")}else{G.removeClass("force-split")}})}function E(){F.each(function(G,H){var I=0;D(H).children(".toolbar-item").each(function(K,J){I+=D(this).outerWidth()});D(this).width(I)})}E();B();var A=false;D(window).resize(function(){if(A!==false){clearTimeout(A)}A=setTimeout(C,200)})}}});
(function(A){A.fn.autocomplete=function(B,C,K){K=typeof C=="function"?C:(typeof K=="function"?K:function(){});C=!isNaN(Number(C))?C:3;var J=this;J[0].lastSelectedValue=J.val();var H=A(document.createElement("ol"));var D=J.offset();var G=parseInt(A("body").css("border-left-width"));H.css({position:"absolute",width:J.outerWidth()-2+"px"});H.addClass("autocompleter");this.after(H);H.css({margin:(Math.abs(this.offset().left-H.offset().left)>=Math.abs(this.offset().top-H.offset().top))?J.outerHeight()+"px 0 0 -"+J.outerWidth()+"px":"-1px 0 0 0"});H.hide();function F(){H.hide();A(document).unbind("click",F)}function E(){var L=J.val();if(L.length>=C&&L!=J[0].lastQuery&&L!=J[0].lastSelectedValue){A.getJSON(B+encodeURI(L),function(P){var R="";L=L.toLowerCase();var U=L.split(" ");for(var Q=0,W=P.length;Q<W;Q++){var S=false;if(P[Q].fullName&&P[Q].username){var V=P[Q].fullName+" ("+P[Q].username+")";var M=P[Q].fullName.split(" ");for(var O=0,T=M.length;O<T;O++){for(var N=0;N<U.length;N++){if(M[O].toLowerCase().indexOf(U[N])==0){M[O]="<strong>"+M[O].substring(0,U[N].length)+"</strong>"+M[O].substring(U[N].length);S=true}}}if(!S){for(var N=0;N<U.length;N++){if(P[Q].username&&P[Q].username.toLowerCase().indexOf(U[N])==0){P[Q].username="<strong>"+P[Q].username.substring(0,U[N].length)+"</strong>"+P[Q].username.substring(U[N].length)}}}P[Q].fullName=M.join(" ");R+="<li><span>"+P[Q].fullName+"</span> <span class='username-in-autocomplete-list'>("+P[Q].username+")</span><i class='fullDetails'>"+V+"</i><i class='username'>"+P[Q].username+"</i><i class='fullName'>"+P[Q].fullName+"</i></li>"}if(P[Q].status){R+="<li>"+P[Q].status+"</li>"}}H.html(R);A("li",H).click(function(Y){Y.stopPropagation();var X=A("i.fullDetails",this).html();I(X)}).hover(function(){A(".focused").removeClass("focused");A(this).addClass("focused")},function(){});A(document).click(F);H.show()});J[0].lastQuery=L}else{if(L.length<C){F()}}}J.keydown(function(M){var L=this;if(this.timer){clearTimeout(this.timer)}var N={"40":function(){var O=A(".focused").removeClass("focused").next();if(O.length){O.addClass("focused")}else{A(".autocompleter li:first").addClass("focused")}},"38":function(){var O=A(".focused").removeClass("focused").prev();if(O.length){O.addClass("focused")}else{A("li:last",H).addClass("focused")}},"27":function(){F()},"13":function(){var O=A(".focused i.fullDetails").html();I(O)},"9":function(){this[13]();setTimeout(function(){L.focus()},0)}};if(H.css("display")!="none"&&M.keyCode in N){M.preventDefault();N[M.keyCode]()}this.timer=setTimeout(E,300)});function I(N){var M=J.val();if(N){J[0].lastSelectedValue=N;J.val(N);var L={input:J,originalValue:M,value:N,fullName:A(".focused i.fullName").text(),username:A(".focused i.username").text()};K(L);F()}}}})(jQuery);
jQuery.fn.isDirty=function(){var B,A=[];window.onbeforeunload=function(){var C=window.onbeforeunload;if(B!==false){jQuery.each(A,function(){if(this.initVal!==AJS.$(this).val()){B=true;return false}})}if(B){window.onbeforeunload=null;window.setTimeout(function(){jQuery(document).bind("mousemove",function(){window.onbeforeunload=C;jQuery(document).unbind("mousemove",arguments.callee)})},1000);B=void (0);return AJS.params.dirtyMessage||""}};return function(D){if(this.length===0){return }function C(F){var E=jQuery(this);jQuery.fn.isDirty.fieldInFocus=E;if(jQuery.inArray(this,A)===-1){this.initVal=E.val();A.push(this);E.die(F.type,C)}}jQuery(":not(:input)").live("click",function(){delete jQuery.fn.isDirty.fieldInFocus});jQuery(":input[type != hidden]",this.selector).bind("keydown",C).bind("keypress",C).bind("click",C);jQuery(D.ignoreUnloadFromElems).live("mousedown",function(){B=false});this.each(function(){this.onsubmit=function(E){return function(){B=false;if(E){return E.apply(this,arguments)}}}(this.onsubmit);AJS.$(this).submit(function(){B=false})});return this}}();
(function(A){A.fn.progressBar=function(I,L){var C=this;var F={height:"1em",showPercentage:true};var B=A.extend(F,L);var J=C.attr("id")+"-incomplete-bar";var D=C.attr("id")+"-complete-bar";var K=C.attr("id")+"-percent-complete-text";if(A("#"+J).length==0){var E=A(document.createElement("div"));E.attr("id",J);E.css({width:"90%",border:"solid 1px #ccc","float":"left","margin-right":"0.5em"});E.addClass("progress-background-color");var G=A(document.createElement("div"));G.attr("id",D);G.addClass("progress-fill-color");G.css({height:B.height,width:I+"%"});var H=A(document.createElement("span"));H.attr("id",K);H.addClass("percent-complete-text");H.html(I+"%");E.append(G);C.append(E);if(B.showPercentage){C.append(H)}}else{A("#"+D).css("width",I+"%");A("#"+K).html(I+"%")}}})(jQuery);
(function(A){if(document.selection){var B=function(C){return C.replace(/\u000D/g,"")};A.fn.selection=function(F){var E=this[0];this.focus();if(!E){return false}if(F==null){return document.selection.createRange().text}else{var D=E.scrollTop;var C=document.selection.createRange();C.text=F;C.select();E.focus();E.scrollTop=D}};A.fn.selectionRange=function(C,F){var G=this[0];this.focus();var I=document.selection.createRange();if(C==null){var K=this.val(),J=K.length,E=I.duplicate();E.moveToElementText(G);E.setEndPoint("StartToEnd",I);var D=J-B(E.text).length;E.setEndPoint("StartToStart",I);var H=J-B(E.text).length;if(D!=H&&K.charAt(D+1)=="\n"){D+=1}return{end:D,start:H,text:K.substring(H,D),textBefore:K.substring(0,H),textAfter:K.substring(D)}}else{I.moveToElementText(G);I.collapse(true);I.moveStart("character",C);I.moveEnd("character",F-C);I.select()}}}else{A.fn.selection=function(E){var D=this[0];if(!D){return false}if(E==null){if(D.setSelectionRange){return D.value.substring(D.selectionStart,D.selectionEnd)}else{return false}}else{var C=D.scrollTop;if(!!D.setSelectionRange){var F=D.selectionStart;D.value=D.value.substring(0,F)+E+D.value.substring(D.selectionEnd);D.selectionStart=F;D.selectionEnd=F+E.length}D.focus();D.scrollTop=C}};A.fn.selectionRange=function(F,C){if(F==null){var D={start:this[0].selectionStart,end:this[0].selectionEnd};var E=this.val();D.text=E.substring(D.start,D.end);D.textBefore=E.substring(0,D.start);D.textAfter=E.substring(D.end);return D}else{this[0].selectionStart=F;this[0].selectionEnd=C}}}A.fn.wrapSelection=function(C,D){this.selection(C+this.selection()+(D||""))}})(jQuery);
jQuery.fn.throbber=function(A){return function(){var C=[],B={isLatentThreshold:100,minThrobberDisplay:200,loadingClass:"loading"};A(document).ajaxComplete(function(E,D){A(C).each(function(F){if(D===this.get(0)){this.hideThrobber();C.splice(F,1)}})});return function(F){var E,G,D=function(I,H){D.t=setTimeout(function(){clearTimeout(D.t);D.t=undefined;I()},H)};F=A.extend(B,F||{});if(!F.target){return this}G=jQuery(F.target);C.push(A.extend(this,{showThrobber:function(){D(function(){if(!E){G.addClass(F.loadingClass);D(function(){if(E){E()}},F.minThrobberDisplay)}},F.isLatentThreshold)},hideThrobber:function(){E=function(){G.removeClass(F.loadingClass);if(F.end){F.end()}};if(!D.t){E()}}}));this.showThrobber();return this}}()}(jQuery);
AJS.copyObject=function(object,deep){var copiedObject={};AJS.$.each(object,function(name,property){if(typeof property!=="object"||property===null||property instanceof AJS.$){copiedObject[name]=property}else{if(deep!==false){copiedObject[name]=AJS.copyObject(property,deep)}}});return copiedObject};
var JIRA=window.JIRA||{};AJS.namespace=function(namespace,context,value){var names=namespace.split(".");context=context||window;for(var i=0,n=names.length-1;i<n;i++){var x=context[names[i]];context=(x!=null)?x:context[names[i]]={}}return context[names[i]]=value||{}};AJS.canAccessIframe=function(iframe){var $iframe=AJS.$(iframe);return !/^(http|https):\/\//.test($iframe.attr("src"))||(AJS.params.baseURL&&(AJS.$.trim($iframe.attr("src")).indexOf(AJS.params.baseURL)===0))};(function(){function preventScrolling(e){var keyCode=e.keyCode,keys=AJS.$.ui.keyCode;if(!jQuery(e.target).is("textarea, :text, select, :radio")&&(keyCode===keys.DOWN||keyCode===keys.UP||keyCode===keys.LEFT||keyCode===keys.RIGHT)){e.preventDefault()}}AJS.disableKeyboardScrolling=function(){AJS.$(document).bind("keypress keydown",preventScrolling)};AJS.enableKeyboardScrolling=function(){AJS.$(document).unbind("keypress keydown",preventScrolling)}})();AJS.$.namespace=function(namespace){return AJS.namespace(namespace)};jQuery.noConflict();jQuery.ajaxSettings.traditional=true;contextPath=typeof contextPath==="undefined"?"":contextPath;AJS.LEFT="left";AJS.RIGHT="right";AJS.ACTIVE_CLASS="active";AJS.BOX_SHADOW_CLASS="box-shadow";AJS.LOADING_CLASS="loading";AJS.INTELLIGENT_GUESS="Intelligent Guess";(function(){var SPECIAL_CHARS=/[.*+?|^$()[\]{\\]/g;RegExp.escape=function(str){return str.replace(SPECIAL_CHARS,"\\$&")}})();(function($){$.readData=function(s){var r={},n="";$(s).children().each(function(i){if(i%2){r[n]=jQuery.trim($(this).text())}else{n=jQuery.trim($(this).text())}}).remove();$(s).remove();return r}})(jQuery);String.prototype.escapejQuerySelector=function(){return this.replace(/([:.])/g,"\\$1")};AJS.trigger=function(event,target){event=new jQuery.Event(event);jQuery(target||window.top.document).trigger(event);return !event.isDefaultPrevented()};jQuery.aop.after({target:jQuery,method:"append"},function(elem){var iframes;if(elem.attr("tagName")==="iframe"&&AJS.canAccessIframe(elem)){if(!elem.data("iframeAppendedFired")){elem.data("iframeAppendedFired",true);jQuery(document).trigger("iframeAppended",elem)}}iframes=jQuery("iframe",elem);if(iframes.length>0){jQuery.each(iframes,function(i){var iframe=iframes.eq(i);if(!iframe.data("iframeAppendedFired")&&AJS.canAccessIframe(iframe)){iframe.data("iframeAppendedFired",true);iframe.trigger("iframeAppended",iframe)}})}return elem});AJS.isSelenium=function(){return window.name.toLowerCase().indexOf("selenium")>=0};AJS.reloadViaWindowLocation=function(url){var windowReload=function(){window.location.reload()};url=url||window.location.href;if(AJS.isSelenium()){windowReload()}else{var makeHashUrlsUnique=function(url){var MAGIC_PARAM="jwupdated";var hashIndex=url.indexOf("#");if(hashIndex==-1){return url}var secondsSinceMidnight=function(){var now=new Date();var midnight=new Date(now.getFullYear(),now.getMonth(),now.getDate(),0,0,0,0);var secs=(now.getTime()-midnight.getTime())/1000;return Math.max(Math.floor(secs),1)};var firstQuestionMark=url.indexOf("?");var magicParamValue=MAGIC_PARAM+"="+secondsSinceMidnight();if(firstQuestionMark==-1){url=url.replace("#","?"+magicParamValue+"#")}else{if(url.indexOf(MAGIC_PARAM+"=")!=-1){url=url.replace(/(jwupdated=[0-9]+)/,magicParamValue)}else{url=url.replace("?","?"+magicParamValue+"&")}}return url};url=makeHashUrlsUnique(url);if(jQuery.browser.webkit&&parseInt(jQuery.browser.version)<533){window.location=url}else{window.location.replace(url)}}};AJS.extractBodyFromResponse=function(text){var fragment=text.match(/<body[^>]*>([\S\s]*)<\/body[^>]*>/);if(fragment&&fragment.length>0){return fragment[1]}return text};AJS.escapeHTML=AJS.escapeHtml;function tryIt(f,defaultVal){try{return f()}catch(ex){return defaultVal}}function begetObject(obj){var f=function(){};f.prototype=obj;return new f}function submitOnEnter(e){if(e.keyCode==13&&e.target.form&&!e.ctrlKey&&!e.shiftKey){jQuery(e.target.form).submit();return false}return true}function submitOnCtrlEnter(e){if(e.ctrlKey&&e.target.form&&(e.keyCode==13||e.keyCode==10)){jQuery(e.target.form).submit();return false}return true}function getMultiSelectValues(selectObject){var selectedValues="";for(var i=0;i<selectObject.length;i++){if(selectObject.options[i].selected){if(selectObject.options[i].value&&selectObject.options[i].value.length>0){selectedValues=selectedValues+" "+selectObject.options[i].value}}}return selectedValues}function getMultiSelectValuesAsArray(selectObject){var selectedValues=new Array();for(var i=0;i<selectObject.length;i++){if(selectObject.options[i].selected){if(selectObject.options[i].value&&selectObject.options[i].value.length>0){selectedValues[selectedValues.length]=selectObject.options[i].value}}}return selectedValues}function arrayContains(array,value){for(var i=0;i<array.length;i++){if(array[i]==value){return true}}return false}function addClassName(elementId,classNameToAdd){var elem=document.getElementById(elementId);if(elem){elem.className=elem.className+" "+classNameToAdd}}function removeClassName(elementId,classNameToRemove){var elem=document.getElementById(elementId);if(elem){elem.className=(" "+elem.className+" ").replace(" "+classNameToRemove+" "," ")}}function getEscapedFieldValue(id){var e=document.getElementById(id);if(e.value){return id+"="+encodeURIComponent(e.value)}else{return""}}function getEscapedFieldValues(ids){var s="";for(var i=0;i<ids.length;i++){s=s+"&"+getEscapedFieldValue(ids[i])}return s}var GuiPrefs={toggleVisibility:function(elementId){var elem=document.getElementById(elementId);if(elem){if(readFromConglomerateCookie("jira.conglomerate.cookie",elementId,"1")=="1"){elem.style.display="none";removeClassName(elementId+"header","headerOpened");addClassName(elementId+"header","headerClosed");saveToConglomerateCookie("jira.conglomerate.cookie",elementId,"0")}else{elem.style.display="";removeClassName(elementId+"header","headerClosed");addClassName(elementId+"header","headerOpened");eraseFromConglomerateCookie("jira.conglomerate.cookie",elementId)}}}};function toggle(elementId){GuiPrefs.toggleVisibility(elementId)}function toggleDivsWithCookie(elementShowId,elementHideId){var elementShow=document.getElementById(elementShowId);var elementHide=document.getElementById(elementHideId);if(elementShow.style.display=="none"){elementHide.style.display="none";elementShow.style.display="block";saveToConglomerateCookie("jira.viewissue.cong.cookie",elementShowId,"1");saveToConglomerateCookie("jira.viewissue.cong.cookie",elementHideId,"0")}else{elementShow.style.display="none";elementHide.style.display="block";saveToConglomerateCookie("jira.viewissue.cong.cookie",elementHideId,"1");saveToConglomerateCookie("jira.viewissue.cong.cookie",elementShowId,"0")}}function restoreDivFromCookie(elementId,cookieName,defaultValue){if(defaultValue==null){defaultValue="1"}var elem=document.getElementById(elementId);if(elem){if(readFromConglomerateCookie(cookieName,elementId,defaultValue)!="1"){elem.style.display="none";removeClassName(elementId+"header","headerOpened");addClassName(elementId+"header","headerClosed")}else{elem.style.display="";removeClassName(elementId+"header","headerClosed");addClassName(elementId+"header","headerOpened")}}}function restore(elementId){restoreDivFromCookie(elementId,"jira.conglomerate.cookie","1")}function saveToConglomerateCookie(cookieName,name,value){var cookieValue=getCookieValue(cookieName);cookieValue=addOrAppendToValue(name,value,cookieValue);saveCookie(cookieName,cookieValue,365)}function readFromConglomerateCookie(cookieName,name,defaultValue){var cookieValue=getCookieValue(cookieName);var value=getValueFromCongolmerate(name,cookieValue);if(value!=null){return value}return defaultValue}function eraseFromConglomerateCookie(cookieName,name){saveToConglomerateCookie(cookieName,name,"")}function getValueFromCongolmerate(name,cookieValue){if(cookieValue==null){cookieValue=""}var eq=name+"=";var cookieParts=cookieValue.split("|");for(var i=0;i<cookieParts.length;i++){var cp=cookieParts[i];while(cp.charAt(0)==" "){cp=cp.substring(1,cp.length)}if(cp.indexOf(name)==0){return cp.substring(eq.length,cp.length)}}return null}function addOrAppendToValue(name,value,cookieValue){var newCookieValue="";if(cookieValue==null){cookieValue=""}var cookieParts=cookieValue.split("|");for(var i=0;i<cookieParts.length;i++){var cp=cookieParts[i];if(cp!=""){while(cp.charAt(0)==" "){cp=cp.substring(1,cp.length)}if(cp.indexOf(name)!=0){newCookieValue+=cp+"|"}}}if(value!=null&&value!=""){var pair=name+"="+value;if((newCookieValue.length+pair.length)<4020){newCookieValue+=pair}}return newCookieValue}function getCookieValue(name){var eq=name+"=";var ca=document.cookie.split(";");for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==" "){c=c.substring(1,c.length)}if(c.indexOf(eq)==0){return unescape(c.substring(eq.length,c.length))}}return null}function saveCookie(name,value,days){if(typeof contextPath==="undefined"){return }var path=contextPath;if(!path){path="/"}var ex;if(days){var d=new Date();d.setTime(d.getTime()+(days*24*60*60*1000));ex="; expires="+d.toGMTString()}else{ex=""}document.cookie=name+"="+escape(value)+ex+";path="+path}function readCookie(name,defaultValue){var cookieVal=getCookieValue(name);if(cookieVal!=null){return cookieVal}if(defaultValue){saveCookie(name,defaultValue,365);return defaultValue}else{return null}}function eraseCookie(name){saveCookie(name,"",-1)}function recolourSimpleTableRows(tableId){recolourTableRows(tableId,"rowNormal","rowAlternate",tableId+"_empty")}function recolourTableRows(tableId,rowNormal,rowAlternate,emptyTableId){var tbl=document.getElementById(tableId);var emptyTable=document.getElementById(emptyTableId);var alternate=false;var rowsFound=0;var rows=tbl.rows;var firstVisibleRow=null;var lastVisibleRow=null;if(AJS.$(tbl).hasClass("aui")){rowNormal="";rowAlternate="zebra"}for(var i=1;i<rows.length;i++){var row=rows[i];if(row.style.display!="none"){if(!alternate){row.className=rowNormal}else{row.className=rowAlternate}rowsFound++;alternate=!alternate}if(row.style.display!="none"){if(firstVisibleRow==null){firstVisibleRow=row}lastVisibleRow=row}}if(firstVisibleRow!=null){firstVisibleRow.className=firstVisibleRow.className+" first-row"}if(lastVisibleRow!=null){lastVisibleRow.className=lastVisibleRow.className+" last-row"}if(emptyTable){if(rowsFound==0){tbl.style.display="none";emptyTable.style.display=""}else{tbl.style.display="";emptyTable.style.display="none"}}}function htmlEscape(str){var divE=document.createElement("div");divE.appendChild(document.createTextNode(str));return divE.innerHTML}function atl_token(){return jQuery("#atlassian-token").attr("content")}function openDateRangePicker(formName,previousFieldName,nextFieldName,fieldId){var previousFieldValue=document.forms[formName].elements[previousFieldName].value;var nextFieldValue=document.forms[formName].elements[nextFieldName].value;var url=contextPath+"/secure/popups/DateRangePicker.jspa?";url+="formName="+formName+"&";url+="previousFieldName="+escape(previousFieldName)+"&";url+="nextFieldName="+escape(nextFieldName)+"&";url+="previousFieldValue="+escape(previousFieldValue)+"&";url+="nextFieldValue="+escape(nextFieldValue)+"&";url+="fieldId="+escape(fieldId);var vWinUsers=window.open(url,"DateRangePopup","status=no,resizable=yes,top=100,left=200,width=580,height=400,scrollbars=yes");vWinUsers.opener=self;vWinUsers.focus()}function show_calendar2(formName,fieldName){var form=document.forms[formName];var element=form.elements[fieldName];var vWinCal=window.open(contextPath+"/secure/popups/Calendar.jspa?form="+formName+"&field="+fieldName+"&value="+escape(element.value)+"&decorator=none","Calendar","width=230,height=170,status=no,resizable=yes,top=220,left=200");vWinCal.opener=self;vWinCal.focus()};
(function(){begetObject=function(obj){var f=function(){};f.prototype=obj;return new f()};var initializing=false,fnTest=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(){var prop;var _super=this.prototype;if(arguments.length>1){var interfaces=AJS.$.makeArray(arguments);prop=interfaces.pop();var completeInterface;AJS.$.each(interfaces,function(i,inter){if(completeInterface){completeInterface=completeInterface.extend(inter)}else{completeInterface=inter}});return completeInterface.extend(this.prototype).extend(prop)}else{prop=arguments[0]}initializing=true;var prototype=new this();initializing=false;for(var name in prop){if(prototype[name]=typeof prop[name]=="function"&&typeof _super[name]=="function"&&fnTest.test(prop[name])){prototype[name]=(function(name,fn){return function(){var tmp=this._super;this._super=_super[name];var ret=fn.apply(this,arguments);this._super=tmp;return ret}})(name,prop[name])}else{if(typeof _super[name]==="object"){var newObj=begetObject(prop[name]);AJS.$.each(_super[name],function(name,obj){if(!newObj[name]){newObj[name]=obj}else{if(typeof newObj[name]==="object"){var newSubObj=begetObject(newObj[name]);AJS.$.each(obj,function(subName,subObj){if(!newSubObj[subName]){newSubObj[subName]=subObj}});newObj[name]=newSubObj}}});prototype[name]=newObj}else{prototype[name]=prop[name]}}}function Class(){if(!initializing&&this.init){this.init.apply(this,arguments)}}Class.prototype=prototype;Class.constructor=Class;Class.extend=arguments.callee;return Class}})();
AJS.Control=Class.extend({INVALID:"INVALID",_throwReadOnlyError:function(property){new Error(this.CLASS_SIGNATURE+": Sorry ["+property+"] is a read-only property")},_assignEvents:function(group,$target){this._unassignEvents(group,$target);if(typeof $target==="string"){for(var eventType in this._events[group]){AJS.$(document).delegate($target,eventType,this._getDispatcher(group,eventType))}}else{$target=jQuery($target);for(eventType in this._events[group]){$target.bind(eventType,this._getDispatcher(group,eventType))}}},_unassignEvents:function(group,$target){if(typeof $target==="string"){for(var eventType in this._events[group]){AJS.$(document).undelegate($target,eventType,this._getDispatcher(group,eventType))}}else{$target=jQuery($target);for(eventType in this._events[group]){$target.unbind(eventType,this._getDispatcher(group,eventType))}}},_getDispatcher:function(group,eventType){var ns=group+"/"+eventType;if(!this._dispatchers){this._dispatchers={}}if(!this._dispatchers[ns]){var handler=this._events[group][eventType];var instance=this;this._dispatchers[ns]=function(event){return handler.call(instance,event,AJS.$(this))}}return this._dispatchers[ns]},_isValidInput:function(){return true},_handleKeyEvent:function(event){if(this._isValidInput(event)){if(this.keys[event.key]){this.keys[event.key].call(this,event)}else{if(this.onEdit&&(event.type==="aui:keypress"||event.key==="Backspace"||event.key==="Del")){this.onEdit(event)}}}},getCustomEventName:function(methodName){return(this.CLASS_SIGNATURE||"")+"_"+methodName},_getCustomEventArgs:function(){return[this]},trigger:function(event){return AJS.trigger(event,this)},_supportsBoxShadow:function(){var s=document.body.style;return s.WebkitBoxShadow!==undefined||s.MozBoxShadow!==undefined||s.boxShadow!==undefined},_setOptions:function(options){var element,optionsFromDOM;options=options||{};if(options instanceof AJS.$||typeof options==="string"||(typeof options==="object"&&options.nodeName)){options={element:options}}element=AJS.$(options.element);optionsFromDOM=element.getOptionsFromAttributes();this.options=AJS.$.extend(true,this._getDefaultOptions(options),optionsFromDOM,options);if(element.length===0){return this.INVALID}return undefined},getCaret:function(node){var startIndex=node.selectionStart;if(startIndex>=0){return(node.selectionEnd>startIndex)?-1:startIndex}if(document.selection){var textRange1=document.selection.createRange();if(textRange1.text.length===0){var textRange2=textRange1.duplicate();textRange2.moveToElementText(node);textRange2.setEndPoint("EndToStart",textRange1);return textRange2.text.length}}return -1},_render:function(){var i,name=arguments[0],args=[];for(i=1;i<arguments.length;i++){args.push(arguments[i])}return this._renders[name].apply(this,args)}});
AJS.Descriptor=Class.extend({init:function(properties){if(this._validate(properties)){this.properties=AJS.$.extend(this._getDefaultOptions(),properties)}},allProperties:function(){return this.properties},_validate:function(properties){if(this.REQUIRED_PROPERTIES){AJS.$.each(this.REQUIRED_PROPERTIES,function(name){if(typeof properties[name]==="undefined"){throw new Error("AJS.Descriptor: expected property ["+name+"] but was undefined")}})}return true}});
JIRA.Keyboard={};(function($){var _keyCodeToEnum={},_enumToKeyCode={},_keyCodeToIsAscii={};var SpecialKey=JIRA.Keyboard.SpecialKey={BACKSPACE:specialKey("backspace",8,true),TAB:specialKey("tab",9,true),RETURN:specialKey("return",13,true),SHIFT:specialKey("shift",16),CTRL:specialKey("ctrl",17),ALT:specialKey("alt",18),PAUSE:specialKey("pause",19),CAPS_LOCK:specialKey("capslock",20),ESC:specialKey("esc",27,true),SPACE:specialKey("space",32,true),PAGE_UP:specialKey("pageup",33),PAGE_DOWN:specialKey("pagedown",34),END:specialKey("end",35),HOME:specialKey("home",36),LEFT:specialKey("left",37),UP:specialKey("up",38),RIGHT:specialKey("right",39),DOWN:specialKey("down",40),INSERT:specialKey("insert",45),DELETE:specialKey("del",46),F1:specialKey("f1",112),F2:specialKey("f2",113),F3:specialKey("f3",114),F4:specialKey("f4",115),F5:specialKey("f5",116),F6:specialKey("f6",117),F7:specialKey("f7",118),F8:specialKey("f8",119),F9:specialKey("f9",120),F10:specialKey("f10",121),F11:specialKey("f11",122),F12:specialKey("f12",123),NUMLOCK:specialKey("numlock",144),SCROLL:specialKey("scroll",145),META:specialKey("meta",224)};function specialKey(name,keyCode,isAscii){_keyCodeToEnum[keyCode]=name;_enumToKeyCode[name]=keyCode;if(isAscii){_keyCodeToIsAscii[keyCode]=true}return name}SpecialKey.eventType=function(){return $.browser.mozilla?"keypress":"keydown"};SpecialKey.fromKeyCode=function(keyCode){return _keyCodeToEnum[keyCode]};SpecialKey.toKeyCode=function(specialKey){return _enumToKeyCode[specialKey]};SpecialKey.isAscii=function(keyCode){return !!_keyCodeToIsAscii[keyCode]};SpecialKey.isSpecialKey=function(keyName){return !!SpecialKey.toKeyCode(keyName)};function originalEvent(e){return e.originalEvent||e}JIRA.Keyboard.characterEntered=function(keypressEvent){var e=originalEvent(keypressEvent);if(e.type==="keypress"){var characterCode=characterCodeForKeypress(e);if(characterCode!==null&&(!SpecialKey.isAscii(characterCode)||SpecialKey.fromKeyCode(characterCode)===SpecialKey.SPACE)){return String.fromCharCode(characterCode)}}return undefined};function characterCodeForKeypress(keypressEvent){var e=originalEvent(keypressEvent);if(e.which==null){return e.keyCode}else{if(e.which!=0&&e.charCode!=0){return e.which}else{return null}}}JIRA.Keyboard.specialKeyEntered=function(e){e=originalEvent(e);if($.browser.mozilla){if(e.type==="keypress"){var characterCode=characterCodeForKeypress(e);if(characterCode===null){return SpecialKey.fromKeyCode(e.keyCode)}else{if(SpecialKey.isAscii(characterCode)){return SpecialKey.fromKeyCode(characterCode)}}}}else{if(e.type!=="keypress"){return SpecialKey.fromKeyCode(e.keyCode)}}return undefined};function keyEntered(e){e=originalEvent(e);var special=JIRA.Keyboard.specialKeyEntered(e);if(special){return special}else{if($.browser.mozilla){if(e.type==="keypress"){var characterCode=characterCodeForKeypress(e);if(characterCode!==null){return String.fromCharCode(characterCode).toLowerCase()}}}else{if(e.type!=="keypress"){return String.fromCharCode(e.keyCode).toLowerCase()}}}return undefined}JIRA.Keyboard.shortcutEntered=function(e){e=originalEvent(e);if(e.type===JIRA.Keyboard.SpecialKey.eventType()){var specialKey=JIRA.Keyboard.specialKeyEntered(e),modifiers="";if(e.altKey&&specialKey!==SpecialKey.ALT){modifiers+=modifier(SpecialKey.ALT)}if(e.ctrlKey&&specialKey!==SpecialKey.CTRL){modifiers+=modifier(SpecialKey.CTRL)}if(e.metaKey&&!e.ctrlKey&&specialKey!==SpecialKey.META){modifiers+=modifier(SpecialKey.META)}if(e.shiftKey&&specialKey!==SpecialKey.SHIFT){modifiers+=modifier(SpecialKey.SHIFT)}if(specialKey){return modifiers+specialKey}else{if(modifiers.length>0&&modifiers!=="shift+"){var key=keyEntered(e);if(key){return modifiers+key}}}}return undefined};function modifier(modifier){return modifier+"+"}})(AJS.$);
(function($){JIRA.Mouse={};var MotionDetector=JIRA.Mouse.MotionDetector=function(){this.reset()};MotionDetector.prototype.reset=function(){this._handler=null;this._x=null;this._y=null;this.moved=false};MotionDetector.prototype.wait=function(eventHandler){var instance=this;if(!instance._handler){this.reset();$(window.top.document).bind("mousemove",instance._handler=function(e){if(!instance._x&&!instance._y){instance._x=e.pageX;instance._y=e.pageY}else{if(!(e.pageX===instance._x&&e.pageY===instance._y)){instance.unbind();instance.moved=true;if(eventHandler){eventHandler.call(this,e)}}}})}};MotionDetector.prototype.unbind=function(){if(this._handler){$(window.top.document).unbind("mousemove",this._handler);this.reset()}}})(AJS.$);
AJS.describeBrowser=function(userAgent){userAgent=userAgent||navigator.userAgent;var isChrome=/chrome/.test(navigator.userAgent.toLowerCase()),isSafari=!isChrome&&/safari/.test(navigator.userAgent.toLowerCase()),match=jQuery.uaMatch(userAgent),browser=match.browser,version=match.version.replace(/\.0$/,""),classNames=[];if(isChrome){classNames.push("chrome")}if(isSafari){classNames.push("safari")}classNames.push(browser);if(browser==="msie"){classNames.push(browser+"-"+version);version=parseInt(version);while(version>6){--version;classNames.push(browser+"-gt-"+version)}}jQuery("html").addClass(classNames.join(" "))};
jQuery.fn.getOptionsFromAttributes=function(){var options={};if(this.length){jQuery.each(this[0].attributes,function(){var map,nodeValue=this.nodeValue,target=options;if(/^data-/.test(this.nodeName)){map=this.nodeName.replace(/^data-/,"").split("."),AJS.$.each(map,function(i,propertyName){propertyName=propertyName.replace(/([a-z])-([a-z])/gi,function(entireMatch,firstMatch,secondMatch){return firstMatch+secondMatch.toUpperCase()});propertyName=propertyName.replace(/_([a-z]+)/gi,function(entireMatch,firstMatch){return firstMatch.toUpperCase()});if(i===map.length-1){target[propertyName]=nodeValue.match(/^(tru|fals)e$/i)?nodeValue.toLowerCase()=="true":nodeValue}else{if(!target[propertyName]){target[propertyName]={}}}target=target[propertyName]})}})}return options};
JIRA.SmartAjax={};(function($){JIRA.SmartAjax.SmartAjaxResult=function(xhr,requestId,statusText,data,successful,errorThrown){var status=tryIt(function(){return xhr.status},0);var result={successful:successful,status:status,statusText:statusText,errorThrown:errorThrown,readyState:xhr.readyState,hasData:data!=null&&data.length>0,data:data,xhr:xhr,aborted:xhr.aborted,requestId:requestId,validationError:!!(xhr.status===400&&data&&data.errors)};result.toString=function(){return"{\n"+"successful  : "+this.successful+",\n"+"status      : "+this.status+",\n"+"statusText  : "+this.statusText+",\n"+"hasData     : "+this.hasData+",\n"+"readyState  : "+this.readyState+",\n"+"requestId   : "+this.requestId+",\n"+"aborted     : "+this.aborted+",\n"+"}"};return result};JIRA.SmartAjax.SmartAjaxResult.ERROR="error";JIRA.SmartAjax.SmartAjaxResult.TIMEOUT="timeout";JIRA.SmartAjax.SmartAjaxResult.NOTMODIFIED="notmodified";JIRA.SmartAjax.SmartAjaxResult.PARSEERROR="parseerror";JIRA.SmartAjax.makeRequest=function(ajaxOptions){var _smartAjaxResult={};var log=function(calltype,requestId,msg){if(AJS.log){var id=requestId?"["+requestId+"] ":" ";AJS.log("ajax"+id+calltype+" : "+msg)}};var generateRequestId=function(){var now=new Date();var midnight=new Date(now.getFullYear(),now.getMonth(),now.getDate(),0,0,0,0);var ms=(now.getTime()-midnight.getTime());return Math.max(Math.floor(ms),1)};var errorHandler=function(xhr,statusText,errorThrown,smartAjaxResult){if(!smartAjaxResult){var data=tryIt(function(){return xhr.responseText},"");smartAjaxResult=_smartAjaxResult=new JIRA.SmartAjax.SmartAjaxResult(xhr,_requestId,statusText,data,false,errorThrown)}log("error",smartAjaxResult.requestId,smartAjaxResult);if($.isFunction(ajaxOptions.error)){ajaxOptions.error(xhr,statusText,errorThrown,smartAjaxResult)}};var successHandler=function(data,statusText,xhr){if(xhr.status<100){_smartAjaxResult=new JIRA.SmartAjax.SmartAjaxResult(xhr,_requestId,JIRA.SmartAjax.SmartAjaxResult.ERROR,"",false);errorHandler(xhr,JIRA.SmartAjax.SmartAjaxResult.ERROR,undefined,_smartAjaxResult);return }_smartAjaxResult=new JIRA.SmartAjax.SmartAjaxResult(xhr,_requestId,statusText,data,true);if($.isFunction(ajaxOptions.success)){ajaxOptions.success(data,statusText,xhr,_smartAjaxResult)}};var completeHandler=function(xhr,textStatus){if($.isFunction(ajaxOptions.complete)){ajaxOptions.complete(xhr,textStatus,_smartAjaxResult)}};var ourAjaxOptions={};for(var x in ajaxOptions){ourAjaxOptions[x]=ajaxOptions[x]}ourAjaxOptions.error=errorHandler;ourAjaxOptions.success=successHandler;ourAjaxOptions.complete=completeHandler;var xhr=$.ajax(ourAjaxOptions);var _requestId=generateRequestId();try{xhr.abort=function(oldabort){return function(){log("aborted",_requestId,"");xhr.aborted=true;if($.isFunction(oldabort)){try{oldabort.call(xhr)}catch(ex){}}}}(xhr.abort)}catch(ex){}return xhr};JIRA.SmartAjax.buildDialogErrorContent=function(smartAjaxResult,noHeader){var fourHundredClass=Math.floor(smartAjaxResult.status/100);if(smartAjaxResult.hasData&&fourHundredClass!=4){return wrapDialogErrorContent(AJS.extractBodyFromResponse(smartAjaxResult.data))}else{var errMsg=buildRawHttpErrorMessage(smartAjaxResult);return buildDialogAjaxErrorMessage(errMsg,noHeader)}};JIRA.SmartAjax.buildSimpleErrorContent=function(smartAjaxResult,options){return buildRawHttpErrorMessage(smartAjaxResult,options?options:{})};function buildRawHttpErrorMessage(smartAjaxResult,options){var AJS=window.top.AJS;var errMsg;if(smartAjaxResult.statusText==JIRA.SmartAjax.SmartAjaxResult.TIMEOUT){errMsg="The call to the JIRA server did not complete within the timeout period.  We are unsure of the result of this operation."}else{if(smartAjaxResult.status==401){errMsg=(options.alert?AJS.params.ajaxUnauthorisedAlert:AJS.params.ajaxUnauthorised)}else{if(smartAjaxResult.hasData){errMsg="The JIRA server was contacted but has returned an error response. We are unsure of the result of this operation."}else{errMsg="The JIRA server could not be contacted.  This may be a temporary glitch or the server may be down."}}}return errMsg}function buildDialogAjaxErrorMessage(errorMessage,noHeader){var errorContent='<div class="aui-message error"><span class="aui-icon icon-warning"></span>'+"<p>"+errorMessage+"</p>"+"<p>"+"Close this dialog and press refresh in your browser"+"</p>"+"</div>";if(!noHeader){errorContent="<h1>"+"Communications Breakdown"+"</h1>"+errorContent}return wrapDialogErrorContent(errorContent)}function wrapDialogErrorContent(content){var $container=$('<div class="ajaxerror"/>');$container.append(content);return $container}})(AJS.$);AJS.$(function(){AJS.$.ajaxSetup({timeout:60000,async:true,cache:false,global:true})});AJS.namespace("jira.ajax",null,JIRA.SmartAjax);
(function(){var $doc=jQuery(document);function getWindow(){var topWindow=window;try{while(topWindow.parent.window!==topWindow.window&&topWindow.parent.AJS){topWindow=topWindow.parent}}catch(error){}return topWindow}function getLayer(instance){return(instance.$layer||instance.$popup||instance.$||instance.popup||instance)[0]}function listenForLayerEvents($doc){$doc.bind("showLayer",function(e,type,item){if(item&&item.id&&(item.id.indexOf("user-hover-dialog")>=0||item.id.indexOf("aui-inline-edit-error")>=0)){return }var topWindow=getWindow().AJS;if(topWindow.currentLayerItem&&item!==topWindow.currentLayerItem&&topWindow.currentLayerItem.type!=="popup"){topWindow.currentLayerItem.hide()}if(item){topWindow.currentLayerItem=item;topWindow.currentLayerItem.type=type}}).bind("hideLayer",function(e,type,item){if(!item||item.id&&(item.id.indexOf("user-hover-dialog")>=0||item.id.indexOf("aui-inline-edit-error")>=0)){return }var topWindow=getWindow().AJS;if(topWindow.currentLayerItem){if(topWindow.currentLayerItem===item){topWindow.currentLayerItem=null}else{if(jQuery.contains(getLayer(item),getLayer(topWindow.currentLayerItem))){topWindow.currentLayerItem.hide()}}}}).bind("hideAllLayers",function(){var topWindow=getWindow().AJS;if(topWindow.currentLayerItem){topWindow.currentLayerItem.hide()}}).click(function(e){var topWindow=getWindow().AJS;if(topWindow.currentLayerItem&&topWindow.currentLayerItem.type!=="popup"){if(topWindow.currentLayerItem._validateClickToClose){if(topWindow.currentLayerItem._validateClickToClose(e)){topWindow.currentLayerItem.hide()}}else{topWindow.currentLayerItem.hide()}}})}$doc.bind("iframeAppended",function(e,iframe){iframe=jQuery(iframe);iframe.load(function(){listenForLayerEvents(iframe.contents())})});listenForLayerEvents($doc)})();
jQuery.fn.hasFixedParent=function(){var hasFixedParent=false;this.parents().each(function(){if(AJS.$(this).css("position")==="fixed"){hasFixedParent=true;return false}});return hasFixedParent};
jQuery.getDocHeight=function(){return Math.max(jQuery(document).height(),jQuery(window).height(),document.documentElement.clientHeight)};
jQuery.os={};if(navigator.platform.toLowerCase().indexOf("win")!=-1){jQuery.os.windows=true}if(navigator.platform.toLowerCase().indexOf("mac")!=-1){jQuery.os.mac=true}if(navigator.platform.toLowerCase().indexOf("linux")!=-1){jQuery.os.linux=true};
if(jQuery.browser.msie&&jQuery.browser.version>7&&typeof JSON!=="undefined"){JSON.stringify=null};
if(!this.JSON){this.JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());
function parseUri(str){var o=parseUri.options,m=o.parser[o.strictMode?"strict":"loose"].exec(str),uri={},i=14;while(i--){uri[o.key[i]]=m[i]||""}uri[o.q.name]={};uri[o.key[12]].replace(o.q.parser,function($0,$1,$2){if($1){uri[o.q.name][$1]=$2}});return uri}parseUri.options={strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};
jQuery.effects||(function($){$.effects={};$.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(i,attr){$.fx.step[attr]=function(fx){if(!fx.colorInit){fx.start=getColor(fx.elem,attr);fx.end=getRGB(fx.end);fx.colorInit=true}fx.elem.style[attr]="rgb("+Math.max(Math.min(parseInt((fx.pos*(fx.end[0]-fx.start[0]))+fx.start[0],10),255),0)+","+Math.max(Math.min(parseInt((fx.pos*(fx.end[1]-fx.start[1]))+fx.start[1],10),255),0)+","+Math.max(Math.min(parseInt((fx.pos*(fx.end[2]-fx.start[2]))+fx.start[2],10),255),0)+")"}});function getRGB(color){var result;if(color&&color.constructor==Array&&color.length==3){return color}if(result=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)){return[parseInt(result[1],10),parseInt(result[2],10),parseInt(result[3],10)]}if(result=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)){return[parseFloat(result[1])*2.55,parseFloat(result[2])*2.55,parseFloat(result[3])*2.55]}if(result=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)){return[parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16)]}if(result=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)){return[parseInt(result[1]+result[1],16),parseInt(result[2]+result[2],16),parseInt(result[3]+result[3],16)]}if(result=/rgba\(0, 0, 0, 0\)/.exec(color)){return colors["transparent"]}return colors[$.trim(color).toLowerCase()]}function getColor(elem,attr){var color;do{color=$.curCSS(elem,attr);if(color!=""&&color!="transparent"||$.nodeName(elem,"body")){break}attr="backgroundColor"}while(elem=elem.parentNode);return getRGB(color)}var colors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};var classAnimationActions=["add","remove","toggle"],shorthandStyles={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};function getElementStyles(){var style=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,newStyle={},key,camelCase;if(style&&style.length&&style[0]&&style[style[0]]){var len=style.length;while(len--){key=style[len];if(typeof style[key]=="string"){camelCase=key.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase()});newStyle[camelCase]=style[key]}}}else{for(key in style){if(typeof style[key]==="string"){newStyle[key]=style[key]}}}return newStyle}function filterStyles(styles){var name,value;for(name in styles){value=styles[name];if(value==null||$.isFunction(value)||name in shorthandStyles||(/scrollbar/).test(name)||(!(/color/i).test(name)&&isNaN(parseFloat(value)))){delete styles[name]}}return styles}function styleDifference(oldStyle,newStyle){var diff={_:0},name;for(name in newStyle){if(oldStyle[name]!=newStyle[name]){diff[name]=newStyle[name]}}return diff}$.effects.animateClass=function(value,duration,easing,callback){if($.isFunction(easing)){callback=easing;easing=null}return this.each(function(){var that=$(this),originalStyleAttr=that.attr("style")||" ",originalStyle=filterStyles(getElementStyles.call(this)),newStyle,className=that.attr("className");$.each(classAnimationActions,function(i,action){if(value[action]){that[action+"Class"](value[action])}});newStyle=filterStyles(getElementStyles.call(this));that.attr("className",className);that.animate(styleDifference(originalStyle,newStyle),duration,easing,function(){$.each(classAnimationActions,function(i,action){if(value[action]){that[action+"Class"](value[action])}});if(typeof that.attr("style")=="object"){that.attr("style").cssText="";that.attr("style").cssText=originalStyleAttr}else{that.attr("style",originalStyleAttr)}if(callback){callback.apply(this,arguments)}})})};$.fn.extend({_addClass:$.fn.addClass,addClass:function(classNames,speed,easing,callback){return speed?$.effects.animateClass.apply(this,[{add:classNames},speed,easing,callback]):this._addClass(classNames)},_removeClass:$.fn.removeClass,removeClass:function(classNames,speed,easing,callback){return speed?$.effects.animateClass.apply(this,[{remove:classNames},speed,easing,callback]):this._removeClass(classNames)},_toggleClass:$.fn.toggleClass,toggleClass:function(classNames,force,speed,easing,callback){if(typeof force=="boolean"||force===undefined){if(!speed){return this._toggleClass(classNames,force)}else{return $.effects.animateClass.apply(this,[(force?{add:classNames}:{remove:classNames}),speed,easing,callback])}}else{return $.effects.animateClass.apply(this,[{toggle:classNames},force,speed,easing])}},switchClass:function(remove,add,speed,easing,callback){return $.effects.animateClass.apply(this,[{add:add,remove:remove},speed,easing,callback])}});$.extend($.effects,{version:"1.8rc3",save:function(element,set){for(var i=0;i<set.length;i++){if(set[i]!==null){element.data("ec.storage."+set[i],element[0].style[set[i]])}}},restore:function(element,set){for(var i=0;i<set.length;i++){if(set[i]!==null){element.css(set[i],element.data("ec.storage."+set[i]))}}},setMode:function(el,mode){if(mode=="toggle"){mode=el.is(":hidden")?"show":"hide"}return mode},getBaseline:function(origin,original){var y,x;switch(origin[0]){case"top":y=0;break;case"middle":y=0.5;break;case"bottom":y=1;break;default:y=origin[0]/original.height}switch(origin[1]){case"left":x=0;break;case"center":x=0.5;break;case"right":x=1;break;default:x=origin[1]/original.width}return{x:x,y:y}},createWrapper:function(element){if(element.parent().is(".ui-effects-wrapper")){return element.parent()}var props={width:element.outerWidth(true),height:element.outerHeight(true),"float":element.css("float")},wrapper=$("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});element.wrap(wrapper);wrapper=element.parent();if(element.css("position")=="static"){wrapper.css({position:"relative"});element.css({position:"relative"})}else{$.extend(props,{position:element.css("position"),zIndex:element.css("z-index")});$.each(["top","left","bottom","right"],function(i,pos){props[pos]=element.css(pos);if(isNaN(parseInt(props[pos],10))){props[pos]="auto"}});element.css({position:"relative",top:0,left:0})}return wrapper.css(props).show()},removeWrapper:function(element){if(element.parent().is(".ui-effects-wrapper")){return element.parent().replaceWith(element)}return element},setTransition:function(element,list,factor,value){value=value||{};$.each(list,function(i,x){unit=element.cssUnit(x);if(unit[0]>0){value[x]=unit[0]*factor+unit[1]}});return value}});function _normalizeArguments(effect,options,speed,callback){if(typeof effect=="object"){callback=options;speed=null;options=effect;effect=options.effect}if($.isFunction(options)){callback=options;speed=null;options={}}if(typeof options=="number"||$.fx.speeds[options]){callback=speed;speed=options;options={}}options=options||{};speed=speed||options.duration;speed=$.fx.off?0:typeof speed=="number"?speed:$.fx.speeds[speed]||$.fx.speeds._default;callback=callback||options.complete;return[effect,options,speed,callback]}$.fn.extend({effect:function(effect,options,speed,callback){var args=_normalizeArguments.apply(this,arguments),args2={options:args[1],duration:args[2],callback:args[3]},effectMethod=$.effects[effect];return effectMethod&&!$.fx.off?effectMethod.call(this,args2):this},_show:$.fn.show,show:function(speed){if(!speed||typeof speed=="number"||$.fx.speeds[speed]){return this._show.apply(this,arguments)}else{var args=_normalizeArguments.apply(this,arguments);args[1].mode="show";return this.effect.apply(this,args)}},_hide:$.fn.hide,hide:function(speed){if(!speed||typeof speed=="number"||$.fx.speeds[speed]){return this._hide.apply(this,arguments)}else{var args=_normalizeArguments.apply(this,arguments);args[1].mode="hide";return this.effect.apply(this,args)}},__toggle:$.fn.toggle,toggle:function(speed){if(!speed||typeof speed=="number"||$.fx.speeds[speed]||typeof speed=="boolean"||$.isFunction(speed)){return this.__toggle.apply(this,arguments)}else{var args=_normalizeArguments.apply(this,arguments);args[1].mode="toggle";return this.effect.apply(this,args)}},cssUnit:function(key){var style=this.css(key),val=[];$.each(["em","px","%","pt"],function(i,unit){if(style.indexOf(unit)>0){val=[parseFloat(style),unit]}});return val}});$.easing.jswing=$.easing.swing;$.extend($.easing,{def:"easeOutQuad",swing:function(x,t,b,c,d){return $.easing[$.easing.def](x,t,b,c,d)},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return -c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b}return -c/2*((--t)*(t-2)-1)+b},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t+b}return c/2*((t-=2)*t*t+2)+b},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b},easeOutQuart:function(x,t,b,c,d){return -c*((t=t/d-1)*t*t*t-1)+b},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b}return -c/2*((t-=2)*t*t*t-2)+b},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t*t+b}return c/2*((t-=2)*t*t*t*t+2)+b},easeInSine:function(x,t,b,c,d){return -c*Math.cos(t/d*(Math.PI/2))+c+b},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b},easeInOutSine:function(x,t,b,c,d){return -c/2*(Math.cos(Math.PI*t/d)-1)+b},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},easeInOutExpo:function(x,t,b,c,d){if(t==0){return b}if(t==d){return b+c}if((t/=d/2)<1){return c/2*Math.pow(2,10*(t-1))+b}return c/2*(-Math.pow(2,-10*--t)+2)+b},easeInCirc:function(x,t,b,c,d){return -c*(Math.sqrt(1-(t/=d)*t)-1)+b},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1){return -c/2*(Math.sqrt(1-t*t)-1)+b}return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0){return b}if((t/=d)==1){return b+c}if(!p){p=d*0.3}if(a<Math.abs(c)){a=c;var s=p/4}else{var s=p/(2*Math.PI)*Math.asin(c/a)}return -(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0){return b}if((t/=d)==1){return b+c}if(!p){p=d*0.3}if(a<Math.abs(c)){a=c;var s=p/4}else{var s=p/(2*Math.PI)*Math.asin(c/a)}return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0){return b}if((t/=d/2)==2){return b+c}if(!p){p=d*(0.3*1.5)}if(a<Math.abs(c)){a=c;var s=p/4}else{var s=p/(2*Math.PI)*Math.asin(c/a)}if(t<1){return -0.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b}return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*0.5+c+b},easeInBack:function(x,t,b,c,d,s){if(s==undefined){s=1.70158}return c*(t/=d)*t*((s+1)*t-s)+b},easeOutBack:function(x,t,b,c,d,s){if(s==undefined){s=1.70158}return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined){s=1.70158}if((t/=d/2)<1){return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b}return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b},easeInBounce:function(x,t,b,c,d){return c-$.easing.easeOutBounce(x,d-t,0,c,d)+b},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else{if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+0.75)+b}else{if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+0.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+0.984375)+b}}}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2){return $.easing.easeInBounce(x,t*2,0,c,d)*0.5+b}return $.easing.easeOutBounce(x,t*2-d,0,c,d)*0.5+c*0.5+b}})})(jQuery);
(function(){JIRA.parseOptionsFromFieldset=function($fieldset){var parsedValues=parseFieldset($fieldset,$fieldset);$fieldset.remove();return parsedValues};function parseFieldset($fieldset,$parentFieldset){var ret={};$fieldset.children().each(function(){var itemValue,$item=jQuery(this);if($item.is("input[type=hidden]")){itemValue=parseValue($item);ret[itemValue.id]=itemValue.value}else{if($item.is("fieldset")){ret[$item.attr("title")||$item.attr("id")]=parseFieldset($item,$parentFieldset)}else{$item.insertBefore($parentFieldset)}}});return ret}function parseValue($item){var itemValue={},value=$item.val();itemValue.id=$item.attr("title")||$item.attr("id");itemValue.value=(value.match(/^(tru|fals)e$/i)?value.toLowerCase()=="true":value);return itemValue}})();
jQuery.fn.handleAccessKeys=function(options){var accessKeyAttr="accesskey";if(jQuery.browser.msie&&jQuery.browser.version=="7.0"){accessKeyAttr="accessKey"}options=options||{};this.each(function(){var $form=AJS.$(this),blackList=[],$myAccessKeyElems,$accessKeyElems;$accessKeyElems=jQuery("form").not(this).find(":input["+accessKeyAttr+"], a["+accessKeyAttr+"]");$myAccessKeyElems=jQuery(":input["+accessKeyAttr+"], a["+accessKeyAttr+"]",this);if(!$form.is("form")){console.warn("jQuery.fn.enableAccessKeys: node type ["+$form.attr("nodeName")+"] is not valid. "+"Only <form> supported");return this}if($form.data("handleAccessKeys.applied")){return }$form.data("handleAccessKeys.applied",true);$form.find(":input["+accessKeyAttr+"], a["+accessKeyAttr+"]").each(function(){var accessKey=jQuery(this).attr(accessKeyAttr);if(accessKey){blackList.push(accessKey.toLowerCase())}});$form.delegate(":input, a","focus",function(){removeAccessKeys($accessKeyElems,blackList);attachAccessKeys($myAccessKeyElems)}).delegate(":input, a","blur",function(){attachAccessKeys($accessKeyElems)})});function isInvalid(key,blackList){if(key){if(options.selective===false){return true}if(/[a-z]/i.test(key)){key=key.toLowerCase()}return jQuery.inArray(key,blackList)!==-1}}function attachAccessKeys($accessKeyElems){$accessKeyElems.each(function(){var $this=AJS.$(this);if($this.data(accessKeyAttr)){$this.attr(accessKeyAttr,$this.data(accessKeyAttr))}})}function removeAccessKeys($accessKeyElems,blackList){$accessKeyElems.each(function(){var $this=AJS.$(this);if(isInvalid($this.attr(accessKeyAttr),blackList)){$this.data(accessKeyAttr,$this.attr(accessKeyAttr));$this.removeAttr(accessKeyAttr)}})}return this};
new function(settings){var $separator=settings.separator||"&";var $spaces=settings.spaces===false?false:true;var $suffix=settings.suffix===false?"":"[]";var $prefix=settings.prefix===false?false:true;var $hash=$prefix?settings.hash===true?"#":"?":"";var $numbers=settings.numbers===false?false:true;jQuery.query=new function(){var is=function(o,t){return o!=undefined&&o!==null&&(!!t?o.constructor==t:true)};var parse=function(path){var m,rx=/\[([^[]*)\]/g,match=/^([^[]+)(\[.*\])?$/.exec(path),base=match[1],tokens=[];while(m=rx.exec(match[2])){tokens.push(m[1])}return[base,tokens]};var set=function(target,tokens,value){var o,token=tokens.shift();if(typeof target!="object"){target=null}if(token===""){if(!target){target=[]}if(is(target,Array)){target.push(tokens.length==0?value:set(null,tokens.slice(0),value))}else{if(is(target,Object)){var i=0;while(target[i++]!=null){}target[--i]=tokens.length==0?value:set(target[i],tokens.slice(0),value)}else{target=[];target.push(tokens.length==0?value:set(null,tokens.slice(0),value))}}}else{if(token&&token.match(/^\s*[0-9]+\s*$/)){var index=parseInt(token,10);if(!target){target=[]}target[index]=tokens.length==0?value:set(target[index],tokens.slice(0),value)}else{if(token){var index=token.replace(/^\s*|\s*$/g,"");if(!target){target={}}if(is(target,Array)){var temp={};for(var i=0;i<target.length;++i){temp[i]=target[i]}target=temp}target[index]=tokens.length==0?value:set(target[index],tokens.slice(0),value)}else{return value}}}return target};var queryObject=function(a){var self=this;self.keys={};if(a.queryObject){jQuery.each(a.get(),function(key,val){self.SET(key,val)})}else{jQuery.each(arguments,function(){var q=""+this;q=q.replace(/^[?#]/,"");q=q.replace(/[;&]$/,"");if($spaces){q=q.replace(/[+]/g," ")}jQuery.each(q.split(/[&;]/),function(){var key=decodeURIComponent(this.split("=")[0]||"");var val=decodeURIComponent(this.split("=")[1]||"");if(!key){return }if($numbers){if(/^[+-]?[0-9]+\.[0-9]*$/.test(val)){val=parseFloat(val)}else{if(/^[+-]?[0-9]+$/.test(val)){val=parseInt(val,10)}}}val=(!val&&val!==0)?true:val;if(val!==false&&val!==true&&typeof val!="number"){val=val}self.SET(key,val)})})}return self};queryObject.prototype={queryObject:true,has:function(key,type){var value=this.get(key);return is(value,type)},GET:function(key){if(!is(key)){return this.keys}var parsed=parse(key),base=parsed[0],tokens=parsed[1];var target=this.keys[base];while(target!=null&&tokens.length!=0){target=target[tokens.shift()]}return typeof target=="number"?target:target||""},get:function(key){var target=this.GET(key);if(is(target,Object)){return jQuery.extend(true,{},target)}else{if(is(target,Array)){return target.slice(0)}}return target},SET:function(key,val){var value=!is(val)?null:val;var parsed=parse(key),base=parsed[0],tokens=parsed[1];var target=this.keys[base];this.keys[base]=set(target,tokens.slice(0),value);return this},set:function(key,val){return this.copy().SET(key,val)},REMOVE:function(key){return this.SET(key,null).COMPACT()},remove:function(key){return this.copy().REMOVE(key)},EMPTY:function(){var self=this;jQuery.each(self.keys,function(key,value){delete self.keys[key]});return self},load:function(url){var hash=url.replace(/^.*?[#](.+?)(?:\?.+)?$/,"$1");var search=url.replace(/^.*?[?](.+?)(?:#.+)?$/,"$1");return new queryObject(url.length==search.length?"":search,url.length==hash.length?"":hash)},empty:function(){return this.copy().EMPTY()},copy:function(){return new queryObject(this)},COMPACT:function(){function build(orig){var obj=typeof orig=="object"?is(orig,Array)?[]:{}:orig;if(typeof orig=="object"){function add(o,key,value){if(is(o,Array)){o.push(value)}else{o[key]=value}}jQuery.each(orig,function(key,value){if(!is(value)){return true}add(obj,key,build(value))})}return obj}this.keys=build(this.keys);return this},compact:function(){return this.copy().COMPACT()},toString:function(){var i=0,queryString=[],chunks=[],self=this;var encode=function(str){str=str+"";if($spaces){str=str.replace(/ /g,"+")}return encodeURIComponent(str)};var addFields=function(arr,key,value){if(!is(value)||value===false){return }var o=[encode(key)];if(value!==true){o.push("=");o.push(encode(value))}arr.push(o.join(""))};var build=function(obj,base){var newKey=function(key){return !base||base==""?[key].join(""):[base,"[",key,"]"].join("")};jQuery.each(obj,function(key,value){if(typeof value=="object"){build(value,newKey(key))}else{addFields(chunks,newKey(key),value)}})};build(this.keys);if(chunks.length>0){queryString.push($hash)}queryString.push(chunks.join($separator));return queryString.join("")}};return new queryObject(location.search,location.hash)}}(jQuery.query||{});
jQuery.fn.setSelectionRange=function(selectionStart,selectionEnd){if(this.length==0){return }if(this[0].setSelectionRange){this[0].focus();this[0].setSelectionRange(selectionStart,selectionEnd)}else{if(this[0].createTextRange){var range=this[0].createTextRange();range.collapse(true);range.moveEnd("character",selectionEnd);range.moveStart("character",selectionStart);range.select()}}},jQuery.fn.setCaretToPosition=function(position){this.setSelectionRange(position,position)};
JIRA.SessionStorage={};(function(){var MAGIC_MARK="jsessionstorage:";var nonNativeSessionStorageObjInitialised=false;var nonNativeSessionStorageObj={};var nonNativeSessionStorageImpl={nonnativeimplementation:true,_storage:function(){if(nonNativeSessionStorageObjInitialised){return nonNativeSessionStorageObj}if(typeof window.name!="string"){window.name=MAGIC_MARK+"{}"}if(window.name.indexOf(MAGIC_MARK)!=0){window.name=MAGIC_MARK+"{}"}var jsonData=window.name.substr(MAGIC_MARK.length);nonNativeSessionStorageObj=JSON.parse(jsonData);if(!nonNativeSessionStorageObj){nonNativeSessionStorageObj={}}nonNativeSessionStorageObjInitialised=true;return nonNativeSessionStorageObj},_persistStorage:function(){var storeObj=this._storage();var jsonData=JSON.stringify(storeObj);window.name=MAGIC_MARK+jsonData},length:function(){var i=0;var store=this._storage();for(var x in store){i++}return i},key:function(index){var i=0;var store=this._storage();for(var x in store){if(i==index){return x}i++}return null},getItem:function(key){return this._storage()[key]},setItem:function(key,value){this._storage()[key]=value;this._persistStorage()},removeItem:function(key){delete this._storage()[key];this._persistStorage()},clear:function(){var store=this._storage();for(var x in store){delete x}this._persistStorage()}};var _sessionStorageImpl=window.sessionStorage!=null?window.sessionStorage:nonNativeSessionStorageImpl;JIRA.SessionStorage.nativesupport=window.sessionStorage!=null;JIRA.SessionStorage.length=function(){if(typeof _sessionStorageImpl.length=="function"){return _sessionStorageImpl.length()}return _sessionStorageImpl.length};JIRA.SessionStorage.key=function(index){return _sessionStorageImpl.key(index)};JIRA.SessionStorage.getItem=function(key){return _sessionStorageImpl.getItem(key)};JIRA.SessionStorage.setItem=function(key,value){_sessionStorageImpl.setItem(key,value)};JIRA.SessionStorage.removeItem=function(key){_sessionStorageImpl.removeItem(key)};JIRA.SessionStorage.clear=function(){_sessionStorageImpl.clear()};JIRA.SessionStorage.asJSON=function(){var len=this.length();var jsData="{\n";for(var i=0;i<len;i++){var key=this.key(i);var value=this.getItem(key);jsData+=key+":"+value;if(i<len-1){jsData+=","}jsData+="\n"}jsData+="}\n";return jsData}})(jQuery);AJS.namespace("jira.app.session.storage",null,JIRA.SessionStorage);
AJS.nextPage=function(){var data=[],oldBeforeUnload=window.onbeforeunload;window.onbeforeunload=function(){if(window.sessionStorage){sessionStorage.setItem("AJS.thisPage",JSON.stringify(data))}else{saveCookie("AJS.thisPage",JSON.stringify(data))}if(oldBeforeUnload){oldBeforeUnload()}};return function(name,value){var replaced;jQuery.each(data,function(){if(this.name===name){this.value=value;replaced=true}});if(!replaced){data.push({name:name,value:value})}}}();AJS.thisPage=function(){var i,value,unformattedData,data={};if(window.sessionStorage){unformattedData=sessionStorage.getItem("AJS.thisPage");sessionStorage.removeItem("AJS.thisPage")}else{unformattedData=readCookie("AJS.thisPage");eraseCookie("AJS.thisPage")}if(unformattedData){unformattedData=JSON.parse(unformattedData);for(i=0;i<unformattedData.length;i++){data[unformattedData[i].name]=unformattedData[i].value}}return function(key){return data[key]}}();
(function(){var META_TOKEN_ID="atlassian-token";var PARAM_TOKEN_NAME="atl_token";var INPUT_TOKEN_NAME="atl_token";var tokenQueryParam=function(token){return AJS.format("{0}={1}",PARAM_TOKEN_NAME,token)};var replaceTokenInMeta=function(oldToken,newToken){var metaTokenSelector=AJS.format("meta#{0}",META_TOKEN_ID);AJS.$(metaTokenSelector).attr("content",newToken)};var replaceTokenInLinks=function(oldToken,newToken){AJS.$("a,link").each(function(){var link=AJS.$(this);var href=link.attr("href");if(href){link.attr("href",href.replace(tokenQueryParam(oldToken),tokenQueryParam(newToken)))}})};var replaceTokenInForms=function(oldToken,newToken){AJS.$("form").each(function(){var $form=AJS.$(this);var action=$form.attr("action");if(action){$form.attr("ACTION",action.replace(tokenQueryParam(oldToken),tokenQueryParam(newToken)))}var formInputSelector=AJS.format("input[name={0}][value={1}]",INPUT_TOKEN_NAME,oldToken);$form.find(formInputSelector).each(function(){AJS.$(this).attr("value",newToken)})})};AJS.namespace("JIRA.XSRF");if(typeof JIRA.XSRF.updateTokenOnPage!=="function"){JIRA.XSRF.updateTokenOnPage=function(newToken){var oldToken=atl_token();if(oldToken!==newToken){replaceTokenInMeta(oldToken,newToken);replaceTokenInLinks(oldToken,newToken);replaceTokenInForms(oldToken,newToken)}}}}());AJS.namespace("jira.xsrf",null,JIRA.XSRF);
(function(){var defaultEvents={};AJS.bindDefaultCustomEvent=function(name,defaultHandler){if(defaultEvents[name]){throw new Error("You have already bound a default handler for ["+name+"] event")}defaultEvents[name]=function(e){var events=AJS.$(document).data("events")[name],lastEventHandler=events[events.length-1].handler;if(lastEventHandler!==arguments.callee){e.preventDefault=function(){defaultHandler=null};events[events.length-1].handler=function(){lastEventHandler.apply(this,arguments);if(defaultHandler){defaultHandler.apply(this,arguments)}events[events.length-1].handler=lastEventHandler}}else{defaultHandler.apply(this,arguments)}};AJS.$(document).bind(name,defaultEvents[name])};AJS.unbindDefaultCustomEvent=function(name){if(defaultEvents[name]){AJS.$(document).unbind(name,defaultEvents[name]);delete defaultEvents[name]}}})();
AJS.ContentRetriever=Class.extend({startingRequest:jQuery.noop,finishedRequest:jQuery.noop,cache:jQuery.noop,isLocked:jQuery.noop,content:jQuery.noop});
AJS.AjaxContentRetriever=AJS.ContentRetriever.extend({init:function(options){var instance=this;this.ajaxOptions=options;if(typeof this.ajaxOptions==="string"){this.ajaxOptions={url:this.ajaxOptions}}this.ajaxOptions.globalThrobber=false;this.ajaxOptions.success=function(data,textStatus,xhr){instance._requestComplete(xhr,textStatus,data,true,null)};this.ajaxOptions.error=function(xhr,textStatus){if(xhr.rc){xhr.status=xhr.rc}instance._requestComplete(xhr,textStatus,null,false,null)}},content:function(arg){if(AJS.$.isFunction(arg)){this.callback=arg;this._makeRequest(arg)}else{if(arg){this.callback(arg);delete this.callback}}return this.$content},startingRequest:function(callback){if(callback){this.startingCallback=callback}else{if(this.startingCallback){this.locked=true;this.startingCallback()}}},finishedRequest:function(callback){if(callback){this.finishedCallback=callback}else{if(this.finishedCallback){this.locked=false;this.finishedCallback()}}},cache:function(cache){if(typeof cache!=="undefined"){this.ajaxOptions.cache=cache}return this.ajaxOptions.cache},isLocked:function(){return this.locked},_requestComplete:function(xhr,statusText,data,successful,errorThrown){var $content,smartAjaxResult;if(JIRA.SmartAjax.SmartAjaxResult){smartAjaxResult=JIRA.SmartAjax.SmartAjaxResult.apply(window,arguments)}if(successful){if(AJS.$.isFunction(this.ajaxOptions.formatSuccess)){$content=this.ajaxOptions.formatSuccess(data)}else{$content=AJS.$("<div>"+data+"</div>")}}else{if(AJS.$.isFunction(this.ajaxOptions.formatError)){$content=this.ajaxOptions.formatError(data)}else{if(smartAjaxResult){var errorClass=smartAjaxResult.status===401?"warning":"error";$content=AJS.$('<div class="aui-message '+errorClass+'"><span class="aui-icon icon-'+errorClass+'"></span>'+JIRA.SmartAjax.buildSimpleErrorContent(smartAjaxResult)+"</div>")}}}this.content($content);this.finishedRequest()},_makeRequest:function(){this.startingRequest();AJS.$.ajax(this.ajaxOptions)}});
AJS.DOMContentRetriever=AJS.ContentRetriever.extend({init:function(content){this.$content=AJS.$(content)},content:function(callback){if(AJS.$.isFunction(callback)){callback(this.$content)}return this.$content},cache:function(){},isLocked:function(){},startingRequest:function(){},finishedRequest:function(){}});
AJS.InlineLayer=AJS.Control.extend({CLASS_SIGNATURE:"AJS_InlineLayer",SCROLL_HIDE_EVENT:"scroll.hide-dropdown",init:function(options){var instance=this;if(!(options instanceof AJS.InlineLayer.OptionsDescriptor)){this.options=new AJS.InlineLayer.OptionsDescriptor(options)}else{this.options=options}this.offsetTarget(this.options.offsetTarget());this.contentRetriever=this.options.contentRetriever();this.positionController=this.options.positioningController();if(!(this.contentRetriever instanceof AJS.ContentRetriever)){throw new Error("AJS.InlineLayer: Failed construction, Content retriever does not implement interface "+"[AJS.ContentRetrieverInterface]")}this.contentRetriever.startingRequest(function(){instance._showLoading()});this.contentRetriever.finishedRequest(function(){instance._hideLoading()});this.$layer=this._render("layer",this.options.alignment())},content:function(arg){var instance=this;if(AJS.$.isFunction(arg)){if(this.contentRetriever.isLocked()){throw new Error(this.CLASS_SIGNATURE+".content() : Illegal operation, trying to access content while it is "+"locked. If you are seeing this error it is most likely because we are waiting for an request to "+"come back from the server that builds content")}this.contentRetriever.content(function(content){instance.$content=content.removeClass("hidden");arg.call(instance)})}else{return this.$content}},offsetTarget:function(offsetTarget){if(offsetTarget){this.$offsetTarget=AJS.$(offsetTarget)}return this.$offsetTarget},contentChange:function(callback){var event,instance=this;if(AJS.$.isFunction(callback)){if(!this.contentChangeCallback){this.contentChangeCallback=[]}this.contentChangeCallback.push(callback)}else{if(!callback&&this.contentChangeCallback){AJS.$.each(this.contentChangeCallback,function(i,callback){callback(instance)});AJS.trigger("contentChange",this.layer());this.offsetTarget().trigger("InlineLayer.contentChange",[this]);this.setWidth(this.options.width())}}},onhide:function(callback){var instance=this;if(AJS.$.isFunction(callback)){if(!this.hideCallback){this.hideCallback=[]}this.hideCallback.push(callback)}else{if(!callback&&this.hideCallback){AJS.$.each(this.hideCallback,function(i,callback){callback(instance)})}}},layer:function(layer){if(layer){this.$layer=layer}else{return this.$layer}},placeholder:function(placeholder){if(placeholder){this._throwReadOnlyError("placeholder")}else{return this.$placeholder}},isVisible:function(visible){if(typeof visible!=="undefined"){this._throwReadOnlyError("visible")}return this.visible},scrollableContainer:function(scrollableContainer){if(scrollableContainer){this._throwReadOnlyError("scrollableContainer")}return this.$scrollableContainer},isInitialized:function(initialised){if(initialised){this._throwReadOnlyError("initialized")}return this.initialized},hide:function(){if(!this.isVisible()){return false}this.visible=false;this.layer().removeClass(AJS.ACTIVE_CLASS).hide();this.$offsetTarget.removeClass(AJS.ACTIVE_CLASS);var positionController=this.positionController;setTimeout(function(){positionController.appendToPlaceholder()},0);this._unbindEvents();this.onhide();AJS.$(document).trigger("hideLayer",[this.CLASS_SIGNATURE,this]);AJS.InlineLayer.current=null},refreshContent:function(callback){var instance=this;this.content(function(){this.layer().empty().append(this.content());if(AJS.$.isFunction(callback)){callback.call(instance)}this.contentChange()})},show:function(){var instance=this;if(this.isVisible()){return }if(!this.isInitialized()){this._lazyInit(function(){instance._show()})}else{if(this.contentRetriever.cache()===false){this.refreshContent(function(){instance._show()})}else{instance._show()}}},setPosition:function(){var positioning;if(!this.isInitialized()||!this.offsetTarget()||this.offsetTarget().length===0){return }if(this.options.alignment()===AJS.RIGHT){positioning=this.positionController.right()}else{if(this.options.alignment()===AJS.LEFT){positioning=this.positionController.left()}else{if(this.options.alignment()===AJS.INTELLIGENT_GUESS){if((this.offsetTarget().offset().left+this.layer().outerWidth()/2)>AJS.$(window).width()/2){positioning=this.positionController.right()}else{positioning=this.positionController.left()}}}}if(AJS.dim.dim){var scrollLeft=AJS.$(window).scrollLeft();if(scrollLeft>0){positioning.left-=scrollLeft}positioning.maxHeight=AJS.$(window).height()-positioning.top-this.options.cushion()}this.layer().css(positioning)},setOverflowAndHeight:function(){if(this.options.properties.maxInlineResultsDisplayed){this.layer().addClass("limited")}},setWidth:function(width,showhorizontalScroll){var contentScrollWidth=this.content().attr("scrollWidth");if(!(this.content().hasClass("error")||this.content().hasClass("warn"))){this.content().css({whiteSpace:"nowrap",overflowX:"",width:"auto"})}if(contentScrollWidth<=width){this.layer().css({width:width,whiteSpace:""})}else{if(showhorizontalScroll){this.layer().css({width:width,overflowX:"auto",whiteSpace:""})}else{this.layer().css({width:contentScrollWidth,overflowX:"hidden",whiteSpace:""})}}},_lazyInit:function(callback){this.initialized=true;this.refreshContent(function(){var instance=this;this.layer().insertAfter(this.offsetTarget());if(this._supportsBoxShadow()){this.layer().addClass(AJS.BOX_SHADOW_CLASS)}this.$placeholder=AJS.$("<div class='ajs-layer-placeholder' />").insertAfter(this.offsetTarget());this.$scrollableContainer=this.offsetTarget().closest(this.options.hideOnScroll());this.positionController.set(this.layer(),this.offsetTarget(),this.placeholder());this.positionController.rebuilt(function(layer){instance.layer(layer)});callback()})},_show:function(){if(AJS.InlineLayer.current){AJS.InlineLayer.current.hide()}this.visible=true;this.content().show();this.positionController.appendToBody();this.layer().addClass(AJS.ACTIVE_CLASS);this.$offsetTarget.addClass(AJS.ACTIVE_CLASS);this.layer().show();this.setWidth(this.options.width());this.setPosition();this.setOverflowAndHeight();this._bindEvents();if(!AJS.dim.dim){this.positionController.scrollTo()}AJS.InlineLayer.current=this;AJS.$(document).trigger("showLayer",[this.CLASS_SIGNATURE,this])},_hideLoading:function(){this.$layer.removeClass(AJS.LOADING_CLASS);this.$offsetTarget.removeClass(AJS.LOADING_CLASS)},_showLoading:function(){this.$layer.addClass(AJS.LOADING_CLASS);this.$offsetTarget.addClass(AJS.LOADING_CLASS)},_unbindEvents:function(){this.$scrollableContainer.unbind(this.SCROLL_HIDE_EVENT);this._unassignEvents("container",document);this._unassignEvents("win",window)},_bindEvents:function(){var instance=this;this.$scrollableContainer.one(this.SCROLL_HIDE_EVENT,function(){instance.hide()});this._assignEvents("container",document);this._assignEvents("win",window)},_validateClickToClose:function(e){if(e.target===this.offsetTarget()[0]){return false}else{if(e.target===this.layer()[0]){return false}else{if(this.offsetTarget().has(e.target).length>0){return false}else{if(this.layer().has(e.target).length>0){return false}}}}return true},"keys":{Esc:function(){this.hide()}},_events:{container:{"aui:keydown aui:keypress":function(event){this._handleKeyEvent(event)},click:function(e){if(this._validateClickToClose(e)){this.hide()}}},win:{resize:function(){this.setPosition()},scroll:function(){this.setPosition()}}},_renders:{layer:function(){return AJS.$("<div />").addClass("ajs-layer "+(this.options.styleClass()||""))}}});
AJS.InlineLayer.OptionsDescriptor=AJS.Descriptor.extend({init:function(properties){this._super(properties);if(!this.contentRetriever()){if(this.ajaxOptions()){this.contentRetriever(new AJS.AjaxContentRetriever(this.ajaxOptions()))}else{if(this.content()){this.contentRetriever(new AJS.DOMContentRetriever(this.content()))}else{throw new Error("AJS.InlineLayer.OptionsDescriptor: Expected either [ajaxOptions] or [contentRetriever] or [content] to be defined")}}}if(!AJS.params.ignoreFrame&&this._inIFrame()){this.positioningController(new AJS.InlineLayer.IframePositioning())}else{this.positioningController(new AJS.InlineLayer.StandardPositioning())}if(AJS.$.browser.msie&&AJS.$.browser.version<9&&this.positioningController().isOffsetIncludingScroll){this.positioningController().isOffsetIncludingScroll(false)}if(!this.offsetTarget()&&this.content()){this.offsetTarget(this.content().prev())}},_inIFrame:function(){var parentWindow=window;try{while(parentWindow.parent.window!==parentWindow.window){parentWindow=parentWindow.parent;if(parentWindow.AJS){return true}}}catch(error){}return false},_getDefaultOptions:function(){return{alignment:AJS.INTELLIGENT_GUESS,hideOnScroll:".content-body",cushion:20,width:200}},positioningController:function(positioningController){if(positioningController){this.properties.positioningController=positioningController}else{return this.properties.positioningController}},ajaxOptions:function(ajaxOptions){if(ajaxOptions){this.properties.ajaxOptions=ajaxOptions}else{return this.properties.ajaxOptions}},content:function(content){if(content){content=AJS.$(content);if(content.length){this.properties.content=content}}else{if(this.properties.content&&this.properties.content.length){return this.properties.content}}},contentRetriever:function(contentRetriever){if(contentRetriever){this.properties.contentRetriever=contentRetriever}else{return this.properties.contentRetriever}},offsetTarget:function(offsetTarget){if(offsetTarget){offsetTarget=AJS.$(offsetTarget);if(offsetTarget.length){this.properties.offsetTarget=offsetTarget}}else{if(this.properties.offsetTarget&&this.properties.offsetTarget.length){return this.properties.offsetTarget}}},cushion:function(cushion){if(cushion){this.properties.cushion=cushion}else{return this.properties.cushion}},styleClass:function(styleClass){if(styleClass){this.properties.styleClass=styleClass}else{return this.properties.styleClass}},hideOnScroll:function(hideOnScroll){if(hideOnScroll){this.properties.hideOnScroll=hideOnScroll}else{return this.properties.hideOnScroll}},alignment:function(alignment){if(alignment){this.properties.alignment=alignment}else{return this.properties.alignment}},width:function(width){if(width){this.properties.width=width}else{return this.properties.width}}});
AJS.InlineLayer.create=function(options){var inlineLayers=[];if(options.content){options.content=AJS.$(options.content);AJS.$.each(options.content,function(){var instanceOptions=AJS.copyObject(options);instanceOptions.content=AJS.$(this);inlineLayers.push(new AJS.InlineLayer(instanceOptions))})}if(inlineLayers.length==1){return inlineLayers[0]}else{return inlineLayers}};
AJS.InlineLayer.StandardPositioning=Class.extend({set:function($layer,$offsetTarget,$placeholder){this.$layer=$layer;this.$offsetTarget=$offsetTarget;this.$placeholder=$placeholder;this.rebuiltCallbacks=[]},left:function(){var offset=this.offset();return{left:offset.left,top:offset.top+this.$offsetTarget.outerHeight()}},right:function(){var offset=this.offset();return{left:offset.left-this.$layer.outerWidth()+this.$offsetTarget.outerWidth(),top:offset.top+this.$offsetTarget.outerHeight()}},window:function(){return window},offset:function(){var offset=this.$offsetTarget.offset();if(this.$offsetTarget.hasFixedParent()){this.$layer.css("position","fixed");offset.top=offset.top-AJS.$(window).scrollTop()}else{this.$layer.css("position","absolute")}return offset},rebuilt:function(arg){var instance=this;if(AJS.$.isFunction(arg)){this.rebuiltCallbacks.push(arg)}else{AJS.$.each(this.rebuiltCallbacks,function(){this(instance.$layer)})}},appendToBody:function(){this.$layer.appendTo("body")},appendToPlaceholder:function(){this.$layer.appendTo(this.$placeholder)},scrollTo:function(){}});
AJS.InlineLayer.IframePositioning=AJS.InlineLayer.StandardPositioning.extend({offset:function(){var offsetInDocument=this._super(),iframeOffset=AJS.$("iframe[name="+window.name+"]",window.top.document.body).parent().offset(),topDocumentScrollTop=this._topDocumentScrollTop(),topDocumentScrollLeft=this._topDocumentScrollLeft(),iframeScrollTop=this._iframeScrollTop(),iframeScrollLeft=this._iframeScrollLeft(),scrollTopModifier=topDocumentScrollTop-iframeScrollTop,scrollLeftModifier=topDocumentScrollLeft-iframeScrollLeft;return{left:iframeOffset.left+offsetInDocument.left+scrollLeftModifier,top:iframeOffset.top+offsetInDocument.top+scrollTopModifier}},_topDocumentScrollTop:function(){return this.isOffsetIncludingScroll()?0:Math.max(window.top.document.body.scrollTop,window.top.document.documentElement.scrollTop)},_topDocumentScrollLeft:function(){return this.isOffsetIncludingScroll()?0:Math.max(window.top.document.body.scrollLeft,window.top.document.documentElement.scrollLeft)},_iframeScrollTop:function(){return this.isOffsetIncludingScroll()?2*Math.max(window.document.body.scrollTop,window.document.documentElement.scrollTop):0},_iframeScrollLeft:function(){return this.isOffsetIncludingScroll()?2*Math.max(window.document.body.scrollLeft,window.document.documentElement.scrollLeft):0},isOffsetIncludingScroll:function(offsetIncludingScroll){if(typeof this.offsetIncludingScroll==="undefined"){this.offsetIncludingScroll=true}if(typeof offsetIncludingScroll!=="undefined"){this.offsetIncludingScroll=offsetIncludingScroll}return this.offsetIncludingScroll},appendToBody:function(){window.top.jQuery("body").append(this.$layer)},window:function(){return window.top},scrollTo:function(){}});if(AJS.$.browser.safari||(AJS.$.browser.msie&&AJS.$.browser.version<8)){AJS.InlineLayer.IframePositioning=AJS.InlineLayer.IframePositioning.extend({appendToBody:function(){this.$layer=this._rebuildLayerInParent();window.top.jQuery("body").append(this.$layer);this.rebuilt()},appendToPlaceholder:function(){this.$layer=this._rebuildLayerInIframe();this.$layer.appendTo(this.$placeholder);this.rebuilt()},_rebuildLayerInParent:function(){return window.top.jQuery("<div class='ajs-layer'>"+this.$layer.html()+"</div>")},_rebuildLayerInIframe:function(){return AJS.$("<div class='ajs-layer'>"+this.$layer.html()+"</div>")}})};
AJS.Group=AJS.Control.extend({init:function(){this.items=[];this.index=-1;this._assignEvents("instance",this)},addItem:function(item){this.items.push(item);this._assignEvents("item",item)},removeItem:function(item){var index=AJS.$.inArray(item,this.items);if(index<0){throw new Error("AJS.Group: item ["+item+"] is not a member of this group")}item.trigger("blur");if(index<this.index){this.index--}this.items.splice(index,1);this._unassignEvents("item",item)},removeAllItems:function(){for(var i=0;i<this.items.length;i++){this._unassignEvents("item",this.items[i]);this.items[i].trigger("blur")}this.index=-1;this.items.length=0;this._unassignEvents("keys",document)},shiftFocus:function(offset){if(this.index===-1&&offset===1){offset=0}if(this.items.length>0){var i=(Math.max(0,this.index)+this.items.length+offset)%this.items.length;this.items[i].trigger("focus")}},prepareForInput:function(){this._assignEvents("keys",document)},_events:{"instance":{"focus":function(){if(this.items.length===0){return }if(this.index<0){this.items[0].trigger("focus")}else{this._assignEvents("keys",document)}},"blur":function(){if(this.index>=0){this.items[this.index].trigger("blur")}else{this._unassignEvents("keys",document)}}},"keys":{"aui:keydown aui:keypress":function(event){this._handleKeyEvent(event)}},"item":{"focus":function(event){var index=this.index;this.index=AJS.$.inArray(event.target,this.items);if(index<0){this.trigger("focus")}else{if(index!==this.index){this.items[index].trigger("blur")}}},"blur":function(event){if(this.index===AJS.$.inArray(event.target,this.items)){this.index=-1;this.trigger("blur")}},"remove":function(event){this.removeItem(event.target)}}},keys:{}});
AJS.ItemDescriptor=AJS.Descriptor.extend({REQUIRED_PROPERTIES:{label:true},_getDefaultOptions:function(){return{showLabel:true}},styleClass:function(){return this.properties.styleClass},value:function(){return this.properties.value},labelSuffix:function(value){if(typeof value!=="undefined"){this.properties.labelSuffix=value}return this.properties.labelSuffix},title:function(){return this.properties.title},label:function(){return this.properties.label},allowDuplicate:function(){return this.properties.allowDuplicate},removeOnUnSelect:function(){return this.properties.removeOnUnSelect},icon:function(){return this.properties.icon},selected:function(value){if(typeof value!=="undefined"){this.properties.selected=value}return this.properties.selected},model:function($model){if($model){this.properties.model=$model}else{return this.properties.model}},keywords:function(){return this.properties.keywords},href:function(){return this.properties.href},html:function(){return this.properties.html}});
AJS.GroupDescriptor=AJS.Descriptor.extend({_getDefaultOptions:function(){return{showLabel:true,label:"",items:[]}},styleClass:function(){return this.properties.styleClass},weight:function(){return this.properties.weight},label:function(){return this.properties.label},showLabel:function(){return this.properties.showLabel},items:function(){return this.properties.items},addItem:function(item){this.properties.items.push(item)},id:function(){return this.properties.id},setModel:function($model){this.properties.model=$model},replace:function(){return this.properties.replace},description:function(){return this.properties.description},model:function($model){if($model){this.properties.model=$model}else{return this.properties.model}}});
AJS.List=AJS.Control.extend({init:function(options){options=options||{};if(options){this.options=AJS.$.extend(true,this._getDefaultOptions(options),options)}else{this.options=this._getDefaultOptions(options)}var instance=this;this.containerSelector=AJS.$(this.options.$layerContent);this.disabled=true;this.reset();if(this.options.selectionHandler){this.$container.delegate(this.options.itemSelector,"click",function(e){instance.options.selectionHandler.call(instance,e)})}this.$container.delegate(this.options.itemSelector,"mouseover",function(){if(instance.motionDetector.moved&&!instance.disabled){instance.unfocusAll();instance.index=AJS.$.inArray(this,instance.$visibleItems);instance.focus()}})},_getDefaultOptions:function(){return{matchingStrategy:"(^|.*?\\s+)({0})(.*)",containerSelector:".aui-list",itemSelector:"li"}},index:0,moveToNext:function(){if(this.index<this.maxIndex){this.unfocusAll();++this.index;this.focus(this.SCROLL_DOWN)}else{if(this.$visibleItems.length>1){this.unfocusAll();this.index=0;this.focus(this.SCROLL_DOWN)}}this.motionDetector.wait()},SCROLL_UP:-1,SCROLL_DOWN:1,container:function(container){if(container){this.$container=AJS.$(container);this.containerSelector=container}else{return this.$container}},scrollContainer:function(){return this.container().parent()},unfocusAll:function(){this.$visibleItems.removeClass("active")},moveToPrevious:function(){if(this.index>0){this.unfocusAll();--this.index;this.focus(this.SCROLL_UP)}else{if(this.$visibleItems.length>0){this.unfocusAll();this.index=this.$visibleItems.length-1;this.focus(this.SCROLL_UP)}}this.motionDetector.wait()},unfocus:function(direction){if(direction!==undefined){this.scrollTo(this.$visibleItems.eq(this.index),direction)}this.$visibleItems.eq(this.index).removeClass("active")},scrollTo:function($target,direction){var $scrollContainer=this.scrollContainer(),offsetTop=$target.offset().top-this.$container.offset().top;if($target[0]===this.$visibleItems[0]){$scrollContainer.scrollTop(0)}else{if($scrollContainer.scrollTop()+$scrollContainer.height()<offsetTop+$target.outerHeight()||$scrollContainer.scrollTop()>offsetTop){if(direction===-1){$scrollContainer.scrollTop(offsetTop)}else{if(direction===1){$scrollContainer.scrollTop(offsetTop+$target.outerHeight()-$scrollContainer.height())}}}}},focus:function(direction){var $target=this.$visibleItems.eq(this.index);if(direction!==undefined){this.scrollTo($target,direction)}this.lastFocusedItemDescriptor=$target.data("descriptor");this.motionDetector.unbind();$target.addClass("active");if(!AJS.dim.dim){$target.scrollIntoView({duration:100,marginBottom:50,callback:AJS.$.proxy(this.motionDetector,"wait")})}else{this.motionDetector.wait()}},motionDetector:new JIRA.Mouse.MotionDetector(),disable:function(){if(this.disabled){return }this._unassignEvents("document",document);this.disabled=true;this.lastFocusedItemDescriptor=null;this.motionDetector.unbind()},enable:function(){var instance=this;if(!instance.disabled){return }instance.motionDetector.wait();window.setTimeout(function(){instance._assignEvents("document",document)},0);instance.disabled=false;this.scrollContainer().scrollTop(0)},getFocused:function(){return this.$visibleItems.filter(".active")},reset:function(index){var noSuggestionsClassName=/(?:^|\s)no-suggestions(?!\S)/;var hiddenClassName=/(?:^|\s)hidden(?!\S)/;this.$container=AJS.$(this.options.containerSelector);this.items=AJS.$(this.options.itemSelector,this.$container).filter(function(){return !noSuggestionsClassName.test(this.className)});this.$visibleItems=this.items.filter(function(){return !hiddenClassName.test(this.className)});this.groups=AJS.$(this.options.groupSelector,this.$container);this.maxIndex=this.$visibleItems.length-1;this.index=this.$visibleItems[index]?index:0;this.focus()},_getLinkFromItem:function(item){var link;item=AJS.$(item);if(item.is("a")){link=item}else{link=item.find("a")}if(!link.length){throw new Error("AJS.List._getLinkFromItem: could not find a link node")}else{return link}},generateListFromJSON:function(data,query){var event,$result=AJS.$("<div>"),instance=this,ungrouped=[],$listItems;this.suggestions=0;this.exactMatchIndex=-1;this.lastFocusedIndex=-1;this.lastQuery=query;AJS.$.each(data,function(i,descriptor){if(descriptor instanceof AJS.GroupDescriptor){if(ungrouped.length>0){$result.append(instance._generateUngroupedOptions(ungrouped,query));ungrouped=[]}$result.append(instance._generateOptGroup(descriptor,query))}else{if(this instanceof AJS.ItemDescriptor){ungrouped.push(descriptor)}}});if(ungrouped.length>0){$result.append(this._generateUngroupedOptions(ungrouped,query))}if($result.children().length===0){this.$container.html(this._render("noSuggestion"))}else{$result.find("ul:last").addClass("aui-last");this.$container.html($result.children())}this.$container.hide();$listItems=AJS.$("li > a",this.$container);$listItems.each(function(){var elem=AJS.$(this);elem.attr("title",elem.text())});$listItems.css({textOverflow:"ellipsis",overflow:"hidden"});this.$container.show();$listItems.textOverflow("&#x2026;",false);AJS.trigger("contentChange",this.$container);this.reset(this.exactMatchIndex>=0?this.exactMatchIndex:this.lastFocusedIndex)},_generateOption:function(item,query){var replacementText;if(query&&item.labelSuffix()===""){replacementText=item.label().replace(this.regex,function(_,prefix,match,suffix){return AJS.$("<div>").append(AJS.$("<span>").text(prefix)).append(AJS.$("<em>").text(match)).append(AJS.$("<span>").text(suffix)).html()})}if(this.exactMatchIndex<0){var itemValue=AJS.$.trim(item.label()).toLowerCase();if(itemValue===AJS.$.trim(query).toLowerCase()){this.exactMatchIndex=this.suggestions}else{if(this.lastFocusedIndex<0&&this.lastFocusedItemDescriptor&&itemValue===AJS.$.trim(this.lastFocusedItemDescriptor.label()).toLowerCase()){this.lastFocusedIndex=this.suggestions}}}this.suggestions++;return this._render("suggestion",item,replacementText)},_filterUngroupedOptions:function(options){var instance=this,filtered=[],keywordsRegex=(this.regexEscapedQuery)?new RegExp(AJS.format(".*{0}.*",this.regexEscapedQuery),"i"):null;AJS.$.each(options,function(i,item){item.labelSuffix("");if(instance.regex&&!instance.regex.test(item.label())){var matchedKeywords="";if(item.keywords()){var keywordString=""+item.keywords(),keywords=keywordString.split(",");for(var i=0;i<keywords.length;i++){var keyword=keywords[i];if(keywordsRegex.test(keyword)){if(matchedKeywords!=""){matchedKeywords+=", "}matchedKeywords+=keyword}}}if(matchedKeywords!=""){item.labelSuffix(" "+matchedKeywords);filtered.push(item)}}else{filtered.push(item)}});return filtered},_setRegexFromQuery:function(query){this.regexEscapedQuery=(query)?RegExp.escape(query):null;this.regex=(query)?new RegExp(AJS.format(this.options.matchingStrategy,this.regexEscapedQuery),"i"):null},_addOptionsToContainer:function(options,$container,query){var instance=this,maxInlineResultsDisplayed=this.options.maxInlineResultsDisplayed,hasSuggestion=false;AJS.$.each(options,function(i,option){if(!maxInlineResultsDisplayed||i<maxInlineResultsDisplayed||!query){var $suggestion=instance._generateOption(option,query);if($suggestion){hasSuggestion=true;$container.append($suggestion)}}else{$container.append(instance._render("tooManySuggestions",options.length-i));return false}});return hasSuggestion},_generateUngroupedOptions:function(options,query){var instance=this,$container=this._render("ungroupedSuggestions");this._setRegexFromQuery(query);if(query){options=this._filterUngroupedOptions(options)}var hasSuggestion=this._addOptionsToContainer(options,$container,query);if(hasSuggestion){return $container}},_generateOptGroup:function(groupDescriptor,query){var res=AJS.$(),optContainer=this._render("suggestionGroup",groupDescriptor),options=groupDescriptor.items();this._setRegexFromQuery(query);if(query){options=this._filterUngroupedOptions(options)}var hasSuggestion=this._addOptionsToContainer(options,optContainer,query);if(!hasSuggestion){return }if(groupDescriptor.label()&&groupDescriptor.showLabel()!==false){res=res.add(this._render("suggestionGroupHeading",groupDescriptor))}res=res.add(optContainer);return res},_events:{document:{"aui:keydown aui:keypress":function(event){this._handleKeyEvent(event)}}},_renders:{suggestion:function(descriptor,replacementText){var itemId=AJS.escapeHTML(AJS.$.trim(descriptor.label().toLowerCase()).replace(/[\s\.]+/g,"-")),listElem=AJS.$('<li class="aui-list-item aui-list-item-li-'+itemId+'">'),linkElem=AJS.$("<a />").addClass("aui-list-item-link");if(descriptor.selected()){listElem.addClass("aui-checked")}linkElem.attr("href",descriptor.href()||"#");if(descriptor.icon()&&descriptor.icon()!=="none"){linkElem.addClass("aui-iconised-link").css({backgroundImage:"url("+descriptor.icon()+")"})}if(descriptor.styleClass()){linkElem.addClass(descriptor.styleClass())}if(descriptor.html()){linkElem.html(descriptor.html())}else{if(!replacementText){linkElem.text(descriptor.label())}else{linkElem.html(replacementText)}}if(descriptor.labelSuffix()){var suffixSpan=AJS.$("<span class='aui-item-suffix' />").text(descriptor.labelSuffix());if(suffixSpan){suffixSpan.appendTo(linkElem)}}listElem.append(linkElem).data("descriptor",descriptor);return listElem},noSuggestion:function(){return AJS.$("<li class='no-suggestions'>"+"No Matches"+"</li>")},tooManySuggestions:function(suggestionCount){return AJS.$("<li class='no-suggestions'>"+AJS.format("{0} more options. Continue typing to refine futher.",suggestionCount)+"</li>")},ungroupedSuggestions:function(){return AJS.$("<ul>")},suggestionGroup:function(descriptor){return AJS.$("<ul class='aui-list-section' />").attr("id",descriptor.label().replace(/\s/g,"-").toLowerCase()).addClass(descriptor.styleClass()).data("descriptor",descriptor)},suggestionGroupHeading:function(descriptor){var elem=AJS.$("<h5 />").text(descriptor.label()).addClass(descriptor.styleClass()).data("descriptor",descriptor);if(descriptor.description()){AJS.$("<span class='aui-section-description' />").text(" ("+descriptor.description()+")").appendTo(elem)}return elem}},_acceptSuggestion:function(item){if(!item instanceof AJS.$){item=AJS.$(item)}var linkNode=this._getLinkFromItem(item);var event=new jQuery.Event("click");linkNode.trigger(event,[linkNode]);if(!event.isDefaultPrevented()){window.location.href=linkNode.attr("href")}},_acceptUserInput:function($field){$field.triggerHandler("blur")},_handleSectionByKeyboard:function(e){var $focusedItem=this.getFocused();var $field=AJS.$(e.target);if($focusedItem.length===0){return }if($focusedItem.closest("#user-inputted-option").length>0){this._acceptUserInput($field);return }if(this._latestQuery&&$field.val()!==this._latestQuery){var inputWords=$field.val().toLowerCase().match(/\S+/g);if(inputWords){var html=this.lastFocusedItemDescriptor&&this.lastFocusedItemDescriptor.html();var $item=html?AJS.$("<div>").html(html):$focusedItem;var matches=AJS.$.map($item.find("em,b"),function($match){$match=AJS.$($match);return($match.text()+AJS.$($match.attr("nextSibling")).text().match(/^\S*/)[0]).toLowerCase()});for(var i=0;i<inputWords.length;i++){var word=inputWords[i];var n=word.length;var hasMatch=false;for(var j=0;j<matches.length;j++){if(matches[j].slice(0,n)===word){hasMatch=true;break}}if(!hasMatch){this._acceptUserInput($field);return }}}}if(this.options.selectionHandler&&!this.options.selectionHandler.call(this,e)){return }this._acceptSuggestion($focusedItem)},_isValidInput:function(){return !this.disabled&&this.$container.is(":visible")},keys:{"Down":function(e){this.moveToNext();e.preventDefault()},"Up":function(e){this.moveToPrevious();e.preventDefault()},"Return":function(e){this._handleSectionByKeyboard(e)}}});
AJS.Dropdown=AJS.Control.extend({CLASS_SIGNATURE:"AJS_DROPDOWN",init:function(options){var instance=this;if(!(options instanceof AJS.Dropdown.OptionsDescriptor)){this.options=new AJS.Dropdown.OptionsDescriptor(options)}else{this.options=options}this.layerController=new AJS.InlineLayer(this.options.allProperties());this.layerController._validateClickToClose=function(e){if(e.target===this.offsetTarget()[0]){return false}else{if(e.target===this.layer()[0]){return false}else{if(this.offsetTarget().has(e.target).length>0){return false}}}return true};this.listController=this.options.listController();this.listEnabler=function(e){instance.listController._handleKeyEvent(e)};this.layerController.onhide(function(){instance.hide()});this.layerController.contentChange(function(){instance.listController.removeAllItems();instance.layerController.layer().find("li").each(function(){instance.listController.addItem(new AJS.Dropdown.ListItem({element:this,autoScroll:instance.options.autoScroll()}))});if(instance.options.focusFirstItem()){instance.listController.shiftFocus(0)}else{instance.listController.prepareForInput()}});this.trigger(this.options.trigger());this._applyIdToLayer()},show:function(){var instance=this;this.trigger().addClass(AJS.ACTIVE_CLASS);jQuery(this).trigger("showLayer");this.layerController.show();if(this.options.focusFirstItem()){this.listController.shiftFocus(0)}else{this.listController.prepareForInput()}},hide:function(){jQuery(this).trigger("hideLayer");this.trigger().removeClass(AJS.ACTIVE_CLASS);this.layerController.hide();this.listController.trigger("blur")},toggle:function(){if(this.layerController.isVisible()){this.hide()}else{this.show()}},content:function(content){if(content){this.layerController.content(content)}else{return this.layerController.content()}},trigger:function(trigger){if(trigger){if(this.options.trigger()){this._unassignEvents("trigger",this.options.trigger())}this.options.trigger(AJS.$(trigger));if(!this.layerController.offsetTarget()){this.layerController.offsetTarget(this.options.trigger())}this._assignEvents("trigger",this.options.trigger())}else{return this.options.trigger()}},_applyIdToLayer:function(){if(this.trigger().attr("id")){this.layerController.layer().attr("id",this.trigger().attr("id")+"_drop")}},_events:{trigger:{click:function(e){e.preventDefault();this.toggle()}}}});AJS.Dropdown.TRIGGER_SELECTOR=".aui-dropdown-trigger";AJS.Dropdown.CONTENT_SELECTOR=".aui-dropdown-content";AJS.DropDown=AJS.Dropdown;AJS.Dropdown.create=function(options){var dropdowns=[];if(options.content&&!options.trigger){options.content=AJS.$(options.content);AJS.$.each(options.content,function(){var instanceOptions=AJS.copyObject(options);instanceOptions.content=AJS.$(this);dropdowns.push(new AJS.Dropdown(instanceOptions))})}else{if(!options.content&&options.trigger){options.trigger=AJS.$(options.trigger);AJS.$.each(options.trigger,function(){var instanceOptions=AJS.copyObject(options);instanceOptions.trigger=AJS.$(this);dropdowns.push(new AJS.Dropdown(instanceOptions))})}else{if(options.content&&options.trigger){options.content=AJS.$(options.content);options.trigger=AJS.$(options.trigger);if(options.content.length===options.trigger.length){options.trigger.each(function(i){var instanceOptions=AJS.copyObject(options);instanceOptions.trigger=AJS.$(this);instanceOptions.content=options.content.eq(i);dropdowns.push(new AJS.Dropdown(instanceOptions))})}else{throw new Error("AJS.Dropdown.create: Expected the same number of content elements as trigger elements")}}}}return dropdowns};
AJS.Dropdown.OptionsDescriptor=AJS.Descriptor.extend({init:function(properties){this._super(properties);if(!this.content()&&!this.trigger()){throw new Error("AJS.Dropdown.OptionsDescriptor: expected either [content] or [trigger] to be defined.")}if(this.trigger()&&!this.content()){this.content(this.trigger().next(AJS.Dropdown.CONTENT_SELECTOR))}else{if(this.content()&&!this.trigger()){this.content(this.trigger().next(AJS.Dropdown.TRIGGER_SELECTOR))}}if(this.trigger()&&!this.content()){if(!this.ajaxOptions()){if(this.trigger().attr("href")){this.ajaxOptions(this.trigger().attr("href"))}}else{if(!this.ajaxOptions().url){this.ajaxOptions().url=this.trigger().attr("href")}}this.contentRetriever(new AJS.AjaxContentRetriever(this.ajaxOptions()))}else{if(this.content()){this.contentRetriever(new AJS.DOMContentRetriever(this.content()))}}if(!this.listController()){this.listController(new AJS.Dropdown.ListItemGroup())}},_getDefaultOptions:function(){return{trigger:null,ajaxOptions:null,autoScroll:true}},content:function(content){if(content){content=AJS.$(content);if(content.length){this.properties.content=content}}else{return this.properties.content}},trigger:function(trigger){if(trigger){this.properties.trigger=trigger}else{return this.properties.trigger}},contentRetriever:function(contentRetriever){if(contentRetriever){this.properties.contentRetriever=contentRetriever}else{return this.properties.contentRetriever}},listController:function(listController){if(listController){this.properties.listController=listController}else{return this.properties.listController}},focusFirstItem:function(focusFirstItem){if(focusFirstItem){this.properties.focusFirstItem=focusFirstItem}else{return this.properties.focusFirstItem}},autoScroll:function(autoScroll){if(typeof autoScroll!=="undefined"){this.properties.autoScroll=!!autoScroll}return this.properties.autoScroll},ajaxOptions:function(ajaxOptions){if(ajaxOptions){this.properties.ajaxOptions=ajaxOptions}else{return this.properties.ajaxOptions}},loop:function(loop){if(typeof loop!=="undefined"){this.properties.loop=loop}else{return this.properties.loop}},alignment:function(alignment){if(alignment){this.properties.alignment=alignment}else{return this.properties.alignment}},eventDelegator:function(eventDelegator){if(typeof eventDelegator!=="undefined"){this.properties.eventDelegator=eventDelegator}else{return this.properties.eventDelegator}}});
AJS.Dropdown.ListItem=AJS.Control.extend({init:function(options){this._setOptions(options);this.$element=AJS.$(this.options.element);this.hasFocus=false;this._assignEvents("instance",this);this._assignEvents("element",this.$element)},_getDefaultOptions:function(){return{element:null,autoScroll:true,focusClass:AJS.ACTIVE_CLASS}},_events:{"instance":{"focus":function(event){this.hasFocus=true;this.$element.addClass(this.options.focusClass);if(!event.noscrolling){AJS.Dropdown.ListItem.MOTION_DETECTOR.unbind();this.isWaitingForMove=true;if(this.options.autoScroll){this.$element.scrollIntoView(AJS.Dropdown.ListItem.SCROLL_INTO_VIEW_OPTIONS)}}},"blur":function(){this.hasFocus=false;this.$element.removeClass(this.options.focusClass)},"accept":function(){var event=new jQuery.Event("click");var $target=this.$element.is("a[href]")?this.$element:this.$element.find("a[href]");$target.trigger(event);if(!event.isDefaultPrevented()){window.top.location=$target.attr("href")}}},"element":{"mousemove":function(){if(((this.isWaitingForMove&&AJS.Dropdown.ListItem.MOTION_DETECTOR.moved)&&!this.hasFocus)||!this.hasFocus){this.isWaitingForMove=false;this.trigger({type:"focus",noscrolling:true})}}}}});AJS.Dropdown.ListItem.MOTION_DETECTOR=new JIRA.Mouse.MotionDetector();AJS.Dropdown.ListItem.SCROLL_INTO_VIEW_OPTIONS={duration:100,callback:function(){AJS.Dropdown.ListItem.MOTION_DETECTOR.wait()}};
AJS.Dropdown.ListItemGroup=AJS.Group.extend({keys:{"Up":function(event){this.shiftFocus(-1);event.preventDefault()},"Down":function(event){this.shiftFocus(1);event.preventDefault()},"Return":function(event){this.items[this.index].trigger("accept");event.preventDefault()}}});
JIRA.Dropdown=function(){var instances=[];return{addInstance:function(){instances.push(this)},hideInstances:function(){var that=this;jQuery(instances).each(function(){if(that!==this){this.hideDropdown()}})},getHash:function(){if(!this.hash){this.hash={container:this.dropdown,hide:this.hideDropdown,show:this.displayDropdown}}return this.hash},displayDropdown:function(){if(JIRA.Dropdown.current===this){return }this.hideInstances();JIRA.Dropdown.current=this;this.dropdown.css({display:"block"});this.displayed=true;var dd=this.dropdown;setTimeout(function(){var win=jQuery(window);var minScrollTop=dd.offset().top+dd.attr("offsetHeight")-win.height()+10;if(win.scrollTop()<minScrollTop){jQuery("html,body").animate({scrollTop:minScrollTop},300,"linear")}},100)},hideDropdown:function(){if(this.displayed===false){return }JIRA.Dropdown.current=null;this.dropdown.css({display:"none"});this.displayed=false},init:function(trigger,dropdown){var that=this;this.addInstance(this);this.dropdown=jQuery(dropdown);this.dropdown.css({display:"none"});jQuery(document).keydown(function(e){if(e.keyCode===9){that.hideDropdown()}});if(trigger.target){jQuery.aop.before(trigger,function(){if(!that.displayed){that.displayDropdown()}})}else{that.dropdown.css("top",jQuery(trigger).outerHeight()+"px");trigger.click(function(e){if(!that.displayed){that.displayDropdown();e.stopPropagation()}else{that.hideDropdown()}e.preventDefault()})}jQuery(document.body).click(function(){if(that.displayed){that.hideDropdown()}})}}}();JIRA.Dropdown.Standard=function(trigger,dropdown){var that=begetObject(JIRA.Dropdown);that.init(trigger,dropdown);return that};JIRA.Dropdown.AutoComplete=function(trigger,dropdown){var that=begetObject(JIRA.Dropdown);that.init=function(trigger,dropdown){this.addInstance(this);this.dropdown=jQuery(dropdown).click(function(e){e.stopPropagation()});this.dropdown.css({display:"none"});if(trigger.target){jQuery.aop.before(trigger,function(){if(!that.displayed){that.displayDropdown()}})}else{trigger.click(function(e){if(!that.displayed){that.displayDropdown();e.stopPropagation()}})}jQuery(document.body).click(function(){if(that.displayed){that.hideDropdown()}})};that.init(trigger,dropdown);return that};AJS.namespace("jira.widget.dropdown",null,JIRA.Dropdown);
JIRA.containDropdown=function(dropdown,containerSelector,dynamic){function getDropdownOffset(){return dropdown.$.offset().top-jQuery(containerSelector).offset().top}var container,ddOffset,availableArea,shadowOffset=25;if(dropdown.$.parents(containerSelector).length!==-1){container=jQuery(containerSelector),ddOffset=getDropdownOffset(),shadowOffset=30,availableArea=container.outerHeight()-ddOffset-shadowOffset;if(availableArea<=parseInt(dropdown.$.attr("scrollHeight"),10)){JIRA.containDropdown.containHeight(dropdown,availableArea)}else{if(dynamic){JIRA.containDropdown.releaseContainment(dropdown)}}dropdown.reset()}};JIRA.containDropdown.containHeight=function(dropdown,availableArea){dropdown.$.css({height:availableArea});if(dropdown.$.css("overflowY")!=="scroll"){dropdown.$.css({width:15+dropdown.$.attr("scrollWidth"),overflowY:"scroll",overflowX:"hidden"})}};JIRA.containDropdown.releaseContainment=function(dropdown){dropdown.$.css({height:"",width:"",overflowY:"",overflowX:""})};AJS.namespace("AJS.containDropdown",null,JIRA.containDropdown);
AJS.$.deactivateLinkedMenu=function(){};AJS.$.linkedMenuInstances=[];AJS.$.fn.linkedMenu=function(opts){var idx,that=this,onDisable,enabled=false,focusElement=function(elem){elem=AJS.$(elem);that.blur();elem.trigger("click","focus","mousedown")},keyHandler=function(e){var targ;if(e.keyCode===37||e.keyCode===39||e.keyCode===27){if(e.keyCode===37){targ=idx-1;if(idx-1>=0){if(isNotActive(that[targ])){idx=targ;focusElement(that[idx])}}else{targ=that.length-1;if(isNotActive(that[targ])){idx=targ;focusElement(that[idx])}}}else{if(e.keyCode===39){targ=idx+1;if(targ<that.length){if(isNotActive(that[targ])){idx=targ;focusElement(that[idx])}}else{targ=0;if(isNotActive(that[targ])){idx=targ;focusElement(that[idx])}}}else{that.disableLinkedMenu(e)}}e.preventDefault()}},isNotActive=function(elem){if(elem!==that[idx]){return true}},focusBridge=function(){if(isNotActive(this)){idx=AJS.$.inArray(this,that);focusElement(this)}},reflectionBridge=function(){var targ=AJS.$.inArray(this,AJS.$(opts.reflectFocus));if(isNotActive(that[targ])){idx=targ;focusElement(that[idx])}},enable=function(){var elem,clss;if(!enabled){AJS.$.currentLinkedMenu=that;if(opts.onFocusRemoveClass){elem=AJS.$(opts.onFocusRemoveClass);clss=opts.onFocusRemoveClass.match(/\.([a-z]*)$/);if(clss&&clss[1]&&elem.length>0){AJS.$(opts.onFocusRemoveClass).removeClass(clss[1]);onDisable=function(){AJS.$(elem).addClass(clss[1])}}}enabled=true;idx=AJS.$.inArray(this,that);that.mouseover(focusBridge);if(AJS.$.browser.mozilla){AJS.$(document).keypress(keyHandler)}else{AJS.$(document).keydown(keyHandler)}AJS.$(document).mousedown(that.disableLinkedMenu);if(opts.reflectFocus){AJS.$(opts.reflectFocus).mouseover(reflectionBridge)}}};that.disableLinkedMenu=function(e){AJS.$(document).unbind("keypress",keyHandler);AJS.$(document).unbind("keydown",keyHandler);that.unbind("mouseover",focusBridge);AJS.$(document).unbind("mousedown",arguments.callee);if(opts.reflectFocus){AJS.$(opts.reflectFocus).unbind("mouseover",reflectionBridge)}if(onDisable){onDisable()}that.blur();delete AJS.$.currentLinkedMenu;window.setTimeout(function(){enabled=false},200)};opts=opts||{};focusElement=opts.focusElement||focusElement;that.click(enable);return that};
(function(){function getNewScrollTop(options){options=options||{};options.marginTop=options.marginTop||options.margin||0;options.marginBottom=options.marginBottom||options.margin||0;var $window=window.top.jQuery(window.top);var $stalker=window.top.jQuery("#stalker");var scrollTop=$window.scrollTop();var scrollHeight=$window.height();var offsetTop=Math.max(0,getPageY(this[0])-options.marginTop);var offsetHeight=options.marginTop+this.outerHeight()+options.marginBottom;var newScrollTop=scrollTop;if(newScrollTop+scrollHeight<offsetTop+offsetHeight){newScrollTop=offsetTop+offsetHeight-scrollHeight}if($stalker.length>0){offsetTop-=$stalker.outerHeight()+35}if(newScrollTop>offsetTop){newScrollTop=offsetTop}return newScrollTop}function getPageY(element){var currElement=element,offsetTop=0;do{offsetTop+=currElement.offsetTop}while(currElement=currElement.offsetParent);currElement=element;do{if(currElement.scrollTop){offsetTop-=currElement.scrollTop}currElement=currElement.parentNode}while(currElement&&currElement!=document.body);return offsetTop}jQuery.fn.scrollIntoView=function(options){if(this.length>0&&!this.hasFixedParent()){options=options||{};if(!this.is(":visible")&&options.callback){options.callback();return this}var scrollTop=window.top.jQuery(window.top).scrollTop();var newScrollTop=getNewScrollTop.call(this,options);var $stalker=window.top.jQuery("#stalker");if(newScrollTop!==scrollTop){var $target=this;var $document=window.top.jQuery(window.top.document);$document.trigger("moveToStarted",$target);if(options.duration){$document.find("body, html").stop(true).animate({scrollTop:newScrollTop},options.duration,"swing",function(){if(options.callback){options.callback()}$document.trigger("moveToFinished",$target);$stalker.trigger("positionChanged")})}else{$document.find("body, html").attr("scrollTop",newScrollTop)}}else{if(options.callback){options.callback()}}}return this};jQuery.fn.isInView=function(options){if(this.length>0&&!this.hasFixedParent()){options=options||{};var scrollTop=window.top.jQuery(window.top).scrollTop();var newScrollTop=getNewScrollTop.call(this,options);return newScrollTop===scrollTop}return this}})();
AJS.namespace("JIRA.FRAGMENTS");JIRA.FRAGMENTS.issueActionsFragment=function(){function addIssueIdToReturnUrl(issueId){var matchSelectedIssueId=/selectedIssueId=[0-9]*/g;if(self!=top){return encodeURIComponent(window.top.location.href)}var url=window.location.href,newUrl=url;if(/selectedIssueId=[0-9]*/.test(url)){newUrl=url.replace(matchSelectedIssueId,"selectedIssueId="+issueId)}else{if(url.lastIndexOf("?")>=0){newUrl=url+"&"}else{newUrl=url+"?"}newUrl=newUrl+"selectedIssueId="+issueId}return encodeURIComponent(newUrl)}return function(json){var returnURL=addIssueIdToReturnUrl(json.id);var htmlParts=['<div class="aui-list"><ul class="aui-list-section"><li class="aui-list-item"><a href="',contextPath,"/browse/",json.key,'" class="aui-list-item-link">',htmlEscape(json.viewIssue),"</a></li></ul>"];var hasActions=json.actions&&json.actions.length>0;var hasOperations=json.operations&&json.operations.length>0;if(hasActions){htmlParts.push(hasOperations?'<ul class="aui-list-section">':'<ul class="aui-list-section aui-last">');var URL_A=contextPath+"/secure/WorkflowUIDispatcher.jspa?id="+json.id+"&amp;action=";var URL_B="&amp;atl_token="+json.atlToken+"&amp;returnUrl="+returnURL;AJS.$.each(json.actions,function(){htmlParts.push('<li class="aui-list-item"><a href="',URL_A,this.action,URL_B,'" rel="',this.action,'" class="aui-list-item-link issueaction-workflow-transition">',htmlEscape(this.name),"</a></li>")});htmlParts.push("</ul>")}if(hasOperations){htmlParts.push('<ul class="aui-list-section aui-last">');URL_A="&amp;returnUrl="+returnURL;URL_B="&amp;atl_token="+json.atlToken;AJS.$.each(json.operations,function(){htmlParts.push('<li class="aui-list-item"><a href="',this.url,URL_A,URL_B,'" class="aui-list-item-link ',this.styleClass,'">',htmlEscape(this.name),"</a></li>")});htmlParts.push("</ul>")}htmlParts.push("</div>");return AJS.$(htmlParts.join(""))}}();
AJS.DropdownSelect=AJS.Control.extend({init:function(options){var instance=this;this.model=new AJS.SelectModel(options);this.model.$element.hide();this._createFurniture();this.dropdownController=AJS.InlineLayer.create({alignment:AJS.LEFT,width:200,content:AJS.$(".aui-list",this.$container)});this.dropdownController.layer().addClass("select-menu");this.listController=new AJS.List({containerSelector:AJS.$(".aui-list",this.$container),groupSelector:"ul.opt-group",itemSelector:"li:not(.no-suggestions)",selectionHandler:function(e){instance._selectionHandler(this.getFocused(),e);e.preventDefault()}});this._assignEventsToFurniture()},show:function(){this.dropdownController.show();this._resetSuggestions();this.listController.enable()},_assignEventsToFurniture:function(){this._assignEvents("trigger",this.$trigger)},_createFurniture:function(){var id=this.model.$element.attr("id");this.$container=this._render("container",id);this.$trigger=this.model.$element.prev("a").appendTo(this.$container);this.$container.append(this._render("suggestionsContainer",id));this.$container.insertBefore(this.model.$element)},_resetSuggestions:function(){this.listController.generateListFromJSON(this.model.getAllDescriptors());this.listController.unfocusAll();this.listController.index=0;this.listController.focus()},_renders:{container:function(idPrefix){return AJS.$('<div class="select-menu" id="'+idPrefix+'-multi-select">')},suggestionsContainer:function(idPrefix){return AJS.$('<div class="aui-list aui-list-checked" id="'+idPrefix+'-suggestions" tabindex="-1"></div>')}},_selectionHandler:function(selected){var instance=this,intCount=0;this.model.setSelected(selected.data("descriptor"));this.dropdownController.content().find(".aui-checked").removeClass(".aui-checked");selected.addClass(".aui-checked");var myInterval=window.setInterval(function(){intCount++;selected.toggleClass(".aui-checking");if(intCount>2){clearInterval(myInterval);instance.dropdownController.hide()}},80)},_events:{trigger:{click:function(e){this.show();e.preventDefault();e.stopPropagation()}}}});AJS.namespace("AJS.SelectMenu",null,AJS.DropdownSelect);
AJS.SecurityLevelSelect=AJS.DropdownSelect.extend({_createFurniture:function(){AJS.populateParameters();this._super()},_selectionHandler:function(selected){var descriptor=selected.data("descriptor");if(descriptor&&!descriptor.value()){this.$trigger.find("span:first").removeClass("icon-locked").addClass("icon-unlocked");this.$container.parent().find(".current-level").text("Viewable by All Users")}else{this.$trigger.find("span:first").removeClass("icon-unlocked").addClass("icon-locked");var htmlEscapedLabel=AJS.$("<div/>").text(descriptor.label()).html();this.$container.parent().find(".current-level").html(AJS.format("Restricted to \u003cspan class=\'\'redText\'\'>{0}\u003c\/span>",htmlEscapedLabel))}this._super(selected)},_handleDownKey:function(e){if(e.keyCode===jQuery.ui.keyCode.DOWN&&!this.dropdownController.isVisible()){e.preventDefault();e.stopPropagation();this.show()}},_events:{trigger:{keydown:function(e){this._handleDownKey(e)},keypress:function(e){this._handleDownKey(e)}}}});AJS.namespace("AJS.SecurityLevel",null,AJS.SecurityLevelSelect);
AJS.SelectModel=AJS.Control.extend({init:function(options){if(options.element){options.element=AJS.$(options.element)}else{options.element=AJS.$(options)}this._setOptions(options);this.$element=this.options.element;this.type=this.$element.attr("multiple")?"multiple":"single";if(this.type==="single"){this.$element.attr("multiple","multiple")}this._parseDescriptors()},_getDefaultOptions:function(){return{}},setSelected:function(descriptor){var selectedItem=false;if(this.type==="single"){this.setAllUnSelected()}this.$element.find("option").filter(function(){return AJS.$(this).attr("value")===descriptor.value()}).each(function(){selectedItem=true;AJS.$(this).attr("selected","selected").data("descriptor").selected(true)});if(!selectedItem){descriptor.selected(true);var newOption=this._render("option",descriptor);newOption.attr("selected","selected");this.$element.append(newOption)}},setAllUnSelected:function(){var instance=this;AJS.$(this.getSelectedDescriptors()).each(function(){instance.setUnSelected(this)})},setUnSelected:function(descriptor){var instance=this;this.$element.find("option").filter(function(){return AJS.$(this).attr("value")===descriptor.value()}).each(function(){var $this=AJS.$(this);if(instance.options.removeOnUnSelect||$this.data("descriptor").removeOnUnSelect()){$this.remove()}else{$this.attr("selected","");$this.data("descriptor").selected(false)}})},_isOptionPresent:function(descriptor,ctx){var notFound=true;var value=descriptor.value();AJS.$("option",ctx||this.$element).each(function(){return notFound=(this.value!==value)});return !notFound},_isOptionGroupPresent:function(descriptor){var $optgroup=this.$element.find("optgroup").filter(function(){return AJS.$(this).attr("label")===descriptor.label()});return $optgroup.length>0},remove:function(descriptor){if(descriptor&&descriptor.model()){descriptor.model().remove()}},getDescriptor:function(value){var returnDescriptor;value=AJS.$.trim(value.toLowerCase());AJS.$.each(this.getAllDescriptors(false),function(e,descriptor){if(value===AJS.$.trim(descriptor.label().toLowerCase())||value===AJS.$.trim(descriptor.value().toLowerCase())){returnDescriptor=descriptor;return false}});return returnDescriptor},appendOptionsFromJSON:function(optionDescriptors){var instance=this;AJS.$.each(optionDescriptors,function(i,descriptor){var optgroup;if(descriptor instanceof AJS.GroupDescriptor&&(descriptor.replace()||!instance._isOptionGroupPresent(descriptor))){if(descriptor.replace()){if(descriptor.id()){optgroup=instance.$element.find("#"+descriptor.id())}else{optgroup=instance.$element.find("optgroup[label='"+descriptor.label()+"']")}if(optgroup.length){optgroup.find("option:not(:selected)").remove()}}if(!optgroup||!optgroup.length){optgroup=instance._render("optgroup",descriptor)}optgroup.data("descriptor",descriptor);AJS.$.each(descriptor.items(),function(i,optDescriptor){if(!instance._isOptionPresent(optDescriptor,optgroup)){optgroup.append(instance._render("option",optDescriptor))}});if(typeof descriptor.weight()!=="undefined"){var target=instance.$element.children().eq(descriptor.weight());if(target[0]!==optgroup[0]){if(target.length){optgroup.insertBefore(target)}else{optgroup.appendTo(instance.$element)}}}else{optgroup.appendTo(instance.$element)}}else{if(descriptor instanceof AJS.GroupDescriptor){if(descriptor.id()){optgroup=instance.$element.find("#"+descriptor.id())}else{optgroup=instance.$element.find("optgroup[label='"+descriptor.label()+"']")}optgroup.data("descriptor",descriptor);AJS.$.each(descriptor.items(),function(i,optDescriptor){var value=optDescriptor.value();if(!instance._isOptionPresent(optDescriptor,optgroup)){optgroup.append(instance._render("option",optDescriptor))}else{optgroup.find('option[value="'+value.replace(/"/g,'\\"')+'"]').data("descriptor",optDescriptor)}})}else{if(descriptor instanceof AJS.ItemDescriptor&&!instance._isOptionPresent(descriptor)){instance._render("option",descriptor).appendTo(instance.$element)}}}})},_parseOption:function(optionElem){var descriptor;optionElem=AJS.$(optionElem);if(this.options.removeNullOptions&&this._hasNullValue(optionElem)){optionElem.remove();return null}descriptor=new AJS.ItemDescriptor({styleClass:optionElem.attr("className"),value:optionElem.val(),title:optionElem.attr("title"),label:AJS.$.trim(optionElem.text()),icon:optionElem.css("backgroundImage").replace(/url\(['"]?(.*?)['"]?\)/,"$1"),selected:optionElem.attr("selected")?true:false,model:optionElem});optionElem.data("descriptor",descriptor);return descriptor},_hasNullValue:function(optionElement){return optionElement.val()<0},_parseDescriptors:function(){var instance=this,items=this.$element.children();function parseOptGroup(optionGroup){optionGroup.data("descriptor",new AJS.GroupDescriptor({label:optionGroup.attr("label"),styleClass:optionGroup.attr("className"),model:optionGroup,items:retrieveAvailableOptions(optionGroup)}))}function retrieveAvailableOptions(parent){var availableOptionElems=AJS.$("option",parent),arr=[];AJS.$.each(availableOptionElems,function(){arr.push(instance._parseOption(this))});return arr}items.each(function(i){var item=items.eq(i);if(item.is("optgroup")){parseOptGroup(item)}else{if(item.is("option")){instance._parseOption(item)}}})},getSelectedDescriptors:function(){var descriptors=[];this.$element.find("option").each(function(){if(this.selected){descriptors.push(AJS.$.data(this,"descriptor"))}});return descriptors},getAllDescriptors:function(showGroups){var properties,descriptors=[];this.$element.children().each(function(){var descriptor,elem=AJS.$(this);if(elem.is("option")){descriptors.push(elem.data("descriptor"))}else{if(elem.is("optgroup")){if(showGroups!==false){properties=AJS.copyObject(elem.data("descriptor").allProperties(),false);properties.items=[];descriptor=new AJS.GroupDescriptor(properties);descriptors.push(descriptor)}elem.children("option").each(function(){var elem=AJS.$(this);if(showGroups!==false){descriptor.addItem(elem.data("descriptor"))}else{descriptors.push(elem.data("descriptor"))}})}}});return descriptors},clearUnSelected:function(){this.$element.find("option:not(:selected)").remove()},getUnSelectedDescriptors:function(showGroups){var descriptors=[],selectedValues={},addedValues={};function isValid(descriptor){var descriptorVal=descriptor.value().toLowerCase();if(!selectedValues[descriptorVal]&&(!addedValues[descriptorVal]||descriptor.allowDuplicate()!==false)){addedValues[descriptorVal]=true;return true}return false}AJS.$.each(this.getSelectedDescriptors(),function(i,descriptor){selectedValues[descriptor.value().toLowerCase()]=true});this.$element.children().each(function(){var descriptor,properties,elem=AJS.$(this);if(elem.is("option")&&!this.selected){descriptor=AJS.$.data(this,"descriptor");if(isValid(descriptor)){descriptors.push(descriptor)}}else{if(elem.is("optgroup")){if(showGroups!==false){properties=AJS.copyObject(elem.data("descriptor").allProperties(),false);properties.items=[];descriptor=new AJS.GroupDescriptor(properties);descriptors.push(descriptor)}elem.find("option").each(function(){if(this.selected){return }var itemDescriptor=AJS.$.data(this,"descriptor");if(isValid(itemDescriptor)){if(showGroups!==false){descriptor.addItem(itemDescriptor)}else{descriptors.push(itemDescriptor)}}})}}});return descriptors},_renders:{option:function(descriptor){var option=new Option(descriptor.label(),descriptor.value());var $option=AJS.$(option);var iconUrl=descriptor.icon();option.title=descriptor.title();AJS.$.data(option,"descriptor",descriptor);descriptor.model($option);if(iconUrl){$option.css("backgroundImage","url("+iconUrl+")")}return $option},optgroup:function(descriptor){var elem=AJS.$("<optgroup />").addClass(descriptor.styleClass()).attr("label",descriptor.label());descriptor.model(elem);elem.data("descriptor",descriptor);if(descriptor.id()){elem.attr("id",descriptor.id())}return elem}}});
AJS.QueryableDropdownSelect=AJS.Control.extend({INVALID_KEYS:{"Shift":true,"Esc":true,"Right":true},init:function(options){var instance=this;this._setOptions(options);this._queuedRequest=0;this.suggestionsVisible=false;if(this.options.ajaxOptions.minQueryLength){this.options.ajaxOptions.minQueryLength=parseInt(this.options.ajaxOptions.minQueryLength,10)}this._createFurniture();if(this.options.dropdownController){this.dropdownController=this.options.dropdownController}else{this.dropdownController=AJS.InlineLayer.create({offsetTarget:this.$field,width:this.$field.innerWidth(),content:options.element})}this.dropdownController.onhide(function(){instance.hideSuggestions()});this.listController=new AJS.List({containerSelector:options.element,groupSelector:"ul.aui-list-section",matchingStategy:this.options.matchingStategy,itemSelector:"li",eventTarget:this.$field,selectionHandler:function(){instance.$field.val("Loading...").css("color","#999");instance.hideSuggestions();return true}});if(this.options.width){this.setFieldWidth(this.options.width)}this._assignEventsToFurniture();if(this.options.loadOnInit){this.suggestionsDisabled=true;this._requestThenResetSuggestions()}},setFieldWidth:function(width){var paddingWidth;this.$container.css({width:width,minWidth:width});paddingWidth=this.$field.outerWidth()-this.$field.width();this.$field.width(width-paddingWidth)},showErrorMessage:function(value){var $container=this.$container.parent(".field-group");this.hideErrorMessage();this.$errorMessage.text(AJS.format(this.options.errorMessage,value||this.getQueryVal()));if($container.length===1){$container.append(this.$errorMessage);return }if($container.length===0){$container=this.$container.parent(".frother-control-renderer")}if($container.length===1){this.$errorMessage.prependTo($container);return }if($container.length===0){this.$container.parent().append(this.$errorMessage)}},hideErrorMessage:function(){if(this.$errorMessage){this.$errorMessage.remove()}this.$container.parent().find(".error").remove()},_getDefaultOptions:function(){return{id:"default",ajaxOptions:{data:{query:""},dataType:"json",minQueryLength:0},keyInputPeriod:75,localListLiveUpdateLimit:25,localListLiveUpdateDelay:150}},getAjaxOptions:function(){this.options.ajaxOptions.data.query=AJS.$.trim(this.getQueryVal());return AJS.copyObject(this.options.ajaxOptions)},issueRequest:function(){var instance=this,ajaxOptions=this.getAjaxOptions();ajaxOptions.complete=function(xhr,textStatus,smartAjaxResult){instance.outstandingRequest=null;if(!instance.$container.is(":visible")){return }if(smartAjaxResult.successful){instance._handleServerSuccess(smartAjaxResult)}else{if(!smartAjaxResult.aborted){instance.hideSuggestions();instance._handleServerError(smartAjaxResult)}}if(instance.options.ajaxOptions.query){instance.$container.attr("data-query",instance.options.ajaxOptions.data.query)}};this.outstandingRequest=JIRA.SmartAjax.makeRequest(ajaxOptions);AJS.$(this.outstandingRequest).throbber({target:this.$dropDownIcon,isLatentThreshold:500})},_handleServerSuccess:function(smartAjaxResult){if(!this.options.ajaxOptions.query||this.options.loadOnInit||this.getQueryVal()==this.options.ajaxOptions.data.query){this._handleSuggestionResponse(smartAjaxResult.data)}},_handleServerError:function(smartAjaxResult){var errMsg=JIRA.SmartAjax.buildSimpleErrorContent(smartAjaxResult,{alert:true});alert(errMsg)},_createFurniture:function(){this.$container=this._render("container").insertBefore(this.options.element);this.$field=this._render("field").appendTo(this.$container);this.$dropDownIcon=this._render("dropdownAndLoadingIcon",this._hasDropdownButton()).appendTo(this.$container);this.$suggestionsContainer=this._render("suggestionsContainer");if(this.options.overlabel){this.$overlabel=this._render("overlabel").insertBefore(this.$field);this.$overlabel.overlabel()}},_hasDropdownButton:function(){if(this.options.showDropdownButton===false){return false}else{if(this.options.showDropdownButton||this.options.ajaxOptions.minQueryLength===0){return true}}},_assignEventsToFurniture:function(){var instance=this;if(jQuery.browser.msie&&jQuery.browser.version<8){this.$field.bind("beforedeactivate",function(e){if(e.toElement===document.documentElement){var blurEvents=instance.$field.data("events").blur;delete instance.$field.data("events").blur;instance.$field.one("blur",function(){instance.$field.focus();window.setTimeout(function(){instance.$field.data("events").blur=blurEvents},0)})}})}this._assignEvents("ignoreBlurElement",this.dropdownController.$layer);if(this._hasDropdownButton()){this._assignEvents("ignoreBlurElement",this.$dropDownIcon);this._assignEvents("dropdownAndLoadingIcon",this.$dropDownIcon)}setTimeout(function(){instance._assignEvents("field",instance.$field);instance._assignEvents("keys",instance.$field)},15)},_useCachedRequest:function(){return !!(this.cachedList&&!this.options.ajaxOptions.query)},_isValidRequest:function(){return this.options.ajaxOptions.query||(!this.cachedList&&!this.outstandingRequest)},_requestThenResetSuggestions:function(ignoreBuffer){var instance=this;this.listController._latestQuery=AJS.$.trim(this.getQueryVal());if(this._useCachedRequest()){this._handleSuggestionResponse(this.cachedList)}else{if(this._isValidRequest()){if(ignoreBuffer&&this.outstandingRequest){this.outstandingRequest.abort();this.outstandingRequest=null}clearTimeout(this._queuedRequest);if(!this.outstandingRequest){this.issueRequest()}else{this._queuedRequest=setTimeout(function(){instance._requestThenResetSuggestions(ignoreBuffer)},this.options.keyInputPeriod)}}}},showSuggestions:function(){this._requestThenResetSuggestions(true)},_handleSuggestionResponse:function(data){if(data!==this.cachedList){if(this._formatResponse){data=this._formatResponse(data)}else{if(this.options.ajaxOptions.formatResponse){data=this.options.ajaxOptions.formatResponse.call(this,data)}}}this.cachedList=data;this._setSuggestions(this.cachedList)},_setSuggestions:function(data){if(this.suggestionsDisabled){this.suggestionsDisabled=false;return }this.suggestionsVisible=true;if(data){this.dropdownController.show();this.dropdownController.setWidth(this.$field.innerWidth());this.dropdownController.setPosition();if(this.options.ajaxOptions.query){this.listController.generateListFromJSON(data)}else{this.listController.generateListFromJSON(data,this.getQueryVal())}this.listController.enable()}else{this.hideSuggestions()}if(!this.options.ajaxOptions.query){this.$container.attr("data-query",this.getQueryVal())}},getQueryVal:function(){return this.$field.val()},_isValidInput:function(event){return this.$field.is(":visible")&&!this.INVALID_KEYS[event.key]},_handleCharacterInput:function(ignoreBuffer,ignoreQueryLength){this.suggestionsDisabled=false;if(ignoreQueryLength||AJS.$.trim(this.$field.val()).length>=this.options.ajaxOptions.minQueryLength){if(this.options.ajaxOptions.url){this.$dropDownIcon.removeClass("noloading");this._requestThenResetSuggestions(ignoreBuffer)}else{var descriptors=this.model.getUnSelectedDescriptors(),instance=this;if(this.inlineBufferTimeout){clearTimeout(this.inlineBufferTimeout)}if(descriptors.length>=this.options.localListLiveUpdateLimit){this.inlineBufferTimeout=setTimeout(function(){instance._setSuggestions(descriptors)},this.options.localListLiveUpdateDelay)}else{this._setSuggestions(descriptors)}}}else{this._setSuggestions()}},_handleDown:function(e){if(!this.suggestionsVisible){this._handleCharacterInput(true,true)}},_rejectPendingRequests:function(){if(this.outstandingRequest){this.outstandingRequest.abort()}clearTimeout(this._queuedRequest)},hideSuggestions:function(){if(!this.suggestionsVisible){return }clearTimeout(this.inlineBufferTimeout);this._rejectPendingRequests();this.suggestionsVisible=false;this.$dropDownIcon.addClass("noloading");this.dropdownController.hide();this.listController.disable()},_deactivate:function(){this.hideSuggestions()},_handleEscape:function(e){if(this.suggestionsVisible){e.stopPropagation();if(e.type==="keyup"){this.hideSuggestions()}}},acceptFocusedSuggestion:function(){var focused=this.listController.getFocused();if(focused.length!==0&&focused.is(":visible")){this.listController._acceptSuggestion(focused)}},keys:{"Down":function(e){if(this._hasDropdownButton()){this._handleDown(e)}},"Up":function(e){e.preventDefault()},"Return":function(e){e.preventDefault()}},onEdit:function(e){var instance=this;if(e.key==="\r"){return }this.$field.one("keyup",function(){instance._handleCharacterInput()})},_events:{dropdownAndLoadingIcon:{click:function(e){if(this.suggestionsVisible){this.hideSuggestions()}else{this._handleDown(e)}e.stopPropagation()}},field:{blur:function(){if(!this.ignoreBlurEvent){this._deactivate()}},click:function(e){e.stopPropagation()},"keydown keyup":function(e){if(e.keyCode===27){this._handleEscape(e)}}},keys:{"aui:keydown aui:keypress":function(event){this._handleKeyEvent(event)}},ignoreBlurElement:{mousedown:function(e){var instance=this;if(jQuery.browser.msie){this.ignoreBlurEvent=true;jQuery(e.target).one("focus",function(){instance.$field.focus();instance.ignoreBlurEvent=false})}else{e.preventDefault()}}}},_renders:{overlabel:function(){return AJS.$("<label id='"+this.options.id+"-label' for='"+this.options.id+"-field' class='overlabel'>"+this.options.overlabel+"</label>")},field:function(){return AJS.$("<input class='text' id='"+this.options.id+"-field' type='text' autocomplete='off' />")},container:function(){return AJS.$("<div class='queryable-select' id='"+this.options.id+"-queryable-container' />")},dropdownAndLoadingIcon:function(showDropdown){var $element=AJS.$('<span class="icon noloading"><span>More</span></span>');if(showDropdown){$element.addClass("drop-menu")}return $element},suggestionsContainer:function(){return AJS.$("<div class='aui-list' id='"+this.options.id+"' tabindex='-1'></div>")}}});AJS.namespace("AJS.QueryableDropdown",null,AJS.QueryableDropdownSelect);
AJS.MultiSelect=AJS.QueryableDropdownSelect.extend({init:function(options){var instance=this;if(this._setOptions(options)===this.INVALID){return this.INVALID}AJS.$(this.options.element).hide();if(this.options.disabled){this._createFurniture(true);return this}this.model=new AJS.SelectModel({element:this.options.element,removeOnUnSelect:this.options.removeOnUnSelect});this._createFurniture();this.dropdownController=AJS.InlineLayer.create({alignment:AJS.LEFT,offsetTarget:this.$field,maxInlineResultsDisplayed:this.options.maxInlineResultsDisplayed,content:AJS.$(".aui-list",this.$container)});this.dropdownController.onhide(function(){instance.hideSuggestions()});this.listController=new AJS.List({containerSelector:AJS.$(".aui-list",this.$container),groupSelector:"ul.aui-list-section",itemSelector:"li",matchingStrategy:this.options.matchingStrategy,maxInlineResultsDisplayed:this.options.maxInlineResultsDisplayed,selectionHandler:function(e){instance._selectionHandler(this.getFocused(),e);return false}});this._assignEventsToFurniture();this.lozengeGroup=new AJS.MultiSelect.LozengeGroup();this._assignEvents("lozengeGroup",this.lozengeGroup);if(this.options.width){this.setFieldWidth(this.options.width)}this._restoreSelectedOptions();this.model.$element.trigger("initialized",[this]);return this},_getDefaultOptions:function(){return AJS.$.extend(true,this._super(),{minRoomForText:50,errorMessage:"The value {0} is invalid.",ajaxOptions:{minQueryLength:1},showDropdownButton:true})},_createFurniture:function(disabled){var id=this.model.$element.attr("id");if(this.model.$element.prev().hasClass("ajs-multi-select-placeholder")){this.model.$element.prev().remove()}if(disabled){this.model.$element.replaceWith(this._render("disableSelectField",id))}else{this.$container=this._render("container",id);this.$field=this._render("field",id).appendTo(this.$container);this.$container.append(this._render("suggestionsContainer",id));this.$container.insertBefore(this.model.$element);this.$dropDownIcon=this._render("dropdownAndLoadingIcon",this._hasDropdownButton()).appendTo(this.$container);this.$errorMessage=this._render("errorMessage");this.$selectedItemsWrapper=this._render("selectedItemsWrapper").appendTo(this.$container);this.$selectedItemsContainer=this._render("selectedItemsContainer").appendTo(this.$selectedItemsWrapper)}},_assignEventsToFurniture:function(){this._super();this._assignEvents("body",document);this._assignEvents("selectedItemsContainer",this.$selectedItemsContainer)},_getUserInputValue:function(){return this.options.uppercaseUserEnteredOnSelect?this.$field.val().toUpperCase():this.$field.val()},_handleUserInputOption:function(){var groupDescriptor;if(!this.hasUserInputtedOption()||this.$field.val().length===0){return }groupDescriptor=new AJS.GroupDescriptor({type:"optgroup",label:"user inputted option",weight:9999,showLabel:false,replace:true});groupDescriptor.addItem(new AJS.ItemDescriptor({value:this._getUserInputValue(),label:this.$field.val(),labelSuffix:" ("+this.options.userEnteredOptionsMsg+")",title:this.$field.val(),allowDuplicate:false}));this.model.appendOptionsFromJSON([groupDescriptor])},hasUserInputtedOption:function(){return this.options.userEnteredOptionsMsg},_handleSuggestionResponse:function(data){if(this.options.ajaxOptions.query){this.model.clearUnSelected()}this._handleUserInputOption();this._super(data)},_setSuggestions:function(data){if(data){this.model.appendOptionsFromJSON(data);this._super(this.model.getUnSelectedDescriptors())}else{this.hideSuggestions()}},removeItem:function(descriptor){this.model.setUnSelected(descriptor);this.updateItemsIndent();this.model.trigger("unselect",[descriptor,this])},_restoreSelectedOptions:function(){var instance=this;AJS.$.each(this.model.getSelectedDescriptors(),function(){instance.addItem(this)});this.updateItemsIndent()},_shouldEnableLozengeGroup:function(){return this.lozengeGroup.items.length>0&&this.lozengeGroup.index<0&&(this.$field.val().length===0||this.getCaret(this.$field[0])===0)},_handleBackSpace:function(){var instance=this;if(this._shouldEnableLozengeGroup()){setTimeout(function(){instance.lozengeGroup.shiftFocus(-1)},0)}else{this.$field.one("keyup",function(){instance._handleCharacterInput()})}},_handleDelete:function(){if(AJS.$.trim(this.$field.val())!==""){var instance=this;this.$field.one("keyup",function(){instance._handleCharacterInput()})}},_handleLeft:function(){if(this._shouldEnableLozengeGroup()){var instance=this;setTimeout(function(){instance.lozengeGroup.shiftFocus(-1)},0)}},_handlePaste:function(){this.$field.val(AJS.$.trim(this.$field.val()).replace(/\s+/g," "));this._handleCharacterInput()},updateItemsIndent:function(){var inputIndent=this._getInputIndent();this.$field.css({paddingTop:inputIndent.top,paddingLeft:inputIndent.left,width:0});this.$field.css({width:this.$container.width()-inputIndent.left-21});if(this.currentTopOffset&&this.currentTopOffset!==inputIndent.top){this.$container.trigger("multiSelectHeightUpdated",[this])}if(AJS.$.browser.msie){this.$field.val(this.$field.val()+" ");this.$field.val(this.$field.val().replace(/\s$/,""))}this.currentTopOffset=inputIndent.top},_isItemPresent:function(descriptor){var duplicate=false;var value=descriptor.value();AJS.$.each(this.lozengeGroup.items,function(){if(this.value===value){duplicate=true;return false}});return duplicate},addItem:function(descriptor){if(descriptor instanceof AJS.ItemDescriptor){descriptor=AJS.copyObject(descriptor.allProperties(),false)}descriptor.value=AJS.$.trim(descriptor.value);descriptor.label=AJS.$.trim(descriptor[this.options.itemAttrDisplayed])||descriptor.value;descriptor.title=AJS.$.trim(descriptor.title)||descriptor.label;descriptor=new AJS.ItemDescriptor(descriptor);if(this._isItemPresent(descriptor)){return }var lozenge=new AJS.MultiSelect.Lozenge({label:descriptor.label(),title:descriptor.title(),container:this.$selectedItemsContainer});this.lozengeGroup.addItem(lozenge);this._assignEvents("lozenge",lozenge);this.model.setSelected(descriptor);this.updateItemsIndent();this.dropdownController.setPosition();lozenge.value=descriptor.value();this.model.$element.trigger("selected",[descriptor,this])},_addMultipleItems:function(items,removeOnUnSelect){var instance=this;AJS.$.each(items,function(i,descriptor){if(removeOnUnSelect){descriptor.removeOnUnSelect=true}instance.addItem(descriptor)})},_getTargetItemContainerWidth:function(){var lozenges=this.lozengeGroup.items,width=parseInt(this.$selectedItemsContainer.css("paddingLeft"),10)+parseInt(this.$selectedItemsContainer.css("paddingRight"),10);for(var i=lozenges.length-1;i>=0;i--){var $item=lozenges[i].$lozenge;width=width+$item.outerWidth()+parseInt($item.css("marginLeft"),10)+parseInt($item.css("marginRight"),10)}return width},_getInputIndent:function(){var top,left,iconArea=22,paddingLeft=2,paddingTop=4,indent={top:paddingTop,left:paddingLeft},lastLozengeIndex=this.lozengeGroup.items.length-1,$last;if(lastLozengeIndex>=0){$last=this.lozengeGroup.items[lastLozengeIndex].$lozenge;top=$last.attr("offsetTop");left=$last.attr("offsetLeft")+$last.outerWidth();if(left>this.$container.width()-iconArea-this.options.minRoomForText){top+=$last.attr("offsetHeight");left=0}indent.top+=top;indent.left+=left}return indent},_selectionHandler:function(selected,e){var instance=this;selected.each(function(){instance.addItem(AJS.$.data(this,"descriptor"))});this.$field.val("").focus().scrollIntoView({margin:20});this.hideSuggestions();this.hideErrorMessage();this.model.$element.trigger("change");e.preventDefault()},isValidItem:function(itemValue){var suggestedItemDescriptor=this.listController.getFocused().data("descriptor");if(!suggestedItemDescriptor){return false}itemValue=itemValue.toLowerCase();return itemValue===AJS.$.trim(suggestedItemDescriptor.label.toLowerCase())||itemValue===AJS.$.trim(suggestedItemDescriptor.value.toLowerCase())},handleFreeInput:function(){var value=AJS.$.trim(this.$field.val()),descriptor;if(value){descriptor=this.model.getDescriptor(value);if(descriptor){this.addItem(descriptor);this.model.$element.trigger("change")}else{this.showErrorMessage(value);return }}this.hideErrorMessage();this.$field.val("")},submitForm:function(){if(this.$field.val().length===0&&!this.suggestionsVisible){AJS.$(this.$field[0].form).submit()}},_deactivate:function(){this.handleFreeInput();this.lozengeGroup.trigger("blur");this.hideSuggestions()},keys:{"Left":function(){this._handleLeft()},"Backspace":function(){this._handleBackSpace()},"Del":function(){this._handleDelete()},"Return":function(e){this.submitForm();e.preventDefault()},"Tab":function(e){this.acceptFocusedSuggestion()}},_events:{body:{tabSelect:function(){if(this.$field.is(":visible")){this.updateItemsIndent()}},bulkTabSelect:function(){if(this.$field.is(":visible")){this.updateItemsIndent()}}},field:{paste:function(){setTimeout(AJS.$.proxy(this,"_handlePaste"),0)},"aui:keydown aui:keypress":function(event){if(this.lozengeGroup.index>=0){if(event.key in this.lozengeGroup.keys){event.preventDefault()}else{if(event.key==="Return"){this.submitForm();event.preventDefault()}else{this.onEdit(event);this.lozengeGroup.trigger("blur")}}}},click:function(){this.lozengeGroup.trigger("blur");this.$field.focus()}},lozengeGroup:{focus:function(){this.$field.focus();this.hideSuggestions();this._unassignEvents("keys",this.$field)},blur:function(){this._assignEvents("keys",this.$field);if(this.$field.val()){this._handleCharacterInput()}}},lozenge:{remove:function(event){this.removeItem(this.model.getDescriptor(event.target.value))}},selectedItemsContainer:{click:function(event){if(event.target===event.currentTarget){this.lozengeGroup.trigger("blur");this.$field.focus()}}}},_renders:{errorMessage:function(){return AJS.$('<div class="error" />')},selectedItemsWrapper:function(){return AJS.$('<div class="representation"></div>')},selectedItemsContainer:function(){return AJS.$('<ul class="items" />')},field:function(idPrefix){return AJS.$('<textarea autocomplete="off" id="'+idPrefix+'-textarea" class="aui-field" wrap="off"></textarea>')},disableSelectField:function(id){return AJS.$("<input type='text' class='long-field' name='"+id+"' id='"+id+"' />")},container:function(idPrefix){return AJS.$('<div class="multi-select" id="'+idPrefix+'-multi-select">')},suggestionsContainer:function(idPrefix){return AJS.$('<div class="aui-list" id="'+idPrefix+'-suggestions" tabindex="-1"></div>')}}});
AJS.MultiSelect.Lozenge=AJS.Control.extend({init:function(options){this._setOptions(options);this.$lozenge=this._render("lozenge");this.$removeButton=this._render("removeButton");this._assignEvents("instance",this);this._assignEvents("lozenge",this.$lozenge);this._assignEvents("removeButton",this.$removeButton);this.$removeButton.appendTo(this.$lozenge);this.$lozenge.appendTo(this.options.container)},_getDefaultOptions:function(){return{label:null,title:null,container:null,focusClass:"focused"}},_renders:{"lozenge":function(){var label=AJS.escapeHtml(this.options.label);var title=AJS.escapeHtml(this.options.title)||"";return AJS.$('<li class="item-row" title="'+title+'"><button type="button" tabindex="-1" class="value-item"><span><span class="value-text">'+label+"</span></span></button></li>")},"removeButton":function(){return AJS.$('<em class="item-delete" title="'+AJS.escapeHtml("Remove")+'"></em>')}},_events:{"instance":{"focus":function(){this.$lozenge.addClass(this.options.focusClass)},"blur":function(){this.$lozenge.removeClass(this.options.focusClass)},"remove":function(){this.$lozenge.remove()}},"lozenge":{"click":function(){this.trigger("focus")}},"removeButton":{"click":function(){this.trigger("remove")}}}});
AJS.MultiSelect.LozengeGroup=AJS.Group.extend({keys:{"Left":function(){if(this.index>0){this.shiftFocus(-1)}},"Right":function(){if(this.index===this.items.length-1){this.items[this.index].trigger("blur")}else{this.shiftFocus(1)}},"Backspace":function(){var index=this.index;if(index>0){this.shiftFocus(-1)}else{if(this.items.length>1){this.shiftFocus(1)}}this.items[index].trigger("remove")},"Del":function(){var index=this.index;if(index+1<this.items.length){this.shiftFocus(1)}this.items[index].trigger("remove")}}});
JIRA.IssuePicker=AJS.MultiSelect.extend({_formatResponse:function(response){var ret=[],canonicalBaseUrl=(function(){var uri=parseUri(window.location);return uri.protocol+"://"+uri.authority})();if(response&&response.sections){AJS.$(response.sections).each(function(i,section){var groupDescriptor=new AJS.GroupDescriptor({weight:i,label:section.label,description:section.sub});if(section.issues&&section.issues.length>0){AJS.$(section.issues).each(function(){groupDescriptor.addItem(new AJS.ItemDescriptor({value:this.key,label:this.key+" - "+this.summaryText,icon:this.img?canonicalBaseUrl+contextPath+this.img:null,html:this.keyHtml+" - "+this.summary}))})}ret.push(groupDescriptor)})}return ret},getAjaxOptions:function(){var ajaxOptions=this._super();if(this.$field.val().length===0){delete ajaxOptions.data.currentJQL}return ajaxOptions},hasUserInputtedOption:function(){return this.$field.val().length!==0},_launchPopup:function(){function getWithDefault(value,def){if(typeof value=="undefined"||value==null){return def}else{return value}}var url,urlParam,vWinUsers,options,instance=this;JIRA.IssuePicker.callback=function(items){if(typeof items==="string"){items=JSON.parse(items)}instance._addMultipleItems(items,true);instance.$field.focus()};options=this.options.ajaxOptions.data;url=contextPath+"/secure/popups/IssuePicker.jspa?";urlParam={singleSelectOnly:"false",currentIssue:options.currentIssueKey||"",showSubTasks:getWithDefault(options.showSubTasks,false),showSubTasksParent:getWithDefault(options.showSubTaskParent,false)};if(options.currentProjectId){urlParam["currentProjectId"]=options.currentProjectId}url+=AJS.$.param(urlParam);vWinUsers=window.open(url,"IssueSelectorPopup","status=no,resizable=yes,top=100,left=200,width="+this.options.popupWidth+",height="+this.options.popupHeight+",scrollbars=yes,resizable");vWinUsers.opener=self;vWinUsers.focus()},_createFurniture:function(disabled){var $popupLink;this._super(disabled);$popupLink=this._render("popupLink");this._assignEvents("popupLink",$popupLink);this.$container.addClass("hasIcon");$popupLink.appendTo(this.$container)},handleFreeInput:function(){var values=this.$field.val().toUpperCase().match(/\S+/g);if(values){this._addMultipleItems(jQuery.map(values,function(value){return{value:value,label:value}}))}this.$field.val("")},_events:{popupLink:{click:function(e){this._launchPopup();e.preventDefault()}}},_renders:{popupLink:function(){return AJS.$("<a class='issue-picker-popup' />").attr({href:"#",title:this.options.popupLinkMessage}).text(""+this.options.popupLinkMessage+"")}}});AJS.namespace("jira.issuepicker",null,JIRA.IssuePicker);AJS.namespace("AJS.IssuePicker",null,JIRA.IssuePicker);
JIRA.LabelPicker=AJS.MultiSelect.extend({_getDefaultOptions:function(){return AJS.$.extend(true,this._super(),{ajaxOptions:{url:contextPath+"/includes/js/ajs/layer/labeldata.js",query:true},removeOnUnSelect:true,userEnteredOptionsMsg:"New Label"})},isValidItem:function(itemValue){return !/\s/.test(itemValue)},_handleSuggestionResponse:function(data){if(data&&data.token){if(AJS.$.trim(this.$field.val())!==data.token){return }}this._super(data)},_handleDown:function(e){if(!this.suggestionsVisible){this._requestThenResetSuggestions();e.stopPropagation()}},_handleSpace:function(){if(AJS.$.trim(this.$field.val())!==""){if(this.handleFreeInput()){this.hideSuggestions()}}},keys:{"Spacebar":function(event){this._handleSpace();event.preventDefault()}},_formatResponse:function(data){var optgroup=new AJS.GroupDescriptor({label:"Suggestions",type:"optgroup",weight:1,styleClass:"labels-suggested"});if(data&&data.suggestions){AJS.$.each(data.suggestions,function(){optgroup.addItem(new AJS.ItemDescriptor({value:this.label,label:this.label,html:this.html}))})}return[optgroup]},handleFreeInput:function(){var values=AJS.$.trim(this.$field.val()).match(/\S+/g);if(values){for(var value,i=0;value=values[i];i++){this.addItem({value:value,label:value})}this.model.$element.trigger("change")}this.$field.val("")}});AJS.namespace("AJS.LabelPicker",null,JIRA.LabelPicker);
AJS.SingleSelect=AJS.QueryableDropdownSelect.extend({init:function(options){var instance=this;if(this._setOptions(options)===this.INVALID){return this.INVALID}AJS.$(this.options.element).hide();if(this.options.disabled){this._createFurniture(true);return this}this.model=new AJS.SelectModel({element:this.options.element,removeOnUnSelect:this.options.removeOnUnSelect});this.options.id=this.model.$element.attr("id");AJS.$(this.options.element).data("aui-ss",true);this._createFurniture();this.dropdownController=AJS.InlineLayer.create({alignment:AJS.LEFT,offsetTarget:this.$field,content:AJS.$(".aui-list",this.$container)});this.listController=new AJS.List({containerSelector:AJS.$(".aui-list",this.$container),groupSelector:"ul.aui-list-section",itemSelector:"li",matchingStrategy:this.options.matchingStrategy,selectionHandler:function(e){var selectedSuggestion=this.getFocused(),selectedDescriptor=selectedSuggestion.data("descriptor");instance.setSelection(selectedDescriptor);e.preventDefault();return false}});this._assignEventsToFurniture();if(this.getSelectedDescriptor()){this.setSelection(this.getSelectedDescriptor())}else{this._setEditingMode();if(this.options.inputText){this.$field.val(this.options.inputText)}}if(this.options.width){this.setFieldWidth(this.options.width)}if(this.$overlabel){this.$overlabel.overlabel(this.$field)}this.model.$element.trigger("initialized",[this]);return this},setFieldWidth:function(width){this.$container.css({width:width,minWidth:width});this.$field.width(width)},getSelectedDescriptor:function(){return this.model.getSelectedDescriptors()[0]},getDisplayVal:function(descriptor){return descriptor[this.options.itemAttrDisplayed||"label"]()},_getDefaultOptions:function(){return AJS.$.extend(true,this._super(),{errorMessage:"The value {0} is invalid.",ajaxOptions:{minQueryLength:1},showDropdownButton:true})},_createFurniture:function(disabled){this.$container=this._render("container",this.options.id);this.$field=this._render("field",this.options.id).appendTo(this.$container);this.$container.append(this._render("suggestionsContainer",this.options.id));this.$container.insertBefore(this.model.$element);this.$dropDownIcon=this._render("dropdownAndLoadingIcon",this._hasDropdownButton()).appendTo(this.$container);this.$errorMessage=this._render("errorMessage");if(this.options.overlabel){this.$overlabel=this._render("overlabel").insertBefore(this.$field)}},getQueryVal:function(){if(this.$container.hasClass("aui-ss-editing")){return this.$field.val()}else{return""}},_setSuggestions:function(data){if(data){this.model.appendOptionsFromJSON(data);this._super(this.model.getUnSelectedDescriptors());this.model.$element.trigger("suggestionsRefreshed",[this])}else{this.hideSuggestions()}},_setEditingMode:function(){this.$container.addClass("aui-ss-editing").removeClass("aui-ss-has-entity-icon");this.$field.css("paddingLeft")},_hasIcon:function(){return this.getSelectedDescriptor().icon()&&this.getSelectedDescriptor().icon()!=="none"},_setReadOnlyMode:function(){this.$container.removeClass("aui-ss-editing");if(this._hasIcon()){this.$container.addClass("aui-ss-has-entity-icon");this.$container.append(this.$field.detach())}},submitForm:function(){if(!this.suggestionsVisible){this.handleFreeInput();AJS.$(this.$field[0].form).submit()}},setSelection:function(descriptor){if(typeof descriptor==="string"){descriptor=new AJS.ItemDescriptor({value:descriptor,label:descriptor})}this.model.setSelected(descriptor);this.$field.val(this.getDisplayVal(descriptor));if(this._hasIcon()){if(this.$entityIcon){this.$entityIcon.remove()}this.$entityIcon=this._render("entityIcon",descriptor.icon()).appendTo(this.$container)}this._setReadOnlyMode();this.hideSuggestions();this.hideErrorMessage();this.$field.select();this.model.$element.trigger("selected",[descriptor,this])},clearSelection:function(){var instance=this;instance._setEditingMode();instance.model.setAllUnSelected();instance.model.$element.trigger("unselect",[this])},onEdit:function(e){var instance=this;if(e.key==="\r"){return }else{if(this.getSelectedDescriptor()){if(this.$field.val().length===0&&e.key==="Backspace"){e.preventDefault()}this.clearSelection()}}this.$field.one("keyup",function(){instance._handleCharacterInput()});this.model.$element.trigger("query")},handleFreeInput:function(){var value=AJS.$.trim(this.$field.val()),descriptor;if(this.$container.hasClass("aui-ss-editing")&&value){descriptor=this.model.getDescriptor(value);if(descriptor){this.setSelection(descriptor);this.model.$element.trigger("change")}else{if(this.options.submitInputVal){descriptor=new AJS.ItemDescriptor({value:value,label:value,removeOnUnSelect:true});this.model.setSelected(descriptor)}else{this.showErrorMessage(value);return }}}this.hideErrorMessage()},disable:function(){this._unassignEvents("field",this.$field)},enable:function(){this._assignEvents("field",this.$field)},_deactivate:function(){this.handleFreeInput();this.hideSuggestions()},keys:{"Return":function(e){this.submitForm();e.preventDefault()},"Tab":function(e){this.acceptFocusedSuggestion()}},_events:{field:{focus:function(){var instance=this;window.setTimeout(function(){instance.$field.select()},0)}}},_renders:{label:function(label,id){return AJS.$("<label />").attr("for",id).text(label).addClass("overlabel")},errorMessage:function(){return AJS.$('<div class="error" />')},entityIcon:function(url){return AJS.$('<div class="aui-ss-entity-icon" />').css("backgroundImage","url('"+url+"')")},field:function(idPrefix){return AJS.$('<input id="'+idPrefix+'-field" class="text aui-ss-field ajs-dirty-warning-exempt" autocomplete="off" />')},disableSelectField:function(id){return AJS.$("<input type='text' class='long-field' name='"+id+"' id='"+id+"' />")},container:function(idPrefix){return AJS.$('<div class="aui-ss" id="'+idPrefix+'-single-select">')},suggestionsContainer:function(idPrefix){return AJS.$('<div class="aui-list" id="'+idPrefix+'-suggestions" tabindex="-1"></div>')},dropdownAndLoadingIcon:function(showDropdown){var $element=AJS.$('<span class="icon aui-ss-icon noloading"><span>More</span></span>');if(showDropdown){$element.addClass("drop-menu")}return $element}}});
AJS.$(function(){function initSingleUserPicker(el){AJS.$(el||document.body).find(".single-user-picker").each(function(){var $this=AJS.$(this);if(!$this.data("aui-ss")){new AJS.SingleSelect({element:$this,showDropdownButton:false,removeOnUnSelect:true,submitInputVal:true,overlabel:"Start Typing for Users",errorMessage:"The user \'\'{0}\'\' is invalid.",ajaxOptions:{url:contextPath+"/rest/api/1.0/users/picker",query:true,minQueryLength:1,data:{showAvatar:true},formatResponse:function(response){var ret=[];AJS.$(response).each(function(i,suggestions){var groupDescriptor=new AJS.GroupDescriptor({weight:i,id:"user-suggestions",replace:true,label:suggestions.footer});AJS.$(suggestions.users).each(function(){groupDescriptor.addItem(new AJS.ItemDescriptor({value:this.name,label:this.displayName,html:this.html,allowDuplicate:false,icon:this.avatarUrl}))});ret.push(groupDescriptor)});return ret}}})}})}AJS.$(document).bind("contentRefresh",function(e,context){initSingleUserPicker(e.target)});AJS.$(document).bind("dialogContentReady",function(e,dialog){initSingleUserPicker(dialog.get$popupContent())});initSingleUserPicker()});
JIRA.Dialog=AJS.Control.extend({_getDefaultOptions:function(){return{height:"auto",cached:false,widthClass:"medium",ajaxOptions:{data:{inline:true,decorator:"dialog"}}}},init:function(options){if(typeof options==="string"||options instanceof jQuery){options={trigger:options}}else{if(options&&options.width){options.widthClass="custom"}}this.options=jQuery.extend(true,this._getDefaultOptions(),options);this.options.width=JIRA.Dialog.WIDTH_PRESETS[this.options.widthClass]||options.width;if(typeof this.options.content==="function"){this.options.type="builder"}else{if(this.options.content instanceof jQuery||(typeof this.options.content==="object"&&this.options.nodeName)){this.options.type="element"}else{if(!this.options.type&&!this.options.content||(typeof this.options.content==="object"&&this.options.content.url)){this.options.type="ajax"}}}if(this.options.trigger){this._assignEvents("trigger",this.options.trigger)}this.onContentReadyCallbacks=[];this._assignEvents("container",document)},_runContentReadyCallbacks:function(){var that=this;AJS.$.each(this.onContentReadyCallbacks,function(){this.call(that)})},_setContent:function(content,decorate){if(!content){this._contentRetrievers[this.options.type].call(this,this._setContent)}else{if(JIRA.Dialog.current===this){var $popup=this.get$popup();this.$content=content;this.get$popupContent().html(content);$popup.addClass("popup-width-"+this.options.widthClass);$popup.css({marginLeft:-9999}).show();if(decorate!==false){if(this.decorateContent){this.decorateContent()}AJS.$(document).trigger("dialogContentReady",[this]);this._runContentReadyCallbacks()}this._positionInCenter();if(decorate!==false){if(AJS.$.isFunction(this.options.onContentRefresh)){this.options.onContentRefresh.call(this)}}AJS.$(".aui-dialog-open").addClass("aui-dialog-content-ready")}else{if(this.options.cached===false){delete this.$content}}}},_handleInitialDoneResponse:function(data,xhr,smartAjaxResult){},_getRequestOptions:function(){var options={};if(this._getAjaxOptionsObject()===false){return false}options=AJS.$.extend(true,options,this._getAjaxOptionsObject());if(!options.url&&this.$activeTrigger){options.url=this.$activeTrigger.attr("href")}return options},_getAjaxOptionsObject:function(){var ajaxOpts=this.options.ajaxOptions;if(AJS.$.isFunction(ajaxOpts)){return ajaxOpts.call(this)}else{return ajaxOpts}},_contentRetrievers:{"element":function(callback){if(!this.$content){this.$content=jQuery(this.options.content).clone(true)}callback.call(this,this.$content)},"builder":function(callback){var instance=this;if(!this.$content){this._showloadingIndicator();this.options.content.call(this,function(content){instance._hideloadingIndicator();instance.$content=AJS.$(content);callback.call(instance,instance.$content)})}},"ajax":function(callback){var instance=this,ajaxOptions;if(!this.$content){ajaxOptions=this._getRequestOptions();this._showloadingIndicator();this.serverIsDone=false;ajaxOptions.complete=function(xhr,textStatus,smartAjaxResult){if(smartAjaxResult.successful){var instructions=instance._detectRedirectInstructions(xhr);instance.serverIsDone=instructions.serverIsDone;if(instructions.redirectUrl){instance._performRedirect(instructions.redirectUrl)}else{if(ajaxOptions.dataType&&ajaxOptions.dataType.toLowerCase()==="json"&&instance._buildContentFromJSON){instance.$content=instance._buildContentFromJSON(smartAjaxResult.data)}else{instance.$content=smartAjaxResult.data}if(instance.serverIsDone){instance._handleInitialDoneResponse(smartAjaxResult.data,xhr,smartAjaxResult)}else{instance._hideloadingIndicator();callback.call(instance,instance.$content)}}}else{instance._hideloadingIndicator();var errorContent=JIRA.SmartAjax.buildDialogErrorContent(smartAjaxResult);callback.call(instance,errorContent)}};JIRA.SmartAjax.makeRequest(ajaxOptions)}}},_detectRedirectInstructions:function(xhr){var instructions={serverIsDone:false,redirectUrl:""};var doneHeader=xhr.getResponseHeader("X-Atlassian-Dialog-Control");if(doneHeader){instructions.serverIsDone=true;var idx=doneHeader.indexOf("redirect:");if(idx==0){instructions.redirectUrl=doneHeader.substr("redirect:".length)}}return instructions},_performRedirect:function(url){AJS.reloadViaWindowLocation(url)},_renders:{popupHeading:function(){return jQuery("<h2 />").addClass("aui-popup-heading")},popupContent:function(){return jQuery("<div />").addClass("aui-popup-content")},popup:function(){return jQuery("<div />").attr("id",this.options.id||"").addClass("aui-popup").hide()},loadingIndicator:function(){return jQuery("<div />").addClass("aui-loading")}},_events:{"trigger":{click:function(e,item){this.$activeTrigger=item;this.show();e.preventDefault()}},"container":{"keydown":function(e){function calendarClosingBy(e){if(window._dynarch_popupCalendar&&!window._dynarch_popupCalendar.hidden){return true}else{if(e.calendarClosed){return true}else{if(e.originalEvent&&e.originalEvent.calendarClosed){return true}}}return false}if(e.which===jQuery.ui.keyCode.ESCAPE&&!AJS.InlineLayer.current&&!JIRA.Dropdown.current&&!calendarClosingBy(e)){this.handleCancel()}}}},handleCancel:function(){this.hide()},_get$loadingIndicator:function(){if(!JIRA.Dialog.$loadingIndicator){JIRA.Dialog.$loadingIndicator=this._render("loadingIndicator").css("zIndex",9999).appendTo("body")}return JIRA.Dialog.$loadingIndicator},_showloadingIndicator:function(){var instance=this,heightOfSprite=440,currentOffsetOfSprite=0;clearInterval(this.loadingTimer);this._get$loadingIndicator().show();this.loadingTimer=window.setInterval(function(){if(currentOffsetOfSprite===heightOfSprite){currentOffsetOfSprite=0}currentOffsetOfSprite=currentOffsetOfSprite+40;instance._get$loadingIndicator().css("backgroundPosition","0 -"+currentOffsetOfSprite+"px")},50)},_hideloadingIndicator:function(){clearInterval(this.loadingTimer);this._get$loadingIndicator().hide()},_positionInCenter:function(){var $window=AJS.$(window),$popup=this.get$popup(),$heading=$popup.find(".aui-popup-heading"),$container=$popup.find(".content-body"),$footer=$popup.find(".content-footer");var cushion=40;var windowHeight=$window.height();if(typeof this.options.width==="number"){$popup.width(this.options.width)}$popup.css({marginLeft:-$popup.outerWidth()/2,marginTop:Math.max(-$popup.outerHeight()/2,cushion-windowHeight/2)});var top=0;var el=$popup[0];while(el){top+=el.offsetTop;el=el.offsetParent}var popupMaxHeight=windowHeight-top-cushion;var padding=parseInt($container.css("padding-top"),10)+parseInt($container.css("padding-bottom"),10);$container.css("max-height",popupMaxHeight-$heading.outerHeight()-$footer.outerHeight()-padding)},get$popup:function(){if(!this.$popup){this.$popup=this._render("popup").appendTo("body");this.$popup.addClass("box-shadow")}return this.$popup},get$popupContent:function(){if(!this.$popupContent){this.$popupContent=this._render("popupContent").appendTo(this.get$popup())}return this.$popupContent},get$popupHeading:function(){if(!this.$popupHeading){this.$popupHeading=this._render("popupHeading").prependTo(this.get$popup())}return this.$popupHeading},_watchTab:function(e){var $dialog_selectable,$first_selectable,$last_selectable;if(AJS.$(e.target).parents(this.get$popupContent()).length>0){if(AJS.$.browser.safari){$dialog_selectable=AJS.$(":input:visible:enabled, :checkbox:visible:enabled, :radio:visible:enabled",".aui-popup.aui-dialog-open")}else{$dialog_selectable=AJS.$("a:visible, :input:visible:enabled, :checkbox:visible:enabled, :radio:visible:enabled",".aui-popup.aui-dialog-open")}$first_selectable=$dialog_selectable.first();$last_selectable=$dialog_selectable.last();if((e.target==$first_selectable[0]&&e.shiftKey)||(e.target==$last_selectable[0]&&!e.shiftKey)){if(e.shiftKey){$last_selectable.focus()}else{$first_selectable.focus()}e.preventDefault()}}},show:function(){var myEvent=new AJS.$.Event("beforeShow");if(JIRA.Dialog.current===this){return false}AJS.$(this).trigger(myEvent);if(myEvent.result===false){return false}if(AJS.InlineLayer.current){AJS.InlineLayer.current.hide()}if(AJS.dropDown.current){AJS.dropDown.current.hide()}if(JIRA.Dialog.current){if(JIRA.Dialog.current.options.stacked){var prev=JIRA.Dialog.current,prevCachedValue=prev.options.cached,hideHandler=this.hide;prev.options.cached=true;JIRA.Dialog.current.hide(false);this.hide=function(){prev.options.cached=prevCachedValue;this.hide=hideHandler;prev.show()}}else{JIRA.Dialog.current.hide(false)}}else{AJS.dim(false)}JIRA.Dialog.current=this;var $popup=this.get$popup().addClass("aui-dialog-open");if(this.options.type!=="blank"&&!this.$content){this._setContent()}else{$popup.show();this._positionInCenter()}this.tabWatcher=function(e){if(e.keyCode==9){JIRA.Dialog.current._watchTab(e)}};AJS.$(document).bind("keydown",this.tabWatcher);AJS.disableKeyboardScrolling()},destroy:function(){this.$popup.remove();delete this.$popup;delete this.$popupContent;delete this.$popupHeading;delete this.$content},hide:function(undim){if(JIRA.Dialog.current!==this){return false}var atlToken=AJS.$(".aui-dialog-open  input[name=atl_token]").attr("value");if(atlToken!==undefined){JIRA.XSRF.updateTokenOnPage(atlToken)}if(this.options.cached===false){this.destroy()}if(undim!==false){AJS.undim()}this.get$popup().removeClass("aui-dialog-open").removeClass("aui-dialog-content-ready").hide();this._hideloadingIndicator();JIRA.Dialog.current=null;AJS.$(document).trigger("hideAllLayers");AJS.enableKeyboardScrolling();if(this.tabWatcher){AJS.$(document).unbind("keydown",this.tabWatcher)}},addHeading:function(heading){this.get$popupHeading().html(heading)},onContentReady:function(func){if(AJS.$.isFunction(func)){this.onContentReadyCallbacks.push(func)}}});AJS.popup=function(options,width,id){if(typeof options!=="object"){options={width:arguments[0],height:arguments[1],id:arguments[2]}}var popup=new JIRA.Dialog({type:"blank",id:options.id||id,width:options.width,cached:true});return{element:popup.get$popup(),show:function(){popup.show()},hide:function(){popup.hide()},changeSize:function(){popup._positionInCenter()},remove:function(){this.element.remove();this.element=null},disable:function(){},enable:function(){}}};JIRA.Dialog.WIDTH_PRESETS={small:360,medium:540,large:810};AJS.namespace("AJS.FlexiPopup",null,JIRA.Dialog);
JIRA.FormDialog=JIRA.Dialog.extend({_getDefaultOptions:function(){return AJS.$.extend(this._super(),{autoClose:false,targetUrl:"",handleRedirect:false,onUnSuccessfulSubmit:function(){},onSuccessfulSubmit:function(){},onDialogFinished:function(){var targetUrl=this._getTargetUrlValue();this.hide();if(targetUrl){AJS.$(document).trigger("page-unload.location-change.from-dialog");window.location.href=targetUrl}else{AJS.$(document).trigger("page-unload.refresh.from-dialog");AJS.reloadViaWindowLocation(window.location.href)}},submitAjaxOptions:{type:"post",data:{inline:true,decorator:"dialog"},dataType:"html"}})},_getFormDataAsObject:function(){var fieldValues={};AJS.$(this.$form.serializeArray()).each(function(){var fieldVal=fieldValues[this.name];if(!fieldVal){fieldVal=this.value}else{if(AJS.$.isArray(fieldVal)){fieldVal.push(this.value)}else{fieldVal=[fieldVal,this.value]}}fieldValues[this.name]=fieldVal});return fieldValues},_getRelativePath:function(){return parseUri(this.options.url||this.$activeTrigger.attr("href")).directory},_getPath:function(action){var relPath=this._getRelativePath();if(action.indexOf(relPath)==0){return action}else{return relPath+action}},_submitForm:function(e){this.cancelled=false;this.xhr=null;this.redirected=false;this.serverIsDone=false;this.$form.addClass("submitting");var instance=this,defaultRequestOptions=AJS.$.extend(true,{},this.options.submitAjaxOptions),requestOptions=AJS.$.extend(true,defaultRequestOptions,{url:this._getPath(this.$form.attr("action")),data:this._getFormDataAsObject(),complete:function(xhr,textStatus,smartAjaxResult){if(!instance.cancelled){if(smartAjaxResult.successful){instance.$form.trigger("fakesubmit");instance._handleServerSuccess(smartAjaxResult.data,xhr,textStatus,smartAjaxResult);if(!instance.redirected){instance._handleSubmitResponse(smartAjaxResult.data,xhr,smartAjaxResult)}}else{instance._handleServerError(xhr,textStatus,smartAjaxResult.errorThrown,smartAjaxResult)}}instance.$form.removeClass("submitting")}});this.xhr=JIRA.SmartAjax.makeRequest(requestOptions);AJS.$(this.xhr).throbber({target:AJS.$(".throbber",this.get$popupContent())});e.preventDefault()},_handleServerError:function(xhr,textStatus,errorThrown,smartAjaxResult){if(this.options.onUnSuccessfulSubmit){this.options.onUnSuccessfulSubmit.call(xhr,textStatus,errorThrown,smartAjaxResult)}var errorContent=JIRA.SmartAjax.buildDialogErrorContent(smartAjaxResult,true);var content$=this.get$popupContent().find(".content-body");if(content$.length!==1){content$=this.get$popupContent()}var insertErrMsg=content$.length==1&&!smartAjaxResult.hasData;if(insertErrMsg){content$.prepend(errorContent)}else{this._setContent(errorContent)}},_handleServerSuccess:function(data,xhr,textStatus,smartAjaxResult){var instructions=this._detectRedirectInstructions(xhr);this.serverIsDone=instructions.serverIsDone;if(instructions.redirectUrl){if(this.options.onSuccessfulSubmit){this.options.onSuccessfulSubmit.call(this,data,xhr,textStatus,smartAjaxResult)}this._performRedirect(instructions.redirectUrl)}else{this._setContent(data)}},_handleInitialDoneResponse:function(data,xhr,smartAjaxResult){this._handleSubmitResponse(data,xhr,smartAjaxResult)},_handleSubmitResponse:function(data,xhr,smartAjaxResult){if(this.serverIsDone){if(this.options.onSuccessfulSubmit){this.options.onSuccessfulSubmit.call(this,data,xhr,smartAjaxResult)}if(this.options.autoClose){this.hide()}if(this.options.onDialogFinished){this.options.onDialogFinished.call(this,data,xhr,smartAjaxResult)}}},_performRedirect:function(url){this.hide();this.redirected=true;this._super(url)},_hasTargetUrl:function(){return this._getTargetUrlHolder().length>0},_getTargetUrlHolder:function(){return AJS.$(this.options.targetUrl)},_getTargetUrlValue:function(){return this._getTargetUrlHolder().val()},decorateContent:function(){var instance=this,$formHeading,$buttons,$cancel,$buttonContainer,$closeLink;this.$form=AJS.$("form",this.get$popupContent());$formHeading=AJS.$(":header:first",this.get$popupContent());if($formHeading.length>0){this.addHeading($formHeading.html());$formHeading.hide()}this.$form.submit(function(e){if(instance.$form.trigger("before-submit",[e,instance])){var submitButtons=AJS.$(":submit",instance.$form);submitButtons.attr("disabled","disabled");if(instance.options.submitHandler){instance.options.submitHandler.call(instance,e)}else{instance._submitForm(e)}}});this.$form.find("input[type=file]").inlineAttach();$cancel=AJS.$(".cancel",this.get$popupContent());$cancel.click(function(e){if(instance.xhr){instance.xhr.abort()}instance.xhr=null;instance.cancelled=true;instance.hide();e.preventDefault()});if(AJS.$.browser.msie){$cancel.focus(function(e){if(e.altKey){$cancel.click()}})}var $popupContent=this.get$popupContent();$buttons=AJS.$(".button",$popupContent);$buttonContainer=AJS.$("div.buttons",$popupContent);if($cancel.length==0&&$buttons.length==0){if($buttonContainer.length==0){$buttonContainer=AJS.$('<div class="buttons-container content-footer"><div class="buttons"/></div>').appendTo($popupContent)}AJS.populateParameters();$closeLink=AJS.$("<a href='#' class='cancel' id='aui-dialog-close'>"+"Close"+"</a>");AJS.$($popupContent).find(".buttons").append($closeLink);$closeLink=AJS.$(".cancel",this.get$popupContent());$closeLink.click(function(e){instance.hide();e.preventDefault()})}$buttonContainer.prepend(AJS.$("<span class='icon throbber'/>"));AJS.$(".shortcut-tip-trigger",$popupContent).click(function(e){e.preventDefault();if(!$popupContent.isDirty()||confirm("You have entered new data in this dialog. If you navigate away from this dialog without first saving your data, the changes will be lost. Click cancel to return to the dialog.")){instance.hide();AJS.$("#keyshortscuthelp").click()}})},_setContent:function(content,decorate){this._super(content,decorate);if(content){if(AJS.$.browser.msie){this.$form.bind("keypress",function(e){var $target=AJS.$(e.target);if($target.is(":input")&&!$target.is("textarea")&&e.keyCode===13){AJS.$(this).submit()}})}if(JIRA.Dialog.current===this){this._focusFirstField()}}},_focusFirstField:function(){var triggerConfig=new JIRA.setFocus.FocusConfiguration();if(this.$activeTrigger&&this.$activeTrigger.attr("data-field")){triggerConfig.focusElementSelector="[name='"+this.$activeTrigger.attr("data-field")+"']"}triggerConfig.context=this.get$popup()[0];if(AJS.$.browser.msie){var $focusHack=AJS.$(".trigger-hack",triggerConfig.context);if($focusHack.length===0){$focusHack=AJS.$("<input Class='trigger-hack' type='text' value=''/>").css({position:"absolute",left:-9000}).appendTo(triggerConfig.context)}$focusHack.focus()}JIRA.setFocus.pushConfiguration(triggerConfig);JIRA.setFocus.triggerFocus();JIRA.setFocus.triggerFocus()},hide:function(undim){if(this._super(undim)===false){return false}JIRA.setFocus.popConfiguration()}});AJS.namespace("AJS.FormPopup",null,JIRA.FormDialog);
JIRA.IssueActionsDialog=JIRA.Dialog.extend({_getDefaultOptions:function(){return AJS.$.extend(this._super(),{cached:false,id:"issue-actions-dialog",widthClass:"small"})},_setContent:function(content,decorate){if(content){this._super(content,decorate)}else{this._super(AJS.$(["<form id='issue-actions-dialog-form' class='aui'>","<div class='content-body'>","<div id='issueactions-suggestions' class='aui-list' />","<div class='description'>","Begin typing for available operations or press down to see all","</div>","</div>","</form>"].join("")),true)}if(JIRA.Dialog.current===this){var triggerConfig=new JIRA.setFocus.FocusConfiguration();triggerConfig.context=this.get$popup()[0];triggerConfig.parentElementSelectors=[".content-body"];JIRA.setFocus.pushConfiguration(triggerConfig);JIRA.setFocus.triggerFocus()}},_formatActionsResponse:function(response){function addSelected(issueId){var url=window.location.href,newUrl=url;if(/selectedIssueId=[0-9]*/.test(url)){newUrl=newUrl.replace(/selectedIssueId=[0-9]*/g,"selectedIssueId="+issueId)}else{if(JIRA.IssueNavigator.isNavigator()){if(/\?/.test(url)){newUrl=newUrl+"&"}else{newUrl=newUrl+"?"}newUrl=newUrl+"selectedIssueId="+issueId}}return encodeURIComponent(newUrl)}function formatWorkflowResponse(workflowResponse){var workflows=new AJS.GroupDescriptor({label:"Workflow"});AJS.$(workflowResponse).each(function(){workflows.addItem(new AJS.ItemDescriptor({href:contextPath+"/secure/WorkflowUIDispatcher.jspa?id="+response.id+"&action="+this.action+"&atl_token="+response.atlToken+"&returnUrl="+addSelected(response.id),label:this.name,styleClass:"issueaction-workflow-transition"}))});return workflows}function formatOperationResonse(operationsResponse){var operations=new AJS.GroupDescriptor({label:"Actions"});AJS.$(operationsResponse).each(function(){var _returnUrl;if(this.name==="Clone"){if(JIRA.IssueNavigator.isNavigator()){_returnUrl=addSelected(response.id)}else{_returnUrl=""}}else{_returnUrl=addSelected(response.id)}operations.addItem(new AJS.ItemDescriptor({href:this.url+"&returnUrl="+_returnUrl,label:this.name,styleClass:this.styleClass}))});return operations}var res=[];if(response){if(response.actions&&response.actions.length!=0){res.push(formatWorkflowResponse(response.actions))}if(response.operations&&response.operations.length!=0){res.push(formatOperationResonse(response.operations))}}return res},decorateContent:function(){var instance=this,issueKey=JIRA.IssueNavigator.getSelectedIssueKey(),issueId=JIRA.Issue.getIssueId()||JIRA.IssueNavigator.getSelectedIssueId();if(issueKey){this.addHeading("Operations"+": <span>"+issueKey+"</span>")}else{this.addHeading("Operations")}this.queryControl=new AJS.QueryableDropdownSelect({id:"issueactions",element:this.$content.find("#issueactions-suggestions"),ajaxOptions:{minQueryLength:1,dataType:"json",url:AJS.format(contextPath+"/rest/api/1.0/issues/{0}/ActionsAndOperations?atl_token={1}",issueId,atl_token()),formatResponse:this._formatActionsResponse},showDropdownButton:true,loadOnInit:true});this.queryControl._handleServerError=function(smartAjaxResult){var errMsg=JIRA.SmartAjax.buildSimpleErrorContent(smartAjaxResult);var errorClass=smartAjaxResult.status===401?"warning":"error";instance._setContent(AJS.$('<div class="ajaxerror"><div class="aui-message '+errorClass+'"><p>'+errMsg+"</p></div></div>"),false);instance._addCloseLink()};this.timeoutId=undefined;this._addCloseLink()},_addCloseLink:function(){var instance=this,$closeLink,$buttonContainer,$buttons;$buttonContainer=AJS.$('<div class="buttons-container content-footer"></div>').appendTo(this.get$popupContent());$buttons=AJS.$('<div class="buttons"/>').appendTo($buttonContainer);$closeLink=AJS.$("<a href='#' class='cancel' id='aui-dialog-close'>"+"Close"+"</a>");$closeLink.appendTo($buttons,this.get$popupContent()).click(function(e){instance.hide();e.preventDefault()});this.get$popupContent().append($buttonContainer)},hide:function(undim){if(this._super(undim)===false){return false}JIRA.setFocus.popConfiguration()}});AJS.namespace("AJS.IssueActionsPopup",null,JIRA.IssueActionsDialog);
JIRA.LabelsDialog=JIRA.FormDialog.extend((function(){var impl={};impl.init=function(options){this._super(options);this.issueId=null;this.customFieldId=null;this.labelsProvider=this.initLabelsProvider();this.labelPicker=null},impl.initLabelsProvider=function(){if(this.options.labelsProvider&&AJS.$.isFunction(this.options.labelsProvider)){return this.options.labelsProvider}else{if(this.options.labels){return this._getLabelsFromOptions}else{return this._getLabelsFromTrigger}}},impl._getLabelsFromOptions=function(){return AJS.$(this.options.labels)},impl._getLabelsFromTrigger=function(){return this.$activeTrigger.closest(".labels-wrap")},impl.decorateContent=function(){this._super();var $content=this.get$popupContent();this.issueId=$content.find("input[name=id]").val();var $customFieldId=$content.find("input[name=customFieldId]");if($customFieldId.length===1){this.customFieldId=$customFieldId.val()}else{this.customFieldId=null}};impl.focusLabelPicker=function(){this.get$popupContent().find("textarea").focus()};impl.show=function(){if(this._super()){this.focusLabelPicker()}};impl._handleSubmitResponse=function(data,xhr,smartAjaxResult){if(this.serverIsDone){if(this.options.onSuccessfulSubmit){this.options.onSuccessfulSubmit.call(this,data,xhr,smartAjaxResult)}var issueIdVal=this.get$popupContent().find("input[name=id]").val(),noLinkVal=this.get$popupContent().find("input[name=noLink]").val();if(this.options.autoClose){this.hide()}JIRA.IssueNavigator.Shortcuts.flashIssueRow(this.issueId);var postData={id:issueIdVal,decorator:"none",noLink:noLinkVal};if(this.customFieldId){postData.customFieldId=this.customFieldId}var instance=this;var $labelsWrap=instance.labelsProvider(this);if($labelsWrap){jQuery(jQuery.ajax({url:contextPath+"/secure/EditLabels!viewLinks.jspa",data:postData,success:function(html){var $newLabelsWrap=jQuery("<div>").html(html).find(".labels-wrap");if(JIRA.IssueNavigator.isNavigator()){$newLabelsWrap.find("a.edit-labels").remove()}$labelsWrap.html($newLabelsWrap.html())}})).throbber({target:$labelsWrap})}}};impl.handleCancel=function(){this._super();this.$content=null};return impl})());AJS.namespace("AJS.LabelsPopup",null,JIRA.LabelsDialog);
JIRA.ScreenshotDialog=function(options){var self=this;this.$trigger=jQuery(options.trigger);this.$trigger.click(function(e){e.preventDefault();self.openWindow()})};JIRA.ScreenshotDialog.prototype.openWindow=function(){if(JIRA.Dialog.current){JIRA.Dialog.current.hide()}if(AJS.InlineLayer.current){AJS.InlineLayer.current.hide()}window.open(this.$trigger.attr("href"),"screenshot","width=800,height=700,scrollbars=yes,status=yes")};AJS.namespace("jira.app.attachments.screenshot.ScreenshotWindow",null,JIRA.ScreenshotDialog);
JIRA.userhover=function(context){AJS.$(".user-hover",context).bind({"mouseenter":function(){JIRA.userhover.show(this)},"mouseleave":function(){JIRA.userhover.hide(this)},"click":function(){JIRA.userhover.hide(this,-1)}})};JIRA.userhover.INLINE_DIALOG_OPTIONS={urlPrefix:contextPath+"/secure/ViewUserHover!default.jspa?decorator=none&username=",showDelay:400,closeOthers:false,noBind:true};JIRA.userhover.show=function(trigger){clearTimeout(AJS.$.data(trigger,"AJS.InlineDialog.delayId")||0);AJS.$.data(trigger,"AJS.InlineDialog.hasUserAttention",true);if(AJS.$.data(trigger,"AJS.InlineDialog")||JIRA.userhover._locked){return }AJS.$.data(trigger,"AJS.InlineDialog.delayId",setTimeout(function(){AJS.$.data(trigger,"AJS.InlineDialog",AJS.InlineDialog(AJS.$(trigger),"user-hover-dialog-"+new Date().getTime(),function($contents,_,showPopup){JIRA.userhover._fetchDialogContents($contents,trigger,showPopup);$contents.bind({"mouseenter":function(){JIRA.userhover.show(trigger)},"mouseleave":function(){JIRA.userhover.hide(trigger)}})},JIRA.userhover.INLINE_DIALOG_OPTIONS)).show()},JIRA.userhover.INLINE_DIALOG_OPTIONS.showDelay))};JIRA.userhover.hide=function(trigger,showDelay){clearTimeout(AJS.$.data(trigger,"AJS.InlineDialog.delayId")||0);AJS.$.data(trigger,"AJS.InlineDialog.hasUserAttention",false);var dialog=AJS.$.data(trigger,"AJS.InlineDialog");if(dialog&&!JIRA.userhover._locked){if(typeof showDelay!=="number"){showDelay=JIRA.userhover.INLINE_DIALOG_OPTIONS.showDelay}if(showDelay>=0){AJS.$.data(trigger,"AJS.InlineDialog.delayId",setTimeout(function(){dialog.hide();AJS.$.data(trigger,"AJS.InlineDialog",null)},showDelay))}else{dialog.hide();AJS.$.data(trigger,"AJS.InlineDialog",null)}}};JIRA.userhover._locked=false;JIRA.userhover._fetchDialogContents=function($contents,trigger,showPopup){AJS.$.get(JIRA.userhover.INLINE_DIALOG_OPTIONS.urlPrefix+trigger.getAttribute("rel"),function(html){if(AJS.$.data(trigger,"AJS.InlineDialog.hasUserAttention")){$contents.html(html);$contents.css("overflow","visible");AJS.$(AJS.Dropdown.create({trigger:$contents.find(".aui-dd-link"),content:$contents.find(".aui-list")})).bind({"showLayer":function(){JIRA.userhover._locked=true},"hideLayer":function(){JIRA.userhover._locked=false;if(!AJS.$.data(trigger,"AJS.InlineDialog.hasUserAttention")){JIRA.userhover.hide(trigger)}}});showPopup()}})};AJS.$(function(){JIRA.userhover(document.body)});AJS.namespace("jira.app.userhover",null,JIRA.userhover);
AJS.InlineAttach=Class.extend({init:function(element){var $element=AJS.$(element);if(AJS.InlineAttach.AjaxPresenter.isSupported($element)){new AJS.InlineAttach.AjaxPresenter($element)}else{new AJS.InlineAttach.FormPresenter($element)}}});AJS.$.extend(AJS.InlineAttach,{MAX_UPLOADS:2,DISPLAY_WAIT:600,rescope:function(fn,scope){if(fn){if(scope){return AJS.$.proxy(fn,scope)}else{return fn}}else{return AJS.$.noop}},copyArrayLike:function(array){return AJS.$.makeArray(array)},Renderers:{container:function(){return AJS.$("<div class='field-group'/>")}}});AJS.InlineAttach.Presenter=Class.extend({init:function(){this.cancelled=false;this.running=[];this.waiting=[]},_addUpload:function(upload){if(!this.cancelled){if(this.running.length>=AJS.InlineAttach.MAX_UPLOADS){this.waiting.push(upload)}else{this.running.push(upload);upload.upload()}}return this.running.length>0},_finishUpload:function(upload){if(!this.cancelled){AJS.InlineAttach.Presenter.removeFromArray(this.waiting,upload);if(AJS.InlineAttach.Presenter.removeFromArray(this.running,upload)){if(this.waiting.length>0){var next=this.waiting.shift();this.running.push(next);next.upload()}}}return this.running.length>0},_cancel:function(){this.cancelled=true;var i;var wait=AJS.InlineAttach.copyArrayLike(this.waiting);for(i=0;i<wait.length;i++){wait[i].abort()}var run=AJS.InlineAttach.copyArrayLike(this.running);for(i=0;i<run.length;i++){run[i].abort()}this.waiting=[];this.running=[]}});AJS.$.extend(AJS.InlineAttach.Presenter,{removeFromArray:function(array,element){var index=AJS.$.inArray(element,array);if(index>=0){return array.splice(index,1)}else{return null}}});AJS.InlineAttach.FormPresenter=AJS.InlineAttach.Presenter.extend({init:function($element){this._super();this.form=new AJS.InlineAttach.Form(new AJS.InlineAttach.FileInput($element,false));this.form.fileSelector.onChange(AJS.$.proxy(this._attach,this));this.form.onCancel(AJS.$.proxy(this._cancel,this))},_attach:function(fileName){this.form.clearErrors();if(this.cancelled){return }var form=this.form,data=this._createSubmitData();var $oldInput=form.cloneFileInput();form.fileSelector.clear();var progress=form.addStaticProgress(fileName);var timer=new AJS.InlineAttach.Timer(function(){!this.cancelled&&progress.show()},this);var upload=new AJS.InlineAttach.FormUpload({$input:$oldInput,url:AJS.InlineAttach.FormPresenter.DEFAULT_URL,params:data,scope:this,before:function(){!this.cancelled&&progress.start()},success:function(val){if(this.cancelled){return }if(val.id&&val.name){form.addTemporaryFileCheckbox(val.id,val.name,progress)}else{if(val.errorMsg){form.addErrorWithFileName(val.errorMsg,fileName,progress)}else{form.addError(AJS.InlineAttach.Text.tr("upload.error.bad.response",fileName),progress)}}},error:function(text){if(this.cancelled){return }if(text.indexOf("SecurityTokenMissing")>=0){form.addError(AJS.InlineAttach.Text.tr("upload.xsrf.timeout",fileName),progress)}else{form.addError(AJS.InlineAttach.Text.tr("upload.error.unknown",fileName),progress)}},after:function(){timer.cancel();progress.remove();if(!this.cancelled&&!this._finishUpload(upload)){form.enable()}}});progress.onCancel(function(){upload.abort()});if(this._addUpload(upload)){timer.schedule(AJS.InlineAttach.DISPLAY_WAIT);form.disable()}form.fileSelector.focus()},_cancel:function(){this._super();this.form.enable()},_createSubmitData:function(){var data={atl_token:this.form.getAtlToken()};if(this.form.issueId){data.id=this.form.issueId}else{if(this.form.projectId){data.create=true;data.projectId=this.form.projectId}else{throw"Unable to find either an issueId or projectId to submit the attachment to."}}return data}});AJS.InlineAttach.FormPresenter.DEFAULT_URL=contextPath+"/secure/AttachTemporaryFile.jspa?decorator=none";AJS.InlineAttach.AjaxPresenter=AJS.InlineAttach.Presenter.extend({init:function($element){this._super();this.form=new AJS.InlineAttach.Form(new AJS.InlineAttach.FileInput($element,true));this.form.fileSelector.onChange(AJS.$.proxy(this._attach,this));this.form.onCancel(AJS.$.proxy(this._cancel,this))},_attach:function(files){this.form.clearErrors();if(this.cancelled){return }if(files&&files.length>0){files=this._checkAndFilterFiles(files);if(files){this._uploadFiles(files)}}this.form.fileSelector.clear().focus()},_checkAndFilterFiles:function(files){if(files.length>AJS.InlineAttach.AjaxPresenter.MAX_SELECTED_FILES){this.form.addError(AJS.InlineAttach.Text.tr("upload.error.too.many.files",files.length,AJS.InlineAttach.AjaxPresenter.MAX_SELECTED_FILES));return null}var maxSize=this.form.maxSize;var newFiles=[];for(var i=0;i<files.length;i++){try{var file=files[i];if(file.size==0){this.form.addError(AJS.InlineAttach.Text.tr("upload.empty.file",file.name))}else{if(maxSize>0&&file.size>maxSize){var sizes=AJS.InlineAttach.Text.fileSize(maxSize,file.size);this.form.addError(AJS.InlineAttach.Text.tr("upload.too.big",file.name,sizes[1],sizes[0]))}else{newFiles.push({name:file.name,size:file.size,file:file})}}}catch(e){this.form.addError(AJS.InlineAttach.AjaxUpload.getClientErrorMessage(e,file))}}return newFiles.length==0?null:newFiles},_createSubmitData:function(){var data={atl_token:this.form.getAtlToken()};if(this.form.issueId){data.issueId=this.form.issueId}else{if(this.form.projectId){data.projectId=this.form.projectId}else{throw"Unable to find either an issueId or projectId to submit the attachment to."}}return data},_uploadFiles:function(files){var form=this.form,data=this._createSubmitData(),that=this,running=false;AJS.$.each(files,function(){var progress=form.addProgress(this),file=this;var timer=new AJS.InlineAttach.Timer(function(){if(!that.cancelled){progress.show()}});var upload=new AJS.InlineAttach.AjaxUpload({file:file.file,params:AJS.$.extend({filename:file.name,size:file.size},data),scope:that,url:AJS.InlineAttach.AjaxPresenter.DEFAULT_URL,before:function(){!this.cancelled&&progress.start()},progress:function(val){!this.cancelled&&progress.update(val)},success:function(val,status){if(this.cancelled){return }if(status===201){if(val.id!==undefined&&val.name!==undefined){form.addTemporaryFileCheckbox(val.id,val.name,progress,file.file)}else{form.addError(AJS.InlineAttach.Text.tr("upload.error.bad.response",file.name),progress)}}else{if(val.token){form.setAtlToken(val.token)}if(val.errorMessage){form.addErrorWithFileName(val.errorMessage,file.name,progress)}else{form.addError(this._getErrorFromStatus(status,file),progress)}}},error:function(text,status){if(this.cancelled){return }if(status<0){form.addError(text,progress)}else{var statusError=this._getErrorFromStatus(status,file);if(statusError){form.addError(statusError,progress)}else{form.addError(AJS.InlineAttach.Text.tr("upload.error.unknown",file.name),progress)}}},after:function(){timer.cancel();progress.finish().remove();if(!this.cancelled&&!this._finishUpload(upload)){form.enable()}}});progress.onCancel(function(){upload.abort()});if(that._addUpload(upload)){running=true;timer.schedule(AJS.InlineAttach.DISPLAY_WAIT)}});if(running){this.form.disable()}},_getErrorFromStatus:function(status,file){var error;if(status===0){error=AJS.InlineAttach.Text.tr("upload.error.server.no.reply",file.name)}else{if(status===400){error=AJS.InlineAttach.Text.tr("upload.error.badrequest",file.name)}else{if(status===401){error=AJS.InlineAttach.Text.tr("upload.error.auth",file.name)}else{error=AJS.InlineAttach.Text.tr("upload.error.unknown.status",file.name,status)}}}return error},_cancel:function(){this._super();this.form.enable()}});AJS.$.extend(AJS.InlineAttach.AjaxPresenter,{DEFAULT_URL:contextPath+"/rest/internal/1.0/AttachTemporaryFile",MAX_SELECTED_FILES:100,isSupported:function($element){if(!$element||!$element[0]||!$element[0].files){return false}else{return AJS.InlineAttach.AjaxUpload.isSupported()}}});AJS.InlineAttach.FileInput=Class.extend({init:function($fileInput,testMultiple){this.$element=$fileInput;this.$container=$fileInput.parent();if(testMultiple&&this.$element[0].files!==undefined){this.$element.attr("multiple","multiple");this.multiple=true}else{this.multiple=false}},clear:function(){this.$element.val("");return this},getFiles:function(){return this.$element[0].files},hasFiles:function(){return this.getFiles().length>0},onChange:function(callback){var that=this;this.$element.change(function(){if(that.multiple){callback.call(that,this.files)}else{callback.call(that,that.getFileName())}});return this},focus:function(){if(this._isIE()){var $e=this.$element;setTimeout(function(){$e.focus()},0)}else{this.$element.focus()}return this},cloneInput:function(){var oldElement=this.$element;oldElement.replaceWith(this.$element=oldElement.clone(true));oldElement.unbind();return oldElement},getFileName:(function(){var fakepath=/^c:\\fakepath\\(?!$)/i;return function(){var fileName=this.$element.val();fileName=fileName.replace(fakepath,"");if(this._isIE()&&fileName.indexOf("\\")>=0){fileName=fileName.substring(fileName.lastIndexOf("\\")+1)}return fileName}})(),_isIE:function(){return AJS.$.browser.msie},before:function(el){if(el){if(el.$element){el=el.$element}this.$container.before(el)}}});AJS.InlineAttach.ProgressBar=(function(){var options={showPercentage:false,height:"2px"},count=0;return Class.extend({init:function(){var $container=this.$element=this._renderers.container();this.$progress=this._renderers.progress().appendTo($container);this.$progress.progressBar(0,options);this.hidden=true;this.old=0},value:function(value){if(value>100){value=100}else{if(value<0){value=0}}if(this.hidden){this.$progress.show();this.hidden=false}if(this.old!==value){this.$progress.progressBar(value,options);if(value>=100){this.$progress.fadeOut()}this.old=value}},_renderers:{container:function(){return AJS.$("<div>").addClass("file-progress")},progress:function(){return AJS.$("<div>").attr("id","upload-progress-"+(count++)).hide()}}})})();AJS.InlineAttach.UploadProgress=Class.extend({init:function(file){var $container=this.$element=AJS.InlineAttach.Renderers.container().hide();var progress=this.progress=new AJS.InlineAttach.ProgressBar();var content=this._renders.content(file.name);this.$content=content.$content;this.$cancel=content.$cancel;$container.append(content.$element).append(progress.$element);this.total=file.size;this.current=0;this.name=file.name;this.timer=new AJS.InlineAttach.Timer(this._update,this);this.rateNumerator=0;this.rateDenominator=0;this._title(AJS.InlineAttach.Text.tr("upload.progress.title.waiting"))},start:function(){this.started=this._now();this.startedSize=0;return this},update:function(current){this.timer.cancel();return this._update(current)},_update:function(current){var now=this._now();if(current===undefined){current=this.current}else{if(current!==this.current){this.lastUpdate=now;this.current=current}}var text=AJS.InlineAttach.Text;var percentage=Math.min(100,Math.round(current/this.total*100));var partSize=text.currentOutOfTotalSize(current,this.total);var rateDisplay,remainingDisplay;this.progress.value(percentage);var timeDiff=(now-this.started)/1000;if(timeDiff>=2){if(this.startedSize>0){this._addRate((current-this.startedSize)/timeDiff)}this.started=now;this.startedSize=current}var rate=this._calcRate();if(current>=AJS.InlineAttach.UploadProgress.DATA_MIN&&rate>0){var remaining=Math.max(1,(this.total-current)/rate);rateDisplay=text.rate(rate);remainingDisplay=text.time(remaining)}if(now-this.lastUpdate>=AJS.InlineAttach.UploadProgress.STALLED_TIMEOUT){this._content(text.tr("upload.file.stalled",this.name));if(rateDisplay){this._title(text.tr("upload.progress.title.known.stalled",rateDisplay,partSize))}else{this._title(text.tr("upload.progress.title.unknown.stalled",partSize))}}else{if(rateDisplay){this._title(text.tr("upload.progress.title.known",rateDisplay,partSize,remainingDisplay));this._content(text.tr("upload.file.remaining",this.name,remainingDisplay))}else{this._title(partSize);this._content(this.name)}}if(current<this.total){this.timer.schedule(AJS.InlineAttach.UploadProgress.UPLOAD_REFRESH)}return this},finish:function(){this.progress.value(100);this.timer.cancel();return this},onCancel:function(callback){var that=this;this.$cancel.click(function(e){e.preventDefault();callback.call(that)});return this},remove:function(){this.$element.remove();return this},hide:function(){this.$element.hide();return this},show:function(){this.$element.fadeIn();return this},_title:function(title){this.$element.attr("title",title);return this},_content:function(rem){this.$content.text(rem);return this},_addRate:function(rate){var weight=AJS.InlineAttach.UploadProgress.WEIGHT;this.rateNumerator=this.rateNumerator*weight+rate;this.rateDenominator=this.rateDenominator*weight+1},_calcRate:function(){if(this.rateDenominator==0){return 0}var value=this.rateNumerator/this.rateDenominator;if(Math.abs(value)<0.005){return 0}else{return value}},_now:function(){return new Date().getTime()},_renders:{content:function(fileName){var text=AJS.InlineAttach.Text.tr("upload.file.waiting",fileName);var $container=AJS.$("<div class='loading file'>");var $content=AJS.$("<span>").text(text);var $cancel=AJS.$("<a href='#'/>").text(AJS.InlineAttach.Text.tr("upload.cancel"));$container.append($content).append(" ").append($cancel);return{$element:$container,$content:$content,$cancel:$cancel}}}});AJS.$.extend(AJS.InlineAttach.UploadProgress,{STALLED_TIMEOUT:10000,UPLOAD_REFRESH:2000,DATA_MIN:20*1024,WEIGHT:0.7});AJS.InlineAttach.UnknownProgress=Class.extend({init:function(fileName){var content=this._renders.content(fileName);this.$element=content.$element;this.$cancel=content.$cancel;this.$content=content.$content;this.fileName=fileName;this._title(AJS.InlineAttach.Text.tr("upload.progress.title.waiting"))},remove:function(){this.$element.remove();return this},hide:function(){this.$element.hide();return this},show:function(){this.$element.fadeIn();return this},start:function(){this._title(AJS.InlineAttach.Text.tr("upload.progress.title.running"));this._content(this.fileName);return this},onCancel:function(callback){var that=this;this.$cancel.click(function(e){e.preventDefault();callback.call(that)});return this},_title:function(title){this.$element.attr("title",title);return this},_content:function(text){this.$content.text(text);return this},_renders:{content:function(fileName){var text=AJS.InlineAttach.Text.tr("upload.file.waiting",fileName);var $cancel=AJS.$("<a href='#'/>").text(AJS.InlineAttach.Text.tr("upload.cancel"));var $loading=AJS.$("<div class='loading file'>");var $content=AJS.$("<span>").text(text);$loading.append($content).append(" ").append($cancel);var $container=AJS.InlineAttach.Renderers.container().append($loading);return{$element:$container,$cancel:$cancel,$content:$content}}}});AJS.InlineAttach.Form=Class.extend({init:function(fileInput){this.fileSelector=fileInput;this.$form=fileInput.$element.closest("form");this.maxSize=parseInt(AJS.$("#attach-max-size").text());if(isNaN(this.maxSize)){throw"Unable to find maximum upload size on form."}var assigned=false;var val=parseInt(this.$form.find("input[name=id]").val());if(!isNaN(val)){assigned=true;this.issueId=val}val=parseInt(this.$form.find("input[name=pid]").val());if(!isNaN(val)){assigned=true;this.projectId=val}if(!assigned){throw"Unable to find either an issueId or projectId to submit the attachment to."}},getAtlToken:function(){var $atlToken=this.$form.find("input[name='atl_token']");if($atlToken.length>0){return $atlToken.val()}else{return atl_token()}},setAtlToken:function(token){var $token=this.$form.find("input[name='atl_token']");if($token.length>0){$token.val(token)}else{JIRA.XSRF.updateTokenOnPage(token)}return this},disable:function(){this._getFormSubmits().attr("disabled",true);return this},enable:function(){this._getFormSubmits().attr("disabled",false);return this},addProgress:function(file){var prog=new AJS.InlineAttach.UploadProgress(file);this._addElement(prog.$element);return prog},addStaticProgress:function(fileName){var prog=new AJS.InlineAttach.UnknownProgress(fileName);this._addElement(prog.$element);return prog},addTemporaryFileCheckbox:function(value,name,replaceObj,file){var $thumbNail=this.addLocalThumbnailImage(name,file);var $element=AJS.InlineAttach.Renderers.container();var $label=AJS.$("<label>").text(name);var $check=AJS.$("<input type='checkbox' class='checkbox' name='filetoconvert' checked='checked'>").attr({"value":value,"title":AJS.InlineAttach.Text.tr("upload.checkbox.title")});$element.append($check).append($label);if($thumbNail){$element.append(AJS.$("<br/>")).append($thumbNail)}$element.hide();this._replaceElement($element,replaceObj);return this},addLocalThumbnailImage:function(name,file){var $thumbNail=null;if(file&&window.FileReader){var imageType=/image.*/;if(file.type.match(imageType)){var that=this;var title=name+" - "+AJS.InlineAttach.Text.fileSize(file.size)+" - "+file.type;try{$thumbNail=AJS.$("<img style='display:none;margin-left: 16px;' />").attr({"alt":title,"title":title});var thumbIMG=$thumbNail[0];var reader=new FileReader();reader.onload=function(event){thumbIMG.src=event.target.result;$thumbNail[0].onload=function(){var aspectRatio=that.getAspectRatio(100,100,thumbIMG.width,thumbIMG.height);thumbIMG.width=Math.round(thumbIMG.width/aspectRatio);thumbIMG.height=Math.round(thumbIMG.height/aspectRatio);$thumbNail.show()}};reader.readAsDataURL(file)}catch(e){$thumbNail=null}}}return $thumbNail},getAspectRatio:function(maxWidth,maxHeight,origWidth,origHeight){if(origWidth>maxWidth){return Math.round(origWidth/maxWidth)}else{if(origHeight>maxHeight){return Math.round(origHeight/maxHeight)}else{return 1}}},addErrorWithFileName:function(error,fileName,replaceObj){if(error.indexOf(fileName)==-1){error=AJS.InlineAttach.Text.tr("upload.error.server",fileName,error)}this.addError(error,replaceObj)},addError:function(error,replaceObj){var $element=AJS.InlineAttach.Renderers.container();$element.addClass("error").append(AJS.$("<div>").text(error)).hide();this._replaceElement($element,replaceObj);return this},clearErrors:function(){this.$form.find("div.error").remove();return this},cloneFileInput:function(){return this.fileSelector.cloneInput()},onCancel:function(callback){var $cancel=this.$form.find("a.cancel");$cancel.click(AJS.$.proxy(callback,this));return this},_getFormSubmits:function(){return this.$form.find("input[type=submit]")},_addElement:function(el){this.fileSelector.before(el)},_replaceElement:function($element,replaceObj){if(replaceObj&&replaceObj.$element){replaceObj.$element.replaceWith($element)}else{this._addElement($element)}$element.fadeIn()}});AJS.InlineAttach.FormUpload=Class.extend({init:function(options){var scope=options.scope||null;var rescope=AJS.InlineAttach.rescope;this.$input=options.$input;this.url=options.url;this.params=options.params||{};this.successcb=rescope(options.success,scope);this.errorcb=rescope(options.error,scope);this.before=rescope(options.before,scope);this.after=rescope(options.after,scope);this.abortcb=rescope(options.abort,scope);this.aborted=false;this.$form=null;this.xhr=null},upload:function(){if(this.aborted){return }var $attachForm=this.$form=this._renders.form(this.url),that=this;this._addToBody($attachForm.append(this.$input));$attachForm.ajaxForm({dataType:"json",data:this.params,timeout:0,beforeSend:function(xhr){that.xhr=xhr},beforeSubmit:function(){that.before()},error:function(xhr){if(that.aborted){that.abortcb()}else{var text=(xhr&&xhr.responseText)||"";that.errorcb(text)}},success:function(data){that.successcb(data||{})},complete:function(){if(that.$form){that.$form.remove();that.$form=null}that.after()}});$attachForm.submit()},abort:function(){if(!this.aborted){this.aborted=true;if(this.xhr){this.xhr.abort();this.xhr=null}else{this.abortcb();this.after()}}},_addToBody:function($form){AJS.$("body").append($form)},_renders:{form:function(postUrl){return AJS.$("<form method='post' enctype='multipart/form-data'/>").attr("action",postUrl).hide()}}});AJS.InlineAttach.AjaxUpload=Class.extend({init:function(options){var scope=options.scope||null;var rescope=AJS.InlineAttach.rescope;this.file=options.file;this.url=options.url;this.params=options.params||{};this.beforecb=rescope(options.before,scope);this.progresscb=rescope(options.progress,scope);this.errorcb=rescope(options.error,scope);this.successcb=rescope(options.success,scope);this.abortcb=rescope(options.abort,scope);this.finalcb=rescope(options.after,scope);this.aborted=false},upload:function(){if(this.aborted||this.xhr){return }var xhr=this.xhr=AJS.InlineAttach.AjaxUpload.xhr();xhr.upload.onprogress=AJS.$.proxy(this._upload,this);xhr.onreadystatechange=AJS.$.proxy(this._statechange,this);var url=this.url;var params=AJS.$.param(this.params);if(params){url=url+"?"+params}this.beforecb();try{xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",this.file.type||"application/octet-stream");xhr.send(this.file)}catch(e){this._clienterror(e,this.file)}},abort:function(){if(!this.aborted){this.aborted=true;if(this.xhr){this.xhr.abort()}else{this.abortcb();this.finalcb()}}},_statechange:function(){if(this.xhr.readyState===4){if(this.aborted){this.abortcb()}else{try{this.successcb(JSON.parse(this.xhr.responseText),this.xhr.status,this.xhr)}catch(e){this.errorcb(this.xhr.responseText,this.xhr.status,this.xhr)}this.xhr.upload.onprogress=this.xhr.statechange=null}this.finalcb()}},_clienterror:function(e,file){this.errorcb(AJS.InlineAttach.AjaxUpload.getClientErrorMessage(e,file),-1,this.xhr);this.finalcb()},_upload:function(event){if(event.lengthComputable){this.progresscb(event.loaded)}}});AJS.$.extend(AJS.InlineAttach.AjaxUpload,{isSupported:function(){return AJS.InlineAttach.AjaxUpload._fileApiSupport(window)&&AJS.InlineAttach.AjaxUpload._xhrSupport()},xhr:function(){var fn=AJS.InlineAttach.AjaxUpload._xhrJquery();if(!fn){fn=AJS.InlineAttach.AjaxUpload._xhrDirect}AJS.InlineAttach.AjaxUpload.xhr=fn;return fn()},getClientErrorMessage:function(e,file){var safeName;try{safeName=file.name}catch(ignored){safeName="<unknown>"}if(e.name==="NS_ERROR_FILE_ACCESS_DENIED"){return AJS.InlineAttach.Text.tr("upload.error.no.access",safeName)}else{if(e.name==="NS_ERROR_FILE_NOT_FOUND"||e.name==="NS_ERROR_FILE_TARGET_DOES_NOT_EXIST"){return AJS.InlineAttach.Text.tr("upload.error.does.not.exist",safeName)}else{return AJS.InlineAttach.Text.tr("upload.error.client.unknown",safeName,e.message||e)}}},_xhrJquery:function(){var settings=AJS.$.ajaxSettings;return(settings&&settings.xhr)||null},_xhrDirect:function(){try{return new XMLHttpRequest()}catch(e){return null}},_xhrSupport:function(){try{var xhr=AJS.InlineAttach.AjaxUpload.xhr();if(xhr&&xhr.upload){return true}}catch(e){}return false},_fileApiSupport:function(window){return window.File&&window.FileList&&window.FileReader}});AJS.InlineAttach.Timer=Class.extend({init:function(callback,scope){this.callback=AJS.InlineAttach.rescope(callback,scope||this);this._callback=AJS.$.proxy(this._callback,this);this.timeoutId=null},cancel:function(){if(this.timeoutId!==null){this._endTimeout(this.timeoutId);this.timeoutId=null}return this},schedule:function(timeout){this.cancel();this.timeoutId=this._startTimeout(this._callback,timeout);return this},_callback:function(){this.timeoutId=null;this.callback()},_startTimeout:function(fn,timeout){return window.setTimeout(fn,timeout)},_endTimeout:function(id){window.clearTimeout(id)}});AJS.InlineAttach.Text=(function(){var kB=1024;var MB=1024*kB;var GB=1024*MB;var bMax=Math.floor(kB*0.995);var kBMax=Math.floor(MB*0.995);var MBMax=Math.floor(GB*0.995);return{"upload.empty.file":"Cannot attach empty file {0}.","upload.too.big":"{0} is too large to attach. Attachment is {1} but the largest allowed attachment is {2}.","upload.error.bad.response":"Cannot attach file {0}: Unexpected server response.","upload.error.unknown.status":"Cannot attach file {0}: Unknown server error ({1}).","upload.error.auth":"Cannot attach file {0}: You do not have permission attach a file to the issue.","upload.error.badrequest":"Cannot attach file {0}. Browser made bad request to the server.","upload.error.server":"Cannot attach file {0}: {1}","upload.cancel":"Cancel","upload.file.remaining":"{0} - {1} left.","upload.file.waiting":"{0} - waiting.","upload.file.stalled":"{0} - stalled.","upload.checkbox.title":"Clear check box to prevent file being attached","upload.xsrf.timeout":"Cannot attach file {0}: Your session has timed out or you were logged out. Please save your work and reload the page.","upload.error.unknown":"Cannot attach file {0}: Unknown server error.","upload.progress.title.waiting":"Waiting for other uploads to complete.","upload.progress.title.running":"Uploading.","upload.progress.title.unknown.stalled":"{0}, stalled.","upload.progress.title.known":"{0} - {1}, {2} left.","upload.progress.title.known.stalled":"{0} - {1}, stalled.","upload.kilobyte":"{0} kB","upload.kilobyte.part":"{0}\/{1} kB","upload.megabyte":"{0} MB","upload.megabyte.part":"{0}\/{1} MB","upload.gigabyte":"{0} GB","upload.gigabyte.part":"{0}\/{1} GB","upload.seconds":"{0} sec","upload.minutes":"{0} min","upload.hours":"{0} hr","upload.hours.minutes":"{0} hr {1} min","upload.bytes.per.second":"{0} B\/sec","upload.kilobytes.per.second":"{0} kB\/sec","upload.megabytes.per.second":"{0} MB\/sec","upload.error.no.access":"Browser does not have permission to access {0}.","upload.error.does.not.exist":"{0} does not exist.","upload.error.client.unknown":"An unknown error occured on the browser while trying to attach {0}: {1}.","upload.error.too.many.files":"You are trying to attach {0} files. Only {1} files can be attached at a time.","upload.error.server.no.reply":"Cannot attach file {0}: Unable to communicate with JIRA.",tr:function(key){if(arguments.length==0){return undefined}else{if(arguments.length==1){return this[key]||key}else{if(this[key]){var args=AJS.InlineAttach.copyArrayLike(arguments);args[0]=this[key];return AJS.format.apply(AJS,args)}else{return key}}}},fileSize:function(){if(arguments.length==0){return undefined}else{var key,b=AJS.InlineAttach.Text._classifySize(arguments[0]);if(b.unit===kB){key="upload.kilobyte"}else{if(b.unit===MB){key="upload.megabyte"}else{key="upload.gigabyte"}}if(arguments.length==1){return this.tr(key,b.convert(arguments[0]))}else{var result=new Array(arguments.length);for(var i=0;i<arguments.length;i++){result[i]=this.tr(key,b.convert(arguments[i]))}return result}}},currentOutOfTotalSize:function(current,total){var b=this._classifySize(total),key;if(b.unit===kB){key="upload.kilobyte.part"}else{if(b.unit===MB){key="upload.megabyte.part"}else{key="upload.gigabyte.part"}}return this.tr(key,b.convert(current),b.convert(total))},_classifySize:function(size){var base;if(size<=kBMax){base=kB}else{if(size<=MBMax){base=MB}else{base=GB}}return{unit:base,convert:function(s){return AJS.InlineAttach.Text._toDisplay(s/base)}}},time:function(seconds){if(seconds<60){return this.tr("upload.seconds",Math.floor(seconds))}else{var minutes=seconds/60;if(minutes<60){return this.tr("upload.minutes",Math.floor(minutes))}else{var hours=Math.floor(minutes/60);minutes=Math.floor(minutes%60);if(minutes>0){return this.tr("upload.hours.minutes",hours,minutes)}else{return this.tr("upload.hours",hours)}}}},rate:function(bytesPerSecond){if(bytesPerSecond<=bMax){return this.tr("upload.bytes.per.second",AJS.InlineAttach.Text._toDisplay(bytesPerSecond))}else{if(bytesPerSecond<=kBMax){return this.tr("upload.kilobytes.per.second",AJS.InlineAttach.Text._toDisplay(bytesPerSecond/kB))}else{return this.tr("upload.megabytes.per.second",AJS.InlineAttach.Text._toDisplay(bytesPerSecond/MB))}}},_toDisplay:function(number){if(number<0.005){return"0"}else{return(Math.round(number*100)/100).toFixed(2)}}}})();jQuery.fn.inlineAttach=function(){var res=[];this.each(function(){res.push(new AJS.InlineAttach(this))});return res};
JIRA.setFocus=(function(){var _defaultExcludeParentSelector="form.dont-default-focus",_defaultFocusElementSelector="input:not(#issue-filter-submit), select, textarea, button, a.cancel",_defaultParentElementSelectors=["div.aui-popup-content:visible","form.aui:visible","form:visible"],_configurationStack=[];var _focusIn=function(context,parentSelector,excludeParentSelector,elementSelector){var found=false;AJS.$(parentSelector,context).not(excludeParentSelector).find(elementSelector).each(function(){var elem=AJS.$(this);if(elem.is(":visible:enabled, a:visible")){elem.focus();if(elem.is(":text, :password, textarea")){if(elem.is(".focus-select-end")){elem.setCaretToPosition(elem[0].value.length)}else{elem.setSelectionRange(0,elem[0].value.length)}}found=true;return false}});return found},_defaultFocusNow=function(){var i=0,currentConfig=_configurationStack[_configurationStack.length-1];while(!_focusIn(currentConfig.context,currentConfig.parentElementSelectors[i],currentConfig.excludeParentSelector,currentConfig.focusElementSelector)&&i<currentConfig.parentElementSelectors.length){i++}};return{FocusConfiguration:function(){this.context=document;this.excludeParentSelector=_defaultExcludeParentSelector;this.focusElementSelector=_defaultFocusElementSelector;this.parentElementSelectors=_defaultParentElementSelectors;this.focusNow=_defaultFocusNow},triggerFocus:function(){if(_configurationStack.length==0){_configurationStack.push(new this.FocusConfiguration())}_configurationStack[_configurationStack.length-1].focusNow()},pushConfiguration:function(configuration){_configurationStack.push(configuration)},popConfiguration:function(){_configurationStack.pop()}}})();jQuery(function(){JIRA.setFocus.triggerFocus()});
(function(){var eventsToListenTo="input keyup";jQuery.fn.expandOnInput=function(maxHeight){var $textareas=this.filter("textarea");$textareas.unbind(eventsToListenTo,setHeight).bind(eventsToListenTo,setHeight);if(AJS.$.browser.mozilla||AJS.$.browser.msie){$textareas.unbind("paste",triggerKeyup).bind("paste",triggerKeyup)}$textareas.unbind("refreshInputHeight").bind("refreshInputHeight",function(){setHeight.call(AJS.$(this).css("height",""))});$textareas.data("expandOnInput_maxHeight",maxHeight);$textareas.each(function(){var $this=AJS.$(this);$this.each(function(){var $this=AJS.$(this);$this.data("hasFixedParent",$this.hasFixedParent())});if(AJS.$(this).val()!==""){setHeight.call(this)}});return this};function triggerKeyup(){var $textarea=AJS.$(this),textarea=this;setTimeout(function(){$textarea.keyup();textarea.scrollTop=textarea.scrollHeight},0)}function setHeight(){var $textarea=AJS.$(this),height=parseInt($textarea.css("height"),10)||$textarea.height(),padding=$textarea.attr("clientHeight")-height;this.scrollHeight;var maxHeight=parseInt($textarea.css("maxHeight"),10)||$textarea.data("expandOnInput_maxHeight")||AJS.$(window).height()-160,newHeight=Math.max(height,this.scrollHeight-padding);if(newHeight<maxHeight){$textarea.css({"overflow":"hidden","height":newHeight+"px"})}else{var cursorPosition=this.selectionStart;$textarea.css({"overflow-y":"auto","height":maxHeight+"px"});if(AJS.$.browser.msie&&AJS.$.browser.version<=7){setTimeout(function(){$textarea.css({"zoom":"1"})},0)}$textarea.unbind(eventsToListenTo,setHeight);$textarea.unbind("paste",triggerKeyup);if(this.selectionStart!==cursorPosition){this.selectionStart=cursorPosition;this.selectionEnd=cursorPosition}newHeight=maxHeight}if(!$textarea.data("hasFixedParent")){var $window=AJS.$(window),scrollTop=$window.scrollTop(),minScrollTop=$textarea.offset().top+newHeight-$window.height()+29;if(scrollTop<minScrollTop){$window.scrollTop(minScrollTop)}}$textarea.trigger("stalkerHeightUpdated")}})();
(function($){var DIRTY_WARNING_EXEMPT="ajs-dirty-warning-exempt";var activeForm=null;var defaultDirtyMessage="You have entered new data on this page. If you navigate away from this page without first saving your data, the changes will be lost.";var dirtyMessage=defaultDirtyMessage;$.fn.isDirty=function(){var $fields=this.find("*").andSelf().filter(":input");for(var i=0;i<$fields.length;i++){if(isElementDirty($fields[i])){return true}}return false};$.fn.removeDirtyWarning=function(){$(this.form||this).closest("form").addClass(DIRTY_WARNING_EXEMPT);return this};$(document).bind("page-unload.location-change.from-dialog",function(e){window.onbeforeunload=function(){}});$(document).bind("page-unload.refresh.from-dialog",function(e){dirtyMessage="The data in the dialog box was successfully submitted, although this page requires a refresh to display the results.\n\nYou had entered new data on the page before you opened the dialog box. If you continue, your page data will be lost."});function getDirtyMessage(){var msg=dirtyMessage;dirtyMessage=defaultDirtyMessage;return"***\n\n"+msg+"\n\n***"}JIRA.DirtyForm={getDirtyWarning:function(){var $textareas=$("textarea[name]");for(var i=0,ii=$textareas.length;i<ii;i++){if($textareas[i].form!==activeForm&&isElementDirty($textareas[i])){return getDirtyMessage()}}}};if(!AJS.isSelenium()){window.onbeforeunload=JIRA.DirtyForm.getDirtyWarning}function isElementDirty(element){var $element=$(element),$form=$(element.form),type=element.type;if($form.hasClass(DIRTY_WARNING_EXEMPT)||$element.hasClass(DIRTY_WARNING_EXEMPT)){return false}if($element.is(":hidden")){return false}if(type==="hidden"||type==="submit"||type==="button"){return false}if(type==="select-one"||type==="select-multiple"){var options=element.options;for(var i=0;i<options.length;i++){var option=options[i];if(option.selected!==option.defaultSelected){return true}}return false}if(type==="checkbox"||type==="radio"){return element.checked!==element.defaultChecked}return element.value!==element.defaultValue}$(document).delegate("form","submit cancel",function(){activeForm=this});$(document).delegate(".cancel","click",cancelForm);$(function(){$("#cancelButton").bind("mousedown keydown click",cancelForm)});function cancelForm(){$(this.form||this).closest("form").trigger("cancel")}})(AJS.$);
jQuery.fn.overlabel=function(targField){this.each(function(){var label=AJS.$(this).removeClass("overlabel").addClass("overlabel-apply show").click(function(e){field.focus();e.preventDefault()});var field=targField||AJS.$("#"+label.attr("for"));field.focus(function(){label.removeClass("show").hide()}).blur(function(){if(AJS.$(this).val()===""){label.addClass("show").show()}});if(field.val()&&field.val()!==""){label.removeClass("show").hide()}});return this};
/*
 * jQuery Text Overflow v0.7
 *
 * Licensed under the new BSD License.
 * Copyright 2009-2010, Bram Stein
 * All rights reserved.
 */
(function($){var style=document.documentElement.style,hasTextOverflow=("textOverflow" in style||"OTextOverflow" in style),domSplit=function(root,maxIndex){var index=0,result=[],rtrim=function(text){return text.replace(/\s+$/g,"")},domSplitAux=function(nodes){var i=0,tmp;if(index>maxIndex){return }for(i=0;i<nodes.length;i+=1){if(nodes[i].nodeType===1){tmp=nodes[i].cloneNode(false);result[result.length-1].appendChild(tmp);result.push(tmp);domSplitAux(nodes[i].childNodes);result.pop()}else{if(nodes[i].nodeType===3){if(index+nodes[i].length<maxIndex){result[result.length-1].appendChild(nodes[i].cloneNode(false))}else{tmp=nodes[i].cloneNode(false);tmp.textContent=rtrim(tmp.textContent.substring(0,maxIndex-index));result[result.length-1].appendChild(tmp)}index+=nodes[i].length}else{result.appendChild(nodes[i].cloneNode(false))}}}};result.push(root.cloneNode(false));domSplitAux(root.childNodes);return $(result.pop().childNodes)};$.extend($.fn,{textOverflow:function(str,autoUpdate){var more=str||"&#x2026;";if(!hasTextOverflow){return this.each(function(){var element=$(this),clone=element.clone(),originalElement=element.clone(),originalText=element.text(),originalWidth=element.width(),low=0,mid=0,high=originalText.length,reflow=function(){if(originalWidth!==element.width()){element.replaceWith(originalElement);element=originalElement;originalElement=element.clone();element.textOverflow(str,false);originalWidth=element.width()}};element.after(clone.hide().css({"position":"absolute","width":"auto","overflow":"visible","max-width":"inherit"}));if(clone.width()>originalWidth){while(low<high){mid=Math.floor(low+((high-low)/2));clone.empty().append(domSplit(originalElement.get(0),mid)).append(more);if(clone.width()<originalWidth){low=mid+1}else{high=mid}}if(low<originalText.length){element.empty().append(domSplit(originalElement.get(0),low-1)).append(more)}}clone.remove();if(autoUpdate){setInterval(reflow,200)}})}else{return this}}})})(jQuery);
jQuery.fn.tooltip=function(){var defaults={activeClass:"active",delay:0.8};return function(options){var tts=[];options=jQuery.extend(defaults,options);this.each(function(){var $this=jQuery(this);$this.extend($this,{showToolTip:function(){if(!$this.hasClass(options.activeClass)){$this.showToolTip.timer=setTimeout(function(){$this.addClass(options.activeClass);if(options.onShow){options.onShow.call($this)}},options.delay*1000)}else{clearTimeout($this.hideToolTip.timer)}},hideToolTip:function(){if(!$this.hasClass(options.activeClass)){clearTimeout($this.showToolTip.timer)}else{$this.hideToolTip.timer=setTimeout(function(){$this.removeClass(options.activeClass);if(options.onHide){options.onHide.call($this)}},options.delay*1000)}}});$this.click(function(){clearTimeout($this.showToolTip.timer);$this.removeClass(options.activeClass);if(options.onHide){options.onHide.call($this)}});$this.hover($this.showToolTip,$this.hideToolTip);tts.push($this)});return jQuery(tts)}}();
JIRA.ToggleBlock=Class.extend({getDefautOptions:function(){return{blockSelector:".twixi-block",triggerSelector:".twixi",eventType:"click",collapsedClass:"collapsed",expandedClass:"expanded",cookieName:"jira.toggleblocks.cong.cookie",cookieCollectionName:"twixi-blocks",autoFocusTrigger:true}},_collapseTwixiBlocksFromCookie:function(){var block,val=readFromConglomerateCookie(this.options.cookieName,this.options.cookieCollectionName,"");val=val.replace(/\./g,"\\.");if(/#\w+/.test(val)){block=AJS.$(val);if(block.is(this.options.blockSelector)){if(!this.isPermlink()){block.removeClass(this.options.expandedClass).addClass(this.options.collapsedClass)}}}return this},_updateTwixiBlockIdInCookie:function(blockId){if(!this.isPermlink()){if(!/#\w+/.test(blockId)){return this}var val=readFromConglomerateCookie(this.options.cookieName,this.options.cookieCollectionName,""),blockLength=(","+val+",").indexOf(","+blockId+",")+1;if(blockLength){if(val.indexOf(","+blockId)+1){val=val.replace(","+blockId,"")}else{val=val.replace(blockId,"")}}else{val=val.length?val+","+blockId:blockId}saveToConglomerateCookie(this.options.cookieName,this.options.cookieCollectionName,val)}return this},contract:function(block){block=jQuery(block);if(block.is(this.options.blockSelector)){block.removeClass(this.options.expandedClass).addClass(this.options.collapsedClass);if(this.options.persist!==false){this._updateTwixiBlockIdInCookie("#"+block.attr("id"))}}AJS.$(block).trigger("contractBlock");return this},expand:function(block){block=jQuery(block);if(block.is(this.options.blockSelector)){block.removeClass(this.options.collapsedClass).addClass(this.options.expandedClass);if(this.options.persist!==false){this._updateTwixiBlockIdInCookie("#"+block.attr("id"))}}AJS.$(block).trigger("expandBlock");return this},toggle:function(twikiBlockChild){var block=AJS.$(twikiBlockChild).closest(this.options.blockSelector);if(!block.hasClass(this.options.collapsedClass)){this.contract(block)}else{this.expand(block)}if(this.options.autoFocusTrigger){block.find(this.options.triggerSelector+":visible").focus()}return this},isPermlink:function(){var queryString=jQuery.query.load(location.href);return(queryString.get("focusedCommentId")!==""||queryString.get("focusedWorklogId")!=="")},addTrigger:function(triggerSelector,eventType){var thisInstance=this,$doc=AJS.$(document),lastMousedown=0;if(triggerSelector){eventType=eventType||"click";if(eventType==="dblclick"){if(document.selection){$doc.delegate(triggerSelector,"dblclick",function(){document.selection.empty()})}else{$doc.delegate(triggerSelector,"mousedown",function(){var now=new Date().getTime(),allowSelection=now-lastMousedown>750;lastMousedown=now;return allowSelection})}}$doc.delegate(triggerSelector,eventType,function(){thisInstance.toggle(this)})}return this},addCallback:function(methodName,callback){jQuery.aop.after({target:this,method:methodName},callback);return this},init:function(options){var thisInstance=this;options=options||{};this.options=jQuery.extend(this.getDefautOptions(),options);AJS.$(document).delegate(this.options.triggerSelector,this.options.eventType,function(e){if(!(thisInstance.options.originalTargetIgnoreSelector&&jQuery(e.originalTarget).is(thisInstance.options.originalTargetIgnoreSelector))){thisInstance.toggle(this);e.preventDefault()}});if(this.options.persist!==false){jQuery(function(){thisInstance._collapseTwixiBlocksFromCookie()})}}});
JIRA.wikiPreview=function(prefs,ctx){var field,editField,trigger,inPreviewMode=false,origText,setFields=function(){field=AJS.$("#"+prefs.fieldId,ctx),editField=AJS.$("#"+prefs.fieldId+"-wiki-edit",ctx),trigger=AJS.$("#"+prefs.trigger,ctx)},scrollSaver=function(){var elem;return{show:function(){if(!elem){elem=AJS.$("<div>").html("&nbsp;").css({height:"300px"}).insertBefore(editField)}elem.css({display:"block"})},hide:function(){elem.css({display:"none"})}}}(),toggleRenderPreview=function(){if(!inPreviewMode){editField.find(".content-inner").css({maxHeight:field.css("maxHeight")});this.showPreview()}else{editField.find(".content-inner").css({maxHeight:""});this.showInput()}},renderData=function(data){editField.originalHeight=editField.height();scrollSaver.show();editField.addClass("previewClass");origText=field.val();field.hide();trigger.removeClass("loading").addClass("selected");editField.find(".content-inner").html(data);scrollSaver.hide();inPreviewMode=true;AJS.$(document).trigger("showWikiPreview",[editField]);setTimeout(function(){trigger.focus()},0)},handleError=function(previewer){return function(XMLHttpRequest,textStatus,errorThrown){trigger.removeClass("loading");origText=field.val();if(textStatus){alert(textStatus)}if(errorThrown){alert(errorThrown)}previewer.showInput()}};return{showPreview:function(){var that=this;var pid=AJS.$("#pid",ctx).val(),issueType=AJS.$("#issuetype",ctx).val();AJS.$("#"+prefs.trigger,ctx).addClass("loading");AJS.$.ajax({url:contextPath+"/rest/api/1.0/render",contentType:"application/json",type:"POST",data:JSON.stringify({rendererType:prefs.rendererType,unrenderedMarkup:field.val(),issueKey:prefs.issueKey,projectId:pid,issueType:issueType}),dataType:"html",success:renderData,error:handleError(that)})},showInput:function(e){if(editField){scrollSaver.show();editField.css({height:""});editField.removeClass("previewClass").find(".content-inner").empty();field=AJS.$("#"+prefs.fieldId,ctx);field.val(origText);field.show();trigger.removeClass("selected");scrollSaver.hide();inPreviewMode=false;AJS.$(document).trigger("showWikiInput",[editField])}},init:function(){var that=this,$trigger;prefs=AJS.$.readData(prefs);$trigger=AJS.$("#"+prefs.trigger,ctx);$trigger.click(function(e){if(!$trigger.hasClass("loading")){setFields();toggleRenderPreview.call(that)}e.preventDefault()})}}};AJS.$(function(){var wikiRenders=AJS.$("dl.wiki-js-prefs");wikiRenders.each(function(){var render=JIRA.wikiPreview(this);render.init()})});AJS.namespace("jira.app.wikiPreview",null,JIRA.wikiPreview);
AJS.namespace("JIRA.Issue");(function(){JIRA.Issue.wireAssignToMeLink=function(context){jQuery("#assign-to-me-trigger",context).click(function(e){e.preventDefault();var assigneeId=getHashedLinkTarget(jQuery(this).attr("href"));var currentUserOption=jQuery(assigneeId,context).find(".current-user");var val=currentUserOption.val();jQuery(assigneeId,context).val(val).change()})};function getHashedLinkTarget(url){var hashIndex=url.indexOf("#");if(hashIndex!=-1){return url.substring(hashIndex)}else{return url}}var $keyVal;function getKeyVal(){if(!$keyVal){$keyVal=jQuery("#key-val")}return $keyVal}JIRA.Issue.getIssueId=function(){var $keyVal=getKeyVal();if($keyVal.length!==0){return $keyVal.attr("rel")}return undefined};JIRA.Issue.getIssueKey=function(){var $keyVal=getKeyVal();if($keyVal.length!==0){return $keyVal.text()}return undefined}})();AJS.namespace("jira.app.issue",null,JIRA.Issue);
JIRA.IssueNavigator={isNavigator:function(){return jQuery("#isNavigator").length===1},isRowSelected:function(){return JIRA.IssueNavigator.get$focusedRow().length!==0},get$focusedRow:function(){return jQuery("#issuetable tr.issuerow.focused")},getFocsuedIssueIndex:function(){var rowIndex=jQuery("#issuetable").find("tr.issuerow").index(JIRA.IssueNavigator.get$focusedRow());var searchOffset=parseInt(jQuery("#results-count-start").text(),10)-1;return rowIndex+searchOffset},getSelectedIssueKey:function(){var $focusedRow=JIRA.IssueNavigator.get$focusedRow();if($focusedRow.length!==0){return $focusedRow.attr("data-issuekey")}return undefined},getSelectedIssueId:function(){return JIRA.IssueNavigator.get$focusedRow().attr("rel")},getNextIssueId:function(){return JIRA.IssueNavigator.get$focusedRow().next("tr.issuerow").attr("rel")}};AJS.namespace("jira.app.issuenavigator",null,JIRA.IssueNavigator);
(function($){JIRA.IssueNavigator.Shortcuts={};var $rows,index,$nextPage,$previousPage,helpText,isLoadingNewPage=false;var issueIdToRowIndex={};$(document).ready(function(){if(JIRA.IssueNavigator.isNavigator()){var $focusedRow;var focusedClassName=/(?:^|\s)focused(?!\S)/;var preventFocus=function(){$(this).attr("tabIndex",-1)};$rows=$("#issuetable").find("tr.issuerow");$rows.each(function(i){var $row=$(this);$("a.hidden-link",this).blur(preventFocus);if(!$focusedRow&&focusedClassName.test(this.className)){$focusedRow=$row;index=i}issueIdToRowIndex[$row.attr("rel")]=i});if(!$focusedRow){$focusedRow=$rows.first().addClass("focused")}var jqlHasFocus=jQuery("#jqltext").hasClass("focused");if(!jqlHasFocus){var triggerConfig=new JIRA.setFocus.FocusConfiguration();triggerConfig.focusNow=function(){focusRow(index)};JIRA.setFocus.pushConfiguration(triggerConfig)}$(document).keypress(function(e){if(e.keyCode=="13"&&$("div.aui-blanket").length==0){var target=e.target;if(target===undefined||target.nodeName==="HTML"||target.nodeName==="BODY"||target==document){if(hasResults()&&$rows[index]){window.location=contextPath+"/browse/"+$rows.eq(index).attr("data-issuekey")}}}});var $pager=$("p.pagination").first(),shouldFocusSearch=$("#focusSearch").attr("content")==="true";$nextPage=$pager.find("a.icon-next");$previousPage=$pager.find("a.icon-previous");if(!shouldFocusSearch){var activeElement=AJS.$(document.activeElement);if(activeElement.is(":input")){activeElement.blur()}}if($("body").hasClass("iss-nav")){$("#edit-issue").click(updateActionTemplateWithIssueId);if(hasResults()&&!$(document.activeElement).is(":input")){setTimeout(function(){$rows.eq(index).scrollIntoView()},0)}}if(hasResults()){JIRA.IssueNavigator.Shortcuts.flashIssueRow()}$(".issue-actions-trigger").click(function(){var $row=$(this).closest("tr");var issueId=$row.attr("rel");if(issueId){JIRA.IssueNavigator.Shortcuts.focusRow(issueId,0,true)}});$(document).bind("dialogContentReady",function(){if(setSelectedIssueAjax.callback){setSelectedIssueAjax.callback()}})}});var inDuration=1200;var flashLifeSpan=10000;var flashTimerId=null;var $flashedIssueRow=null;function clearFlashTimeout(){if(flashTimerId){window.clearTimeout(flashTimerId)}}function removeIssueRowFlash(outDuration){clearFlashTimeout();if($flashedIssueRow){$flashedIssueRow.addClass("issueactioneddissapearing").removeClass("issueactioned");$("td:first-child",$flashedIssueRow).removeClass("issueactioned");$flashedIssueRow.animate({backgroundColor:"#fff"},outDuration,function(){$(this).removeAttr("style");$(this).removeClass("issueactioneddissapearing")})}$flashedIssueRow=null}function flashIssueRowWithId(issueId,selectedIssueMsg,selectedIssueKey){if($flashedIssueRow){removeIssueRowFlash("fast")}$flashedIssueRow=$("#issuerow"+issueId);$flashedIssueRow.animate({backgroundColor:"#ffd"},inDuration,function(){$(this).css({backgroundColor:null});$(this).addClass("issueactioned")});clearFlashTimeout();flashTimerId=window.setTimeout(function(){removeIssueRowFlash("slow");$("#affectedIssueMsg").fadeOut(inDuration)},flashLifeSpan);if(!selectedIssueKey){selectedIssueKey=$flashedIssueRow.attr("data-issuekey")}if(!selectedIssueMsg){selectedIssueMsg="thanks_issue_updated"}var allMsgTexts={"thanks_issue_updated":"{0} has been updated.","thanks_issue_transitioned":"{0} has been updated.","thanks_issue_assigned":"{0} has been assigned.","thanks_issue_commented":"{0} has been updated with your comment.","thanks_issue_worklogged":"Work has been logged on {0}.","thanks_issue_voted":"Your vote on {0} has been updated.","thanks_issue_watched":"Your watcher status on {0} has been updated.","thanks_issue_moved":"{0} has been moved.","thanks_issue_linked":"The links on {0} have been updated.","thanks_issue_cloned":"{0} has been cloned.","thanks_issue_labelled":"The labels on {0} have been updated.","thanks_issue_deleted":"{0} has been deleted.","thanks_issue_attached":"The files(s) have been attached to {0}."};var msgText=allMsgTexts[selectedIssueMsg];if(msgText&&selectedIssueKey){msgText=AJS.format(msgText,selectedIssueKey);var $msgContainer=$("#affectedIssueMsg");if($msgContainer.length>0){$msgContainer.html('<div class="aui-message warning"><span class="aui-icon icon-warning"></span>'+msgText+"</div>")}else{$msgContainer=$('<div id="affectedIssueMsg"><div class="aui-message warning"><span class="aui-icon icon-warning"></span>'+msgText+"</div></div>");$("#main-content").prepend($msgContainer)}$msgContainer.css("margin-left",(-$msgContainer.outerWidth()/2)).show().fadeIn(100)}}JIRA.IssueNavigator.Shortcuts.flashIssueRow=function(issueId){var sessionstorage=JIRA.SessionStorage;var selectedIssueMsg=null;var selectedIssueKey=null;if(!issueId){if(!issueId){issueId=sessionstorage.getItem("selectedIssueId")}if(!issueId){var result=/[?&]selectedIssueId=([0-9]+)/.exec(window.location);issueId=result&&result.length==2?result[1]:null}}if(issueId){selectedIssueKey=sessionstorage.getItem("selectedIssueKey");selectedIssueMsg=sessionstorage.getItem("selectedIssueMsg");flashIssueRowWithId(issueId,selectedIssueMsg,selectedIssueKey)}sessionstorage.removeItem("selectedIssueId");sessionstorage.removeItem("selectedIssueKey");sessionstorage.removeItem("selectedIssueMsg")};JIRA.IssueNavigator.Shortcuts.selectNextIssue=function(){if(hasResults()&&!isLoadingNewPage){if(index===$rows.length-1){followLink($nextPage)}else{unselectRow(index++);selectRow(index)}}};JIRA.IssueNavigator.Shortcuts.selectPreviousIssue=function(){if(hasResults()&&!isLoadingNewPage){if(index===0){followLink($previousPage)}else{unselectRow(index--);selectRow(index)}}};JIRA.IssueNavigator.Shortcuts.viewSelectedIssue=function(){if(hasResults()&&$($rows[index]).length){try{window.location=contextPath+"/browse/"+$($rows[index]).attr("data-issuekey")}catch(err){}}};JIRA.IssueNavigator.Shortcuts.focusRow=function(issueId,delay,supressLinkFocus){if(hasResults()){if(issueId){selectRowViaIssueId(issueId,delay,supressLinkFocus)}else{if(!supressLinkFocus){$($rows[index]).find("a:first").focus()}}}};JIRA.IssueNavigator.Shortcuts.focusSearch=function(){var $jqlTextArea=$("#jqltext");$("#jira").scrollIntoView();if($jqlTextArea.length>0){$jqlTextArea.focus()}else{var $leftHandColumn=$("#iss-wrap");if($leftHandColumn.hasClass("lhc-collapsed")){$(".toggle-lhc").click()}var $textSection=$("#navigator-filter-subheading-textsearch-group");if($textSection.hasClass("collapsed")){$("#searcher-pid").focus()}else{$("#searcher-query").focus()}}};function updateActionTemplateWithIssueId(){if(/id=\{0\}/.test(this.href)){var issueId=JIRA.IssueNavigator.getSelectedIssueId();var url=this.href;url=url.replace(/(id=\{0\})/g,"id="+issueId);url+="?selectedIssueId="+issueId;this.href=url}}function hasResults(){return $rows&&$rows.length>0}function followLink($a){var href=$a.attr("href");if(href){isLoadingNewPage=true;AJS.nextPage("blurSearch",true);window.location=href;setTimeout(function(){isLoadingNewPage=false},5000)}}function unselectRow(i){var $td=$($rows[i]).find("td:first");$($rows[i]).removeClass("focused");helpText=$td.attr("title");$td.removeAttr("title")}function selectRow(i,delay,supressLinkFocus){var $selected=$($rows[i]).addClass("focused").scrollIntoView();$selected.find("td").first().attr("title",helpText);if(!supressLinkFocus){focusRow(i)}setSelectedIssueAjax(delay||250)}function selectRowViaIssueId(issueId,delay,supressLinkFocus){var newIndex=issueIdToRowIndex[issueId];if(newIndex||newIndex===0){unselectRow(index);selectRow(index=newIndex,delay,supressLinkFocus)}}function focusRow(i){var $selected=$($rows[i]);$selected.find(".hidden-link").removeAttr("tabIndex").focus()}function setSelectedIssueAjax(delay){delay=typeof delay==="number"?delay:1000;clearDelayedTimeout();setSelectedIssueAjax.timeout=setTimeout(setSelectedIssueAjax.callback=function(){$.get(contextPath+"/secure/SetSelectedIssue.jspa",{atl_token:atl_token(),selectedIssueId:JIRA.IssueNavigator.getSelectedIssueId(),selectedIssueIndex:JIRA.IssueNavigator.getFocsuedIssueIndex(),nextIssueId:JIRA.IssueNavigator.getNextIssueId()});clearDelayedTimeout()},delay)}setSelectedIssueAjax.callback=null;setSelectedIssueAjax.timeout=null;function clearDelayedTimeout(){clearTimeout(setSelectedIssueAjax.timeout);setSelectedIssueAjax.callback=null;setSelectedIssueAjax.timeout=null}})(AJS.$);AJS.namespace("jira.app.issuenavigator.shortcuts",null,JIRA.IssueNavigator.Shortcuts);
AJS.describeBrowser();jQuery(function(){AJS.$("label.overlabel").overlabel()});AJS.$(function(){AJS.$(".fieldTabs li").click(function(e){e.preventDefault();e.stopPropagation();var $this=AJS.$(this);if(!$this.hasClass("active")){AJS.$(".fieldTabs li.active").removeClass("active");$this.addClass("active");AJS.$(".fieldTabArea.active").removeClass("active");AJS.$("#"+$this.attr("rel")).addClass("active")}})});jQuery(function(){jQuery("form").handleAccessKeys();jQuery(document).bind("dialogContentReady",function(){jQuery("form",this.$content).handleAccessKeys({selective:false})})});jQuery(document).keydown(function(e){if(AJS.InlineDialog.current&&e.which==27&&!AJS.$(e.target).is(":input")){AJS.InlineDialog.current.hide()}});jQuery(function(){var $issueNav=jQuery("div.results"),$issueNavWrapWidth=$issueNav.width();$issueNav.bind("resultsWidthChanged",function(){var $issueNavWrap=jQuery(this);$issueNavWrap.css("width",100/$issueNavWrapWidth*($issueNavWrapWidth-(parseInt(jQuery(document.documentElement).attr("scrollWidth"),10)-jQuery(window).width()))+"%")});jQuery(window).resize(function(){$issueNav.trigger("resultsWidthChanged")});$issueNav.trigger("resultsWidthChanged")});jQuery(function(){var actionTwixi;actionTwixi=new JIRA.ToggleBlock({blockSelector:".twixi-block",cookieCollectionName:"twixi"}).addCallback("toggle",function(){jQuery("#stalker").trigger("stalkerHeightUpdated")}).addTrigger(".action-details","dblclick");new JIRA.ToggleBlock({blockSelector:".inverted-twixi-block",collapsedClass:"expanded",expandedClass:"collapsed",cookieCollectionName:"inverted-twixi"}).addCallback("toggle",function(){jQuery("#stalker").trigger("stalkerHeightUpdated")});new JIRA.ToggleBlock({blockSelector:"#issue-filter .toggle-wrap:not(#navigator-filter-subheading-textsearch-group)",triggerSelector:".toggle-trigger",collapsedClass:"expanded",expandedClass:"collapsed",cookieCollectionName:"navSimpleSearch"});new JIRA.ToggleBlock({blockSelector:"#navigator-filter-subheading-textsearch-group",triggerSelector:".toggle-trigger",cookieCollectionName:"navSimpleSearchText"});AJS.$("#issue-filter .error").parents(".toggle-wrap").removeClass("collapsed").addClass("expanded");new JIRA.ToggleBlock({blockSelector:"#queryBoxTable.toggle-wrap",triggerSelector:".toggle-trigger",cookieCollectionName:"navAdvanced"});new JIRA.ToggleBlock({blockSelector:".twixi-block",triggerSelector:".twixi-trigger",collapsedClass:"expanded",expandedClass:"collapsed",cookieCollectionName:"twixi"})});AJS.$(function(){AJS.$("#log-work-adjust-estimate-new-value,#log-work-adjust-estimate-manual-value").attr("disabled","disabled");AJS.$("#log-work-adjust-estimate-"+AJS.$("input[name=worklog_adjustEstimate]:checked,input[name=adjustEstimate]:checked").val()+"-value").removeAttr("disabled");AJS.$("input[name=worklog_adjustEstimate],input[name=adjustEstimate]").change(function(){AJS.$("#log-work-adjust-estimate-new-value,#log-work-adjust-estimate-manual-value").attr("disabled","disabled");AJS.$("#log-work-adjust-estimate-"+AJS.$(this).val()+"-value").removeAttr("disabled")})});AJS.$(function(){var radio=AJS.$("input:checked");if(radio.length!==0){if(radio.attr("id")==="forgot-login-rb-forgot-password"){AJS.$("#username,#password").addClass("hidden");AJS.$("#password").removeClass("hidden")}else{if(radio.attr("id")==="forgot-login-rb-forgot-username"){AJS.$("#username,#password").addClass("hidden");AJS.$("#username").removeClass("hidden")}}}AJS.$("#forgot-login-rb-forgot-password").change(function(){AJS.$("#username,#password").addClass("hidden");AJS.$("#password").removeClass("hidden")});AJS.$("#forgot-login-rb-forgot-username").change(function(){AJS.$("#username,#password").addClass("hidden");AJS.$("#username").removeClass("hidden")})});AJS.$(function(){AJS.$("input.upfile").each(function(){var input=AJS.$(this),container=input.closest(".field-group");input.change(function(){if(input.val().length>0){container.next(".field-group").removeClass("hidden")}})})});jQuery(function(){new JIRA.ToggleBlock({blockSelector:"#iss-wrap",triggerSelector:"a.toggle-lhc",collapsedClass:"lhc-collapsed",cookieCollectionName:"lhc-state",autoFocusTrigger:false});new AJS.SecurityLevelSelect(jQuery("#commentLevel"));AJS.$("#iss-wrap").bind("contractBlock expandBlock",function(){jQuery(".results").trigger("resultsWidthChanged")})});jQuery(function(){jQuery("textarea").keypress(submitOnCtrlEnter)});jQuery(function(){var $jql=jQuery("#jqltext");if($jql.length===1){$jql.unbind("keypress",submitOnCtrlEnter).keypress(submitOnEnter)}});jQuery(function(){var $warning=AJS.$("#browser-warning");AJS.$(".icon-close",$warning).click(function(){$warning.slideUp("fast");saveCookie("UNSUPPORTED_BROWSER_WARNING","handled")})});jQuery(function(){AJS.$("form").submit(function(event){AJS.$(this).trigger("before-submit",event)})});AJS.$(function($){var $document=$(document),selector="#comment, #environment, #description",maxTextareaHeight=200;$document.bind("tabSelect",function(e,data){data.pane.find(selector).expandOnInput()});$(selector).expandOnInput(maxTextareaHeight);$document.bind("dialogContentReady",function(e,dialog){dialog.get$popupContent().bind("tabSelect",function(e,data){data.pane.find(selector).expandOnInput(maxTextareaHeight)}).find(selector).expandOnInput(maxTextareaHeight)});$document.bind("showWikiInput",function(e,$container){$container.find(selector).expandOnInput()})});AJS.$(function(){var $auiForm=AJS.$("form.aui");AJS.$("#stqcform input:file").inlineAttach();AJS.$(".file-input-list input:file",$auiForm).inlineAttach();var $cancel=AJS.$("a.cancel",$auiForm);if(AJS.$.browser.msie&&$cancel.attr("accessKey")){$cancel.focus(function(e){if(e.altKey){AJS.$(this).mousedown();window.location.href=$cancel.attr("href")}})}});AJS.$(function(){var checkRow=function(input){AJS.$(input).closest(".availableActionRow").find("td:first :checkbox").attr("checked",true)};var $rows=AJS.$("#availableActionsTable tr.availableActionRow");$rows.children("td:last-child").find(":input").change(function(e){checkRow(this)})});AJS.$(function(){if(AJS.params.showmonitor){var $div=AJS.$("<div class='perf-monitor'/>");var slowRequest=AJS.params["jira.request.server.time"]>2000,tooManySql=AJS.params.jiraSQLstatements>50;if(slowRequest){$div.addClass("tooslow")}if(tooManySql){$div.addClass("toomanysql")}AJS.$("#header-top").append($div);AJS.InlineDialog($div,"perf-monitor-dialog",function($contents,control,show){var timingInfo="<div>Page render time <strong>"+AJS.params["jira.request.server.time"]+" ms</strong>";if(AJS.params.jiraSQLstatements){timingInfo+=" / SQL <strong>"+AJS.params.jiraSQLstatements+"@"+AJS.params.jiraSQLtime+" ms</strong></br>";timingInfo+='<a target="_blank" href='+contextPath+"/sqldata.jsp?requestId="+AJS.params["jira.request.id"]+">More...</a>"}else{timingInfo+=" / No SQL statments"}timingInfo+="</div>";$contents.empty().append(timingInfo);show()})}});AJS.$(function(){AJS.$(".shared-item-trigger").each(function(){var target=AJS.$(this).attr("href");AJS.InlineDialog(this,target.substring(1),function(contents,trigger,showPopup){contents.html(AJS.$(target).html());contentLoaded=true;showPopup()},{width:240})});AJS.$("#admin-config-content.aui-tabs .tabs-menu.admin-tabs a").unbind("click")});
JIRA.Dialogs={};AJS.$(function(){JIRA.Dialogs.keyboardShortcuts=new JIRA.FormDialog({id:"keyboard-shortcuts-dialog",trigger:"#keyshortscuthelp",widthClass:"large",onContentRefresh:function(){var context=this.get$popupContent();AJS.$("a.submit-link",context).click(function(e){e.preventDefault();AJS.$("form",context).submit()})}});JIRA.Dialogs.deleteIssueLink=new JIRA.FormDialog({type:"ajax",id:"delete-issue-link-dialog",trigger:"#linkingmodule a.icon-delete",ajaxOptions:getAjaxOptions});if(document.getElementById("dashboard")){JIRA.Dialogs.deleteDashboard=new JIRA.FormDialog({type:"ajax"});AJS.$(document).delegate("#delete_dashboard","click",function(e){e.stopPropagation();e.preventDefault();JIRA.Dialogs.deleteDashboard.$activeTrigger=AJS.$("#delete_dashboard");JIRA.Dialogs.deleteDashboard.init({type:"ajax",id:"delete-dshboard",ajaxOptions:{url:JIRA.Dialogs.deleteDashboard.$activeTrigger.attr("href")},targetUrl:"input[name=targetUrl]"});JIRA.Dialogs.deleteDashboard.show()})}else{JIRA.Dialogs.linkIssue=new JIRA.FormDialog({id:"link-issue-dialog",trigger:"a.issueaction-link-issue",ajaxOptions:getAjaxOptions,onSuccessfulSubmit:storeCurrentIssueIdOnSucessfulSubmit,issueMsg:"thanks_issue_linked",onContentRefresh:function(){var context=this.get$popupContent();jQuery(".overflow-ellipsis").textOverflow();applyCommentControls(context)}});JIRA.Dialogs.deleteIssue=new JIRA.FormDialog({id:"delete-issue-dialog",trigger:"a.issueaction-delete-issue",targetUrl:"#delete-issue-return-url",ajaxOptions:getAjaxOptions,onSuccessfulSubmit:storeCurrentIssueIdOnSucessfulSubmit,issueMsg:"thanks_issue_deleted",onContentRefresh:function(){jQuery(".overflow-ellipsis").textOverflow()}});JIRA.Dialogs.cloneIssue=new JIRA.FormDialog({id:"clone-issue-dialog",trigger:"a.issueaction-clone-issue",handleRedirect:true,ajaxOptions:getAjaxOptions,onSuccessfulSubmit:storeCurrentIssueIdOnSucessfulSubmit,issueMsg:"thanks_issue_cloned",onContentRefresh:function(){jQuery(".overflow-ellipsis").textOverflow();applyCommentControls(this.get$popupContent())}});JIRA.Dialogs.assignIssue=new JIRA.FormDialog({id:"assign-dialog",trigger:"a.issueaction-assign-issue",ajaxOptions:getAjaxOptions,onSuccessfulSubmit:storeCurrentIssueIdOnSucessfulSubmit,issueMsg:"thanks_issue_assigned",onContentRefresh:function(){jQuery(".overflow-ellipsis").textOverflow();var context=this.get$popupContent();applyCommentControls(context);JIRA.Issue.wireAssignToMeLink(context)}});JIRA.Dialogs.logWork=new JIRA.FormDialog({id:"log-work-dialog",trigger:"a.issueaction-log-work",handleRedirect:true,ajaxOptions:getAjaxOptions,onSuccessfulSubmit:storeCurrentIssueIdOnSucessfulSubmit,issueMsg:"thanks_issue_worklogged",onContentRefresh:function(){jQuery(".overflow-ellipsis").textOverflow();var context=this.get$popupContent(),logWorkSelector="#log-work-adjust-estimate-new-value, #log-work-adjust-estimate-manual-value";applyCommentControls(context);applyLogworkControls(context)}});JIRA.Dialogs.attachFile=new JIRA.FormDialog({id:"attach-file-dialog",trigger:"a.issueaction-attach-file",handleRedirect:true,ajaxOptions:getAjaxOptions,onSuccessfulSubmit:storeCurrentIssueIdOnSucessfulSubmit,issueMsg:"thanks_issue_attached",onContentRefresh:function(){jQuery(".overflow-ellipsis").textOverflow();var context=this.get$popupContent();applyCommentControls(context)}});JIRA.Dialogs.attachScreenshot=new JIRA.ScreenshotDialog({id:"attach-screenshot-window",trigger:"a.issueaction-attach-screenshot"});JIRA.Dialogs.comment=new JIRA.FormDialog({id:"comment-add-dialog",trigger:":not(.ops) > * > a.issueaction-comment-issue",handleRedirect:true,ajaxOptions:getAjaxOptions,onSuccessfulSubmit:storeCurrentIssueIdOnSucessfulSubmit,issueMsg:"thanks_issue_commented",onContentRefresh:function(){jQuery(".overflow-ellipsis").textOverflow();applyCommentControls(this.get$popupContent())}});JIRA.Dialogs.editLabels=new JIRA.LabelsDialog({id:"edit-labels-dialog",trigger:"a.issueaction-edit-labels,a.edit-labels",autoClose:true,ajaxOptions:getAjaxOptions,onSuccessfulSubmit:storeCurrentIssueIdOnSucessfulSubmit,issueMsg:"thanks_issue_labelled",labelsProvider:labelsProvider,onContentRefresh:function(){jQuery(".overflow-ellipsis").textOverflow()}});JIRA.Dialogs.issueActions=new JIRA.IssueActionsDialog;AJS.namespace("jira.app.issueActionsPopup",null,JIRA.Dialogs.issueActions);AJS.$(document).delegate("a.issueaction-workflow-transition","click",function(event){event.preventDefault();var action=/action=(\d+)/.exec(this.href.slice(this.href.indexOf("?")));if(action){var id="workflow-transition-"+action[1]+"-dialog";var $trigger=AJS.$(this);if(!JIRA.Dialogs[id]){JIRA.Dialogs[id]=new JIRA.FormDialog({id:id,url:$trigger.attr("href"),trigger:'a[href*="'+action[0]+'"].issueaction-workflow-transition',widthClass:"large",handleRedirect:true,ajaxOptions:getAjaxOptions,onSuccessfulSubmit:storeCurrentIssueIdOnSucessfulSubmit,issueMsg:"thanks_issue_transitioned",onContentRefresh:function(){var context=this.get$popupContent();AJS.tabs.setup();applyCommentControls(context);JIRA.Issue.wireAssignToMeLink(context);applyLogworkControls(context)}});JIRA.Dialogs[id].show()}}});AJS.$.each(JIRA.Dialogs,function(name,dialog){if(dialog instanceof JIRA.Dialog){AJS.$(dialog).bind("beforeShow",function(){if(name!=="keyboardShortcuts"){return JIRA.IssueNavigator.isRowSelected()||JIRA.Issue.getIssueId()!==undefined}})}})}new JIRA.FormDialog({type:"ajax",id:"create-project-dialog",trigger:".add-project-trigger",autoClose:true});new JIRA.FormDialog({id:"credits-dialog",trigger:"#view_credits",widthClass:"creditsContainer",onContentRefresh:function(){if(!jQuery("html").hasClass("safari")){function center(){jQuery.each(arguments,function(){this.show().css({marginLeft:-this.outerWidth()/2,marginTop:-this.outerHeight()/2}).hide()})}jQuery(function(){var $intro=jQuery("#intro");var $credits=jQuery("#credits");var $jiralogo=jQuery("#jiraLogo");center($intro,$credits,$jiralogo);window.setTimeout(function(){$intro.fadeIn("slow",function(){window.setTimeout(function(){$intro.fadeOut("slow",function(){window.setTimeout(function(){$jiralogo.show();window.setTimeout(function(){$jiralogo.animate({top:30,marginTop:10,width:0,height:0,marginLeft:0},2000);window.setTimeout(function(){$credits.show().css({top:"auto",bottom:-$credits.outerHeight()}).animate({bottom:$credits.outerHeight()},50000)},1000)})},500)})},2000)})},500)})}}});function getAjaxOptions(){var $focusRow=JIRA.IssueNavigator.get$focusedRow();var linkIssueURI=this.options.url||this.$activeTrigger.attr("href");if(/id=\{0\}/.test(linkIssueURI)){if(!$focusRow.length){return false}else{linkIssueURI=linkIssueURI.replace(/(id=\{0\})/,"id="+$focusRow.attr("rel"))}}if(JIRA.IssueNavigator.isNavigator()){var result=/[?&]id=([0-9]+)/.exec(linkIssueURI);this.issueId=result&&result.length==2?result[1]:null;if(this.issueId!==$focusRow.attr("rel")){JIRA.IssueNavigator.Shortcuts.focusRow(this.issueId);$focusRow=JIRA.IssueNavigator.get$focusedRow()}this.issueKey=JIRA.IssueNavigator.getSelectedIssueKey()}return{data:{decorator:"dialog",inline:"true"},url:linkIssueURI}}function storeCurrentIssueIdOnSucessfulSubmit(){if(JIRA.IssueNavigator.isNavigator()){var issueId=this.issueId;var issueKey=this.issueKey;if(!issueId){issueId=JIRA.IssueNavigator.getSelectedIssueId();issueKey=JIRA.IssueNavigator.getSelectedIssueKey()}if(issueId){var sessionStorge=JIRA.SessionStorage;sessionStorge.setItem("selectedIssueId",issueId);sessionStorge.setItem("selectedIssueKey",issueKey);sessionStorge.setItem("selectedIssueMsg",this.options.issueMsg)}}this.issueId=null;this.issueKey=null}function applyCommentControls(context){new AJS.SecurityLevelSelect(AJS.$("#commentLevel",context));var wikiRenders=jQuery(".wiki-js-prefs",context);wikiRenders.each(function(){JIRA.wikiPreview(this,context).init()})}function applyLogworkControls(context){jQuery("#log-work-adjust-estimate-new-value, #log-work-adjust-estimate-manual-value",context).attr("disabled","disabled");jQuery("#log-work-adjust-estimate-"+jQuery("input[name=worklog_adjustEstimate]:checked,input[name=adjustEstimate]:checked",context).val()+"-value",context).removeAttr("disabled");jQuery("input[name=worklog_adjustEstimate],input[name=adjustEstimate]",context).change(function(){jQuery("#log-work-adjust-estimate-new-value,#log-work-adjust-estimate-manual-value",context).attr("disabled","disabled");jQuery("#log-work-adjust-estimate-"+jQuery(this).val()+"-value",context).removeAttr("disabled")});AJS.$(function(){AJS.$(context).find("#log-work-activate").change(function(){AJS.$(context).find("#worklog-logworkcontainer").toggleClass("hidden");if(AJS.$(context).find("#worklog-timetrackingcontainer").size()>0){AJS.$(context).find("#worklog-timetrackingcontainer").toggleClass("hidden")}})})}function labelsProvider(labelsPopup){var $trigger=labelsPopup.$activeTrigger,$labelsContainer=$trigger.closest(".labels-wrap"),isSubtaskForm=$trigger.parents("#view-subtasks").length!==0;if(isSubtaskForm){$labelsContainer=$trigger.parents("tr").find(".labels-wrap")}else{if($trigger.hasClass("issueaction-edit-labels")){if(JIRA.IssueNavigator.isNavigator()){$labelsContainer=jQuery("#issuetable tr.issuerow.focused td.labels .labels-wrap")}else{$labelsContainer=jQuery("#wrap-labels .labels-wrap")}}}if($labelsContainer.length>0){return $labelsContainer}return false}});
AJS.$(function(){AJS.Dropdown.create({trigger:".issue-actions-trigger",ajaxOptions:{dataType:"json",cache:false,formatSuccess:JIRA.FRAGMENTS.issueActionsFragment}});var $navigatorOptions=AJS.$("#navigator-options");AJS.Dropdown.create({trigger:$navigatorOptions.find(".aui-dd-link"),content:$navigatorOptions.find(".aui-list"),alignment:AJS.RIGHT});var $commandBar=AJS.$("div.command-bar");AJS.Dropdown.create({trigger:$commandBar.find("a.drop"),content:$commandBar.find(".aui-list"),autoScroll:false});AJS.$("#dashboard").find(".aui-dd-parent").dropDown("Standard",{trigger:"a.aui-dd-link"});AJS.$("#main-nav.admin-menu-bar").find("li.admin-menu-link").linkedMenu({onFocusRemoveClass:"#main-nav .selected"});AJS.$("#main-nav.standard-menu-bar").find("a.aui-dd-link").linkedMenu({reflectFocus:"#main-nav .lnk",onFocusRemoveClass:"#main-nav .selected"});AJS.$("#navigator-options").find("a.aui-dd-link").linkedMenu()});
AJS.$(function(){JIRA.Issue.wireAssignToMeLink(document);AJS.$(".assignee-edit-group").each(function(){var $this=AJS.$(this);var assigneeFieldId=$this.attr("rel");AJS.$("#assignee_userpicker_dummy_"+assigneeFieldId+"_container").click(function(){AJS.$("#assignee_radio_picker_"+assigneeFieldId).attr("checked","true")});$this.parents("form[name=jiraform]").submit(function(){$this.find("input[name=assignee_radio]:checked").each(function(){if(AJS.$(this).attr("id")=="assignee_radio_picker_"+assigneeFieldId){AJS.$("#"+assigneeFieldId).val(AJS.$("#assignee_userpicker_dummy_"+assigneeFieldId).val())}else{AJS.$("#"+assigneeFieldId).val(AJS.$(this).val())}})})})});
AJS.$(function(){function dropWebSudo(successCallback){AJS.$.ajax({type:"DELETE",url:contextPath+"/rest/auth/1/websudo",contentType:"application/json",success:successCallback})}AJS.$("#websudo-drop-from-protected-page").click(function(event){dropWebSudo(function(){window.location=contextPath+"/secure/Dashboard.jspa"});event.preventDefault()});AJS.$("#websudo-drop-from-normal-page").click(function(event){dropWebSudo(function(){AJS.$("#websudo-banner").slideUp();AJS.$("#websudo-banner").addClass("dropped")});event.preventDefault()})});
jQuery.fn.toggleField=function(field){var that=this,field=jQuery(field),setFieldAttr=function(){field.attr("disabled",function(){if(that.attr("checked")===false){that.parent().addClass("disabled");return true}else{that.parent().removeClass("disabled");return false}}());return arguments.callee}();jQuery(document[this.attr("name")]).click(setFieldAttr).change(setFieldAttr);return this};
(function(){var NONCHARACTER_KEYS={8:"Backspace",9:"Tab",13:"Return",16:"Shift",17:"Control",18:"Alt",27:"Esc",32:"Spacebar",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",46:"Del"};var MODIFIER_KEYS={16:"Shift",17:"Control",18:"Alt"};var lastModifierKey=0;pipe("keydown",function(event){if(event.which in MODIFIER_KEYS){if(event.which===lastModifierKey){return null}lastModifierKey=event.which}else{lastModifierKey=0}return NONCHARACTER_KEYS[event.which]||null},"aui:keydown");pipe("keypress",function(event){lastModifierKey=0;switch(event.which){case 0:case 8:case 9:case 27:break;default:if(!event.ctrlKey&&!event.altKey&&!event.metaKey){return String.fromCharCode(event.which)}}return null},"aui:keypress");pipe("keyup",function(event){if(event.which===lastModifierKey){lastModifierKey=0}return NONCHARACTER_KEYS[event.which]||null},"aui:keyup");function pipe(inType,getKey,outType){var listenerCount=0;jQuery.event.special[outType]={setup:function(){if(listenerCount===0){jQuery(document).bind(inType,dispatchKeyEvent)}listenerCount++},teardown:function(){listenerCount--;if(listenerCount===0){jQuery(document).unbind(inType,dispatchKeyEvent)}}};function dispatchKeyEvent(event){var key=getKey(event);if(key){var $event=new jQuery.Event(outType);$event.key=key;if(outType!=="aui:keypress"){$event.shiftKey=event.shiftKey;$event.ctrlKey=event.ctrlKey;$event.altKey=event.altKey}var target=event.target;var ownerDocument=(target.nodeType===9)?target:target.ownerDocument;if(ownerDocument!==document){$event.target=target;arguments[0]=$event;jQuery.event.trigger($event,arguments,document,true)}else{jQuery(target).trigger($event)}if($event.isDefaultPrevented()){event.preventDefault()}}}}jQuery(document).bind("iframeAppended",function(event){jQuery(event.target).contents().bind("keydown keypress keyup",function(event){jQuery.event.trigger(event,arguments,document,true)})})})();
(function(){var SHORTCUTS={};var KEY_STREAM=[];var MAX_LENGTH=0;var resetTimerId=0;var nonCharacterKeyPressed=false;var $document=jQuery(document);jQuery.event.special.shortcut={setup:function(){$document.bind("keydown",keydown);$document.bind("aui:keypress",keypress);$document.bind("keyup",keyup)},teardown:function(){$document.unbind("keydown",keydown);$document.unbind("aui:keypress",keypress);$document.unbind("keyup",keyup)},add:function(config){if(this!==document){throw new TypeError('"shortcut" event handlers must be bound at the document')}if(config.data===undefined){throw new Error('No data argument supplied in call to jQuery.fn.bind("shortcut", '+(config.handler.name||"function")+")")}if(typeof config.data!=="string"){throw new TypeError("Object "+config.data+" is not a string")}if(config.data.length===0){throw new Error("Shortcut sequence must not be empty")}for(var shortcut in SHORTCUTS){if(hasConflict(shortcut,config.data)){throw new Error('Cannot bind new shortcut "'+config.data+'" due to conflict with existing shortcut "'+shortcut+'"')}}if(config.data.length>MAX_LENGTH){MAX_LENGTH=config.data.length}SHORTCUTS[config.data]=config.handler},remove:function(config){if(this!==document){throw new TypeError('"shortcut" event handlers must be bound at the document')}delete SHORTCUTS[config.data]}};function keydown(event){if(nonCharacterKeyPressed){resetKeyStream()}nonCharacterKeyPressed=(event.which!==16)}function keypress(event){if(jQuery(event.target).is(":input")){resetKeyStream();return }KEY_STREAM.push(event.key);clearTimeout(resetTimerId);resetTimerId=setTimeout(resetKeyStream,2000);if(KEY_STREAM.length>MAX_LENGTH){KEY_STREAM.shift()}var keyStream=KEY_STREAM.join("");for(var i=0;i<keyStream.length;i++){var shortcut=keyStream.slice(i);if(shortcut in SHORTCUTS){event.preventDefault();event=new jQuery.Event("shortcut");event.data=shortcut;SHORTCUTS[shortcut].call(document,event);KEY_STREAM.length=0;break}}nonCharacterKeyPressed=false}function keyup(){if(nonCharacterKeyPressed){resetKeyStream()}}function resetKeyStream(){KEY_STREAM.length=0}function hasConflict(shortcut1,shortcut2){var len1=shortcut1.length;var len2=shortcut2.length;if(len1===len2){return shortcut1===shortcut2}var i,d;if(len1<len2){i=shortcut2.indexOf(shortcut1);d=len2-len1}else{i=shortcut1.indexOf(shortcut2);d=len1-len2}return i>=0&&i<d}})();
AJS.whenIType=function(shortcut){return new AJS.KeyboardShortcut(shortcut)};AJS.KeyboardShortcut=function(shortcut){this._executer=null;this.shortcuts=[shortcut];this._bindShortcut(shortcut)};AJS.KeyboardShortcut.prototype._bindShortcut=function(shortcut){if(typeof shortcut!=="string"){throw new TypeError("AJS.KeyboardShortcut expects string; received "+typeof shortcut)}if(/^(?:ctrl|alt|shift|meta)+/i.test(shortcut)){throw new SyntaxError('AJS.KeyboardShortcut cannot bind the shortcut "'+shortcut+'" because it uses a modifier')}var self=this;jQuery(document).bind("shortcut",shortcut,function(event){if(self._executer&&!AJS.popup.current&&!AJS.dropDown.current&&!JIRA.Dialog.current){if(AJS.InlineDialog.current){AJS.InlineDialog.current.hide()}self._executer(event);event.preventDefault()}})};AJS.KeyboardShortcut.prototype._addShortcutTitle=function(selector){var elem=jQuery(selector);var title=elem.attr("title")||"";var typeStr="Type";var thenStr="then";var orStr="OR";var shortcuts=jQuery.map(this.shortcuts,function(shortcut){return" '"+shortcut.split("").join("' "+thenStr+" '")+"'"});title+=" ( "+typeStr+shortcuts.join(" "+orStr+" ")+" )";elem.attr("title",title)};AJS.KeyboardShortcut.prototype.moveToNextItem=function(selector){this._executer=function(){var index,items=jQuery(selector),focusedElem=jQuery(selector+".focused");if(!this._executer.blurHandler){jQuery(document).one("keypress",function(e){if(e.keyCode===27&&focusedElem){focusedElem.removeClass("focused")}})}if(focusedElem.length===0){focusedElem=jQuery(selector).eq(0)}else{focusedElem.removeClass("focused");index=jQuery.inArray(focusedElem.get(0),items);if(index<items.length-1){index=index+1;focusedElem=items.eq(index)}else{focusedElem.removeClass("focused");focusedElem=jQuery(selector).eq(0)}}if(focusedElem&&focusedElem.length>0){focusedElem.addClass("focused");focusedElem.scrollIntoView();focusedElem.find("a:first").focus()}}};AJS.KeyboardShortcut.prototype.moveToPrevItem=function(selector){this._executer=function(){var index,items=jQuery(selector),focusedElem=jQuery(selector+".focused");if(!this._executer.blurHandler){jQuery(document).one("keypress",function(e){if(e.keyCode===27&&focusedElem){focusedElem.removeClass("focused")}})}if(focusedElem.length===0){focusedElem=jQuery(selector+":last")}else{focusedElem.removeClass("focused");index=jQuery.inArray(focusedElem.get(0),items);if(index>0){index=index-1;focusedElem=items.eq(index)}else{focusedElem.removeClass("focused");focusedElem=jQuery(selector+":last")}}if(focusedElem&&focusedElem.length>0){focusedElem.addClass("focused");focusedElem.scrollIntoView();focusedElem.find("a:first").focus()}}};AJS.KeyboardShortcut.prototype.click=function(selector){this._addShortcutTitle(selector);this._executer=function(){jQuery(selector).click()}};AJS.KeyboardShortcut.prototype.goTo=function(location){this._executer=function(){window.location.href=contextPath+location}};AJS.KeyboardShortcut.prototype.followLink=function(selector){this._addShortcutTitle(selector);this._executer=function(){var elem=jQuery(selector);if(elem.length>0&&(elem.attr("nodeName").toLowerCase()==="a"||elem.attr("nodeName").toLowerCase()==="link")){elem.click();window.location.href=elem.attr("href")}}};AJS.KeyboardShortcut.prototype.moveToAndClick=function(selector){this._addShortcutTitle(selector);this._executer=function(){var elem=jQuery(selector);if(elem.length>0){elem.click();elem.scrollIntoView()}}};AJS.KeyboardShortcut.prototype.moveToAndFocus=function(selector){this._addShortcutTitle(selector);this._executer=function(e){var $elem=jQuery(selector);if($elem.length>0){$elem.focus();$elem.scrollIntoView();if($elem.is(":input")){e.preventDefault()}}}};AJS.KeyboardShortcut.prototype.evaluate=function(command){if(typeof command!=="function"){command=new Function(command)}command.call(this)};AJS.KeyboardShortcut.prototype.execute=function(func){var self=this;this._executer=function(){if(typeof func!=="function"){func=new Function(func)}func.call(self)}};AJS.KeyboardShortcut.prototype.or=function(shortcut){this.shortcuts.push(shortcut);this._bindShortcut(shortcut);return this};
AJS.whenIType.fromJSON=function(json){if(json){jQuery(document).bind("aui:keyup",function(event){var $target=jQuery(event.target);if(event.key==="Esc"&&$target.is(":input")){$target.blur()}});jQuery.each(json,function(){var keys=Function.prototype.call.apply(Array.prototype.concat,this.keys);var shortcut=keys.join("");if(keys.length<shortcut.length){throw new Error("Shortcut sequence ["+keys.join(",")+"] contains invalid keys")}AJS.whenIType(shortcut)[this.op](this.param)})}};jQuery(function(){if(AJS.keys){AJS.whenIType.fromJSON(AJS.keys.shortcuts)}});
AJS.$(function(){AJS.$("#main-nav li").each(function(){var $this=AJS.$(this),trigger=$this.hasClass("admin-menu-link")?$this:AJS.$(".drop",this);if($this.hasClass("lazy")){AJS.Dropdown.create({alignment:AJS.LEFT,offsetTarget:$this,trigger:trigger,styleClass:"main-nav-dropdown",ajaxOptions:{url:contextPath+"/rest/api/1.0/menus/"+trigger.attr("rel"),dataType:"json",cache:false,formatSuccess:JIRA.FRAGMENTS.menuFragment}})}else{if($this.hasClass("nonlazy")){AJS.Dropdown.create({alignment:AJS.LEFT,offsetTarget:$this,styleClass:"main-nav-dropdown",trigger:trigger,content:$this.find(".aui-list")})}}});AJS.Dropdown.create({alignment:AJS.RIGHT,trigger:AJS.$("#header-details-user .drop"),content:AJS.$("#user-options-list")});AJS.$("#admin-quicknav-trigger").click(function(e){e.preventDefault();jira.app.adminQuickNavDialog.show()})});AJS.$(function(){AJS.$("#create_link_params").each(function(){var $this=AJS.$(this);var params={};AJS.$(this).find("input").each(function(){var $this=AJS.$(this);params[$this.attr("id")]=$this.val()});var hideFunction=function(){};var createDialog=AJS.InlineDialog(AJS.$("#"+$this.attr("rel")),"create_issue_popup",function(contents,trigger,doShowPopup){var displayContent=function(args){contents.css({width:"auto",minWidth:"150px"}).parent().addClass("active").click(function(e){e.stopPropagation()});var projects;var recentProjects;var project;var types;var type;var getProject=function(pid){var proj;AJS.$(projects).each(function(){if(this.id===parseInt(pid)){proj=this;return false}});return proj};var initializeProject=function(){projects=args.projects;recentProjects=args.recentProjects;var projectId;if(recentProjects){project=recentProjects[0]}else{if(projects){project=projects[0]}}}();var getType=function(typeId){var type;AJS.$(types).each(function(){if(this.id===typeId){type=this;return false}});return type};var initializeIssueTypes=function(){types=args.types;var issueTypeId=args.defaultType;if(!issueTypeId||issueTypeId==="-1"){issueTypeId=types[0].id}type=getType(issueTypeId);if(!type){type=types[0]}AJS.$(types).each(function(){if(!/^http/.test(this.url)){this.url=contextPath+this.url}})}();var getScheme=function(schemeId){var scheme;AJS.$(args.schemes).each(function(){if(this.id===schemeId){scheme=this;return false}});return scheme};var setTypesForProject=function(project,defaultType){var scheme=getScheme(project.scheme);AJS.$("#quick-issuetype").empty();var isValidType=false;var createTypeUnknownOption=AJS.$("<option />");createTypeUnknownOption.val("-1").text(params.createItem_issuetype_select).appendTo("#quick-issuetype");type=getType("-1");AJS.$(scheme.types).each(function(){var newType=getType(this+"");if(newType){var option=AJS.$("<option/>").val(newType.id).text(newType.name).css("background-image","url("+newType.url+")");if((!defaultType&&newType.id===scheme.defaultId)||(newType.id===defaultType)){type=newType;option.attr("selected","selected");isValidType=true}AJS.$("#quick-issuetype").append(option)}});if(isValidType){createTypeUnknownOption.remove()}};contents.empty().append(AJS.$('<form id="issue-create-quick" />').addClass("aui top-label").attr("action",contextPath+"/secure/CreateIssue.jspa").append(AJS.$("<fieldset>").append(AJS.$('<div class="field-group"/>').append(AJS.$("<label/>").attr("for","quick-pid").text(params.createItem_project+":")).append(AJS.$("<select/>").addClass("imagebacked").addClass("select").attr({id:"quick-pid",name:"pid",title:params.createItem_select_project}).change(function(){AJS.$("#invalid-type").hide();var pid=AJS.$("#quick-pid").val();project=getProject(pid);setTypesForProject(project)}))).append(AJS.$('<div class="field-group"/>').append(AJS.$("<label/>").attr("for","quick-issuetype").text(params.createItem_issuetype+":").append(AJS.$("<span/>").attr("id","invalid-type").addClass("hidden error").text(params.createItem_issuetype_invalid))).append(AJS.$("<select/>").addClass("imagebacked").addClass("select").attr({id:"quick-issuetype",name:"issuetype",title:params.createItem_select_type}).change(function(){var typeId=AJS.$("#quick-issuetype").val();type=getType(typeId);AJS.$("#invalid-type").hide()})))).append(AJS.$('<div class="buttons-container" />').append(AJS.$('<div class="buttons" />').append(AJS.$("<input type='submit' />").addClass("button").addClass("save").attr({title:params.createItem_create_desc,name:"Create",id:"quick-create-button"}).val(params.createItem_create)).append(AJS.$("<a/>").attr("href","#").attr("id","quick-create-cancel").text(params.createItem_cancel).click(function(e){hideFunction();e.preventDefault()})))).submit(function(e){if(!type){AJS.$("#invalid-type").show();return false}}));var parent=AJS.$("#quick-pid");var first=true;if(recentProjects){var group=AJS.$("<optgroup/>").attr("label",params.createItem_project_recent);AJS.$(recentProjects).each(function(){var option=AJS.$("<option/>").val(this.id).text(this.name).css("background-image","url("+contextPath+"/secure/projectavatar?size=small&pid="+this.id+"&avatarId="+this.img+")");if(first){option.attr("selected","selected");first=false;setTypesForProject(project,args.defaultType)}group.append(option)});parent.append(group);group=AJS.$("<optgroup/>").attr("label",params.createItem_project_all);parent.append(group);parent=group}AJS.$(projects).each(function(){var option=AJS.$("<option/>").val(this.id).text(this.name).css("background-image","url("+contextPath+"/secure/projectavatar?size=small&pid="+this.id+"&avatarId="+this.img+")");if(first){option.attr("selected","selected");first=false;setTypesForProject(project,args.defaultType)}parent.append(option)});contents.parent().addClass("aui-dialog-content-ready")};var successHandler=function(args){if(!args.isEmpty){displayContent(args);if(AJS.InlineDialog.current){AJS.InlineDialog.current.reset()}}else{if(args.currentUser){contents.html(AJS.$("<div/>").addClass("message").append(AJS.$("<p/>").text(params.createItem_no_permission)))}else{contents.html(AJS.$("<div/>").addClass("message").append(AJS.$("<p/>").text(params.createItem_log_in_desc)).append(AJS.$("<p/>").append(AJS.$("<a/>").attr("href",contextPath+"/login.jsp?os_destination=%2Fsecure%2FCreateIssue%21default.jspa").text(params.createItem_log_in))))}contents.append(AJS.$("<div/>").addClass("button-panel").append(AJS.$("<a/>").attr("href","#").attr("id","quick-create-cancel").text(params.createItem_cancel).click(function(e){hideFunction();e.preventDefault()})))}if(AJS.InlineDialog.current){AJS.InlineDialog.current.reset()}};var displayLoading=function(){contents.empty();contents.append(AJS.$("<div/>").addClass("loading-small").css("height",50));doShowPopup();AJS.$.ajax({type:"GET",url:contextPath+"/rest/api/1.0/admin/issuetypeschemes",data:{includeRecent:true},dataType:"json",success:successHandler,error:function(XMLHttpRequest,textStatus,errorThrown){window.location=contextPath+"/secure/CreateIssue!default.jspa"}})}()},{width:250,cacheContent:false,initCallback:function(){hideFunction=this.hide},hideCallback:function(){this.popup.removeClass("active").removeClass("aui-dialog-content-ready");if(AJS.$.browser.safari){jQuery(":input").blur()}JIRA.setFocus.popConfiguration()}})})});AJS.$(document).bind("showLayer",function(e,type,inlineLayer){if(type==="inlineDialog"&&AJS.InlineDialog.current.id==="create_issue_popup"){AJS.InlineDialog.current.reset=(function(reset){return function(){reset.call(this);var triggerConfig=new JIRA.setFocus.FocusConfiguration();triggerConfig.context=inlineLayer.popup[0];triggerConfig.focusElementSelector="#quick-create-button";JIRA.setFocus.pushConfiguration(triggerConfig);JIRA.setFocus.triggerFocus()}})(AJS.InlineDialog.current.reset)}});AJS.$(function(){var adminSummaryLink=AJS.$("#admin_summary");if(adminSummaryLink){adminSummaryLink.parent().click(function(event){window.location=adminSummaryLink.attr("href")})}});
JIRA.FRAGMENTS.menuFragment=function(response){var html=AJS.$("<div class='aui-list' />");var isFirst=true;var listNode;AJS.$(response.sections).each(function(){listNode=AJS.$("<ul class='aui-list-section' />");var listItemNode,linkNode;if(this.id){listNode.attr("id",this.id)}if(this.style){listNode.addClass(this.style)}if(this.items&&this.items.length!=0){if(isFirst){listNode.addClass("first");isFirst=false}if(this.label){html.append(AJS.$("<h5/>").text(this.label))}AJS.$(this.items).each(function(){listItemNode=AJS.$("<li class='aui-list-item' />");if(this.id){listItemNode.attr("id",this.id)}if(this.style){listItemNode.addClass(this.style)}linkNode=AJS.$("<a class='aui-list-item-link' />").attr("href",this.url);if(this.id){linkNode.attr("id",this.id+"_lnk")}if(this.title){linkNode.attr("title",this.title)}if(this.iconUrl){linkNode.addClass("aui-iconised-link").css("background-image","url('"+this.iconUrl+"')")}if(this.label){linkNode.text(this.label)}listItemNode.append(linkNode);listNode.append(listItemNode)});html.append(listNode)}});listNode.addClass("aui-last");return html};

