/*
 * Raphael 1.4.3 - JavaScript Vector Library
 *
 * Copyright (c) 2010 Dmitry Baranovskiy (http://raphaeljs.com)
 * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
 */
Raphael=function(){function m(){if(m.is(arguments[0],U)){for(var a=arguments[0],b=Aa[K](m,a.splice(0,3+m.is(a[0],O))),c=b.set(),d=0,f=a[o];d<f;d++){var e=a[d]||{};nb.test(e.type)&&c[E](b[e.type]().attr(e))}return c}return Aa[K](m,arguments)}m.version="1.4.3";var V=/[, ]+/,nb=/^(circle|rect|path|ellipse|text|image)$/,p="prototype",z="hasOwnProperty",C=document,X=window,La={was:Object[p][z].call(X,"Raphael"),is:X.Raphael};function G(){}var y="appendChild",K="apply",M="concat",Ba="createTouch"in C,s=
"",P=" ",H="split",Ma="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend orientationchange touchcancel gesturestart gesturechange gestureend"[H](P),Ca={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},Q="join",o="length",ca=String[p].toLowerCase,w=Math,Y=w.max,$=w.min,O="number",ea="string",U="array",N="toString",aa="fill",ob=Object[p][N],D=w.pow,E="push",ga=/^(?=[\da-f]$)/,Na=/^url\(['"]?([^\)]+?)['"]?\)$/i,pb=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+\s*,\s*[\d\.]+\s*,\s*[\d\.]+(?:\s*,\s*[\d\.]+)?)\s*\)|rgba?\(\s*([\d\.]+%\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%(?:\s*,\s*[\d\.]+%))\s*\)|hs[bl]\(\s*([\d\.]+\s*,\s*[\d\.]+\s*,\s*[\d\.]+)\s*\)|hs[bl]\(\s*([\d\.]+%\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%)\s*\))\s*$/i,
F=w.round,W="setAttribute",A=parseFloat,da=parseInt,Da=" progid:DXImageTransform.Microsoft",pa=String[p].toUpperCase,qa={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},Ea={along:"along",blur:O,"clip-rect":"csv",cx:O,cy:O,fill:"colour","fill-opacity":O,"font-size":O,height:O,opacity:O,path:"path",r:O,rotation:"csv",rx:O,ry:O,scale:"csv",stroke:"colour","stroke-opacity":O,"stroke-width":O,translation:"csv",width:O,x:O,y:O},I="replace";m.type=X.SVGAngle||C.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure",
"1.1")?"SVG":"VML";if(m.type=="VML"){var ha=C.createElement("div");ha.innerHTML="<!--[if vml]><br><br><![endif]--\>";if(ha.childNodes[o]!=2)return m.type=null;ha=null}m.svg=!(m.vml=m.type=="VML");G[p]=m[p];m._id=0;m._oid=0;m.fn={};m.is=function(a,b){b=ca.call(b);return b=="object"&&a===Object(a)||b=="undefined"&&typeof a==b||b=="null"&&a==null||ca.call(ob.call(a).slice(8,-1))==b};m.setWindow=function(a){X=a;C=X.document};function ra(a){if(m.vml){var b=/^\s+|\s+$/g;ra=T(function(d){var f;d=(d+s)[I](b,
s);try{var e=new X.ActiveXObject("htmlfile");e.write("<body>");e.close();f=e.body}catch(g){f=X.createPopup().document.body}e=f.createTextRange();try{f.style.color=d;var h=e.queryCommandValue("ForeColor");h=(h&255)<<16|h&65280|(h&16711680)>>>16;return"#"+("000000"+h[N](16)).slice(-6)}catch(i){return"none"}})}else{var c=C.createElement("i");c.title="Rapha\u00ebl Colour Picker";c.style.display="none";C.body[y](c);ra=T(function(d){c.style.color=d;return C.defaultView.getComputedStyle(c,s).getPropertyValue("color")})}return ra(a)}
function qb(){return"hsb("+[this.h,this.s,this.b]+")"}function rb(){return this.hex}m.hsb2rgb=T(function(a,b,c){if(m.is(a,"object")&&"h"in a&&"s"in a&&"b"in a){c=a.b;b=a.s;a=a.h}var d;if(c==0)return{r:0,g:0,b:0,hex:"#000"};if(a>1||b>1||c>1){a/=255;b/=255;c/=255}d=~~(a*6);a=a*6-d;var f=c*(1-b),e=c*(1-b*a),g=c*(1-b*(1-a));a=[c,e,f,f,g,c,c][d];b=[g,c,c,e,f,f,g][d];d=[f,f,g,c,c,e,f][d];a*=255;b*=255;d*=255;c={r:a,g:b,b:d,toString:rb};a=(~~a)[N](16);b=(~~b)[N](16);d=(~~d)[N](16);a=a[I](ga,"0");b=b[I](ga,
"0");d=d[I](ga,"0");c.hex="#"+a+b+d;return c},m);m.rgb2hsb=T(function(a,b,c){if(m.is(a,"object")&&"r"in a&&"g"in a&&"b"in a){c=a.b;b=a.g;a=a.r}if(m.is(a,ea)){var d=m.getRGB(a);a=d.r;b=d.g;c=d.b}if(a>1||b>1||c>1){a/=255;b/=255;c/=255}var f=Y(a,b,c),e=$(a,b,c);d=f;if(e==f)return{h:0,s:0,b:f};else{var g=f-e;e=g/f;a=a==f?(b-c)/g:b==f?2+(c-a)/g:4+(a-b)/g;a/=6;a<0&&a++;a>1&&a--}return{h:a,s:e,b:d,toString:qb}},m);var sb=/,?([achlmqrstvxz]),?/gi,sa=/\s*,\s*/,tb={hs:1,rg:1};m._path2string=function(){return this.join(",")[I](sb,
"$1")};function T(a,b,c){function d(){var f=Array[p].slice.call(arguments,0),e=f[Q]("\u25ba"),g=d.cache=d.cache||{},h=d.count=d.count||[];if(g[z](e))return c?c(g[e]):g[e];h[o]>=1000&&delete g[h.shift()];h[E](e);g[e]=a[K](b,f);return c?c(g[e]):g[e]}return d}m.getRGB=T(function(a){if(!a||(a+=s).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1};if(a=="none")return{r:-1,g:-1,b:-1,hex:"none"};!(tb[z](a.substring(0,2))||a.charAt()=="#")&&(a=ra(a));var b,c,d,f,e;if(a=a.match(pb)){if(a[2]){d=da(a[2].substring(5),
16);c=da(a[2].substring(3,5),16);b=da(a[2].substring(1,3),16)}if(a[3]){d=da((e=a[3].charAt(3))+e,16);c=da((e=a[3].charAt(2))+e,16);b=da((e=a[3].charAt(1))+e,16)}if(a[4]){a=a[4][H](sa);b=A(a[0]);c=A(a[1]);d=A(a[2]);f=A(a[3])}if(a[5]){a=a[5][H](sa);b=A(a[0])*2.55;c=A(a[1])*2.55;d=A(a[2])*2.55;f=A(a[3])}if(a[6]){a=a[6][H](sa);b=A(a[0]);c=A(a[1]);d=A(a[2]);return m.hsb2rgb(b,c,d)}if(a[7]){a=a[7][H](sa);b=A(a[0])*2.55;c=A(a[1])*2.55;d=A(a[2])*2.55;return m.hsb2rgb(b,c,d)}a={r:b,g:c,b:d};b=(~~b)[N](16);
c=(~~c)[N](16);d=(~~d)[N](16);b=b[I](ga,"0");c=c[I](ga,"0");d=d[I](ga,"0");a.hex="#"+b+c+d;isFinite(A(f))&&(a.o=f);return a}return{r:-1,g:-1,b:-1,hex:"none",error:1}},m);m.getColor=function(a){a=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||0.75};var b=this.hsb2rgb(a.h,a.s,a.b);a.h+=0.075;if(a.h>1){a.h=0;a.s-=0.2;a.s<=0&&(this.getColor.start={h:0,s:1,b:a.b})}return b.hex};m.getColor.reset=function(){delete this.start};var ub=/([achlmqstvz])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?\s*,?\s*)+)/ig,
vb=/(-?\d*\.?\d*(?:e[-+]?\d+)?)\s*,?\s*/ig;m.parsePathString=T(function(a){if(!a)return null;var b={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},c=[];if(m.is(a,U)&&m.is(a[0],U))c=ta(a);c[o]||(a+s)[I](ub,function(d,f,e){var g=[];d=ca.call(f);e[I](vb,function(h,i){i&&g[E](+i)});if(d=="m"&&g[o]>2){c[E]([f][M](g.splice(0,2)));d="l";f=f=="m"?"l":"L"}for(;g[o]>=b[d];){c[E]([f][M](g.splice(0,b[d])));if(!b[d])break}});c[N]=m._path2string;return c});m.findDotsAtSegment=function(a,b,c,d,f,e,g,h,i){var j=1-i,l=
D(j,3)*a+D(j,2)*3*i*c+j*3*i*i*f+D(i,3)*g;j=D(j,3)*b+D(j,2)*3*i*d+j*3*i*i*e+D(i,3)*h;var n=a+2*i*(c-a)+i*i*(f-2*c+a),r=b+2*i*(d-b)+i*i*(e-2*d+b),q=c+2*i*(f-c)+i*i*(g-2*f+c),k=d+2*i*(e-d)+i*i*(h-2*e+d);a=(1-i)*a+i*c;b=(1-i)*b+i*d;f=(1-i)*f+i*g;e=(1-i)*e+i*h;h=90-w.atan((n-q)/(r-k))*180/w.PI;(n>q||r<k)&&(h+=180);return{x:l,y:j,m:{x:n,y:r},n:{x:q,y:k},start:{x:a,y:b},end:{x:f,y:e},alpha:h}};var va=T(function(a){if(!a)return{x:0,y:0,width:0,height:0};a=ua(a);for(var b=0,c=0,d=[],f=[],e,g=0,h=a[o];g<h;g++){e=
a[g];if(e[0]=="M"){b=e[1];c=e[2];d[E](b);f[E](c)}else{b=wb(b,c,e[1],e[2],e[3],e[4],e[5],e[6]);d=d[M](b.min.x,b.max.x);f=f[M](b.min.y,b.max.y);b=e[5];c=e[6]}}a=$[K](0,d);e=$[K](0,f);return{x:a,y:e,width:Y[K](0,d)-a,height:Y[K](0,f)-e}});function ta(a){var b=[];if(!m.is(a,U)||!m.is(a&&a[0],U))a=m.parsePathString(a);for(var c=0,d=a[o];c<d;c++){b[c]=[];for(var f=0,e=a[c][o];f<e;f++)b[c][f]=a[c][f]}b[N]=m._path2string;return b}var Oa=T(function(a){if(!m.is(a,U)||!m.is(a&&a[0],U))a=m.parsePathString(a);
var b=[],c=0,d=0,f=0,e=0,g=0;if(a[0][0]=="M"){c=a[0][1];d=a[0][2];f=c;e=d;g++;b[E](["M",c,d])}g=g;for(var h=a[o];g<h;g++){var i=b[g]=[],j=a[g];if(j[0]!=ca.call(j[0])){i[0]=ca.call(j[0]);switch(i[0]){case "a":i[1]=j[1];i[2]=j[2];i[3]=j[3];i[4]=j[4];i[5]=j[5];i[6]=+(j[6]-c).toFixed(3);i[7]=+(j[7]-d).toFixed(3);break;case "v":i[1]=+(j[1]-d).toFixed(3);break;case "m":f=j[1];e=j[2];default:for(var l=1,n=j[o];l<n;l++)i[l]=+(j[l]-(l%2?c:d)).toFixed(3)}}else{b[g]=[];if(j[0]=="m"){f=j[1]+c;e=j[2]+d}i=0;for(l=
j[o];i<l;i++)b[g][i]=j[i]}j=b[g][o];switch(b[g][0]){case "z":c=f;d=e;break;case "h":c+=+b[g][j-1];break;case "v":d+=+b[g][j-1];break;default:c+=+b[g][j-2];d+=+b[g][j-1]}}b[N]=m._path2string;return b},0,ta),ka=T(function(a){if(!m.is(a,U)||!m.is(a&&a[0],U))a=m.parsePathString(a);var b=[],c=0,d=0,f=0,e=0,g=0;if(a[0][0]=="M"){c=+a[0][1];d=+a[0][2];f=c;e=d;g++;b[0]=["M",c,d]}g=g;for(var h=a[o];g<h;g++){var i=b[g]=[],j=a[g];if(j[0]!=pa.call(j[0])){i[0]=pa.call(j[0]);switch(i[0]){case "A":i[1]=j[1];i[2]=
j[2];i[3]=j[3];i[4]=j[4];i[5]=j[5];i[6]=+(j[6]+c);i[7]=+(j[7]+d);break;case "V":i[1]=+j[1]+d;break;case "H":i[1]=+j[1]+c;break;case "M":f=+j[1]+c;e=+j[2]+d;default:for(var l=1,n=j[o];l<n;l++)i[l]=+j[l]+(l%2?c:d)}}else{l=0;for(n=j[o];l<n;l++)b[g][l]=j[l]}switch(i[0]){case "Z":c=f;d=e;break;case "H":c=i[1];break;case "V":d=i[1];break;default:c=b[g][b[g][o]-2];d=b[g][b[g][o]-1]}}b[N]=m._path2string;return b},null,ta);function wa(a,b,c,d){return[a,b,c,d,c,d]}function Pa(a,b,c,d,f,e){var g=1/3,h=2/3;return[g*
a+h*c,g*b+h*d,g*f+h*c,g*e+h*d,f,e]}function Qa(a,b,c,d,f,e,g,h,i,j){var l=w.PI,n=l*120/180,r=l/180*(+f||0),q=[],k,t=T(function(J,fa,xa){var xb=J*w.cos(xa)-fa*w.sin(xa);J=J*w.sin(xa)+fa*w.cos(xa);return{x:xb,y:J}});if(j){x=j[0];k=j[1];e=j[2];B=j[3]}else{k=t(a,b,-r);a=k.x;b=k.y;k=t(h,i,-r);h=k.x;i=k.y;w.cos(l/180*f);w.sin(l/180*f);k=(a-h)/2;x=(b-i)/2;B=k*k/(c*c)+x*x/(d*d);if(B>1){B=w.sqrt(B);c=B*c;d=B*d}B=c*c;var L=d*d;B=(e==g?-1:1)*w.sqrt(w.abs((B*L-B*x*x-L*k*k)/(B*x*x+L*k*k)));e=B*c*x/d+(a+h)/2;var B=
B*-d*k/c+(b+i)/2,x=w.asin(((b-B)/d).toFixed(7));k=w.asin(((i-B)/d).toFixed(7));x=a<e?l-x:x;k=h<e?l-k:k;x<0&&(x=l*2+x);k<0&&(k=l*2+k);if(g&&x>k)x-=l*2;if(!g&&k>x)k-=l*2}l=k-x;if(w.abs(l)>n){q=k;l=h;L=i;k=x+n*(g&&k>x?1:-1);h=e+c*w.cos(k);i=B+d*w.sin(k);q=Qa(h,i,c,d,f,0,g,l,L,[k,q,e,B])}l=k-x;f=w.cos(x);e=w.sin(x);g=w.cos(k);k=w.sin(k);l=w.tan(l/4);c=4/3*c*l;l=4/3*d*l;d=[a,b];a=[a+c*e,b-l*f];b=[h+c*k,i-l*g];h=[h,i];a[0]=2*d[0]-a[0];a[1]=2*d[1]-a[1];if(j)return[a,b,h][M](q);else{q=[a,b,h][M](q)[Q]()[H](",");
j=[];h=0;for(i=q[o];h<i;h++)j[h]=h%2?t(q[h-1],q[h],r).y:t(q[h],q[h+1],r).x;return j}}function la(a,b,c,d,f,e,g,h,i){var j=1-i;return{x:D(j,3)*a+D(j,2)*3*i*c+j*3*i*i*f+D(i,3)*g,y:D(j,3)*b+D(j,2)*3*i*d+j*3*i*i*e+D(i,3)*h}}var wb=T(function(a,b,c,d,f,e,g,h){var i=f-2*c+a-(g-2*f+c),j=2*(c-a)-2*(f-c),l=a-c,n=(-j+w.sqrt(j*j-4*i*l))/2/i;i=(-j-w.sqrt(j*j-4*i*l))/2/i;var r=[b,h],q=[a,g];w.abs(n)>1000000000000&&(n=0.5);w.abs(i)>1000000000000&&(i=0.5);if(n>0&&n<1){n=la(a,b,c,d,f,e,g,h,n);q[E](n.x);r[E](n.y)}if(i>
0&&i<1){n=la(a,b,c,d,f,e,g,h,i);q[E](n.x);r[E](n.y)}i=e-2*d+b-(h-2*e+d);j=2*(d-b)-2*(e-d);l=b-d;n=(-j+w.sqrt(j*j-4*i*l))/2/i;i=(-j-w.sqrt(j*j-4*i*l))/2/i;w.abs(n)>1000000000000&&(n=0.5);w.abs(i)>1000000000000&&(i=0.5);if(n>0&&n<1){n=la(a,b,c,d,f,e,g,h,n);q[E](n.x);r[E](n.y)}if(i>0&&i<1){n=la(a,b,c,d,f,e,g,h,i);q[E](n.x);r[E](n.y)}return{min:{x:$[K](0,q),y:$[K](0,r)},max:{x:Y[K](0,q),y:Y[K](0,r)}}}),ua=T(function(a,b){var c=ka(a),d=b&&ka(b);a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};b={x:0,y:0,
bx:0,by:0,X:0,Y:0,qx:null,qy:null};function f(q,k){var t;if(!q)return["C",k.x,k.y,k.x,k.y,k.x,k.y];!(q[0]in{T:1,Q:1})&&(k.qx=k.qy=null);switch(q[0]){case "M":k.X=q[1];k.Y=q[2];break;case "A":q=["C"][M](Qa[K](0,[k.x,k.y][M](q.slice(1))));break;case "S":t=k.x+(k.x-(k.bx||k.x));k=k.y+(k.y-(k.by||k.y));q=["C",t,k][M](q.slice(1));break;case "T":k.qx=k.x+(k.x-(k.qx||k.x));k.qy=k.y+(k.y-(k.qy||k.y));q=["C"][M](Pa(k.x,k.y,k.qx,k.qy,q[1],q[2]));break;case "Q":k.qx=q[1];k.qy=q[2];q=["C"][M](Pa(k.x,k.y,q[1],
q[2],q[3],q[4]));break;case "L":q=["C"][M](wa(k.x,k.y,q[1],q[2]));break;case "H":q=["C"][M](wa(k.x,k.y,q[1],k.y));break;case "V":q=["C"][M](wa(k.x,k.y,k.x,q[1]));break;case "Z":q=["C"][M](wa(k.x,k.y,k.X,k.Y));break}return q}function e(q,k){if(q[k][o]>7){q[k].shift();for(var t=q[k];t[o];)q.splice(k++,0,["C"][M](t.splice(0,6)));q.splice(k,1);i=Y(c[o],d&&d[o]||0)}}function g(q,k,t,L,B){if(q&&k&&q[B][0]=="M"&&k[B][0]!="M"){k.splice(B,0,["M",L.x,L.y]);t.bx=0;t.by=0;t.x=q[B][1];t.y=q[B][2];i=Y(c[o],d&&
d[o]||0)}}for(var h=0,i=Y(c[o],d&&d[o]||0);h<i;h++){c[h]=f(c[h],a);e(c,h);d&&(d[h]=f(d[h],b));d&&e(d,h);g(c,d,a,b,h);g(d,c,b,a,h);var j=c[h],l=d&&d[h],n=j[o],r=d&&l[o];a.x=j[n-2];a.y=j[n-1];a.bx=A(j[n-4])||a.x;a.by=A(j[n-3])||a.y;b.bx=d&&(A(l[r-4])||b.x);b.by=d&&(A(l[r-3])||b.y);b.x=d&&l[r-2];b.y=d&&l[r-1]}return d?[c,d]:c},null,ta),Ra=T(function(a){for(var b=[],c=0,d=a[o];c<d;c++){var f={},e=a[c].match(/^([^:]*):?([\d\.]*)/);f.color=m.getRGB(e[1]);if(f.color.error)return null;f.color=f.color.hex;
e[2]&&(f.offset=e[2]+"%");b[E](f)}c=1;for(d=b[o]-1;c<d;c++)if(!b[c].offset){a=A(b[c-1].offset||0);e=0;for(f=c+1;f<d;f++)if(b[f].offset){e=b[f].offset;break}if(!e){e=100;f=d}e=A(e);for(e=(e-a)/(f-c+1);c<f;c++){a+=e;b[c].offset=a+"%"}}return b});function Sa(a,b,c,d){if(m.is(a,ea)||m.is(a,"object")){a=m.is(a,ea)?C.getElementById(a):a;if(a.tagName)return b==null?{container:a,width:a.style.pixelWidth||a.offsetWidth,height:a.style.pixelHeight||a.offsetHeight}:{container:a,width:b,height:c}}else return{container:1,
x:a,y:b,width:c,height:d}}function Fa(a,b){var c=this;for(var d in b)if(b[z](d)&&!(d in a))switch(typeof b[d]){case "function":(function(f){a[d]=a===c?f:function(){return f[K](c,arguments)}})(b[d]);break;case "object":a[d]=a[d]||{};Fa.call(this,a[d],b[d]);break;default:a[d]=b[d];break}}function ia(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)}function Ta(a,b){if(b.top!==a){ia(a,b);a.next=null;a.prev=b.top;b.top.next=a;b.top=
a}}function Ua(a,b){if(b.bottom!==a){ia(a,b);a.next=b.bottom;a.prev=null;b.bottom.prev=a;b.bottom=a}}function Va(a,b,c){ia(a,c);b==c.top&&(c.top=a);b.next&&(b.next.prev=a);a.next=b.next;a.prev=b;b.next=a}function Wa(a,b,c){ia(a,c);b==c.bottom&&(c.bottom=a);b.prev&&(b.prev.next=a);a.prev=b.prev;b.prev=a;a.next=b}function Xa(a){return function(){throw new Error("Rapha\u00ebl: you are calling to method \u201c"+a+"\u201d of removed object");}}var Ya=/^r(?:\(([^,]+?)\s*,\s*([^\)]+?)\))?/;if(m.svg){G[p].svgns=
"http://www.w3.org/2000/svg";G[p].xlink="http://www.w3.org/1999/xlink";F=function(a){return+a+(~~a===a)*0.5};var v=function(a,b){if(b)for(var c in b)b[z](c)&&a[W](c,b[c]+s);else{a=C.createElementNS(G[p].svgns,a);a.style.webkitTapHighlightColor="rgba(0,0,0,0)";return a}};m[N]=function(){return"Your browser supports SVG.\nYou are running Rapha\u00ebl "+this.version};var Za=function(a,b){var c=v("path");b.canvas&&b.canvas[y](c);b=new u(c,b);b.type="path";ba(b,{fill:"none",stroke:"#000",path:a});return b},
ma=function(a,b,c){var d="linear",f=0.5,e=0.5,g=a.style;b=(b+s)[I](Ya,function(l,n,r){d="radial";if(n&&r){f=A(n);e=A(r);l=(e>0.5)*2-1;D(f-0.5,2)+D(e-0.5,2)>0.25&&(e=w.sqrt(0.25-D(f-0.5,2))*l+0.5)&&e!=0.5&&(e=e.toFixed(5)-1.0E-5*l)}return s});b=b[H](/\s*\-\s*/);if(d=="linear"){var h=b.shift();h=-A(h);if(isNaN(h))return null;h=[0,0,w.cos(h*w.PI/180),w.sin(h*w.PI/180)];var i=1/(Y(w.abs(h[2]),w.abs(h[3]))||1);h[2]*=i;h[3]*=i;if(h[2]<0){h[0]=-h[2];h[2]=0}if(h[3]<0){h[1]=-h[3];h[3]=0}}b=Ra(b);if(!b)return null;
i=a.getAttribute(aa);(i=i.match(/^url\(#(.*)\)$/))&&c.defs.removeChild(C.getElementById(i[1]));i=v(d+"Gradient");i.id="r"+(m._id++)[N](36);v(i,d=="radial"?{fx:f,fy:e}:{x1:h[0],y1:h[1],x2:h[2],y2:h[3]});c.defs[y](i);c=0;for(h=b[o];c<h;c++){var j=v("stop");v(j,{offset:b[c].offset?b[c].offset:!c?"0%":"100%","stop-color":b[c].color||"#fff"});i[y](j)}v(a,{fill:"url(#"+i.id+")",opacity:1,"fill-opacity":1});g.fill=s;g.opacity=1;return g.fillOpacity=1},Ga=function(a){var b=a.getBBox();v(a.pattern,{patternTransform:m.format("translate({0},{1})",
b.x,b.y)})},ba=function(a,b){var c={"":[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]},d=a.node,f=a.attrs,e=a.rotate();function g(k,t){if(t=c[ca.call(t)]){var L=k.attrs["stroke-width"]||"1";k={round:L,square:L,butt:0}[k.attrs["stroke-linecap"]||b["stroke-linecap"]]||0;for(var B=[],x=t[o];x--;)B[x]=t[x]*L+(x%2?1:-1)*k;v(d,{"stroke-dasharray":B[Q](",")})}}b[z]("rotation")&&(e=b.rotation);var h=
(e+s)[H](V);if(h.length-1){h[1]=+h[1];h[2]=+h[2]}else h=null;A(e)&&a.rotate(0,true);for(var i in b)if(b[z](i))if(qa[z](i)){var j=b[i];f[i]=j;switch(i){case "blur":a.blur(j);break;case "rotation":a.rotate(j,true);break;case "href":case "title":case "target":var l=d.parentNode;if(ca.call(l.tagName)!="a"){var n=v("a");l.insertBefore(n,d);n[y](d);l=n}l.setAttributeNS(a.paper.xlink,i,j);break;case "cursor":d.style.cursor=j;break;case "clip-rect":l=(j+s)[H](V);if(l[o]==4){a.clip&&a.clip.parentNode.parentNode.removeChild(a.clip.parentNode);
var r=v("clipPath");n=v("rect");r.id="r"+(m._id++)[N](36);v(n,{x:l[0],y:l[1],width:l[2],height:l[3]});r[y](n);a.paper.defs[y](r);v(d,{"clip-path":"url(#"+r.id+")"});a.clip=n}if(!j){(j=C.getElementById(d.getAttribute("clip-path")[I](/(^url\(#|\)$)/g,s)))&&j.parentNode.removeChild(j);v(d,{"clip-path":s});delete a.clip}break;case "path":if(a.type=="path")v(d,{d:j?(f.path=ka(j)):"M0,0"});break;case "width":d[W](i,j);if(f.fx){i="x";j=f.x}else break;case "x":if(f.fx)j=-f.x-(f.width||0);case "rx":if(i==
"rx"&&a.type=="rect")break;case "cx":h&&(i=="x"||i=="cx")&&(h[1]+=j-f[i]);d[W](i,F(j));a.pattern&&Ga(a);break;case "height":d[W](i,j);if(f.fy){i="y";j=f.y}else break;case "y":if(f.fy)j=-f.y-(f.height||0);case "ry":if(i=="ry"&&a.type=="rect")break;case "cy":h&&(i=="y"||i=="cy")&&(h[2]+=j-f[i]);d[W](i,F(j));a.pattern&&Ga(a);break;case "r":a.type=="rect"?v(d,{rx:j,ry:j}):d[W](i,j);break;case "src":a.type=="image"&&d.setAttributeNS(a.paper.xlink,"href",j);break;case "stroke-width":d.style.strokeWidth=
j;d[W](i,j);f["stroke-dasharray"]&&g(a,f["stroke-dasharray"]);break;case "stroke-dasharray":g(a,j);break;case "translation":j=(j+s)[H](V);j[0]=+j[0]||0;j[1]=+j[1]||0;if(h){h[1]+=j[0];h[2]+=j[1]}ya.call(a,j[0],j[1]);break;case "scale":j=(j+s)[H](V);a.scale(+j[0]||1,+j[1]||+j[0]||1,isNaN(A(j[2]))?null:+j[2],isNaN(A(j[3]))?null:+j[3]);break;case aa:if(l=(j+s).match(Na)){r=v("pattern");var q=v("image");r.id="r"+(m._id++)[N](36);v(r,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1});v(q,{x:0,y:0});
q.setAttributeNS(a.paper.xlink,"href",l[1]);r[y](q);j=C.createElement("img");j.style.cssText="position:absolute;left:-9999em;top-9999em";j.onload=function(){v(r,{width:this.offsetWidth,height:this.offsetHeight});v(q,{width:this.offsetWidth,height:this.offsetHeight});C.body.removeChild(this);a.paper.safari()};C.body[y](j);j.src=l[1];a.paper.defs[y](r);d.style.fill="url(#"+r.id+")";v(d,{fill:"url(#"+r.id+")"});a.pattern=r;a.pattern&&Ga(a);break}l=m.getRGB(j);if(l.error){if(({circle:1,ellipse:1}[z](a.type)||
(j+s).charAt()!="r")&&ma(d,j,a.paper)){f.gradient=j;f.fill="none";break}}else{delete b.gradient;delete f.gradient;!m.is(f.opacity,"undefined")&&m.is(b.opacity,"undefined")&&v(d,{opacity:f.opacity});!m.is(f["fill-opacity"],"undefined")&&m.is(b["fill-opacity"],"undefined")&&v(d,{"fill-opacity":f["fill-opacity"]})}l[z]("o")&&v(d,{"fill-opacity":l.o/100});case "stroke":l=m.getRGB(j);d[W](i,l.hex);i=="stroke"&&l[z]("o")&&v(d,{"stroke-opacity":l.o/100});break;case "gradient":(({circle:1,ellipse:1})[z](a.type)||
(j+s).charAt()!="r")&&ma(d,j,a.paper);break;case "opacity":case "fill-opacity":if(f.gradient){if(l=C.getElementById(d.getAttribute(aa)[I](/^url\(#|\)$/g,s))){l=l.getElementsByTagName("stop");l[l[o]-1][W]("stop-opacity",j)}break}default:i=="font-size"&&(j=da(j,10)+"px");l=i[I](/(\-.)/g,function(k){return pa.call(k.substring(1))});d.style[l]=j;d[W](i,j);break}}yb(a,b);if(h)a.rotate(h.join(P));else A(e)&&a.rotate(e,true)},$a=1.2,yb=function(a,b){if(!(a.type!="text"||!(b[z]("text")||b[z]("font")||b[z]("font-size")||
b[z]("x")||b[z]("y")))){var c=a.attrs,d=a.node,f=d.firstChild?da(C.defaultView.getComputedStyle(d.firstChild,s).getPropertyValue("font-size"),10):10;if(b[z]("text")){for(c.text=b.text;d.firstChild;)d.removeChild(d.firstChild);b=(b.text+s)[H]("\n");for(var e=0,g=b[o];e<g;e++)if(b[e]){var h=v("tspan");e&&v(h,{dy:f*$a,x:c.x});h[y](C.createTextNode(b[e]));d[y](h)}}else{b=d.getElementsByTagName("tspan");e=0;for(g=b[o];e<g;e++)e&&v(b[e],{dy:f*$a,x:c.x})}v(d,{y:c.y});a=a.getBBox();(a=c.y-(a.y+a.height/2))&&
isFinite(a)&&v(d,{y:c.y+a})}},u=function(a,b){this[0]=a;this.id=m._oid++;this.node=a;a.raphael=this;this.paper=b;this.attrs=this.attrs||{};this.transformations=[];this._={tx:0,ty:0,rt:{deg:0,cx:0,cy:0},sx:1,sy:1};!b.bottom&&(b.bottom=this);(this.prev=b.top)&&(b.top.next=this);b.top=this;this.next=null};u[p].rotate=function(a,b,c){if(this.removed)return this;if(a==null){if(this._.rt.cx)return[this._.rt.deg,this._.rt.cx,this._.rt.cy][Q](P);return this._.rt.deg}var d=this.getBBox();a=(a+s)[H](V);if(a[o]-
1){b=A(a[1]);c=A(a[2])}a=A(a[0]);if(b!=null)this._.rt.deg=a;else this._.rt.deg+=a;c==null&&(b=null);this._.rt.cx=b;this._.rt.cy=c;b=b==null?d.x+d.width/2:b;c=c==null?d.y+d.height/2:c;if(this._.rt.deg){this.transformations[0]=m.format("rotate({0} {1} {2})",this._.rt.deg,b,c);this.clip&&v(this.clip,{transform:m.format("rotate({0} {1} {2})",-this._.rt.deg,b,c)})}else{this.transformations[0]=s;this.clip&&v(this.clip,{transform:s})}v(this.node,{transform:this.transformations[Q](P)});return this};u[p].hide=
function(){!this.removed&&(this.node.style.display="none");return this};u[p].show=function(){!this.removed&&(this.node.style.display="");return this};u[p].remove=function(){if(!this.removed){ia(this,this.paper);this.node.parentNode.removeChild(this.node);for(var a in this)delete this[a];this.removed=true}};u[p].getBBox=function(){if(this.removed)return this;if(this.type=="path")return va(this.attrs.path);if(this.node.style.display=="none"){this.show();var a=true}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,f=this.node.getNumberOfChars();d<f;d++){var e=this.node.getExtentOfChar(d);e.y<b.y&&(b.y=e.y);e.y+e.height-b.y>b.height&&(b.height=e.y+e.height-b.y);e.x+e.width-b.x>b.width&&(b.width=e.x+e.width-b.x)}}a&&this.hide();return b};u[p].attr=function(a,b){if(this.removed)return this;if(a==null){a={};for(var c in this.attrs)if(this.attrs[z](c))a[c]=this.attrs[c];this._.rt.deg&&(a.rotation=this.rotate());(this._.sx!=1||this._.sy!=
1)&&(a.scale=this.scale());a.gradient&&a.fill=="none"&&(a.fill=a.gradient)&&delete a.gradient;return a}if(b==null&&m.is(a,ea)){if(a=="translation")return ya.call(this);if(a=="rotation")return this.rotate();if(a=="scale")return this.scale();if(a==aa&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;return this.attrs[a]}if(b==null&&m.is(a,U)){b={};c=0;for(var d=a.length;c<d;c++)b[a[c]]=this.attr(a[c]);return b}if(b!=null){c={};c[a]=b;ba(this,c)}else a!=null&&m.is(a,"object")&&
ba(this,a);return this};u[p].toFront=function(){if(this.removed)return this;this.node.parentNode[y](this.node);var a=this.paper;a.top!=this&&Ta(this,a);return this};u[p].toBack=function(){if(this.removed)return this;if(this.node.parentNode.firstChild!=this.node){this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild);Ua(this,this.paper)}return this};u[p].insertAfter=function(a){if(this.removed)return this;var b=a.node;b.nextSibling?b.parentNode.insertBefore(this.node,b.nextSibling):
b.parentNode[y](this.node);Va(this,a,this.paper);return this};u[p].insertBefore=function(a){if(this.removed)return this;var b=a.node;b.parentNode.insertBefore(this.node,b);Wa(this,a,this.paper);return this};u[p].blur=function(a){var b=this;if(+a!==0){var c=v("filter"),d=v("feGaussianBlur");b.attrs.blur=a;c.id="r"+(m._id++)[N](36);v(d,{stdDeviation:+a||1.5});c.appendChild(d);b.paper.defs.appendChild(c);b._blur=c;v(b.node,{filter:"url(#"+c.id+")"})}else{if(b._blur){b._blur.parentNode.removeChild(b._blur);
delete b._blur;delete b.attrs.blur}b.node.removeAttribute("filter")}};var ab=function(a,b,c,d){b=F(b);c=F(c);var f=v("circle");a.canvas&&a.canvas[y](f);a=new u(f,a);a.attrs={cx:b,cy:c,r:d,fill:"none",stroke:"#000"};a.type="circle";v(f,a.attrs);return a},bb=function(a,b,c,d,f,e){b=F(b);c=F(c);var g=v("rect");a.canvas&&a.canvas[y](g);a=new u(g,a);a.attrs={x:b,y:c,width:d,height:f,r:e||0,rx:e||0,ry:e||0,fill:"none",stroke:"#000"};a.type="rect";v(g,a.attrs);return a},cb=function(a,b,c,d,f){b=F(b);c=F(c);
var e=v("ellipse");a.canvas&&a.canvas[y](e);a=new u(e,a);a.attrs={cx:b,cy:c,rx:d,ry:f,fill:"none",stroke:"#000"};a.type="ellipse";v(e,a.attrs);return a},db=function(a,b,c,d,f,e){var g=v("image");v(g,{x:c,y:d,width:f,height:e,preserveAspectRatio:"none"});g.setAttributeNS(a.xlink,"href",b);a.canvas&&a.canvas[y](g);a=new u(g,a);a.attrs={x:c,y:d,width:f,height:e,src:b};a.type="image";return a},eb=function(a,b,c,d){var f=v("text");v(f,{x:b,y:c,"text-anchor":"middle"});a.canvas&&a.canvas[y](f);a=new u(f,
a);a.attrs={x:b,y:c,"text-anchor":"middle",text:d,font:qa.font,stroke:"none",fill:"#000"};a.type="text";ba(a,a.attrs);return a},fb=function(a,b){this.width=a||this.width;this.height=b||this.height;this.canvas[W]("width",this.width);this.canvas[W]("height",this.height);return this},Aa=function(){var a=Sa[K](0,arguments),b=a&&a.container,c=a.x,d=a.y,f=a.width;a=a.height;if(!b)throw new Error("SVG container not found.");var e=v("svg");c=c||0;d=d||0;f=f||512;a=a||342;v(e,{xmlns:"http://www.w3.org/2000/svg",
version:1.1,width:f,height:a});if(b==1){e.style.cssText="position:absolute;left:"+c+"px;top:"+d+"px";C.body[y](e)}else b.firstChild?b.insertBefore(e,b.firstChild):b[y](e);b=new G;b.width=f;b.height=a;b.canvas=e;Fa.call(b,b,m.fn);b.clear();return b};G[p].clear=function(){for(var a=this.canvas;a.firstChild;)a.removeChild(a.firstChild);this.bottom=this.top=null;(this.desc=v("desc"))[y](C.createTextNode("Created with Rapha\u00ebl"));a[y](this.desc);a[y](this.defs=v("defs"))};G[p].remove=function(){this.canvas.parentNode&&
this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]=Xa(a)}}if(m.vml){var gb={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},zb=/([clmz]),?([^clmz]*)/gi,Ab=/-?[^,\s-]+/g,na=1000+P+1000,ja=10,oa={path:1,rect:1},Bb=function(a){var b=/[ahqstv]/ig,c=ka;(a+s).match(b)&&(c=ua);b=/[clmz]/g;if(c==ka&&!(a+s).match(b))return a=(a+s)[I](zb,function(i,j,l){var n=[],r=ca.call(j)=="m",q=gb[j];l[I](Ab,function(k){if(r&&n[o]==2){q+=n+gb[j=="m"?"l":"L"];n=[]}n[E](F(k*ja))});return q+n});b=c(a);
var d;a=[];for(var f=0,e=b[o];f<e;f++){c=b[f];d=ca.call(b[f][0]);d=="z"&&(d="x");for(var g=1,h=c[o];g<h;g++)d+=F(c[g]*ja)+(g!=h-1?",":s);a[E](d)}return a[Q](P)};m[N]=function(){return"Your browser doesn\u2019t support SVG. Falling down to VML.\nYou are running Rapha\u00ebl "+this.version};Za=function(a,b){var c=R("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=R("shape"),f=d.style;f.width=
b.width+"px";f.height=b.height+"px";d.coordsize=na;d.coordorigin=b.coordorigin;c[y](d);d=new u(d,c,b);f={fill:"none",stroke:"#000"};a&&(f.path=a);d.isAbsolute=true;d.type="path";d.path=[];d.Path=s;ba(d,f);b.canvas[y](c);return d};ba=function(a,b){a.attrs=a.attrs||{};var c=a.node,d=a.attrs,f=c.style,e;e=(b.x!=d.x||b.y!=d.y||b.width!=d.width||b.height!=d.height||b.r!=d.r)&&a.type=="rect";var g=a;for(var h in b)if(b[z](h))d[h]=b[h];if(e){d.path=hb(d.x,d.y,d.width,d.height,d.r);a.X=d.x;a.Y=d.y;a.W=d.width;
a.H=d.height}b.href&&(c.href=b.href);b.title&&(c.title=b.title);b.target&&(c.target=b.target);b.cursor&&(f.cursor=b.cursor);"blur"in b&&a.blur(b.blur);if(b.path&&a.type=="path"||e)c.path=Bb(d.path);b.rotation!=null&&a.rotate(b.rotation,true);if(b.translation){e=(b.translation+s)[H](V);ya.call(a,e[0],e[1]);if(a._.rt.cx!=null){a._.rt.cx+=+e[0];a._.rt.cy+=+e[1];a.setBox(a.attrs,e[0],e[1])}}if(b.scale){e=(b.scale+s)[H](V);a.scale(+e[0]||1,+e[1]||+e[0]||1,+e[2]||null,+e[3]||null)}if("clip-rect"in b){e=
(b["clip-rect"]+s)[H](V);if(e[o]==4){e[2]=+e[2]+ +e[0];e[3]=+e[3]+ +e[1];h=c.clipRect||C.createElement("div");var i=h.style,j=c.parentNode;i.clip=m.format("rect({1}px {2}px {3}px {0}px)",e);if(!c.clipRect){i.position="absolute";i.top=0;i.left=0;i.width=a.paper.width+"px";i.height=a.paper.height+"px";j.parentNode.insertBefore(h,j);h[y](j);c.clipRect=h}}if(!b["clip-rect"])c.clipRect&&(c.clipRect.style.clip=s)}if(a.type=="image"&&b.src)c.src=b.src;if(a.type=="image"&&b.opacity){c.filterOpacity=Da+".Alpha(opacity="+
b.opacity*100+")";f.filter=(c.filterMatrix||s)+(c.filterOpacity||s)}b.font&&(f.font=b.font);b["font-family"]&&(f.fontFamily='"'+b["font-family"][H](",")[0][I](/^['"]+|['"]+$/g,s)+'"');b["font-size"]&&(f.fontSize=b["font-size"]);b["font-weight"]&&(f.fontWeight=b["font-weight"]);b["font-style"]&&(f.fontStyle=b["font-style"]);if(b.opacity!=null||b["stroke-width"]!=null||b.fill!=null||b.stroke!=null||b["stroke-width"]!=null||b["stroke-opacity"]!=null||b["fill-opacity"]!=null||b["stroke-dasharray"]!=null||
b["stroke-miterlimit"]!=null||b["stroke-linejoin"]!=null||b["stroke-linecap"]!=null){c=a.shape||c;f=c.getElementsByTagName(aa)&&c.getElementsByTagName(aa)[0];e=false;!f&&(e=f=R(aa));if("fill-opacity"in b||"opacity"in b){a=((+d["fill-opacity"]+1||2)-1)*((+d.opacity+1||2)-1)*((+m.getRGB(b.fill).o+1||2)-1);a<0&&(a=0);a>1&&(a=1);f.opacity=a}b.fill&&(f.on=true);if(f.on==null||b.fill=="none")f.on=false;if(f.on&&b.fill)if(a=b.fill.match(Na)){f.src=a[1];f.type="tile"}else{f.color=m.getRGB(b.fill).hex;f.src=
s;f.type="solid";if(m.getRGB(b.fill).error&&(g.type in{circle:1,ellipse:1}||(b.fill+s).charAt()!="r")&&ma(g,b.fill)){d.fill="none";d.gradient=b.fill}}e&&c[y](f);f=c.getElementsByTagName("stroke")&&c.getElementsByTagName("stroke")[0];e=false;!f&&(e=f=R("stroke"));if(b.stroke&&b.stroke!="none"||b["stroke-width"]||b["stroke-opacity"]!=null||b["stroke-dasharray"]||b["stroke-miterlimit"]||b["stroke-linejoin"]||b["stroke-linecap"])f.on=true;(b.stroke=="none"||f.on==null||b.stroke==0||b["stroke-width"]==
0)&&(f.on=false);a=m.getRGB(b.stroke);f.on&&b.stroke&&(f.color=a.hex);a=((+d["stroke-opacity"]+1||2)-1)*((+d.opacity+1||2)-1)*((+a.o+1||2)-1);h=(A(b["stroke-width"])||1)*0.75;a<0&&(a=0);a>1&&(a=1);b["stroke-width"]==null&&(h=d["stroke-width"]);b["stroke-width"]&&(f.weight=h);h&&h<1&&(a*=h)&&(f.weight=1);f.opacity=a;b["stroke-linejoin"]&&(f.joinstyle=b["stroke-linejoin"]||"miter");f.miterlimit=b["stroke-miterlimit"]||8;b["stroke-linecap"]&&(f.endcap=b["stroke-linecap"]=="butt"?"flat":b["stroke-linecap"]==
"square"?"square":"round");if(b["stroke-dasharray"]){a={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};f.dashstyle=a[z](b["stroke-dasharray"])?a[b["stroke-dasharray"]]:s}e&&c[y](f)}if(g.type=="text"){f=g.paper.span.style;d.font&&(f.font=d.font);d["font-family"]&&(f.fontFamily=d["font-family"]);d["font-size"]&&(f.fontSize=d["font-size"]);d["font-weight"]&&(f.fontWeight=d["font-weight"]);
d["font-style"]&&(f.fontStyle=d["font-style"]);g.node.string&&(g.paper.span.innerHTML=(g.node.string+s)[I](/</g,"&#60;")[I](/&/g,"&#38;")[I](/\n/g,"<br>"));g.W=d.w=g.paper.span.offsetWidth;g.H=d.h=g.paper.span.offsetHeight;g.X=d.x;g.Y=d.y+F(g.H/2);switch(d["text-anchor"]){case "start":g.node.style["v-text-align"]="left";g.bbx=F(g.W/2);break;case "end":g.node.style["v-text-align"]="right";g.bbx=-F(g.W/2);break;default:g.node.style["v-text-align"]="center";break}}};ma=function(a,b){a.attrs=a.attrs||
{};var c="linear",d=".5 .5";a.attrs.gradient=b;b=(b+s)[I](Ya,function(i,j,l){c="radial";if(j&&l){j=A(j);l=A(l);D(j-0.5,2)+D(l-0.5,2)>0.25&&(l=w.sqrt(0.25-D(j-0.5,2))*((l>0.5)*2-1)+0.5);d=j+P+l}return s});b=b[H](/\s*\-\s*/);if(c=="linear"){var f=b.shift();f=-A(f);if(isNaN(f))return null}var e=Ra(b);if(!e)return null;a=a.shape||a.node;b=a.getElementsByTagName(aa)[0]||R(aa);!b.parentNode&&a.appendChild(b);if(e[o]){b.on=true;b.method="none";b.color=e[0].color;b.color2=e[e[o]-1].color;a=[];for(var g=0,
h=e[o];g<h;g++)e[g].offset&&a[E](e[g].offset+P+e[g].color);b.colors&&(b.colors.value=a[o]?a[Q]():"0% "+b.color);if(c=="radial"){b.type="gradientradial";b.focus="100%";b.focussize=d;b.focusposition=d}else{b.type="gradient";b.angle=(270-f)%360}}return 1};u=function(a,b,c){this[0]=a;this.id=m._oid++;this.node=a;a.raphael=this;this.Y=this.X=0;this.attrs={};this.Group=b;this.paper=c;this._={tx:0,ty:0,rt:{deg:0},sx:1,sy:1};!c.bottom&&(c.bottom=this);(this.prev=c.top)&&(c.top.next=this);c.top=this;this.next=
null};u[p].rotate=function(a,b,c){if(this.removed)return this;if(a==null){if(this._.rt.cx)return[this._.rt.deg,this._.rt.cx,this._.rt.cy][Q](P);return this._.rt.deg}a=(a+s)[H](V);if(a[o]-1){b=A(a[1]);c=A(a[2])}a=A(a[0]);if(b!=null)this._.rt.deg=a;else this._.rt.deg+=a;c==null&&(b=null);this._.rt.cx=b;this._.rt.cy=c;this.setBox(this.attrs,b,c);this.Group.style.rotation=this._.rt.deg;return this};u[p].setBox=function(a,b,c){if(this.removed)return this;var d=this.Group.style,f=this.shape&&this.shape.style||
this.node.style;a=a||{};for(var e in a)if(a[z](e))this.attrs[e]=a[e];b=b||this._.rt.cx;c=c||this._.rt.cy;var g=this.attrs,h;switch(this.type){case "circle":a=g.cx-g.r;e=g.cy-g.r;h=g=g.r*2;break;case "ellipse":a=g.cx-g.rx;e=g.cy-g.ry;h=g.rx*2;g=g.ry*2;break;case "image":a=+g.x;e=+g.y;h=g.width||0;g=g.height||0;break;case "text":this.textpath.v=["m",F(g.x),", ",F(g.y-2),"l",F(g.x)+1,", ",F(g.y-2)][Q](s);a=g.x-F(this.W/2);e=g.y-this.H/2;h=this.W;g=this.H;break;case "rect":case "path":if(this.attrs.path){g=
va(this.attrs.path);a=g.x;e=g.y;h=g.width;g=g.height}else{e=a=0;h=this.paper.width;g=this.paper.height}break;default:e=a=0;h=this.paper.width;g=this.paper.height;break}b=b==null?a+h/2:b;c=c==null?e+g/2:c;b=b-this.paper.width/2;c=c-this.paper.height/2;var i;d.left!=(i=b+"px")&&(d.left=i);d.top!=(i=c+"px")&&(d.top=i);this.X=oa[z](this.type)?-b:a;this.Y=oa[z](this.type)?-c:e;this.W=h;this.H=g;if(oa[z](this.type)){f.left!=(i=-b*ja+"px")&&(f.left=i);f.top!=(i=-c*ja+"px")&&(f.top=i)}else if(this.type==
"text"){f.left!=(i=-b+"px")&&(f.left=i);f.top!=(i=-c+"px")&&(f.top=i)}else{d.width!=(i=this.paper.width+"px")&&(d.width=i);d.height!=(i=this.paper.height+"px")&&(d.height=i);f.left!=(i=a-b+"px")&&(f.left=i);f.top!=(i=e-c+"px")&&(f.top=i);f.width!=(i=h+"px")&&(f.width=i);f.height!=(i=g+"px")&&(f.height=i)}};u[p].hide=function(){!this.removed&&(this.Group.style.display="none");return this};u[p].show=function(){!this.removed&&(this.Group.style.display="block");return this};u[p].getBBox=function(){if(this.removed)return this;
if(oa[z](this.type))return va(this.attrs.path);return{x:this.X+(this.bbx||0),y:this.Y,width:this.W,height:this.H}};u[p].remove=function(){if(!this.removed){ia(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=true}};u[p].attr=function(a,b){if(this.removed)return this;if(a==null){a={};for(var c in this.attrs)if(this.attrs[z](c))a[c]=this.attrs[c];
this._.rt.deg&&(a.rotation=this.rotate());(this._.sx!=1||this._.sy!=1)&&(a.scale=this.scale());a.gradient&&a.fill=="none"&&(a.fill=a.gradient)&&delete a.gradient;return a}if(b==null&&m.is(a,ea)){if(a=="translation")return ya.call(this);if(a=="rotation")return this.rotate();if(a=="scale")return this.scale();if(a==aa&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;return this.attrs[a]}if(this.attrs&&b==null&&m.is(a,U)){var d={};c=0;for(b=a[o];c<b;c++)d[a[c]]=this.attr(a[c]);
return d}if(b!=null){d={};d[a]=b}b==null&&m.is(a,"object")&&(d=a);if(d){if(d.text&&this.type=="text")this.node.string=d.text;ba(this,d);if(d.gradient&&({circle:1,ellipse:1}[z](this.type)||(d.gradient+s).charAt()!="r"))ma(this,d.gradient);(!oa[z](this.type)||this._.rt.deg)&&this.setBox(this.attrs)}return this};u[p].toFront=function(){!this.removed&&this.Group.parentNode[y](this.Group);this.paper.top!=this&&Ta(this,this.paper);return this};u[p].toBack=function(){if(this.removed)return this;if(this.Group.parentNode.firstChild!=
this.Group){this.Group.parentNode.insertBefore(this.Group,this.Group.parentNode.firstChild);Ua(this,this.paper)}return this};u[p].insertAfter=function(a){if(this.removed)return this;a.Group.nextSibling?a.Group.parentNode.insertBefore(this.Group,a.Group.nextSibling):a.Group.parentNode[y](this.Group);Va(this,a,this.paper);return this};u[p].insertBefore=function(a){if(this.removed)return this;a.Group.parentNode.insertBefore(this.Group,a.Group);Wa(this,a,this.paper);return this};var Cb=/ progid:\S+Blur\([^\)]+\)/g;
u[p].blur=function(a){var b=this.node.style,c=b.filter;c=c.replace(Cb,"");if(+a!==0){this.attrs.blur=a;b.filter=c+Da+".Blur(pixelradius="+(+a||1.5)+")";b.margin=Raphael.format("-{0}px 0 0 -{0}px",Math.round(+a||1.5))}else{b.filter=c;b.margin=0;delete this.attrs.blur}};ab=function(a,b,c,d){var f=R("group"),e=R("oval");f.style.cssText="position:absolute;left:0;top:0;width:"+a.width+"px;height:"+a.height+"px";f.coordsize=na;f.coordorigin=a.coordorigin;f[y](e);e=new u(e,f,a);e.type="circle";ba(e,{stroke:"#000",
fill:"none"});e.attrs.cx=b;e.attrs.cy=c;e.attrs.r=d;e.setBox({x:b-d,y:c-d,width:d*2,height:d*2});a.canvas[y](f);return e};function hb(a,b,c,d,f){return f?m.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",a+f,b,c-f*2,f,-f,d-f*2,f*2-c,f*2-d):m.format("M{0},{1}l{2},0,0,{3},{4},0z",a,b,c,d,-c)}bb=function(a,b,c,d,f,e){var g=hb(b,c,d,f,e);a=a.path(g);var h=a.attrs;a.X=h.x=b;a.Y=h.y=c;a.W=h.width=d;a.H=h.height=f;h.r=e;h.path=
g;a.type="rect";return a};cb=function(a,b,c,d,f){var e=R("group"),g=R("oval");e.style.cssText="position:absolute;left:0;top:0;width:"+a.width+"px;height:"+a.height+"px";e.coordsize=na;e.coordorigin=a.coordorigin;e[y](g);g=new u(g,e,a);g.type="ellipse";ba(g,{stroke:"#000"});g.attrs.cx=b;g.attrs.cy=c;g.attrs.rx=d;g.attrs.ry=f;g.setBox({x:b-d,y:c-f,width:d*2,height:f*2});a.canvas[y](e);return g};db=function(a,b,c,d,f,e){var g=R("group"),h=R("image");g.style.cssText="position:absolute;left:0;top:0;width:"+
a.width+"px;height:"+a.height+"px";g.coordsize=na;g.coordorigin=a.coordorigin;h.src=b;g[y](h);h=new u(h,g,a);h.type="image";h.attrs.src=b;h.attrs.x=c;h.attrs.y=d;h.attrs.w=f;h.attrs.h=e;h.setBox({x:c,y:d,width:f,height:e});a.canvas[y](g);return h};eb=function(a,b,c,d){var f=R("group"),e=R("shape"),g=e.style,h=R("path"),i=R("textpath");f.style.cssText="position:absolute;left:0;top:0;width:"+a.width+"px;height:"+a.height+"px";f.coordsize=na;f.coordorigin=a.coordorigin;h.v=m.format("m{0},{1}l{2},{1}",
F(b*10),F(c*10),F(b*10)+1);h.textpathok=true;g.width=a.width;g.height=a.height;i.string=d+s;i.on=true;e[y](i);e[y](h);f[y](e);g=new u(i,f,a);g.shape=e;g.textpath=h;g.type="text";g.attrs.text=d;g.attrs.x=b;g.attrs.y=c;g.attrs.w=1;g.attrs.h=1;ba(g,{font:qa.font,stroke:"none",fill:"#000"});g.setBox();a.canvas[y](f);return g};fb=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 R;C.createStyleSheet().addRule(".rvml",
"behavior:url(#default#VML)");try{!C.namespaces.rvml&&C.namespaces.add("rvml","urn:schemas-microsoft-com:vml");R=function(a){return C.createElement("<rvml:"+a+' class="rvml">')}}catch(Kb){R=function(a){return C.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}Aa=function(){var a=Sa[K](0,arguments),b=a.container,c=a.height,d=a.width,f=a.x;a=a.y;if(!b)throw new Error("VML container not found.");var e=new G,g=e.canvas=C.createElement("div"),h=g.style;f=f||0;a=a||0;d=d||512;
c=c||342;d==+d&&(d+="px");c==+c&&(c+="px");e.width=1000;e.height=1000;e.coordsize=ja*1000+P+ja*1000;e.coordorigin="0 0";e.span=C.createElement("span");e.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";g[y](e.span);h.cssText=m.format("width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",d,c);if(b==1){C.body[y](g);h.left=f+"px";h.top=a+"px";h.position="absolute"}else b.firstChild?b.insertBefore(g,
b.firstChild):b[y](g);Fa.call(e,e,m.fn);return e};G[p].clear=function(){this.canvas.innerHTML=s;this.span=C.createElement("span");this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";this.canvas[y](this.span);this.bottom=this.top=null};G[p].remove=function(){this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]=Xa(a);return true}}G[p].safari=/^Apple|^Google/.test(X.navigator.vendor)&&(!(X.navigator.userAgent.indexOf("Version/4.0")+
1)||X.navigator.platform.slice(0,2)=="iP")?function(){var a=this.rect(-99,-99,this.width+99,this.height+99);X.setTimeout(function(){a.remove()})}:function(){};function Db(){this.returnValue=false}function Eb(){return this.originalEvent.preventDefault()}function Fb(){this.cancelBubble=true}function Gb(){return this.originalEvent.stopPropagation()}var Hb=function(){if(C.addEventListener)return function(a,b,c,d){var f=Ba&&Ca[b]?Ca[b]:b;function e(g){if(Ba&&Ca[z](b))for(var h=0,i=g.targetTouches&&g.targetTouches.length;h<
i;h++)if(g.targetTouches[h].target==a){i=g;g=g.targetTouches[h];g.originalEvent=i;g.preventDefault=Eb;g.stopPropagation=Gb;break}return c.call(d,g)}a.addEventListener(f,e,false);return function(){a.removeEventListener(f,e,false);return true}};else if(C.attachEvent)return function(a,b,c,d){function f(g){g=g||X.event;g.preventDefault=g.preventDefault||Db;g.stopPropagation=g.stopPropagation||Fb;return c.call(d,g)}a.attachEvent("on"+b,f);function e(){a.detachEvent("on"+b,f);return true}return e}}();for(ha=
Ma[o];ha--;)(function(a){m[a]=u[p][a]=function(b){if(m.is(b,"function")){this.events=this.events||[];this.events.push({name:a,f:b,unbind:Hb(this.shape||this.node||C,a,b,this)})}return this};m["un"+a]=u[p]["un"+a]=function(b){for(var c=this.events,d=c[o];d--;)if(c[d].name==a&&c[d].f==b){c[d].unbind();c.splice(d,1);!c.length&&delete this.events;return this}return this}})(Ma[ha]);u[p].hover=function(a,b){return this.mouseover(a).mouseout(b)};u[p].unhover=function(a,b){return this.unmouseover(a).unmouseout(b)};
u[p].drag=function(a,b,c){this._drag={};var d=this.mousedown(function(g){(g.originalEvent?g.originalEvent:g).preventDefault();this._drag.x=g.clientX;this._drag.y=g.clientY;this._drag.id=g.identifier;b&&b.call(this,g.clientX,g.clientY);Raphael.mousemove(f).mouseup(e)});function f(g){var h=g.clientX,i=g.clientY;if(Ba)for(var j=g.touches.length,l;j--;){l=g.touches[j];if(l.identifier==d._drag.id){h=l.clientX;i=l.clientY;(g.originalEvent?g.originalEvent:g).preventDefault();break}}else g.preventDefault();
a&&a.call(d,h-d._drag.x,i-d._drag.y,h,i)}function e(){d._drag={};Raphael.unmousemove(f).unmouseup(e);c&&c.call(d)}return this};G[p].circle=function(a,b,c){return ab(this,a||0,b||0,c||0)};G[p].rect=function(a,b,c,d,f){return bb(this,a||0,b||0,c||0,d||0,f||0)};G[p].ellipse=function(a,b,c,d){return cb(this,a||0,b||0,c||0,d||0)};G[p].path=function(a){a&&!m.is(a,ea)&&!m.is(a[0],U)&&(a+=s);return Za(m.format[K](m,arguments),this)};G[p].image=function(a,b,c,d,f){return db(this,a||"about:blank",b||0,c||0,
d||0,f||0)};G[p].text=function(a,b,c){return eb(this,a||0,b||0,c||s)};G[p].set=function(a){arguments[o]>1&&(a=Array[p].splice.call(arguments,0,arguments[o]));return new Z(a)};G[p].setSize=fb;G[p].top=G[p].bottom=null;G[p].raphael=m;function ib(){return this.x+P+this.y}u[p].resetScale=function(){if(this.removed)return this;this._.sx=1;this._.sy=1;this.attrs.scale="1 1"};u[p].scale=function(a,b,c,d){if(this.removed)return this;if(a==null&&b==null)return{x:this._.sx,y:this._.sy,toString:ib};b=b||a;!+b&&
(b=a);var f,e,g=this.attrs;if(a!=0){var h=this.getBBox(),i=h.x+h.width/2,j=h.y+h.height/2;f=a/this._.sx;e=b/this._.sy;c=+c||c==0?c:i;d=+d||d==0?d:j;h=~~(a/w.abs(a));var l=~~(b/w.abs(b)),n=this.node.style,r=c+(i-c)*f;j=d+(j-d)*e;switch(this.type){case "rect":case "image":var q=g.width*h*f,k=g.height*l*e;this.attr({height:k,r:g.r*$(h*f,l*e),width:q,x:r-q/2,y:j-k/2});break;case "circle":case "ellipse":this.attr({rx:g.rx*h*f,ry:g.ry*l*e,r:g.r*$(h*f,l*e),cx:r,cy:j});break;case "text":this.attr({x:r,y:j});
break;case "path":i=Oa(g.path);for(var t=true,L=0,B=i[o];L<B;L++){var x=i[L],J=pa.call(x[0]);if(!(J=="M"&&t)){t=false;if(J=="A"){x[i[L][o]-2]*=f;x[i[L][o]-1]*=e;x[1]*=h*f;x[2]*=l*e;x[5]=+!(h+l?!+x[5]:+x[5])}else if(J=="H"){J=1;for(var fa=x[o];J<fa;J++)x[J]*=f}else if(J=="V"){J=1;for(fa=x[o];J<fa;J++)x[J]*=e}else{J=1;for(fa=x[o];J<fa;J++)x[J]*=J%2?f:e}}}e=va(i);f=r-e.x-e.width/2;e=j-e.y-e.height/2;i[0][1]+=f;i[0][2]+=e;this.attr({path:i});break}if(this.type in{text:1,image:1}&&(h!=1||l!=1))if(this.transformations){this.transformations[2]=
"scale("[M](h,",",l,")");this.node[W]("transform",this.transformations[Q](P));f=h==-1?-g.x-(q||0):g.x;e=l==-1?-g.y-(k||0):g.y;this.attr({x:f,y:e});g.fx=h-1;g.fy=l-1}else{this.node.filterMatrix=Da+".Matrix(M11="[M](h,", M12=0, M21=0, M22=",l,", Dx=0, Dy=0, sizingmethod='auto expand', filtertype='bilinear')");n.filter=(this.node.filterMatrix||s)+(this.node.filterOpacity||s)}else if(this.transformations){this.transformations[2]=s;this.node[W]("transform",this.transformations[Q](P));g.fx=0;g.fy=0}else{this.node.filterMatrix=
s;n.filter=(this.node.filterMatrix||s)+(this.node.filterOpacity||s)}g.scale=[a,b,c,d][Q](P);this._.sx=a;this._.sy=b}return this};u[p].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 jb=T(function(a,b,c,d,f,e,g,h,i){for(var j=0,l,n=0;n<1.001;n+=0.0010){var r=m.findDotsAtSegment(a,b,c,d,f,e,g,h,n);n&&(j+=D(D(l.x-r.x,2)+D(l.y-r.y,2),0.5));if(j>=i)return r;l=r}});function Ha(a,b){return function(c,d,f){c=ua(c);
for(var e,g,h,i,j="",l={},n=0,r=0,q=c.length;r<q;r++){h=c[r];if(h[0]=="M"){e=+h[1];g=+h[2]}else{i=Ib(e,g,h[1],h[2],h[3],h[4],h[5],h[6]);if(n+i>d){if(b&&!l.start){e=jb(e,g,h[1],h[2],h[3],h[4],h[5],h[6],d-n);j+=["C",e.start.x,e.start.y,e.m.x,e.m.y,e.x,e.y];if(f)return j;l.start=j;j=["M",e.x,e.y+"C",e.n.x,e.n.y,e.end.x,e.end.y,h[5],h[6]][Q]();n+=i;e=+h[5];g=+h[6];continue}if(!a&&!b){e=jb(e,g,h[1],h[2],h[3],h[4],h[5],h[6],d-n);return{x:e.x,y:e.y,alpha:e.alpha}}}n+=i;e=+h[5];g=+h[6]}j+=h}l.end=j;e=a?n:
b?l:m.findDotsAtSegment(e,g,h[1],h[2],h[3],h[4],h[5],h[6],1);e.alpha&&(e={x:e.x,y:e.y,alpha:e.alpha});return e}}var Ib=T(function(a,b,c,d,f,e,g,h){for(var i={x:0,y:0},j=0,l=0;l<1.01;l+=0.01){var n=la(a,b,c,d,f,e,g,h,l);l&&(j+=D(D(i.x-n.x,2)+D(i.y-n.y,2),0.5));i=n}return j}),kb=Ha(1),za=Ha(),Ia=Ha(0,1);u[p].getTotalLength=function(){if(this.type=="path"){if(this.node.getTotalLength)return this.node.getTotalLength();return kb(this.attrs.path)}};u[p].getPointAtLength=function(a){if(this.type=="path")return za(this.attrs.path,
a)};u[p].getSubpath=function(a,b){if(this.type=="path"){if(w.abs(this.getTotalLength()-b)<1.0E-6)return Ia(this.attrs.path,a).end;b=Ia(this.attrs.path,b,1);return a?Ia(b,a).end:b}};m.easing_formulas={linear:function(a){return a},"<":function(a){return D(a,3)},">":function(a){return D(a-1,3)+1},"<>":function(a){a*=2;if(a<1)return D(a,3)/2;a-=2;return(D(a,3)+2)/2},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(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=0.3,c=b/4;return D(2,-10*a)*w.sin((a-c)*2*w.PI/b)+1},bounce:function(a){var b=7.5625,c=2.75;if(a<1/c)a=b*a*a;else if(a<2/c){a-=1.5/c;a=b*a*a+0.75}else if(a<2.5/c){a-=2.25/c;a=b*a*a+0.9375}else{a-=2.625/c;a=b*a*a+0.984375}return a}};var S={length:0};function lb(){var a=+new Date;for(var b in S)if(b!="length"&&S[z](b)){var c=S[b];if(c.stop||c.el.removed){delete S[b];S[o]--}else{var d=a-c.start,f=c.ms,e=c.easing,g=c.from,h=c.diff,i=c.to,j=c.t,l=c.prev||0,n=c.el,r=c.callback,q=
{},k;if(d<f){r=m.easing_formulas[e]?m.easing_formulas[e](d/f):d/f;for(var t in g)if(g[z](t)){switch(Ea[t]){case "along":k=r*f*h[t];i.back&&(k=i.len-k);e=za(i[t],k);n.translate(h.sx-h.x||0,h.sy-h.y||0);h.x=e.x;h.y=e.y;n.translate(e.x-h.sx,e.y-h.sy);i.rot&&n.rotate(h.r+e.alpha,e.x,e.y);break;case O:k=+g[t]+r*f*h[t];break;case "colour":k="rgb("+[Ja(F(g[t].r+r*f*h[t].r)),Ja(F(g[t].g+r*f*h[t].g)),Ja(F(g[t].b+r*f*h[t].b))][Q](",")+")";break;case "path":k=[];e=0;for(var L=g[t][o];e<L;e++){k[e]=[g[t][e][0]];
for(var B=1,x=g[t][e][o];B<x;B++)k[e][B]=+g[t][e][B]+r*f*h[t][e][B];k[e]=k[e][Q](P)}k=k[Q](P);break;case "csv":switch(t){case "translation":k=h[t][0]*(d-l);e=h[t][1]*(d-l);j.x+=k;j.y+=e;k=k+P+e;break;case "rotation":k=+g[t][0]+r*f*h[t][0];g[t][1]&&(k+=","+g[t][1]+","+g[t][2]);break;case "scale":k=[+g[t][0]+r*f*h[t][0],+g[t][1]+r*f*h[t][1],2 in i[t]?i[t][2]:s,3 in i[t]?i[t][3]:s][Q](P);break;case "clip-rect":k=[];for(e=4;e--;)k[e]=+g[t][e]+r*f*h[t][e];break}break}q[t]=k}n.attr(q);n._run&&n._run.call(n)}else{if(i.along){e=
za(i.along,i.len*!i.back);n.translate(h.sx-(h.x||0)+e.x-h.sx,h.sy-(h.y||0)+e.y-h.sy);i.rot&&n.rotate(h.r+e.alpha,e.x,e.y)}(j.x||j.y)&&n.translate(-j.x,-j.y);i.scale&&(i.scale+=s);n.attr(i);delete S[b];S[o]--;n.in_animation=null;m.is(r,"function")&&r.call(n)}c.prev=d}}m.svg&&n&&n.paper&&n.paper.safari();S[o]&&X.setTimeout(lb)}function Ja(a){return Y($(a,255),0)}function ya(a,b){if(a==null)return{x:this._.tx,y:this._.ty,toString:ib};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=Oa(this.attrs.path);c[0][1]+=+a;c[0][2]+=+b;this.attr({path:c});break}return this}u[p].animateWith=function(a,b,c,d,f){S[a.id]&&(b.start=S[a.id].start);return this.animate(b,c,d,f)};u[p].animateAlong=mb();u[p].animateAlongBack=mb(1);function mb(a){return function(b,c,d,f){var e={back:a};m.is(d,"function")?(f=d):(e.rot=d);b&&b.constructor==u&&(b=b.attrs.path);
b&&(e.along=b);return this.animate(e,c,f)}}u[p].onAnimation=function(a){this._run=a||0;return this};u[p].animate=function(a,b,c,d){if(m.is(c,"function")||!c)d=c||null;var f={},e={},g={};for(var h in a)if(a[z](h))if(Ea[z](h)){f[h]=this.attr(h);f[h]==null&&(f[h]=qa[h]);e[h]=a[h];switch(Ea[h]){case "along":var i=kb(a[h]),j=za(a[h],i*!!a.back),l=this.getBBox();g[h]=i/b;g.tx=l.x;g.ty=l.y;g.sx=j.x;g.sy=j.y;e.rot=a.rot;e.back=a.back;e.len=i;a.rot&&(g.r=A(this.rotate())||0);break;case O:g[h]=(e[h]-f[h])/
b;break;case "colour":f[h]=m.getRGB(f[h]);i=m.getRGB(e[h]);g[h]={r:(i.r-f[h].r)/b,g:(i.g-f[h].g)/b,b:(i.b-f[h].b)/b};break;case "path":i=ua(f[h],e[h]);f[h]=i[0];j=i[1];g[h]=[];i=0;for(l=f[h][o];i<l;i++){g[h][i]=[0];for(var n=1,r=f[h][i][o];n<r;n++)g[h][i][n]=(j[i][n]-f[h][i][n])/b}break;case "csv":j=(a[h]+s)[H](V);i=(f[h]+s)[H](V);switch(h){case "translation":f[h]=[0,0];g[h]=[j[0]/b,j[1]/b];break;case "rotation":f[h]=i[1]==j[1]&&i[2]==j[2]?i:[0,j[1],j[2]];g[h]=[(j[0]-f[h][0])/b,0,0];break;case "scale":a[h]=
j;f[h]=(f[h]+s)[H](V);g[h]=[(j[0]-f[h][0])/b,(j[1]-f[h][1])/b,0,0];break;case "clip-rect":f[h]=(f[h]+s)[H](V);g[h]=[];for(i=4;i--;)g[h][i]=(j[i]-f[h][i])/b;break}e[h]=j}}this.stop();this.in_animation=1;S[this.id]={start:a.start||+new Date,ms:b,easing:c,from:f,diff:g,to:e,el:this,callback:d,t:{x:0,y:0}};++S[o]==1&&lb();return this};u[p].stop=function(){S[this.id]&&S[o]--;delete S[this.id];return this};u[p].translate=function(a,b){return this.attr({translation:a+" "+b})};u[p][N]=function(){return"Rapha\u00ebl\u2019s object"};
m.ae=S;function Z(a){this.items=[];this[o]=0;this.type="set";if(a)for(var b=0,c=a[o];b<c;b++)if(a[b]&&(a[b].constructor==u||a[b].constructor==Z)){this[this.items[o]]=this.items[this.items[o]]=a[b];this[o]++}}Z[p][E]=function(){for(var a,b,c=0,d=arguments[o];c<d;c++)if((a=arguments[c])&&(a.constructor==u||a.constructor==Z)){b=this.items[o];this[b]=this.items[b]=a;this[o]++}return this};Z[p].pop=function(){delete this[this[o]--];return this.items.pop()};for(var Ka in u[p])if(u[p][z](Ka))Z[p][Ka]=function(a){return function(){for(var b=
0,c=this.items[o];b<c;b++)this.items[b][a][K](this.items[b],arguments);return this}}(Ka);Z[p].attr=function(a,b){if(a&&m.is(a,U)&&m.is(a[0],"object")){b=0;for(var c=a[o];b<c;b++)this.items[b].attr(a[b])}else{c=0;for(var d=this.items[o];c<d;c++)this.items[c].attr(a,b)}return this};Z[p].animate=function(a,b,c,d){(m.is(c,"function")||!c)&&(d=c||null);var f=this.items[o],e=f,g,h=this,i;d&&(i=function(){!--f&&d.call(h)});c=m.is(c,ea)?c:i;for(g=this.items[--e].animate(a,b,c,i);e--;)this.items[e].animateWith(g,
a,b,c,i);return this};Z[p].insertAfter=function(a){for(var b=this.items[o];b--;)this.items[b].insertAfter(a);return this};Z[p].getBBox=function(){for(var a=[],b=[],c=[],d=[],f=this.items[o];f--;){var e=this.items[f].getBBox();a[E](e.x);b[E](e.y);c[E](e.x+e.width);d[E](e.y+e.height)}a=$[K](0,a);b=$[K](0,b);return{x:a,y:b,width:Y[K](0,c)-a,height:Y[K](0,d)-b}};Z[p].clone=function(a){a=new Z;for(var b=0,c=this.items[o];b<c;b++)a[E](this.items[b].clone());return a};m.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)if(a.face[z](d))b.face[d]=a.face[d];if(this.fonts[c])this.fonts[c][E](b);else this.fonts[c]=[b];if(!a.svg){b.face["units-per-em"]=da(a.face["units-per-em"],10);for(var f in a.glyphs)if(a.glyphs[z](f)){c=a.glyphs[f];b.glyphs[f]={w:c.w,k:{},d:c.d&&"M"+c.d[I](/[mlcxtrv]/g,function(g){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[g]||"M"})+"z"};if(c.k)for(var e in c.k)if(c[z](e))b.glyphs[f].k[e]=c.k[e]}}return a};
G[p].getFont=function(a,b,c,d){d=d||"normal";c=c||"normal";b=+b||{normal:400,bold:700,lighter:300,bolder:800}[b]||400;if(m.fonts){var f=m.fonts[a];if(!f){a=new RegExp("(^|\\s)"+a[I](/[^\w\d\s+!~.:_-]/g,s)+"(\\s|$)","i");for(var e in m.fonts)if(m.fonts[z](e))if(a.test(e)){f=m.fonts[e];break}}var g;if(f){e=0;for(a=f[o];e<a;e++){g=f[e];if(g.face["font-weight"]==b&&(g.face["font-style"]==c||!g.face["font-style"])&&g.face["font-stretch"]==d)break}}return g}};G[p].print=function(a,b,c,d,f,e){e=e||"middle";
var g=this.set(),h=(c+s)[H](s),i=0;m.is(d,c)&&(d=this.getFont(d));if(d){c=(f||16)/d.face["units-per-em"];var j=d.face.bbox.split(V);f=+j[0];e=+j[1]+(e=="baseline"?j[3]-j[1]+ +d.face.descent:(j[3]-j[1])/2);j=0;for(var l=h[o];j<l;j++){var n=j&&d.glyphs[h[j-1]]||{},r=d.glyphs[h[j]];i+=j?(n.w||d.w)+(n.k&&n.k[h[j]]||0):0;r&&r.d&&g[E](this.path(r.d).attr({fill:"#000",stroke:"none",translation:[i,0]}))}g.scale(c,c,f,e).translate(a-f,b-e)}return g};var Jb=/\{(\d+)\}/g;m.format=function(a,b){var c=m.is(b,
U)?[0][M](b):arguments;a&&m.is(a,ea)&&c[o]-1&&(a=a[I](Jb,function(d,f){return c[++f]==null?s:c[f]}));return a||s};m.ninja=function(){La.was?(Raphael=La.is):delete Raphael;return m};m.el=u[p];return m}();
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}};
/*!
 * jQuery JavaScript Library v1.4.2
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Sat Feb 13 22:33:48 2010 -0500
 */
(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(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(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=
e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=
e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.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 originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=
a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit=
{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&
!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},
toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.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){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=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|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";
if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
a:b+"></"+d+">"},F={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,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(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,false,function(b){this.parentNode.insertBefore(b,
this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!==
"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},
serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,
global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&
e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===
false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=
false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||
d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);
g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===
"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;
if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");
this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration===
"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||
c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;
this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=
this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||
c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(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;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?
function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<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>";
a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);
c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,
d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);

jQuery.noConflict();
/*!
 *
 * This file has been modified to include a patch to Sortable as referenced here:
 * http://github.com/jquery/jquery-ui/commit/a4488aff7c62f3e2db6f894b5f24cfd0adb8c6b7
 * line: 117
 *
 * jQuery UI 1.8.1
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI
 */
jQuery.ui||function(c){c.ui={version:"1.8.1",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,f,g){return c.ui.isOverAxis(a,d,f)&&c.ui.isOverAxis(b,e,g)},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,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}};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)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none")},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!==
undefined)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"));if(!isNaN(b)&&b!=0)return b}a=a.parent()}}return 0}});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");return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b||"area"==b?a.href||!isNaN(d):!isNaN(d))&&
!c(a)["area"==b?"parents":"closest"](":hidden").length},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}})}(jQuery);
;/*!
 * jQuery UI Widget 1.8.1
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(b){var j=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 j.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({},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.substring(0,1)==="_")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!==undefined){h=i;return false}}):this.each(function(){var g=
b.data(this,a);if(g){d&&g.option(d);g._init()}else 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){this.element=b(c).data(this.widgetName,this);this.options=b.extend(true,{},this.options,b.metadata&&b.metadata.get(c)[this.widgetName],a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();
this._init()},_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,e=this;if(arguments.length===0)return b.extend({},e.options);if(typeof a==="string"){if(c===undefined)return this.options[a];d={};d[a]=c}b.each(d,function(f,
h){e._setOption(f,h)});return e},_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.1
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Mouse
 *
 * Depends:
 *	jquery.ui.widget.js
 */
(function(c){c.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(a._preventClickEvent){a._preventClickEvent=false;b.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 b=this,e=a.which==1,f=typeof this.options.cancel=="string"?c(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(){b.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}}this._mouseMoveDelegate=function(d){return b._mouseMove(d)};this._mouseUpDelegate=function(d){return b._mouseUp(d)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);c.browser.safari||a.preventDefault();return a.originalEvent.mouseHandled=true}},_mouseMove:function(a){if(c.browser.msie&&!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){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=a.target==this._mouseDownEvent.target;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.1
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * 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)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}},_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)&&
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)-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]}}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.1"});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._refreshItems();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.1
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * 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")):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();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}}}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]))});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.1"})})(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}}})();
(function(B){B.fn.ajaxSubmit=function(M){if(!this.length){A("ajaxSubmit: skipping submit process - no element selected");return this}if(typeof M=="function"){M={success:M}}M=B.extend({url:this.attr("action")||window.location.toString(),type:this.attr("method")||"GET"},M||{});var O={};this.trigger("form-pre-serialize",[this,M,O]);if(O.veto){A("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(M.beforeSerialize&&M.beforeSerialize(this,M)===false){A("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var I=this.formToArray(M.semantic);if(M.data){M.extraData=M.data;for(var E in M.data){if(M.data[E] instanceof Array){for(var F in M.data[E]){I.push({name:E,value:M.data[E][F]})}}else{I.push({name:E,value:M.data[E]})}}}if(M.beforeSubmit&&M.beforeSubmit(I,this,M)===false){A("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[I,this,M,O]);if(O.veto){A("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var D=B.param(I);if(M.type.toUpperCase()=="GET"){M.url+=(M.url.indexOf("?")>=0?"&":"?")+D;M.data=null}else{M.data=D}var N=this,H=[];if(M.resetForm){H.push(function(){N.resetForm()})}if(M.clearForm){H.push(function(){N.clearForm()})}if(!M.dataType&&M.target){var K=M.success||function(){};H.push(function(P){B(M.target).html(P).each(K,arguments)})}else{if(M.success){H.push(M.success)}}M.success=function(S,Q){for(var R=0,P=H.length;R<P;R++){H[R].apply(M,[S,Q,N])}};var C=B("input:file",this).fieldValue();var L=false;for(var G=0;G<C.length;G++){if(C[G]){L=true}}if(M.iframe||L){if(B.browser.safari&&M.closeKeepAlive){B.get(M.closeKeepAlive,J)}else{J()}}else{B.ajax(M)}this.trigger("form-submit-notify",[this,M]);return this;function J(){var T=N[0];if(B(":input[name=submit]",T).length){alert('Error: Form elements must not be named "submit".');return }var R=B.extend({},B.ajaxSettings,M);var c=jQuery.extend(true,{},B.extend(true,{},B.ajaxSettings),R);var S="jqFormIO"+(new Date().getTime());var Y=B('<iframe id="'+S+'" name="'+S+'" />');var a=Y[0];if(B.browser.msie||B.browser.opera){a.src='javascript:false;document.write("");'}Y.css({position:"absolute",top:"-1000px",left:"-1000px"});var b={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;Y.attr("src","about:blank")}};var Z=R.global;if(Z&&!B.active++){B.event.trigger("ajaxStart")}if(Z){B.event.trigger("ajaxSend",[b,R])}if(c.beforeSend&&c.beforeSend(b,c)===false){c.global&&jQuery.active--;return }if(b.aborted){return }var Q=0;var V=0;var P=T.clk;if(P){var U=P.name;if(U&&!P.disabled){M.extraData=M.extraData||{};M.extraData[U]=P.value;if(P.type=="image"){M.extraData[name+".x"]=T.clk_x;M.extraData[name+".y"]=T.clk_y}}}setTimeout(function(){var f=N.attr("target"),d=N.attr("action");N.attr({target:S,method:"POST",action:R.url});if(!M.skipEncodingOverride){N.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(R.timeout){setTimeout(function(){V=true;W()},R.timeout)}var e=[];try{if(M.extraData){for(var g in M.extraData){e.push(B('<input type="hidden" name="'+g+'" value="'+M.extraData[g]+'" />').appendTo(T)[0])}}Y.appendTo("body");a.attachEvent?a.attachEvent("onload",W):a.addEventListener("load",W,false);T.submit()}finally{N.attr("action",d);f?N.attr("target",f):N.removeAttr("target");B(e).remove()}},10);function W(){if(Q++){return }a.detachEvent?a.detachEvent("onload",W):a.removeEventListener("load",W,false);var f=0;var g=true;try{if(V){throw"timeout"}var h,j;j=a.contentWindow?a.contentWindow.document:a.contentDocument?a.contentDocument:a.document;if(j.body==null&&!f&&B.browser.opera){f=1;Q--;setTimeout(W,100);return }b.responseText=j.body?j.body.innerHTML:null;b.responseXML=j.XMLDocument?j.XMLDocument:j;b.getResponseHeader=function(k){var e={"content-type":R.dataType};return e[k]};if(R.dataType=="json"||R.dataType=="script"){var d=j.getElementsByTagName("textarea")[0];b.responseText=d?d.value:b.responseText}else{if(R.dataType=="xml"&&!b.responseXML&&b.responseText!=null){b.responseXML=X(b.responseText)}}h=B.httpData(b,R.dataType)}catch(i){g=false;B.handleError(R,b,"error",i)}if(g){R.success(h,"success");if(Z){B.event.trigger("ajaxSuccess",[b,R])}}if(Z){B.event.trigger("ajaxComplete",[b,R])}if(Z&&!--B.active){B.event.trigger("ajaxStop")}if(R.complete){R.complete(b,g?"success":"error")}setTimeout(function(){Y.remove();b.responseXML=null},100)}function X(d,e){if(window.ActiveXObject){e=new ActiveXObject("Microsoft.XMLDOM");e.async="false";e.loadXML(d)}else{e=(new DOMParser()).parseFromString(d,"text/xml")}return(e&&e.documentElement&&e.documentElement.tagName!="parsererror")?e:null}}};B.fn.ajaxForm=function(C){return this.ajaxFormUnbind().bind("submit.form-plugin",function(){B(this).ajaxSubmit(C);return false}).each(function(){B(":submit,input:image",this).bind("click.form-plugin",function(E){var D=this.form;D.clk=this;if(this.type=="image"){if(E.offsetX!=undefined){D.clk_x=E.offsetX;D.clk_y=E.offsetY}else{if(typeof B.fn.offset=="function"){var F=B(this).offset();D.clk_x=E.pageX-F.left;D.clk_y=E.pageY-F.top}else{D.clk_x=E.pageX-this.offsetLeft;D.clk_y=E.pageY-this.offsetTop}}}setTimeout(function(){D.clk=D.clk_x=D.clk_y=null},10)})})};B.fn.ajaxFormUnbind=function(){this.unbind("submit.form-plugin");return this.each(function(){B(":submit,input:image",this).unbind("click.form-plugin")})};B.fn.formToArray=function(N){var M=[];if(this.length==0){return M}var D=this[0];var H=N?D.getElementsByTagName("*"):D.elements;if(!H){return M}for(var I=0,K=H.length;I<K;I++){var E=H[I];var F=E.name;if(!F){continue}if(N&&D.clk&&E.type=="image"){if(!E.disabled&&D.clk==E){M.push({name:F+".x",value:D.clk_x},{name:F+".y",value:D.clk_y})}continue}var O=B.fieldValue(E,true);if(O&&O.constructor==Array){for(var G=0,C=O.length;G<C;G++){M.push({name:F,value:O[G]})}}else{if(O!==null&&typeof O!="undefined"){M.push({name:F,value:O})}}}if(!N&&D.clk){var J=D.getElementsByTagName("input");for(var I=0,K=J.length;I<K;I++){var L=J[I];var F=L.name;if(F&&!L.disabled&&L.type=="image"&&D.clk==L){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(typeof 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=B.browser.msie&&!(H.attributes.value.specified)?H.text:H.value;if(G){return M}L.push(M)}}return L}return C.value};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&&window.console&&window.console.log){window.console.log("[jquery.form] "+Array.prototype.join.call(arguments,""))}}})(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 D=[];var C={version:"3.3.1",params:{},$:jQuery,log:function(E){if(typeof console!="undefined"&&console.log){console.log(E)}},I18n:{getText:function(E){return E}},stopEvent:function(E){E.stopPropagation();return false},include:function(E){if(!this.contains(D,E)){D.push(E);var F=document.createElement("script");F.src=E;this.$("body").append(F)}},toggleClassName:function(E,F){if(!(E=this.$(E))){return }E.toggleClass(F)},setVisible:function(F,E){if(!(F=this.$(F))){return }var G=this.$;G(F).each(function(){var H=G(this).hasClass("hidden");if(H&&E){G(this).removeClass("hidden")}else{if(!H&&!E){G(this).addClass("hidden")}}})},setCurrent:function(E,F){if(!(E=this.$(E))){return }if(F){E.addClass("current")}else{E.removeClass("current")}},isVisible:function(E){return !this.$(E).hasClass("hidden")},populateParameters:function(){var E=this;this.$(".parameters input").each(function(){var F=this.value,G=this.title||this.id;if(E.$(this).hasClass("list")){if(E.params[G]){E.params[G].push(F)}else{E.params[G]=[F]}}else{E.params[G]=(F.match(/^(tru|fals)e$/i)?F.toLowerCase()=="true":F)}})},toInit:function(F){var E=this;this.$(function(){try{F.apply(this,arguments)}catch(G){E.log("Failed to run init function: "+G)}});return this},indexOf:function(I,H,F){var G=I.length;if(F==null){F=0}else{if(F<0){F=Math.max(0,G+F)}}for(var E=F;E<G;E++){if(I[E]===H){return E}}return -1},contains:function(F,E){return this.indexOf(F,E)>-1},format:function(G){var E=/^((?:(?:[^']*'){2})*?[^']*?)\{(\d+)\}/,F=/'(?!')/g;AJS.format=function(K){var I=arguments,J="",H=K.match(E);while(H){K=K.substring(H[0].length);J+=H[1].replace(F,"")+(I.length>++H[2]?I[H[2]]:"");H=K.match(E)}return J+=K.replace(F,"")};return AJS.format.apply(AJS,arguments)},firebug:function(){var E=this.$(document.createElement("script"));E.attr("src","http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js");this.$("head").append(E);(function(){if(window.firebug){firebug.init()}else{setTimeout(arguments.callee,0)}})()},clone:function(E){return AJS.$(E).clone().removeAttr("id")},alphanum:function(L,K){L=(L+"").toLowerCase();K=(K+"").toLowerCase();var G=/(\d+|\D+)/g,H=L.match(G),E=K.match(G),J=Math.max(H.length,E.length);for(var F=0;F<J;F++){if(F==H.length){return -1}if(F==E.length){return 1}var M=parseInt(H[F],10),I=parseInt(E[F],10);if(M==H[F]&&I==E[F]&&M!=I){return(M-I)/Math.abs(M-I)}if((M!=H[F]||I!=E[F])&&H[F]!=E[F]){return H[F]<E[F]?-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(F){if(typeof F=="function"){if(AJS.onTextResize["on-text-resize"]){AJS.onTextResize["on-text-resize"].push(function(G){F(G)})}else{var E=AJS("div");E.css({width:"1em",height:"1em",position:"absolute",top:"-9999em",left:"-9999em"});this.$("body").append(E);E.size=E.width();setInterval(function(){if(E.size!=E.width()){E.size=E.width();for(var G=0,H=AJS.onTextResize["on-text-resize"].length;G<H;G++){AJS.onTextResize["on-text-resize"][G](E.size)}}},0);AJS.onTextResize.em=E;AJS.onTextResize["on-text-resize"]=[function(G){F(G)}]}}},unbindTextResize:function(G){for(var E=0,F=AJS.onTextResize["on-text-resize"].length;E<F;E++){if(AJS.onTextResize["on-text-resize"][E]==G){return AJS.onTextResize["on-text-resize"].splice(E,1)}}},escape:function(E){return escape(E).replace(/%u\w{4}/gi,function(F){return unescape(F)})},filterBySearch:function(I,N,O){if(N==""){return[]}var G=this.$;var L=(O&&O.keywordsField)||"keywords";var K=(O&&O.ignoreForCamelCase)?"i":"";var H=(O&&O.matchBoundary)?"\\b":"";var F=(O&&O.splitRegex)||(/\s+/);var J=N.split(F);var E=[];G.each(J,function(){var Q=[new RegExp(H+this,"i")];if(/^([A-Z][a-z]*){2,}$/.test(this)){var P=this.replace(/([A-Z][a-z]*)/g,"\\b$1[^,]*");Q.push(new RegExp(P,K))}E.push(Q)});var M=[];G.each(I,function(){for(var R=0;R<E.length;R++){var P=false;for(var Q=0;Q<E[R].length;Q++){if(E[R][Q].test(this[L])){P=true;break}}if(!P){return }}M.push(this)});return M},drawLogo:function(H){options={};options=AJS.$.extend(H,options);var L=options.scaleFactor||1,K=options.fill||"#fff",J=options.stroke||"#000",G=400*L,E=40*L;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 F=Raphael(containerID,G+50*L,E+100*L);var I=F.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(E);I.scale(L,-L,0,0);I.translate(120*L,E);I.attr("fill",K);I.attr("stroke",J);I.attr("stroke-width",strokeWidth)}};if(typeof AJS!="undefined"){for(var B in AJS){C[B]=AJS[B]}}var A=function(){var E=null;if(arguments.length&&typeof arguments[0]=="string"){E=arguments.callee.$(document.createElement(arguments[0]));if(arguments.length==2){E.html(arguments[1])}}return E};for(var B in C){A[B]=C[B]}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.$("html").css("overflow","hidden")}else{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","")}else{AJS.$("body").css("overflow","")}if(AJS.$.browser.safari){var A=AJS.$(window).scrollTop();AJS.$(window).scrollTop(10+5*(A==10)).scrollTop(A)}}};AJS.popup=function(D){var G={width:800,height:600,closeOnOutsideClick:false,keypressListener:function(H){if(H.keyCode===27&&B.is(":visible")){E.hide()}}};if(typeof D!="object"){D={width:arguments[0],height:arguments[1],id:arguments[2]};D=AJS.$.extend({},D,arguments[3])}D=AJS.$.extend({},G,D);var B=AJS("div").addClass("aui-popup");if(D.id){B.attr("id",D.id)}var A=3000;AJS.$(".aui-dialog").each(function(){var H=AJS.$(this);A=(H.css("z-index")>A)?H.css("z-index"):A});var F=(function(I,H){D.width=(I=(I||D.width));D.height=(H=(H||D.height));B.css({marginTop:-Math.round(H/2)+"px",marginLeft:-Math.round(I/2)+"px",width:I,height:H,background:"#fff","z-index":parseInt(A,10)+2});return arguments.callee})(D.width,D.height);AJS.$("body").append(B);B.hide();B.enable();var C=AJS.$(".aui-blanket");var E={changeSize:function(H,I){if((H&&H!=D.width)||(I&&I!=D.height)){F(H,I)}this.show()},show:function(){var H=function(){var I=5;if(AJS.$.browser.msie&&~~(AJS.$.browser.version)<9){I=3}AJS.$(document).keydown(D.keypressListener);AJS.dim();C=AJS.$(".aui-blanket");if(C.size()!=0&&D.closeOnOutsideClick){C.click(function(){if(B.is(":visible")){E.hide()}})}B.show();if(!this.shadow){var J=B.offset();this.shadow=Raphael.shadow(J.top,J.left,D.width,D.height,{target:B[0],zindex:(B.css("z-index")-1)});this.shadow.css({position:"fixed",top:"50%",left:"50%",marginLeft:-(D.width/2-I)+"px",marginTop:-(D.height/2-I)+"px"})}AJS.popup.current=this;AJS.$(document).trigger("showLayer",["popup",this])};H.call(this);this.show=H},hide:function(){AJS.$(document).unbind("keydown",D.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 E};(function(){function A(J,H,G,I){if(!J.buttonpanel){J.addButtonPanel()}this.page=J;this.onclick=G;this._onclick=function(){G.call(this,J.dialog,J)};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(){H.call(this,K.dialog,K)};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(){G.call(this,page.dialog,page)};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 K=/\{([^\}]+)\}/g,D=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,M=/[<>"'&]/g,H=/([^\\])'/g,F=function(Q,P,R,N){var O=R;P.replace(D,function(U,T,S,W,V){T=T||W;if(O){if(T+":html" in O){O=O[T+":html"];N=true}else{if(T in O){O=O[T]}}if(V&&typeof O=="function"){O=O()}}});if(O==null||O==R){O=Q}O=String(O);if(!N){O=E.escape(O)}return O},I=function(N){return"&#"+N.charCodeAt()+";"},C=function(N){this.template=this.template.replace(K,function(P,O){return F(P,O,N,true)});return this},L=function(N){this.template=this.template.replace(K,function(P,O){return F(P,O,N)});return this},B=function(){return this.template};var E=function(O){function N(){return N.template}N.template=String(O);N.toString=N.valueOf=B;N.fill=L;N.fillHtml=C;return N},A={},J=[];E.load=function(N){N=String(N);if(!A.hasOwnProperty(N)){J.length>=1000&&delete A[J.shift()];J.push(N);A[N]=G("script[title='"+N.replace(H,"$1\\'")+"']")[0].text}return this(A[N])};E.escape=function(N){return String(N).replace(M,I)};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")&&(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";AJS.DIRTY_FORM_VALUE="AJS_DirtyForms_cleanValue";(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);jQuery(document).trigger("iframeAppended",iframe)}})}return elem});AJS.isSelenium=function(){var detectOn=function(obj){for(var propName in obj){if(propName.indexOf("selenium")!=-1){return true}}return false};return detectOn(window.location)||detectOn(window)};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};(function(){var SPECIAL_CHARS=/[&"<]/g;AJS.escapeHTML=function(str){return str.replace(SPECIAL_CHARS,replacement)};function replacement(specialChar){switch(specialChar){case"<":return"&lt;";case"&":return"&amp;";default:return"&quot;"}}})();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){var key,handlers;var instance=this;this._activeEvents=this._activeEvents||{};if(typeof target==="string"){key=group+"/"+target;if(this._activeEvents[key]){return }handlers=this._activeEvents[key]={};AJS.$.each(this._events[group],function(eventType,handler){handlers[eventType]=function(event){handler.call(instance,event,AJS.$(this))};AJS.$(document).delegate(target,eventType,handlers[eventType])})}else{target=AJS.$(target);if(target.length===0){return }if(this._activeEvents[group+"/"+target[0][AJS.$.expando]]){return }handlers={};AJS.$.each(this._events[group],function(eventType,handler){handlers[eventType]=function(event){handler.call(instance,event,AJS.$(this))};target.bind(eventType,handlers[eventType])});key=group+"/"+(target[0]===window?"window":target[0][AJS.$.expando]);this._activeEvents[key]=handlers}},_unassignEvents:function(group,target){var key,handlers,eventType;this._activeEvents=this._activeEvents||{};if(typeof target==="string"){key=group+"/"+target;handlers=this._activeEvents[key];if(!handlers){return }for(eventType in handlers){AJS.$(document).undelegate(target,eventType,handlers[eventType])}}else{target=AJS.$(target);if(target.length===0){return }key=group+"/"+target[0][AJS.$.expando];handlers=this._activeEvents[key];if(!handlers){return }try{for(eventType in handlers){target.unbind(eventType,handlers[eventType])}}catch(error){var events=AJS.$.data(target[0],"events");if(events){for(eventType in handlers){var $handlers=events[eventType];if(!$handlers){continue}var i=$handlers.length;while(i--){if($handlers[i].handler===handlers[eventType]){$handlers.splice(i,1);if($handlers.length===0){delete events[eventType]}break}}}}}}delete this._activeEvents[key]},_isValidInput:function(){return true},_handleKeyEvent:function(e){var instance=this;if(instance._isValidInput(e)){var SpecialKey=JIRA.Keyboard.SpecialKey,shortcut=JIRA.Keyboard.shortcutEntered(e);if(shortcut){if(instance.keys[shortcut]){instance.keys[shortcut].call(instance,e);return }else{if((shortcut===SpecialKey.BACKSPACE||shortcut===SpecialKey.DELETE)&&instance.keys.onEdit){instance.keys.onEdit.call(instance,e);return }}}var character=JIRA.Keyboard.characterEntered(e);if(character&&instance.keys.onEdit){instance.keys.onEdit.call(instance,e,character)}}},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 match=jQuery.uaMatch(userAgent),browser=match.browser,version=match.version.replace(/\.0$/,""),classNames=[];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};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);log("success",_smartAjaxResult.requestId,_smartAjaxResult);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){}log("started",_requestId,""+ourAjaxOptions.url);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){return buildRawHttpErrorMessage(smartAjaxResult)};function buildRawHttpErrorMessage(smartAjaxResult){var AJS=window.top.AJS;var errMsg;if(smartAjaxResult.statusText==JIRA.SmartAjax.SmartAjaxResult.TIMEOUT){errMsg=AJS.params.ajaxTimeout}else{if(smartAjaxResult.status==401){errMsg=AJS.params.ajaxUnauthorised}else{if(smartAjaxResult.hasData){errMsg=AJS.params.ajaxServerError}else{errMsg=AJS.params.ajaxCommsError}}}return errMsg}function buildDialogAjaxErrorMessage(errorMessage,noHeader){var errorContent='<div class="warningBox">'+"<p>"+errorMessage+"</p>"+"<p>"+AJS.params.ajaxErrorCloseDialog+"</p>"+"</div>";if(!noHeader){errorContent="<h1>"+AJS.params.ajaxErrorDialogHeading+"</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})});
(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}function listenForLayerEvents($doc){$doc.bind("showLayer",function(e,type,item){if(item&&item.id&&item.id.indexOf("user-hover-dialog")>=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){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(!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.preventBlurFromElements=function(){var elems=jQuery.makeArray(arguments),$fromElement=this;if(jQuery.browser.msie){$fromElement.bind("beforedeactivate",function(e){var blurEvents;if(e.toElement===document.documentElement){blurEvents=$fromElement.data("events").blur;delete $fromElement.data("events").blur;$fromElement.one("blur",function(){$fromElement.focus();window.setTimeout(function(){$fromElement.data("events").blur=blurEvents},0)})}else{jQuery.each(elems,function(){var $elem=jQuery(this);if($elem.has(e.toElement).length===1){e.preventDefault();return false}})}})}else{jQuery.each(elems,function(){this.mousedown(function(e){if(e.target!==$fromElement[0]){e.preventDefault()}})})}};
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.nextPage=function(){var data=[],oldBeforeUnload=window.onbeforeunload;window.onbeforeunload=function(){if(window.sessionStorage){var keys=[];if(data.length>0){for(var i=0;i<data.length;i++){sessionStorage.setItem(data[i].name,data[i].value);keys.push(data[i].name)}sessionStorage.setItem("AJS.thisPage:keys",keys.join(","))}if(oldBeforeUnload){oldBeforeUnload()}}else{saveCookie("AJS.thisPage:keys",JSON.stringify(data))}};return function(name,value){data.push({name:name,value:value})}}();AJS.thisPage=function(){var i,keys,unformattedData,data={};if(window.sessionStorage){keys=sessionStorage.getItem("AJS.thisPage:keys");if(keys){keys=keys.split(",");for(i=0;i<keys.length;i++){data[keys[i]]=sessionStorage.getItem(keys[i]);sessionStorage.removeItem(keys[i])}sessionStorage.removeItem("AJS.thisPage:keys")}}else{unformattedData=readCookie("AJS.thisPage:keys");if(unformattedData){unformattedData=JSON.parse(unformattedData);for(i=0;i<unformattedData.length;i++){data[unformattedData[i].name]=unformattedData[i].value}}eraseCookie("AJS.thisPage:keys")}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.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?"warn":"error";$content=AJS.$("<div class='notify "+errorClass+"'>"+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.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,scrollTop;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){scrollTop=Math.max(document.body.scrollTop,document.documentElement.scrollTop);positioning.maxHeight=AJS.$(window).height()+scrollTop-positioning.top-this.options.cushion()}this.layer().css(positioning)},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._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},_events:{container:{keydown:function(e){if(JIRA.Keyboard.specialKeyEntered(e)===JIRA.Keyboard.SpecialKey.ESC){this.hide()}},keypress:function(e){if(JIRA.Keyboard.specialKeyEntered(e)===JIRA.Keyboard.SpecialKey.ESC){this.hide()}},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&&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:this.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":{"keydown 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(){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}},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)},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({_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,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()},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()}})},_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){var regexEscapedQuery=RegExp.escape(query),regex=new RegExp(AJS.format(this.options.matchingStrategy,regexEscapedQuery),"i");if(!regex.test(item.label())){return null}replacementText=item.label().replace(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)},_generateUngroupedOptions:function(options,query){var hasSuggestion=false,instance=this,$container=this._render("ungroupedSuggestions");AJS.$.each(options,function(_,option){var $suggestion=instance._generateOption(option,query);if($suggestion){hasSuggestion=true;$container.append($suggestion)}});if(hasSuggestion){return $container}},_generateOptGroup:function(groupDescriptor,query){var res=AJS.$(),hasSuggestion,instance=this,optContainer=this._render("suggestionGroup",groupDescriptor);AJS.$.each(groupDescriptor.items(),function(i,option){var suggestion=instance._generateOption(option,query);if(suggestion){hasSuggestion=true,optContainer.append(suggestion)}});if(!hasSuggestion){return }if(groupDescriptor.showLabel()!==false){res=res.add(this._render("suggestionGroupHeading",groupDescriptor))}res=res.add(optContainer);return res},_events:{document:{keydown:function(e){this._handleKeyEvent(e)},keypress:function(e){this._handleKeyEvent(e)}}},_renders:{suggestion:function(descriptor,replacementText){var listElem=AJS.$('<li class="aui-list-item aui-list-item-'+AJS.$.trim(descriptor.label().toLowerCase()).replace(/[\s\.]+/g,"-")+'">'),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()){AJS.$("<span class='aui-item-suffix' />").text(descriptor.labelSuffix()).appendTo(linkElem)}listElem.append(linkElem).data("descriptor",descriptor);return listElem},noSuggestion:function(){return AJS.$("<div class='no-suggestions'><span style='font-style:oblique'>"+AJS.params.frotherNomatches+"</span></div>")},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.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}))});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);this.layerController.show();if(this.options.focusFirstItem()){this.listController.shiftFocus(0)}else{this.listController.prepareForInput()}},hide:function(){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}},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}},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,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;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.$.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||{};that.click(enable);return that};
jQuery.fn.scrollIntoView=function(options){if(this.length>0&&!this.hasFixedParent()){options=options||{};options.marginTop=options.marginTop||options.margin||0;options.marginBottom=options.marginBottom||options.margin||0;if(!this.is(":visible")&&options.callback){options.callback();return this}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}if(newScrollTop!==scrollTop){var $target=this;var $document=window.top.jQuery(window.top.document);$document.trigger("moveToStarted",$target);$document.find("body, html").stop(true).animate({scrollTop:newScrollTop},options.duration||100,"swing",function(){if(options.callback){options.callback()}$document.trigger("moveToFinished",$target);$stalker.trigger("positionChanged")})}else{if(options.callback){options.callback()}}}return this;function getPageY(element){var offsetTop=0;do{offsetTop+=element.offsetTop}while(element=element.offsetParent);return offsetTop}};
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.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(AJS.params.securityLevelViewableByAll)}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(AJS.params.securityLevelViewableRestrictedTo,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.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";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()){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){optgroup=instance.$element.find('optgroup[label="'+descriptor.label()+'"]');optgroup.data("descriptor",descriptor);AJS.$.each(descriptor.items(),function(i,optDescriptor){if(!instance._isOptionPresent(optDescriptor,optgroup)){optgroup.append(instance._render("option",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({value:optionElem.val(),title:optionElem.attr("title"),label:optionElem.text(),icon:optionElem.css("backgroundImage"),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);return elem}}});
AJS.QueryableDropdownSelect=AJS.Control.extend({INVALID_KEYS:[JIRA.Keyboard.SpecialKey.TAB,JIRA.Keyboard.SpecialKey.ESC,JIRA.Keyboard.SpecialKey.SHIFT,JIRA.Keyboard.SpecialKey.RIGHT],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();this.dropdownController=AJS.InlineLayer.create({offsetTarget:this.$field,width:this.$field.innerWidth(),content:options.element});this.listController=new AJS.List({containerSelector:options.element,groupSelector:"ul.aui-list-section",itemSelector:"li",selectionHandler:function(){instance.$field.val(AJS.params.dotLoading).css("color","#999");instance.hideSuggestions();return true}});this._assignEventsToFurniture();if(this.options.loadOnInit){this.suggestionsDisabled=true;this._requestThenResetSuggestions()}},_getDefaultOptions:function(){return{id:"default",ajaxOptions:{data:{query:""},dataType:"json",minQueryLength:0},keyInputPeriod:75}},getAjaxOptions:function(){this.options.ajaxOptions.data.query=AJS.$.trim(this.$field.val());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)}}};this.outstandingRequest=JIRA.SmartAjax.makeRequest(ajaxOptions);AJS.$(this.outstandingRequest).throbber({target:this.$dropDownIcon,isLatentThreshold:500})},_handleServerSuccess:function(smartAjaxResult){if(this.options.loadOnInit||this.$field.val()==this.options.ajaxOptions.data.query){this._handleSuggestionResponse(smartAjaxResult.data)}},_handleServerError:function(smartAjaxResult){var errMsg=JIRA.SmartAjax.buildSimpleErrorContent(smartAjaxResult);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")},_hasDropdownButton:function(){return this.options.showDropdownButton||this.options.ajaxOptions.minQueryLength===0},_assignEventsToFurniture:function(){var instance=this;this.$field.preventBlurFromElements(instance.dropdownController.$layer,instance.$container);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.$field.val());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)}}}},_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());if(this.options.ajaxOptions.query){this.listController.generateListFromJSON(data)}else{this.listController.generateListFromJSON(data,this.$field.val())}this.listController.enable()}else{this.hideSuggestions()}},_isValidInput:function(e){return this.$field.is(":visible")&&AJS.$.inArray(JIRA.Keyboard.specialKeyEntered(e),this.INVALID_KEYS)===-1},_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{this._setSuggestions(this.model.getUnSelectedDescriptors())}}else{this._setSuggestions()}},_handleDown:function(e){if(!this.suggestionsVisible){this._handleCharacterInput(true,true);e.stopPropagation()}},_rejectPendingRequests:function(){if(this.outstandingRequest){this.outstandingRequest.abort()}clearTimeout(this._queuedRequest)},hideSuggestions:function(){if(!this.suggestionsVisible){return }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()}}},keys:{down:function(e){if(this._hasDropdownButton()){this._handleDown(e)}},up:function(e){e.preventDefault()},"return":function(e){e.preventDefault()},onEdit:function(e,character){var instance=this;this.$field.one("keyup",function(){instance._handleCharacterInput()})}},_events:{dropdownAndLoadingIcon:{click:function(e){this.$field.focus();if(this.suggestionsVisible){this.hideSuggestions()}else{this._handleDown(e)}e.stopPropagation()}},field:{blur:function(){this._deactivate()},click:function(e){e.stopPropagation()},keyup:function(e){if(e.keyCode===JIRA.Keyboard.SpecialKey.toKeyCode(JIRA.Keyboard.SpecialKey.ESC)){this._handleEscape(e)}}},keys:{"keydown keypress":function(e){this._handleKeyEvent(e)}},ignoreBlurElement:{mousedown:function(e){if(e.target!==this.$field[0]){this.ignoreBlurEvent=true;e.preventDefault()}}}},_renders:{field:function(){return AJS.$("<input class='text' 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.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,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){instance._selectionHandler(this.getFocused(),e);return false}});this._assignEventsToFurniture();this._setTextareaDimThresholds();this.lozengeGroup=new AJS.MultiSelect.LozengeGroup();this._assignEvents("lozengeGroup",this.lozengeGroup);this._restoreSelectedOptions();return this},_getDefaultOptions:function(){return AJS.$.extend(true,this._super(),{minRoomForText:50,errorMessage:AJS.params.multiselectGenericError,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()},_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()},_setTextareaDimThresholds:function(){this.maxWidth=this.options.maxWidth||this.$container.attr("scrollWidth");this.minWidth=this.options.minWidth||this.$container.attr("scrollWidth");if(this.minWidth>this.maxWidth){this.minWidth=this.maxWidth}},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 label=descriptor.label();AJS.$.each(this.lozengeGroup.items,function(){if(this.options.label===label){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()},_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())},showErrorMessage:function(value){this.$errorMessage.text(AJS.format(this.options.errorMessage,value||this.$field.val()));var $container=this.$container.parent(".field-group");if($container.length===0){$container=this.$container.parent(".frother-control-renderer");this.$errorMessage.prependTo($container)}else{this.$errorMessage.appendTo($container)}},hideErrorMessage:function(){this.$errorMessage.remove()},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()}},_events:{body:{tabSelect:function(){if(this.$field.is(":visible")){this._setTextareaDimThresholds();this.updateItemsIndent()}},bulkTabSelect:function(){if(this.$field.is(":visible")){this._setTextareaDimThresholds();this.updateItemsIndent()}}},field:{paste:function(){setTimeout(AJS.$.proxy(this,"_handlePaste"),0)},"keydown keypress":function(event){if(this.lozengeGroup.index>=0){if(JIRA.Keyboard.SpecialKey.fromKeyCode(event.keyCode) in this.lozengeGroup.keys){event.preventDefault()}else{if(JIRA.Keyboard.SpecialKey.fromKeyCode(event.keyCode)==="return"){this.submitForm();event.preventDefault()}else{var instance=this;this.$field.one("keyup",function(){instance._handleCharacterInput()});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.options.label))}},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(AJS.params.removeItem)+'"></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);
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:AJS.params.labelNew})},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:{space:function(e){this._handleSpace();e.preventDefault()}},_formatResponse:function(data){var optgroup=new AJS.GroupDescriptor({label:AJS.params.frotherSuggestions,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("")}});
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){this.$content=this.options.content.call(this);callback.call(this,this.$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");if(this._supportsBoxShadow()){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){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();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};
JIRA.FormDialog=JIRA.Dialog.extend({_getDefaultOptions:function(){return AJS.$.extend(this._super(),{autoClose:false,targetUrl:"",handleRedirect:false,onUnSuccessfulSubmit:function(){},onSuccessfulSubmit:function(){},onDialogFinished:function(){if(this._hasTargetUrl()){window.location.href=this._getTargetUrlValue()}else{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;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)}}}});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");instance._submitForm(e)}});var issueId=this.$form.find("input[name=id]").val();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'>"+AJS.params.closelink+"</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(AJS.params.dirtyDialogMessage)){instance.hide();AJS.$("#keyshortscuthelp").click()}})},_setContent:function(content,decorate){this._super(content,decorate);if(content&&JIRA.Dialog.current===this){this._focusFirstField()}},_focusFirstField:function(){var triggerConfig=new JIRA.setFocus.FocusConfiguration();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()}});
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'>",AJS.params.issueActionsHint,"</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:AJS.params.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:AJS.params.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(AJS.params.dotOperations+": <span>"+issueKey+"</span>")}else{this.addHeading(AJS.params.dotOperations)}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?"warn":"error";instance._setContent(AJS.$('<div class="ajaxerror"><div class="notify '+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'>"+AJS.params.closelink+"</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()}});
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})());
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")};
JIRA.userhover=function(context){AJS.$("a.user-hover",context).bind({"mouseenter":function(){var trigger=this,options=JIRA.userhover.INLINE_DIALOG_OPTIONS,control=AJS.$.data(trigger,"AJS.InlineDialog")||AJS.$.data(trigger,"AJS.InlineDialog",{});control.hasUserAttention=true;clearTimeout(control.timerId);control.timerId=setTimeout(function(){if(control.show){control.show()}else{var $trigger=AJS.$(trigger),$popup=AJS.InlineDialog($trigger,"user-hover-dialog-"+new Date().getTime(),function($contents,control,show){JIRA.userhover.fetchDialogContents($contents,$trigger,show)},options);$popup.show();$popup.find(".contents").bind({"mouseenter":function(){control.hasUserAttention=true},"mouseleave":function(e){if(!AJS.InlineLayer.current){$trigger.mouseleave()}}});control.show=$popup.show;control.hide=$popup.hide}},options.showDelay)},"mouseleave":function(){var control=AJS.$.data(this,"AJS.InlineDialog");control.hasUserAttention=false;clearTimeout(control.timerId);if(control.hide){control.timerId=setTimeout(function(){if(!control.hasUserAttention){if(AJS.dropDown.current){AJS.dropDown.current.hide()}control.hide()}},JIRA.userhover.INLINE_DIALOG_OPTIONS.showDelay)}}})};JIRA.userhover.INLINE_DIALOG_OPTIONS={urlPrefix:contextPath+"/secure/ViewUserHover!default.jspa?decorator=none&username=",showDelay:400,closeOthers:false,noBind:true,hideCallback:function(){if(AJS.dropDown.current&&AJS.$(AJS.dropDown.current.trigger).parents(".aui-inline-dialog").length>0){AJS.dropDown.current.hide()}}};JIRA.userhover.fetchDialogContents=function($contents,$trigger,firstShow){var trigger=$trigger[0],options=JIRA.userhover.INLINE_DIALOG_OPTIONS,control=AJS.$.data(trigger,"AJS.InlineDialog");if(!control.hasContent){control.hasContent=true;AJS.$.get(options.urlPrefix+$trigger.attr("rel"),function(html){if(control.hasUserAttention){firstShow()}else{var show=control.show;control.show=function(){firstShow();control.show=show}}$contents.html(html);$contents.css("overflow","visible");AJS.Dropdown.create({trigger:$contents.find(".aui-dd-link"),content:$contents.find(".aui-list")});$contents.bind("click",options.hideCallback)})}};AJS.$(function(){JIRA.userhover(document.body)});
AJS.InlineAttach=Class.extend({_getDefaultOptions:function(){return{postUrl:contextPath+"/secure/AttachTemporaryFile.jspa"}},init:function(options){var that=this;if(typeof options==="string"){options={element:options}}options=options||{};this.options=AJS.$.extend(this._getDefaultOptions(),options);this.$container=AJS.$(this.options.element);this.$form=this.$container.closest("form");this.$container.change(function(){that.attachFile(AJS.$(this))})},_getFilename:function(fileName){if(AJS.$.browser.msie&&fileName.indexOf("\\")>=0){fileName=fileName.substring(fileName.lastIndexOf("\\")+1)}return fileName},_getAtlToken:function($element){if($element){var $form=$element.closest("form");var $atlToken=AJS.$("input[name='atl_token']",$form);if($atlToken.length>0){return $atlToken.val()}}return atl_token()},attachFile:function($input){var that=this,$fileInputContainer=$input.parent(),$originalFileInput=this._renders.fileInput($input),$attachForm=this._renders.attachForm(this.options.postUrl).append($input),$loadingSpan=this._renders.loadingSpan(this._getFilename($input.val())),postData={atl_token:this._getAtlToken($fileInputContainer)};$originalFileInput.change(function(){that.attachFile(AJS.$(this))});$fileInputContainer.parent().find("div.error").remove();AJS.$("body").append($attachForm);if(this.options.issueId){postData.id=this.options.issueId}else{postData.create=true;postData.projectId=this.options.projectId}$attachForm.ajaxForm({dataType:"json",data:postData,timeout:0,cleanupAfterSubmit:function(){$loadingSpan.remove();if(that.$form.find(".loading.file").length===0){that.$form.find("input[type=submit]").removeAttr("disabled")}$attachForm.remove()},beforeSubmit:function(){$fileInputContainer.append($loadingSpan);if($fileInputContainer.is("td")){$fileInputContainer.append(AJS.$("<div class='field-group'/>").append($originalFileInput))}else{$fileInputContainer.after(AJS.$("<div class='field-group'/>").append($originalFileInput))}if(AJS.$.browser.msie){setTimeout(function(){$originalFileInput.focus()},0)}else{$originalFileInput.focus()}that.$form.find("input[type=submit]").attr("disabled","true")},error:function(xhr){if(xhr&&xhr.responseText&&xhr.responseText.indexOf("SecurityTokenMissing")>=0){$loadingSpan.after(that._renders.errors(AJS.params.attachmentsXsrfTimeout))}else{$loadingSpan.after(that._renders.errors(AJS.params.attachmentsUnknownError))}$fileInputContainer.addClass("error");this.cleanupAfterSubmit()},success:function(response){if(response.id){$loadingSpan.after(that._renders.temporaryFileCheckbox(response))}else{if(response.errorMsg){$loadingSpan.after(that._renders.errors(response.errorMsg));$fileInputContainer.addClass("error")}}this.cleanupAfterSubmit()}});$attachForm.submit()},_renders:{attachForm:function(postUrl){return AJS.$("<form method='post' enctype='multipart/form-data' action='"+postUrl+"'/>").hide()},fileInput:function($originalInput){return $originalInput.clone().val("")},loadingSpan:function(fileName){return AJS.$("<div class='loading file'>"+fileName+"</div>")},temporaryFileCheckbox:function(response){return AJS.$("<input type='checkbox' class='checkbox' name='filetoconvert' value='"+response.id+"' title='"+response.title+"' checked><label>"+response.name+"</label>")},errors:function(errorMsg){return AJS.$("<div>"+errorMsg+"</div>")}}});jQuery.fn.inlineAttach=function(options){var res=[];this.each(function(){options=options||{};options.element=this;var context=AJS.$(this).closest("form");options.issueId=AJS.$("input[name=id]",context).val();options.projectId=AJS.$("input[name=pid]",context).val();res.push(new AJS.InlineAttach(options))});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 propertychange";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")}})();
AJS.$.fn.isDirty=function(){var isClean=true;this.find("form").add(this.filter("form")).each(function(){var initValue=AJS.$.data(this,AJS.DIRTY_FORM_VALUE);return isClean=initValue==null||initValue==AJS.$(this).find(":input[name!=atl_token]").serialize()});return !isClean};(function(){var $doc=AJS.$(document);var excluded=$doc;var oldOnbeforeunload=window.onbeforeunload;window.onbeforeunload=function(){if(oldOnbeforeunload){oldOnbeforeunload()}if(AJS.$("form").not(excluded).isDirty()&&!AJS.isSelenium()){return AJS.params.dirtyMessage}};$doc.delegate(":input","focus",function(){var theForm=this.form;setTimeout(function(){initForm.call(theForm)},50)});AJS.$(function(){setTimeout(function(){AJS.$("form").each(initForm)},50);$doc.delegate("*","submit fakesubmit",muteWarnings);AJS.$("form").bind("submit",muteWarnings)});function initForm(){if(AJS.$.data(this,AJS.DIRTY_FORM_VALUE)){return }if(AJS.$(this).is("#jqlform, #quicksearch, #issue-create-quick, #issue-actions-dialog-form, .userpref-form")){return }AJS.$.data(this,AJS.DIRTY_FORM_VALUE,AJS.$(this).find(":input[name!=atl_token]").serialize())}$doc.delegate("a.cancel,#cancelButton,#refresh-dependant-fields,form#tabForm table#field_table a","mousedown keydown click",muteWarnings);function muteWarnings(){excluded=this.form||AJS.$(this).closest("form");if(this.id==="cancelButton"){AJS.$(this).one("click",restoreWarnings)}else{restoreWarnings()}}function restoreWarnings(){setTimeout(function(){excluded=$doc},500)}})();
jQuery.fn.overlabel=function(){this.each(function(){var label=AJS.$(this).removeClass("overlabel").addClass("overlabel-apply show").click(function(){AJS.$("#"+AJS.$(this).attr("for")).focus()});var field=AJS.$("#"+label.attr("for")).focus(function(){label.removeClass("show").hide()}).blur(function(){if(AJS.$(this).val()===""){label.addClass("show").show()}});if(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);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);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()}});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();$nextPage=$pager.find("a.icon-next");$previousPage=$pager.find("a.icon-previous");if(AJS.thisPage("blurSearch")){AJS.$(document.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 msgText=AJS.params[selectedIssueMsg];if(msgText&&selectedIssueKey){msgText=AJS.format(msgText,selectedIssueKey);var $msgContainer=$("#affectedIssueMsg");if($msgContainer.length>0){$msgContainer.html('<div class="noteBox">'+msgText+"</div>")}else{$msgContainer=$('<div id="affectedIssueMsg"><div class="noteBox">'+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(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"})});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")}})});new JIRA.IssuePicker({element:AJS.$("#linkKey"),userEnteredOptionsMsg:AJS.params.enterIssueKey,uppercaseUserEnteredOnSelect:true})});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(){AJS.$("#fetchLicense").click(function(){var formValues=AJS.$("form[name='jiraform']").serializeArray();var url=AJS.$(this).attr("data-url");AJS.$.get(url,formValues,function(){return false})})});
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(),issuePicker=new JIRA.IssuePicker({element:AJS.$("#linkKey",context),userEnteredOptionsMsg:AJS.params.enterIssueKey,uppercaseUserEnteredOnSelect:true});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}})}})}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")});AJS.$("#dashboard").find(".aui-dd-parent").dropDown("Standard",{trigger:"a.aui-dd-link"});AJS.$("#main-nav").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(jQuery){jQuery.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",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",224:"meta"}};var comboIndex=0;var timerId=0;var lastHandleObj=null;var activeHandler=null;var activeCombo=false;function resetComboState(){comboIndex=0;activeCombo=false}function keyHandler(handleObj){if(!(typeof handleObj.data==="string"||jQuery.isArray(handleObj.data)||(handleObj.data&&handleObj.data.combo))){return }var origHandler=handleObj.handler,options={timer:700};(function(data){if(typeof data==="string"){options.combo=[data]}else{if(jQuery.isArray(data)){options.combo=data}else{jQuery.extend(options,data)}}})(handleObj.data);handleObj.combo=options.combo;handleObj.index=0;handleObj.handler=function(event){if(event.target!==this&&jQuery(event.target).is(":input")){return }var keyIsCharacterInput=(event.type==="keypress"&&event.which>0);var key=(keyIsCharacterInput)?String.fromCharCode(event.which):jQuery.hotkeys.specialKeys[event.which||event.keyCode];var modifier="";var result=true;if(!key){return }if(event.ctrlKey&&key!=="ctrl"){modifier+="ctrl+"}if(event.altKey&&key!=="alt"){modifier+="alt+"}if(event.metaKey&&!event.ctrlKey&&key!=="meta"){modifier+="meta+"}if(!keyIsCharacterInput&&event.shiftKey&&key!=="shift"){modifier+="shift+"}if(handleObj.index>=comboIndex&&comboIndex<options.combo.length&&options.combo[comboIndex]===modifier+key){if(comboIndex+1<options.combo.length){handleObj.index++;activeCombo=true}else{if(!activeCombo){handleObj.index=0;activeHandler=origHandler}}}else{handleObj.index=0}if(handleObj===lastHandleObj){clearTimeout(timerId);if(activeCombo){comboIndex++;timerId=setTimeout(resetComboState,750)}else{if(activeHandler){result=activeHandler.apply(this,arguments);activeHandler=null}comboIndex=0}activeCombo=false}return result};lastHandleObj=handleObj}jQuery.each(["keydown","keyup","keypress"],function(){jQuery.event.special[this]={add:keyHandler}})})(jQuery);
AJS.KeyboardShortcut=function(keys){this._executer=null;this._keys=jQuery.isArray(keys)?keys:[keys];this._bindKeys(this._keys)};AJS.KeyboardShortcut.prototype._bindKeys=function(keys){var that=this;jQuery(document).bind("keydown keypress",keys,function(e){if(that._executer&&!AJS.popup.current&&!AJS.dropDown.current&&!JIRA.Dialog.current){if(AJS.InlineDialog.current){AJS.InlineDialog.current.hide()}that._executer(e);e.preventDefault()}})};AJS.KeyboardShortcut.prototype._addShortcutTitle=function(selector){var elem=jQuery(selector),title=elem.attr("title")||"",keyArr=this._keys.slice(0);if(elem.data("kbShortcutAppended")){this._appendShortcutTitle(elem,keyArr,title);return }title+=" ( "+AJS.params.keyType+" '"+keyArr.shift()+"'";jQuery.each(keyArr,function(){title+=" "+AJS.params.keyThen+" '"+this+"'"});title+=" )";elem.attr("title",title);elem.data("kbShortcutAppended",true)};AJS.KeyboardShortcut.prototype._appendShortcutTitle=function(elem,keyArr,title){title=title.replace(/\)$/," OR ");title+="'"+keyArr.shift()+"'";jQuery.each(keyArr,function(){title+=" "+AJS.params.keyThen+" '"+this+"'"});title+=" )";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(keys){this._bindKeys(keys);return this};AJS.whenIType=function(keys){return new AJS.KeyboardShortcut(keys)};if(jQuery.browser.webkit){jQuery(document).bind("iframeAppended",function(e,iframe){jQuery(iframe).load(function(){jQuery(iframe).contents().bind("keyup keydown keypress",function(event){if(!jQuery(event.target).is(":input")){jQuery(document).trigger(event)}})})})};
AJS.whenIType.fromJSON=function(json){function blurTargetField(e){if(e.keyCode===27&&jQuery(e.target).is(":input")){jQuery(e.target).blur()}}if(json){jQuery(document).keyup(blurTargetField);jQuery(document).bind("iframeAppended",function(e,iframe){jQuery(iframe).load(function(){var jQuery;if(iframe.contentWindow&&iframe.contentWindow.jQuery){jQuery=iframe.contentWindow.jQuery;jQuery("body").keyup(blurTargetField)}})});jQuery.each(json,function(){var allKeys=Function.prototype.call.apply(Array.prototype.concat,this.keys);AJS.whenIType(allKeys)[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=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.$(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).keydown(function(e){if(createDialog.is(":visible")&&e.which==27&&!AJS.$(e.target).is(":input")){hideFunction()}})})});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)}});
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};

