/*
 * 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.2.0",params:{},$:jQuery,log:function(E){if(typeof console!="undefined"&&console.log){console.log(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}};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";X[this.method](true);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});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","auto");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]});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="svg-icon close size-16"></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="svg-icon {type} size-18"></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);
jQuery.noConflict();
AJS.$.ajaxSetup({traditional:true});AJS.isIE6=!window.XMLHttpRequest;AJS.applyPngFilter=function(A,C,B){if(!AJS.isIE6){return false}C=C||A.src;B=B||"scale";A.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+C+"', sizingMethod='"+B+"')";return true};
(function(A){AJS.Data=A.extend({},AJS.Data,{get:function(B){return A("meta[name=ajs-"+B+"]").attr("content")}})})(AJS.$);
AJS.ConfluenceDialog=function(A){var B;A=A||{};A=jQuery.extend({},{keypressListener:function(C){if(C.keyCode===27){if(!jQuery(".aui-dropdown",B.popup.element).is(":visible")){if(typeof A.onCancel=="function"){A.onCancel()}else{B.hide()}}}else{if(C.keyCode===13){if(!jQuery(".aui-dropdown",B.popup.element).is(":visible")){var D=C.target.nodeName&&C.target.nodeName.toLowerCase();if(D!="textarea"&&typeof A.onSubmit=="function"){A.onSubmit()}}}}},width:865,height:530},A);B=new AJS.Dialog(A);jQuery.aop.around({target:B,method:"addButton"},function(C){if(C.arguments[0]){C.arguments[0]=AJS.I18n.getText(C.arguments[0])}return C.proceed()});return B};AJS.toInit(function(A){A(document).bind("showLayer",AJS.Confluence.runBinderComponents)});
Raphael.spinner=function(J,F,H){var N=H||"#fff",M=F*13/60,Q=F*35/60,O=F,D=O+M,C=O+M,L=Raphael(J,O*2+M*2,O*2+M*2),K=[],E=[],S=2*Math.PI/12,I={stroke:N,"stroke-width":M,"stroke-linecap":"round"};for(var P=0;P<12;P++){var G=S*P-Math.PI/2,B=Math.cos(G),A=Math.sin(G);E[P]=P/12;K[P]=L.path([["M",D+Q*B,C+Q*A],["L",D+O*B,C+O*A]]).attr(I)}var R;(function T(){E.unshift(E.pop());for(var U=0;U<12;U++){K[U].attr("opacity",E[U])}L.safari();R=setTimeout(T,80)})();return function(){clearTimeout(R);L.remove()}};
AJS.REST = (function($) {
    var baseUrl = "/rest/prototype/1/";

    AJS.safeHTML = function (html) {
        return html.replace(/[<>&"']/g, function (symbol) {
            return "&#" + symbol.charCodeAt() + ";";
        });
    };

    /**
     * Converts a single object in REST format into an object in the format expected by AJS.dropDown.
     */
    var getDropdownObjectForRestResult = function (result) {
        if (!result) {
            AJS.log("REST result is null");
            return null;
        }
        if (!result.link || !$.isArray(result.link)) {
            AJS.log("No link for result with title: " + result.title);
            return null;
        }
        if (!result.title) {
            AJS.log("No title for result with id: " + result.id);
            return null;
        }
        var obj = {
            href : encodeURI(AJS.REST.findLink(result.link)),
            name : AJS.safeHTML(result.title),
            spaceName: AJS.safeHTML(AJS.REST.findSpaceName(result)),
            restObj : result
        };
        if (result.thumbnailLink) {
            var versionQuery = result.version ? "?version="+result.version + "&modificationDate=" : "";
            obj.icon = result.thumbnailLink.href + versionQuery;
        } else {
            obj.className = result.iconClass || "content-type-" + result.type + (result.type == "space" ? "desc" : "");
        }
        return obj;
    };

    return {

        getBaseUrl: function() {
            return baseUrl;
        },
        /**
         * Iterates through the links array to find the first matching link of the given type and rel.
         * @param links typically the link field on a REST JSON object
         * @param type type of link. Defaults to "text/html" if not defined.
         * @param rel relationship of the link. Defaults to "alternate".
         */
        findLink: function(links, type, rel) {
            if (!type) type = "text/html";
            if (!rel) rel = "alternate";
            if (AJS.$.isArray(links)) {
                for (var i=0,ii=links.length; i<ii; i++) {
                    var link = links[i];
                    if (link.type == type && link.rel == rel) {
                        return link.href;
                    }
                }
            }
            return "#";
        },

        findSpaceName: function(restObj){
            if (restObj.space){
                return restObj.space.name;
            }
            return "";
        },

        /**
         * Converts a matrix in REST format into a matrix in the format expected by AJS.dropDown.
         *
         * @param restMatrix matrix of objects in Confluence REST format
         * @return matrix of objects in Confluence drop-down format
         */
        convertFromRest: function (restMatrix) {
            var matrix = [], catArray, obj;
            for (var i = 0, len = restMatrix.length; i < len; i++) {
                catArray = [];
                for (var j = 0, len2 = restMatrix[i].length; j < len2; j++) {
                    obj = getDropdownObjectForRestResult(restMatrix[i][j]);
                    obj && catArray.push(obj);
                }
                catArray.length && matrix.push(catArray);
            }
            return matrix;
        },

        /**
         * Given an ContentEntityObject's REST data construct the alias, destination, href and wiki-markup.
         *
         * @param data - the content data in REST format
         */
        wikiLink : function (data) {
            var alias = data.title,
                destination = data.wikiLink.slice(1, -1); // remove the [ and ]

            // CONF-18940 strip off the space key and page title if linking to an attachment on the current page
            if (data.type == "attachment" && data.space && data.space.key == AJS.params.spaceKey &&
                data.ownerId == AJS.params.attachmentSourceContentId) {
                    destination = destination.substring(destination.indexOf("^"));
            }

            var wikiMarkup = (alias != destination ? (alias + "|") : "") + destination;
            AJS.log("tinymce.confluence.Autocompleter.Manager.makeLinkDetails =>" + wikiMarkup);

            return {
                alias : alias,
                destination : destination,
                href : this.findLink(data.link),
                wikiMarkup : wikiMarkup
            };
        },

        /**
         * Converts an object in REST format into a matrix containing the REST data.
         *
         * @async - called from an AJAX callback method
         * @param restObj object in Confluence REST format
         */
        makeRestMatrixFromData: function (restObj, suggestionField) {
            var restMatrix = [];
            var resultArr = eval("restObj." + suggestionField);
            if (resultArr && resultArr.length)
                    restMatrix.push(resultArr);
            return restMatrix;
        },

        /**
         * Converts an object in REST format into a matrix containing the search REST data.
         *
         * @async - called from an AJAX callback method
         * @param restObj object in Confluence REST format
         * @param suggestionField - the name of the field in the resObj that stores the suggestion. If null, "group" is used.
         * The "group" is the field used for in the /search/name REST service. 
         */
        makeRestMatrixFromSearchData: function(restObj, suggestionField) {
            var restMatrix = [];
            suggestionField = suggestionField || "group";
            var resultArr = eval("restObj." + suggestionField);
            if (resultArr) {

                var set = {
                    content: [],
                    attachment: [],
                    userinfo: [],
                    spacedesc: [],
                    page: [],
                    blogpost: [],
                    comment: [],
                    personalspacedesc: [],
                    mail: []
                };
                for (var i = 0, ii = resultArr.length; i < ii; i++) {
                    var group = resultArr[i];
                    set[group.name] && set[group.name].push(group.result);
                }

                // This line determines the order that the search sections appear. Don't change this unless you have to.
                restMatrix = restMatrix.concat(set.content, set.attachment, set.userinfo, set.spacedesc, set.page, set.blogpost, set.comment, set.personalspacedesc, set.mail);
            }
            else {
                log("makeRestMatrixFromData", "WARNING: Unknown rest object", restObj);
            }

            return restMatrix;
        }
    };
})(AJS.$);


var JSON=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);}
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(A){AJS.Confluence={getContextPath:function(){return AJS.Data.get("context-path")},getBuildNumber:function(){return AJS.Data.get("build-number")},runBinderComponents:function(){AJS.log("AJS.Confluence: run binder components");for(var B in AJS.Confluence.Binder){if(AJS.Confluence.Binder.hasOwnProperty(B)){try{AJS.Confluence.Binder[B]()}catch(C){AJS.log("Exception in initialising of component '"+B+"': "+C.message)}}}},placeFocus:function(){AJS.Confluence.Binder.placeFocus()}};AJS.Confluence.Binder={placeFocus:function(){var C,B=-1;AJS.$("input[data-focus]").each(function(){var E=AJS.$(this),D=E.attr("data-focus");if(D>B){B=D;C=E}});C&&C.focus()}};AJS.toInit(function(){AJS.Confluence.runBinderComponents()})})(AJS.$);
AJS.Confluence.cacheManager=function(C){var A={},B=[],C=C||30;return{get:function(D){return A[D]},put:function(D,E){A[D]=E;B.push(D);if(B.length>C){delete A[B.shift()]}},clear:function(){A={};B=[]}}};
(function(E){var D=function(G){AJS.log("InputDrivenDropDown: truncating text");var I=G.$.closest(".aui-dd-parent").width(),H=20;E("a span:not(.icon)",G.$).each(function(){var K=E(this),J=AJS("var","&#8230;"),M=J.width(),L=false;K.wrapInner(E("<em>"));E("em",K).each(function(){var N=E(this);N.show();if(this.offsetLeft+this.offsetWidth+M>I-H){var U=this.childNodes,T=false;for(var P=U.length-1;P>=0;P--){var Q=U[P],O=1,S=(Q.nodeType==3)?"nodeValue":"innerHTML",R=Q[S];do{if(O<=R.length){Q[S]=R.substr(0,R.length-O++)}else{break}}while(this.offsetLeft+this.offsetWidth+M>I-H);if(O<=R.length){T=true;break}}if(T){L=true}else{N.hide()}}});if(L){K.append(J);this.elpss=J}})};var B=function(G,L){if(!L.length||!L[0]){return }AJS.log("InputDrivenDropDown: highlighting tokens");for(var I=0,J=L.length;I<J;I++){var H=L[I];L[I]=H?H.replace(/[\.\*\+\?\|\(\)\[\]{}\\]/g,"\\$"):""}var K=new RegExp("("+L.join("|")+")","gi");E("li a:not(.dropdown-prevent-highlight) span",G.$).each(function(){var N=E(this),M=N.html().replace(K,"<strong>$1</strong>");N.html(M)})};var C=function(G){AJS.log("InputDrivenDropDown: add space names");E("a span:not(.icon)",G.$).each(function(){var J=E(this);var H;try{H=AJS.dropDown.getAdditionalPropertyValue(J,"spaceName")}catch(I){AJS.log("Problem getting space name: "+I.message)}var K=J.text();if(H){K+=" ("+AJS("i").html(H).text()+")"}J.attr("title",K)})};var F=function(K,H){var J=K.options,I=K.dd;if(I){I.hide();I.$.remove()}J.ajsDropDownOptions=J.ajsDropDownOptions||{};if(J.ajsDropDownOptions&&!J.ajsDropDownOptions.alignment){J.ajsDropDownOptions.alignment="left"}J.ajsDropDownOptions.selectionHandler=J.ajsDropDownOptions.selectionHandler||function(M,L){if(M.type!="click"){M.preventDefault();E("a",L).click();document.location=E("a",L).attr("href")}};var G=K.dd=AJS.dropDown(H.matrix,J.ajsDropDownOptions)[0];if(J.ajsDropDownOptions&&J.ajsDropDownOptions.className){G.$.addClass(J.ajsDropDownOptions.className)}if(J.dropdownPlacement){J.dropdownPlacement(G.$)}else{AJS.log("No dropdownPlacement function specified. Appending dropdown to the body.");E("body").append(G.$)}B(G,H.queryTokens||[H.query]);D(G);C(G);if(J.dropdownPostprocess){J.dropdownPostprocess(G.$)}G.show(K._effect);if(typeof J.onShow=="function"){J.onShow.call(G,G.$)}return G};function A(H,G){this._effect="appear";this._timer=null;this.id=H;this.options=G;this.inactive=false;this.busy=false;this.cacheManager=AJS.Confluence.cacheManager()}A.prototype.clearCache=function(){this.cacheManager.clear()};A.prototype.change=function(I,H){var G=this;if(I!=G._value){G._value=I;G.busy=false;clearTimeout(G._timer);if(H||(/\S{2,}/).test(I)){var J=G.cacheManager.get(I);if(J){F(G,J)}else{G.busy=true;G._timer=setTimeout(function(){G.options.getDataAndRunCallback.call(G,I,G.show)},200)}}else{G.dd&&G.dd.hide()}}};A.prototype.hide=function(){this.dd&&this.dd.hide()};A.prototype.remove=function(){var G=this.dd;if(G){this.hide();G.$.remove()}this.inactive=true;this.options.onDeath&&this.options.onDeath()};A.prototype.show=function(H,J,I){if(this.inactive){AJS.log("Quick search abandoned before server response received, ignoring. "+this);return }var G={matrix:H,query:J,queryTokens:I};this.cacheManager.put(J,G);F(this,G);this.busy=false};AJS.inputDrivenDropdown=function(G){return new A("inputdriven-dropdown",G)}})(jQuery);
(function(A){A.fn.quicksearch=function(F,I,E){if(I){E.onShow=I}E.makeParams=E.makeParams||function(J){return{query:J}};var C=function(L){var M=L.statusMessage;var K;if(M){K=[[{html:L.statusMessage,className:"error"}]]}else{if(E.makeRestMatrixFromData){var J=E.makeRestMatrixFromData(L);K=AJS.REST.convertFromRest(J);if(E.addDropdownData){K=E.addDropdownData(K)}}else{K=L.contentNameMatches}}return K};var D,H;if(typeof F=="function"){H=F(),D=function(K){var J=F();if(J!=H){H=J;K.clearCache()}return J}}else{D=function(){return F}}E.getDataAndRunCallback=E.getDataAndRunCallback||function(M,N){var L=this,K=D(L,M),J=AJS.Data.get("context-path")||"";AJS.$.ajax({type:"GET",dataType:"json",url:J+K,data:E.makeParams(M),success:function(P,Q){A(window).trigger("quicksearch.ajax-success",{url:K,json:P,resultStatus:Q});var O=C(P);N.call(L,O,M,P.queryTokens)},global:false,timeout:5000,error:function(R,P,Q){A(window).trigger("quicksearch.ajax-error",{url:K,xmlHttpRequest:R,resultStatus:P,errorThrown:Q});if(P=="timeout"){var O=C({statusMessage:"Timeout",query:M});N.call(L,O,null)}}})};var G=AJS.inputDrivenDropdown(E),B=A(this);B.keyup(function(J){if(J.which==13||J.which==9){return }!B.hasClass("placeholded")&&G.change(this.value)});B.quickSearchControl=G;return B}})(jQuery);
AJS.Confluence.Binder.placeholder=function(){var B=AJS.$;var A=document.createElement("input");if("placeholder" in A){return }B("input[placeholder][data-placeholder-bound!=true],input.default-text[data-placeholder-bound!=true]").each(function(){var E=B(this).attr("data-placeholder-bound","true"),C=E.attr("placeholder")||E.attr("data-default-text"),D=function(){if(!B.trim(E.val()).length){E.val(C).addClass("placeholded").trigger("reset.placeholder");E.trigger("reset.default-text")}};D();E.blur(D).focus(function(){if(E.hasClass("placeholded")){E.val("");E.removeClass("placeholded")}})})};AJS.Confluence.Binder.inputDefaultText=AJS.Confluence.Binder.placeholder;
AJS.Confluence.Binder.insertOnEvent=function(){var A=AJS.$;A(".insert-on-event[data-inserter-bound!=true]").each(function(){var F=A(this).attr("data-inserter-bound","true"),E=A(F.attr("data-target"))[0],C=F.attr("data-event"),D=F.attr("data-insert-position"),B=F.attr("data-insert-unique-key");if(E&&C&&D){A(self).bind(C,function(J,I){if(E==I.target){if(B){var G=I.content[B],H={};A(".key-holder",D).each(function(){H[A(this).attr("data-key")]=true});if(G in H){return }}A(D).append(AJS.template(F.text()).fill(I.content))}})}})};
AJS.Confluence.Binder.autocompleteUser=function(B){B=B||document.body;var C=AJS.$;var A=function(E){if(!E||!E.result){throw new Error("Invalid JSON format")}var D=[];D.push(E.result);return D};C("input.autocomplete-user[data-autocomplete-user-bound!=true]",B).each(function(){var F=C(this).attr("data-autocomplete-user-bound","true").attr("autocomplete","off");var E=F.attr("data-max")||10,H=F.attr("data-alignment")||"left",G=F.attr("data-dropdown-target"),D=null;if(G){D=C(G)}else{D=C("<div></div>");F.after(D)}D.addClass("aui-dd-parent autocomplete");F.quicksearch(AJS.REST.getBaseUrl()+"search/user.json",function(){F.trigger("open.autocomplete-user")},{makeParams:function(I){return{"max-results":E,query:I}},dropdownPlacement:function(I){D.append(I)},makeRestMatrixFromData:A,addDropdownData:function(I){if(!I.length){var J=F.attr("data-none-message");if(J){I.push([{name:J,className:"no-results",href:"#"}])}}return I},ajsDropDownOptions:{alignment:H,displayHandler:function(I){if(I.restObj&&I.restObj.username){return I.name+" ("+I.restObj.username+")"}return I.name},selectionHandler:function(N,K){if(K.find(".search-for").length){F.trigger("selected.autocomplete-user",{searchFor:F.val()});return }if(K.find(".no-results").length){this.hide();N.preventDefault();return }var I=C("span:eq(0)",K).data("properties"),O=I.restObj.username,L=F.attr("data-target"),M=L&&C(L),J=F.attr("data-template")||"{username}";F.val(AJS.template(J).fillHtml(I.restObj));M&&M.val(O);F.trigger("selected.autocomplete-user",{content:I.restObj});this.hide();N.preventDefault()}}})})};
(function(){var B=AJS.$;var A=function(F){if(!F||!F.group){throw new Error("Invalid JSON format")}var E=[];for(var G=0,H=F.group.length;G<H;G++){E.push(F.group[G].result)}return E};var D=function(O,I,F,G){var N=B(O),S="data-autocomplete-content-bound";if(N.attr(S)){return }if(typeof I=="string"){I=[I]}N.attr(S,"true").attr("autocomplete","off");var P=I.join(","),H=N.attr("data-max")||10,M=N.attr("data-alignment")||"left",L=N.attr("data-spacekey"),K=N.attr("data-none-message"),R=N.attr("data-template")||F,E=N.attr("data-target"),J=N.attr("data-dropdown-target"),Q=null;if(J){Q=B(J)}else{Q=B("<div></div>");N.after(Q)}Q.addClass("aui-dd-parent autocomplete");N.quicksearch(AJS.REST.getBaseUrl()+"search/name.json",null,{onShow:function(){N.trigger("open.autocomplete-content",{contentTypes:I})},makeParams:function(U){var T={"max-results":H,type:P,query:U};if(L){T.spaceKey=L}return T},dropdownPlacement:function(T){Q.append(T)},makeRestMatrixFromData:A,addDropdownData:function(T){if(!T.length){if(K){T.push([{name:K,className:"no-results",href:"#"}])}}return T},ajsDropDownOptions:{alignment:M,displayHandler:G,selectionHandler:function(W,U){if(U.find(".search-for").length){N.trigger("selected.autocomplete-content",{contentTypes:I,searchFor:N.val()});return }if(U.find(".no-results").length){AJS.log("no results selected");this.hide();W.preventDefault();return }var T=U.data("properties");N.val(AJS.template(R).fillHtml(T.restObj));if(E){var V=AJS.template(F).fillHtml(T.restObj);B(E).val(V)}N.trigger("selected.autocomplete-content",{contentTypes:I,content:T.restObj,selection:U});this.hide();W.preventDefault()}}})};AJS.Confluence.Binder.autocompleteSpace=function(E){E=E||document.body;B("input.autocomplete-space",E).each(function(){D(this,["spacedesc","personalspacedesc"],"{name}",function(F){return F.name})})};AJS.Confluence.Binder.autocompleteAttachment=function(E){E=E||document.body;B("input.autocomplete-attachment",E).each(function(){D(this,"attachment","{fileName}",function(F){var G=(F.restObj&&F.restObj.fileName)||F.name;if(F.restObj&&F.restObj.space&&F.restObj.space.title){G+=" ("+F.restObj.space.title+")"}return G})})};var C=function(E){return(E.restObj&&E.restObj.title)||E.name};AJS.Confluence.Binder.autocompletePage=function(E){E=E||document.body;B("input.autocomplete-page",E).each(function(){D(this,"page","{title}",C)})};AJS.Confluence.Binder.autocompleteBlogpost=function(E){E=E||document.body;B("input.autocomplete-blogpost",E).each(function(){D(this,"blogpost","{title}",C)})};AJS.Confluence.Binder.autocompleteConfluenceContent=function(E){E=E||document.body;B("input.autocomplete-confluence-content",E).each(function(){D(this,["page","blogpost"],"{title}",C)})}})();
AJS.Confluence.Binder.userHover=(function(){var E=[],B=AJS.Confluence.getContextPath(),D=AJS.$;var A=function(H){var G=E[H],F={username:G,target:this};D(self).trigger("hover-user.open",F);D(".ajs-menu-bar",this).ajsMenu();D(".follow-icon, .unfollow-icon",this).each(function(){var I=D(this).click(function(K){if(I.hasClass("waiting")){return }var J=I.hasClass("unfollow-icon")?"/unfollowuser.action":"/followuser.action";I.addClass("waiting");AJS.safe.post(B+J+"?username="+G+"&mode=blank",function(){I.removeClass("waiting");I.parent().toggleClass("follow-item").toggleClass("unfollow-item");D(self).trigger("hover-user.follow",F)});return AJS.stopEvent(K)})})};var C=["span.user-hover-trigger","a.confluence-userlink","img.confluence-userlink","a.userLogoLink"].join(", ");return function(){D(C).filter("[data-user-hover-bound!=true]").each(function(){var G=D(this),H=G.attr("data-username");G.attr("title","").attr("data-user-hover-bound","true");D("img",G).attr("title","");var F=D.inArray(H,E);if(F==-1){E.push(H);F=D.inArray(H,E)}D(this).addClass("userlink-"+F)});D.each(E,function(F){AJS.contentHover(D(".userlink-"+F),F,B+"/users/userinfopopup.action?username="+E[F],A)})}})();
AJS.Confluence.Binder.comments=function(){var C=AJS.$;if(C(window).data("comments-bound")){AJS.log("Currently, this comment binding can only be done once per page");return }var B=function(J){var H=function(L,K){return{animate:function(M){L.style.height=AJS.animation.interpolate(M,48,24,K)+"px";L.style.width=L.style.height;L.style.marginLeft=AJS.animation.interpolate(M,0,12,K)+"px"},onFinish:function(){L.style.height="";L.style.width="";L.style.marginLeft=""}}};var F=function(L,K){return{start:1,end:0,reverse:K,animate:function(M){L.style.opacity=M;L.style.filter="alpha(opacity="+(M*100)+")"},onFinish:function(){L.style.opacity="";L.style.filter="alpha(opacity="+(K?100:0)+")"}}};var I=function(L,K){if(!K){L.originalHeight=jQuery(L).height()}return{start:L.originalHeight||50,end:0,reverse:K,animate:function(M){L.style.height=M+"px"},onFinish:function(){L.style.height=""}}};var E=jQuery(J).find(".comment-body")[0];var G=J.className.indexOf("collapsed")>=0;return AJS.animation.combine([H(jQuery(J).parent().find(".comment-user-logo img, .comment-user-logo .replacement")[0],G),F(E,G),F(jQuery(J).find(".excerpt")[0],!G),I(E,G),{onFinish:function(){if(G){jQuery(J).removeClass("collapsed")}else{jQuery(J).addClass("collapsed")}}}])};var D=function(){var E=this;C(E).unbind("click");AJS.animation.add(B(C(E).parent()[0]));AJS.animation.add({onFinish:function(){C(E).click(D)}});AJS.animation.start()};if(AJS.isIE6){C(".logo.anonymous").each(function(){var E=document.createElement("div");E.className="replacement";AJS.applyPngFilter(E,this.src);C(this).replaceWith(E)});C(".comment-actions .comment-permalink a").each(function(){C(this).addClass("filtered");var F=C(this).css("background-image").replace(/^url\(\"?|\"?\)$/g,"");var E=F.replace("light","dark");AJS.applyPngFilter(this,F);this.style.cursor="pointer";this.style.background="none";C(this).hover(function(){AJS.applyPngFilter(this,E)},function(){AJS.applyPngFilter(this,F)})})}C("#comments-section .comment:odd").addClass("odd");C(".comment-action-remove a").click(function(){if(confirm(AJS.params.deleteCommentConfirmMessage)){this.href=this.href+"&confirm=yes";return true}return false});C("#comments-hide").click(function(){C("#page-comments").addClass("hidden");C(this).addClass("hidden");C("#comments-show").removeClass("hidden");C("#comments-expand-collapse").addClass("hidden");return false});C("#comments-show").click(function(){C("#page-comments").removeClass("hidden");C(this).addClass("hidden");C("#comments-hide").removeClass("hidden");C("#comments-expand-collapse").removeClass("hidden");return false});C("#comments-collapse").click(function(){C(this).addClass("hidden");C("#collapse-wait").removeClass("hidden");C(".comment:lt(10):not(.collapsed,.add,.reply,.edit)").each(function(){AJS.animation.add(B(this))});AJS.animation.add({onFinish:function(){C("#collapse-wait").addClass("hidden");C("#comments-expand").removeClass("hidden");C(".comment:not(.add,.reply,.edit)").addClass("collapsed")}});AJS.animation.start();return false});C("#comments-expand").click(function(){C(this).addClass("hidden");C("#expand-wait").removeClass("hidden");C(".comment:lt(10).collapsed").each(function(){AJS.animation.add(B(this))});AJS.animation.add({onFinish:function(){C("#expand-wait").addClass("hidden");C("#comments-collapse").removeClass("hidden");C(".comment").removeClass("collapsed")}});AJS.animation.start();return false});var A=C(".comment-toggle");if(A.length){A.css("cursor","pointer").attr("title",AJS.params.collapseTooltip).click(D)}C(window).data("comments-bound","true")};
AJS.Confluence.Heartbeat=function(){var A=function(){AJS.$.ajax({type:"POST",dataType:"json",global:false,timeout:5000,data:{},url:AJS.Confluence.getContextPath()+"/json/heartbeat.action",success:function(B){AJS.log("sendHeartbeat result: "+B.success)},error:function(C,B){AJS.log("sendHeartbeat error: "+B)}})};if(this.timer){return }AJS.log("Starting confluence heartbeat");A();this.timer=setTimeout(function(){A()},60000)};
(function(D){var B=function(F){var E=D(".aui-tip-parent");E=AJS.$('<div class="aui-tip-parent"></div>');var H=-11;if(AJS.$.browser.msie){H=(parseInt(AJS.$.browser.version,10)<8)?-5:-13}E.css({top:H,left:10});F.prepend(E).css({zIndex:3001});var G=Raphael(E[0],12,6);G.path("M0.001,6.001l6.001-6.001,6.001,6.001").attr({fill:"#f0f0f0",stroke:"#e2e2e2"});G.canvas.style.zIndex=3000;tip=G;return G};var C=function(E){return Raphael.shadow(0,0,E.outerWidth(true),E.outerHeight(true),{radius:5,target:E,offset:2})};var A=function(F,E){E=E||{};setTimeout(function(){var I=AJS.Editor.Adapter.offset(F.anchor),O=F.panel.width()+I.left-D(window).width()+10,R=7,G=0,J=D(F.anchor).outerHeight(),N=I.top+J+R,H=I.left-(O>0?O:0)-G;if(F.options.anchorIframe){var Q=D(F.options.anchorIframe);var M=Q.offset().top+Q.height();N=Math.min(N,M)}F.panel.find(".aui-tip-parent").css({left:Math.abs(I.left-H)+10});var L={top:N,left:H};var P=F.panel.add(F.shadow),K=function(){F.shadow.css("left",F.panel.position().left-1)};E.animate?P.animate(L,E.animateDuration,K):(function(){P.css(L);K()})()},E.delay||0)};AJS.Confluence.PropertyPanel={current:null,createFromButtonModel:function(F,K,N){var E=AJS("div").attr({"class":"panel-buttons"});for(var H=0,M=K.length;H<M;H++){if(!K[H]){continue}var I=K[H],J=I.html||'<span class="icon"></span><span class="panel-button-text">'+(I.text||"")+"</span>",G=[];I.className&&G.push(I.className);I.disabled&&G.push("disabled");I.selected&&G.push("selected");!K[H+1]&&G.push("last");!K[H-1]&&G.push("first");var L=AJS("a").attr({href:K[H].href||"#","class":G.join(" ")}).html(J);K[H].tooltip&&L.attr("title",K[H].tooltip);if(I.disabled){L.attr("title",I.disabledText);L.disable();L.click(function(O){return AJS.stopEvent(O)})}else{K[H].click&&(function(P,O){O.click(function(Q){P.click(O);return AJS.stopEvent(Q)})})(K[H],L)}E.append(L)}return this.create(F,E,N)},create:function(G,J,F){F=F||{};AJS.Editor.Adapter.storeCurrentSelectionState();var H=D("#property-panel"),E;H.length&&this.destroy();H=AJS("div").addClass("aui-property-panel-parent").attr("id","property-panel").appendTo("body");E=AJS("div").addClass("aui-property-panel").append(J);H.append(E).css({top:0,left:-10000});var I=this;J.find(".last:last").css({margin:0});var L=C(H),K=B(H);this.current={anchor:G,panel:H,isAnchor:function(M){return I.isAnchor(M)},snapToElement:function(M){A(this,M)},shadow:L,tip:K,options:F,updating:true};A(this.current);E=this.current;AJS.$(document).bind("keydown.property-panel.escape",function(M){if(M.keyCode===27){AJS.Confluence.PropertyPanel.destroy()}});AJS.$(document).bind("click.property-panel",function(M){if(!AJS.$(M.target).closest("#property-panel").length){AJS.Confluence.PropertyPanel.destroy()}});AJS.trigger("created.property-panel",this.current);this.current.updating=false;return this.current},destroy:function(){if(!this.current){AJS.log("PropertyPanel.destroy: called with no current PropertyPanel, returning");return }if(this.current.updating){AJS.log("PropertyPanel.destroy: called while updating, returning");return }AJS.trigger("destroyed.property-panel",this.current);AJS.unbind("destroyed.property-panel");AJS.$(document).unbind(".property-panel");this.current.panel.remove();this.current.shadow.remove();this.current=null},isAnchor:function(E){return this.current&&D(this.current.anchor)[0]==D(E)[0]}}})(AJS.$);
AJS.toInit(function(A){AJS.applySearchPlaceholders=function(C){var B=A(".quick-search-query, input[type=search]",C);if(!B.length){return }B.each(function(){$searchBox=A(this);$searchBox.data("quicksearch",{placeholder:$searchBox.attr("placeholder")||$searchBox.closest("form").find("input[type='submit']").val(),placeholded:true})});if(!A.browser.safari){B.val(B.data("quicksearch").placeholder);B.addClass("placeholded");B.focus(function(){var D=A(this);if(D.data("quicksearch").placeholded){D.data("quicksearch").placeholded=false;D.val("");D.removeClass("placeholded")}});B.blur(function(){var D=A(this);if(D.data("quicksearch").placeholder&&(/^\s*$/).test(D.val())){D.val(D.data("quicksearch").placeholder);D.data("quicksearch").placeholded=true;D.addClass("placeholded")}})}else{B.each(function(){this.type="search"});B.attr("results",10);B.attr("placeholder",B.data("quicksearch").placeholder);B.val("")}};AJS.applySearchPlaceholders();A("#messageContainer .confluence-messages").each(function(){var B=this;if(!getCookie(B.id)){A(B).show();A(".message-close-button",B).click(function(){A(B).slideUp();setCookie(B.id,true)})}})});AJS.General={getContextPath:AJS.Confluence.getContextPath};(function(){var A={};AJS.I18n={keys:{},get:function(D,B,C){if(A[D]){if(typeof B=="function"){B(AJS.I18n.keys)}return }AJS.$.ajax({url:AJS.Confluence.getContextPath()+"/rest/prototype/1/i18n/"+D,data:{locale:AJS.params.userLocale},dataType:"json",success:function(E){AJS.I18n.load(E);A[D]=true;if(typeof B=="function"){B(E)}},error:function(E,F){AJS.log("Error loading I18n for "+D+":"+F);if(typeof C=="function"){C(F)}}})},load:function(B){AJS.$.extend(AJS.I18n.keys,B)},getText:function(B,C){var D=AJS.params["i18n."+B]||AJS.I18n.keys[B]||B;if(!C){return D}if(arguments.length==2&&C instanceof Array){C.unshift(D)}else{C=Array.prototype.slice.call(arguments,0);C[0]=D}return AJS.format.apply(AJS,C)}}})();jQuery.fn.selectableEffects=function(A,B,C){var E=jQuery,D=E(this);if(C){D.data("properties",C)}D.click(function(G){var F=E(this);if(B){B(this,F.data("properties"))}A.find(".selected").removeClass("selected");F.addClass("selected");return AJS.stopEvent(G)});D.hover(function(){E(this).addClass("hover")},function(){E(this).removeClass("hover")})};
AJS.html=function(A){var B=new String(A);B.isHtml=true;return B};AJS.toInit(function(B){var A={};AJS.loadTemplateScripts=function(E){E=E||document;B("script",E).each(function(){if(this.type=="text/x-template"){A[this.title]=AJS.html(this.text)}})};AJS.loadTemplateScripts();AJS.getTemplate=function(E){return A[E]};var D={"&":"&amp;","<":"&lt;",">":"&gt;","'":"&#39;",'"':"&quot;"};AJS.escapeEntities=function(E){if(E==null){return E}if(E.isHtml){return""+E}return(""+E).replace(/[&<>'"]/g,function(F){return D[F]||F})};function C(F){var E=arguments;return F.replace(/\{(\d+)\}/g,function(I,G){var H=E[parseInt(G,10)+1];return H!=null?H:I})}AJS.renderTemplate=function(E,F){if(!AJS.getTemplate(E)){return""}if(!B.isArray(F)){F=Array.prototype.slice.call(arguments,1)}var I=AJS.getTemplate(E).toString();var H=[I];for(var G=0;G<F.length;G++){H.push(AJS.escapeEntities(F[G]))}return C.apply(this,H)};AJS.loadTemplatesFromUrl=function(E,F){B.ajax({url:E,data:{locale:AJS.params.userLocale},dataType:"html",success:function(G){var H=AJS("div").append(G);AJS.loadTemplateScripts(H);F()}})}});
AJS.menuShowCount=0;jQuery.fn.ajsMenu=function(A){A=A||{};var B=jQuery;var D=null;var C=function(E){if(typeof AJS.dropDownTimer!="undefined"&&AJS.dropDownHider){clearTimeout(AJS.dropDownTimer);delete AJS.dropDownTimer;AJS.dropDownHider();AJS.dropDownHider=null}};B(".ajs-button",this).each(function(){B(this).mouseover(C)});B(".ajs-menu-item",this).each(function(){var G=this,E=B(this),K=B(".ajs-drop-down",G);if(!K.length){return }K=K[0];K.hidden=true;K.focused=-1;K.hide=function(){if(!this.hidden){E.toggleClass("opened");B(G.parentNode).toggleClass("menu-bar-open");var N=B("a",this);B(this).toggleClass("assistive");this.hidden=true;B(document).unbind("click",this.fhide).unbind("keydown",this.fmovefocus).unbind("keypress",this.blocker);if(this.focused+1){B(N[this.focused]).removeClass("active")}this.focused=-1}};K.show=function(){if(typeof this.hidden=="undefined"||this.hidden){var N=this,R=B(this);R.toggleClass("assistive");E.toggleClass("opened");B(G.parentNode).toggleClass("menu-bar-open");this.hidden=false;this.timer=setTimeout(function(){B(document).click(N.fhide)},1);B(document).keydown(N.fmovefocus).keypress(N.blocker);var O=B("a",N);O.each(function(T){var S=this.parentNode.parentNode;B(this).hover(function(U){if(S.focused+1){B(O[S.focused].parentNode).removeClass("active")}B(this.parentNode).addClass("active");S.focused=T},function(U){if(S.focused+1){B(O[S.focused].parentNode).removeClass("active")}S.focused=-1})});var Q=(window.pageYOffset||document.documentElement.scrollTop);var P=Q+B(window).height();R.removeClass("above");if(!A.isFixedPosition){if(R.offset().top+R.height()>P){R.addClass("above");if(R.offset().top<Q){R.removeClass("above")}}}}};K.fmovefocus=function(N){K.movefocus(N)};K.fhide=function(N){K.hide(N)};K.blocker=function(N){var O=N.which;if(O==40||O==38){return false}};K.movefocus=function(P){var S=P.which,O=this.getElementsByTagName("a"),R=this.focused,N=(S==9),Q;do{switch(S){case 40:case 9:if(P.shiftKey){this.focused--}else{this.focused++}break;case 38:this.focused--;break;case 27:this.hide();return false;default:return true}Q=(this.focused<0||this.focused>O.length-1)}while(!Q&&B(O[this.focused].parentNode).hasClass("assistive"));if(N&&Q){if(R!=-1){B(O[R].parentNode).removeClass("active")}this.focused=-1;this.hide();return false}else{if(!N){if(this.focused<0){this.focused=O.length-1}else{if(this.focused>O.length-1){this.focused=0}}}}if(R>=0){B(O[R].parentNode).removeClass("active")}O[this.focused].focus();B(O[this.focused].parentNode).addClass("active");P.stopPropagation();P.preventDefault();return false};K.show();clearTimeout(K.timer);var H=B(K),F=H.offset();K.hide();var J=B(".trigger",G);if(J.length){var L=function(){clearTimeout(AJS.dropDownTimer);delete AJS.dropDownTimer;AJS.dropDownHider();AJS.dropDownHider=null;K.show()};var M=function(O){var N=typeof AJS.dropDownTimer!="undefined";D=K;if(N){L()}else{AJS.dropDownShower=function(){K.show();delete AJS.dropDownShowerTimer};AJS.dropDownShowerTimer=setTimeout(AJS.dropDownShower,O)}};var I=function(N){var O=typeof AJS.dropDownShowerTimer!="undefined";if(O){clearTimeout(AJS.dropDownShowerTimer);delete AJS.dropDownShowerTimer}if(typeof AJS.dropDownTimer!="undefined"){clearTimeout(AJS.dropDownTimer);delete AJS.dropDownHider}AJS.dropDownHider=function(){K.hide();delete AJS.dropDownTimer};AJS.dropDownTimer=setTimeout(AJS.dropDownHider,N)};E.mouseover(function(){M(500)});E.mouseout(function(){I(300)});J.click(function(){if(K.hidden){K.show()}else{K.hide()}})}})};AJS.toInit(function(D){var B=["action-view-source-link","view-user-history-link"];for(var E=B.length;E--;){D("#"+B[E]).click(function(L){window.open(this.href,(this.id+"-popupwindow").replace(/-/g,"_"),"width=600, height=400, scrollbars, resizable");L.preventDefault();return false})}var F=function(L,M){var N=D("#ajax-error");if(N.length==0){D("#com-atlassian-confluence").prepend("<div id='ajax-error'></div>");N=D("#ajax-error")}N.append("<span class='error'>"+L+"<a class='close'>Close</a></span>");N.find("a.close").click(function(){var O=D(this).parent();D(O).slideUp(1000,function(){D(O).remove();if(D("#ajax-error").children(".error").length==0){D("#ajax-error").remove()}});return false});M.removeClass("waiting")};D("#page-favourite").click(function(N){var M=D(this);if(M.hasClass("waiting")){return AJS.stopEvent(N)}M.addClass("waiting");var L=AJS.Confluence.getContextPath()+"/json/addfavourite.action";if(M.hasClass("selected")){L=AJS.Confluence.getContextPath()+"/json/removefavourite.action"}AJS.safeAjax({url:L,type:"POST",dataType:"json",data:{entityId:AJS.params.pageId},success:function(P){if(P.actionErrors){for(var O=0;O<P.actionErrors.length;O++){F(P.actionErrors,M)}return }if(P.errorMessage){F(P.errorMessage,M);return }M.removeClass("waiting");M.toggleClass("selected");M.toggleClass("ie-page-favourite-selected")},error:function(O){F("Server error while updating favourite",M)}});return AJS.stopEvent(N)});var J=D("#page-watch"),K=D("#page-unwatch"),H=D(J.parent("li")),I=D(K.parent("li"));if(J.hasClass("inactive")){H.addClass("assistive")}if(K.hasClass("inactive")){I.addClass("assistive")}var G=function(L,M,N){M.addClass("waiting");AJS.safe.ajax({url:L,type:"POST",dataType:"json",data:{entityId:AJS.params.pageId},success:function(P){if(P.actionErrors){for(var O=0;O<P.actionErrors.length;O++){F(P.actionErrors,M)}return }if(P.errorMessage){F(P.errorMessage,M);return }M.removeClass("waiting");M.toggleClass("inactive");N.toggleClass("inactive");M.parent("li").toggleClass("assistive");N.parent("li").toggleClass("assistive")},error:function(O){M.removeClass("waiting");F("Server error while updating favourite",menuItem)}})};J.click(function(L){G(AJS.Confluence.getContextPath()+"/pages/startwatching.action",J,K);J.addClass("waiting");return AJS.stopEvent(L)});K.click(function(L){G(AJS.Confluence.getContextPath()+"/pages/stopwatching.action",K,J);K.addClass("waiting");return AJS.stopEvent(L)});var A=D("#action-menu-link"),C=D("#add-menu-link");if(A.length){A.next().addClass("most-right-menu-item")}else{if(C.length){C.next().addClass("most-right-menu-item")}}D(".ajs-menu-bar").ajsMenu({isFixedPosition:true})});AJS.$(function(A){A("#header-menu-bar .ajs-menu-item").each(function(){var C=A(this),D=A(".ajs-drop-down",this),B=C.width();if(B>D.width()){D.width(B.valueOf()+50);AJS.log("Dropdown width override occurred")}})});
jQuery.fn.simpleScrollTo=function(C){var E=jQuery;var A=E(this[0]);var B=E(C).position().top;var D=B+E(C).outerHeight()-A.outerHeight();if(B<0){A.scrollTop(A.scrollTop()+B)}else{if(D>0){A.scrollTop(A.scrollTop()+D)}}return this};
AJS.toInit(function(A){A("a#websudo-drop.drop-non-websudo").click(function(){A.getJSON(A(this).attr("href"),function(){A("li#confluence-message-websudo-message").slideUp()});return false})});
AJS.PagePermissions=AJS.PagePermissions||{};AJS.$.fn.disable=function(A){return this.each(function(){var B=AJS.$(this);var C=B.attr("disabled","disabled").addClass("disabled").attr("id");if(C){AJS.$("label[for="+C+"]",B.parent()).addClass("disabled")}})};AJS.$.fn.enable=function(A){return this.each(function(){var B=AJS.$(this);var C=B.attr("disabled","").removeClass("disabled").attr("id");if(C){AJS.$("label[for="+C+"]",B.parent()).removeClass("disabled")}})};AJS.toInit(function(E){var H="user",T="group";var K=E("#confluence-context-path").attr("content");var O=!!E("#permissions-show-hide-link").length;var A=null;var L=null;var R=null;var N={addNames:function(V,X){var W=this;var U=V.replace(/\s*,\s*/g,",").split(",");var Y=E("#waitImage");Y.show();var Z={name:U,type:X||"",pageId:AJS.params.parentPageId,spaceKey:AJS.params.spaceKeyDecoded};E.getJSON(K+"/pages/getentities.action",Z,function(f){Y.hide();for(var e=0,a=f.length;e<a;e++){var c=f[e].entity;var b=f[e].report;W.addEntity(f[e]);var d=E.inArray(c.name,U);U.splice(d,1)}L.validator.handleNonExistentEntityNames(U)})},addEntity:function(W){if(!W){return }var V=W.entity;var U=W.report;var Y=L.getPermissionType();if(L.validator.isDuplicateEntityForType(V,Y)){R.highlightEntityRow(V,Y);return }var X={entity:V,view:true,edit:true,report:U};R.addRow(X,Y);R.changedByUser();R.highlightEntityRow(V,Y);L.nameField.removeFromNameInput(V.name)},makePermissionStrings:function(){var U=R.makePermissionMap(false);return{viewPermissionsUsers:U.user.view.join(","),editPermissionsUsers:U.user.edit.join(","),viewPermissionsGroups:U.group.view.join(","),editPermissionsGroups:U.group.edit.join(",")}},refreshLayout:function(){var Z=E("#page-permissions-tables");var Y=E("#update-page-restrictions-dialog");var W=Y.outerHeight();var U=Y.find("h2").outerHeight();var b=Y.find(".dialog-button-panel").outerHeight();var X=W-(U+b);var a=E("#page-permissions-editor-form").outerHeight();var V=X-a;E("#update-page-restrictions-dialog .dialog-panel-body").height(X);Z.height(V)}};E.extend(AJS.PagePermissions,{addUserPermissions:function(U){N.addNames(U,H)},addGroupPermissions:function(U){N.addNames(U,T)},makePermissionStrings:N.makePermissionStrings});function F(W){R.allowEditing(W.userCanEditRestrictions);R.resetInherited();if(!N.permissionsEdited){R.resetDirect()}if(!W){return }for(var X=0,Z=W.permissions.length;X<Z;X++){var f=W.permissions[X];var b=f[0].toLowerCase();var U=f[1];var d=f[2];var V=(U==H)?W.users[d]:W.groups[d];var e=f[3];var c=f[4];var Y=+e&&e!=AJS.params.pageId;if(N.permissionsEdited&&!Y){continue}var a={owningId:e,entity:V.entity,report:V.report};a[b]=true;a.owningTitle=c;a.inherited=Y;R.addRow(a,b)}R.saveBackup();R.refresh()}function I(){var b=R.makePermissionMap(true);var V=E("#permissions-view-summary");var Z=[].concat(b.group.view).concat(b.user.view);if(Z.length){V.find(".summary-content").text(Z.join(", "))}AJS.setVisible(V,Z.length);var X=E("#permissions-edit-summary");var U=[].concat(b.group.edit).concat(b.user.edit);if(U.length){X.find(".summary-content").text(U.join(", "))}AJS.setVisible(X,U.length);N.permissionsEdited=false;var a=N.makePermissionStrings();for(var W in a){var Y=a[W];E("#"+W).val(Y);if(N.originalPermissions[W]!=Y){N.permissionsEdited=true}}}function Q(){L.validator.resetValidationErrors();R.clearHighlight();A.hide();window.scrollTo(N.bookmark.scrollX,N.bookmark.scrollY)}function G(){var V=E(".permissions-update-button").disable();if(O){I();AJS.setVisible("#page-permissions-unsaved-changes-msg",N.permissionsEdited);V.enable();Q()}else{var U=N.makePermissionStrings();U.pageId=AJS.params.pageId;E("#waitImage").show();AJS.safe.post(K+"/pages/setpagepermissions.action",U,function(W){E("#waitImage").hide();AJS.setVisible("#content-metadata-page-restrictions",W.hasPermissions);V.enable();Q()},"json")}}function D(){Q();if(O){R.restoreBackup()}}function P(){A=AJS.ConfluenceDialog({width:865,height:530,id:"update-page-restrictions-dialog",onCancel:D});A.addHeader(AJS.I18n.getText("page.perms.dialog.heading"));A.addPanel("Page Permissions Editor",AJS.renderTemplate("page-permissions-div"));A.addButton("update.name",G,"permissions-update-button");A.addButton("close.name",D,"permissions-cancel-button");A.popup.element.find(".dialog-button-panel").append(AJS.renderTemplate("page-restrictions-help-link"));L=AJS.PagePermissions.Controls(N);var U=E("#page-permissions-table").bind("changed",S);R=AJS.PagePermissions.Table(U);N.table=R}function J(U){N.bookmark={scrollX:document.documentElement.scrollLeft,scrollY:document.documentElement.scrollTop};B();L.setVisible(U.userCanEditRestrictions);AJS.setVisible(".permissions-update-button",U.userCanEditRestrictions);A.show();N.refreshLayout()}function C(Y,V){var W=(V&&E("#newSpaceKey").val())||AJS.params.spaceKeyDecoded;var U=(V&&E("#parentPageString").val())||"";var X={pageId:AJS.params.pageId,parentPageId:AJS.params.parentPageId,parentPageTitle:U,spaceKey:W};if(AJS.params.newPage){X.draftId=AJS.params.contentId}E("#waitImage").show();E.getJSON(K+"/pages/getpagepermissions.action",X,function(Z){E("#waitImage").hide();F(Z);Y(Z)})}function M(U){A||P();C(J,U)}function S(){E(".permissions-update-button").enable();E(".permissions-cancel-button").text(AJS.I18n.getText("cancel.name"))}function B(){E(".permissions-update-button").disable();E(".permissions-cancel-button").text(AJS.I18n.getText("close.name"))}E("#content-metadata-page-restrictions, #action-page-permissions-link").click(function(U){M(false);U.preventDefault()});E("#permissions-show-hide-link").click(function(U){M(true);U.preventDefault()});if(O){N.originalPermissions={viewPermissionsUsers:E("#viewPermissionsUsers").val(),editPermissionsUsers:E("#editPermissionsUsers").val(),viewPermissionsGroups:E("#viewPermissionsGroups").val(),editPermissionsGroups:E("#editPermissionsGroups").val()}}});
AJS.PagePermissions.Table=function(B){var D=AJS.$,C=this;var E=false;var A=false;this.refresh=function(){var I=B.find(".view-permission-row");var H=B.find(".edit-permission-row");var J=I.length>0;var G=H.length>0;AJS.setVisible("#page-permissions-no-views",!J);AJS.setVisible("#page-permissions-no-edits",!G);B.each(function(){D(".view-permission-row .page-permissions-marker-cell span",this).removeClass("first-of-type").filter(":first").addClass("first-of-type");D(".edit-permission-row .page-permissions-marker-cell span",this).removeClass("first-of-type").filter(":first").addClass("first-of-type")});C.clearHighlight()};this.saveBackup=function(){this.copy=B.children().clone(true)};this.restoreBackup=function(){B.children().remove();B.append(this.copy)};this.addCount=0;this.makePermissionMap=function(H){var G={user:{view:[],edit:[]},group:{view:[],edit:[]}};B.find("tr.view-permission-row, tr.edit-permission-row").each(function(){var M=D(this);var J=M.is(".user-permission")?"user":"group";var L=M.is(".view-permission-row")?"view":"edit";var K=(H&&(J=="user"))?"display-name":"name";var I=M.find(".permission-entity-"+K).text();G[J][L].push(I)});return G};this.makePermissionMapForCheckboxes=function(H){var G={user:{view:[],edit:[]},group:{view:[],edit:[]}};B.find("tr.view-permission-row").each(function(){var N=D(this);var J=!!N.find(".view-permission-cell input").attr("checked");var M=!!N.find(".edit-permission-cell input").attr("checked");if(J||M){var K=N.hasClass("user-permission")?"user":"group";var L=(H&&(K=="user"))?"display-name":"name";var I=N.find(".permission-entity-"+L).text();if(J&&(H||!N.hasClass("readonly-permission"))){G[K].view.push(I)}if(M){G[K].edit.push(I)}}});return G};var F=function(J,G){var I=J.find("td.permission-entity");var H=contextPath+(G.profilePictureDownloadPath||"/images/icons/"+G.type+"_16.gif");I.find("img").attr("src",H);I.find(".permission-entity-name").text(G.name);if(G.type=="group"){I.find(".permission-entity-name-wrap").hide()}I.find(".permission-entity-display-name").text(G.fullName||G.name);var K=I.find("span.entity-container");if(G.type=="user"){K.addClass("content-hover user-hover-trigger").attr("data-username",G.name)}};this.addRow=function(R,M){var J=R.entity;var I=D(AJS.renderTemplate("permissions-row-template"));I.addClass(J.type+"-permission");I.addClass(M+"-permission-row");if(M=="edit"){I.find(".page-permissions-marker-cell span").text(AJS.I18n.getText("page.perms.editing.restricted.to"))}F(I,J);var K=!A||R.inherited||R.readOnly;if(K){I.addClass("readonly-permission")}var N=I.find(".remove-permission-link");if(K||!A){N.remove()}else{N.attr("id","remove-permission-"+this.addCount++);N.click(function(T){D(this).closest("tr").remove();C.changedByUser();return AJS.stopEvent(T)})}if(R.inherited){var O=D(".page-permissions-table[owningTitle='"+AJS.escape(R.owningTitle)+"']");if(!O.length){var H=D(AJS.renderTemplate("page-inherited-permissions-table-div-template"));O=H.find("table");O.attr("owningTitle",AJS.escape(R.owningTitle));var L=H.find(".page-inherited-permissions-table-desc");var P=L.find("a"),G=AJS.Confluence.getContextPath()+"/pages/viewpage.action?pageId="+R.owningId;P.attr("href",G).attr("target","_blank").text(R.owningTitle).addClass("page-perms-owningTitle");var S=D("#content-title");var Q=S.length?S.val():AJS.params.pageTitle;L.find("span").addClass(".page-perms-inherited-this-page").text(Q);D("#page-inherited-permissions-tables").append(H)}O.append(I);D("#page-inherited-permissions-table-div").removeClass("hidden")}else{if(M=="view"){D("#page-permissions-no-edits").before(I)}else{B.append(I)}}AJS.Confluence.runBinderComponents()};this.changedByUser=function(){B.trigger("changed");C.clearHighlight();C.refresh()};this.resetDirect=function(){B.find("tr:not(.marker-row)").remove();C.addCount=0;if(E){var G={entity:{name:"",fullName:AJS.I18n.getText("page.perms.everyone.user"),type:"group"},readOnly:true,view:true,edit:true};this.addEntry(G)}};this.resetInherited=function(){D("#page-inherited-permissions-tables div").remove()};B.click(function(G){C.clearHighlight()});D("#page-inherited-permissions-table-desc").click(function(){D(".page-inheritance-togglable").toggleClass("hidden");D(".icon",this).toggleClass("twisty-open").toggleClass("twisty-closed")});this.highlightEntityRow=function(G,I){var H=B.find("."+I+"-permission-row").filter(function(){return D(".permission-entity-name",this).text()==G.name});D("#page-permissions-tables").simpleScrollTo(H);H.addClass("highlighted-permission")};this.clearHighlight=function(){D("tr.highlighted-permission").removeClass("highlighted-permission")};this.allowEditing=function(G){A=G};return this};
AJS.PagePermissions.Controls=function(B){var D=AJS.$;var C={handleNonExistentEntityNames:function(G){if(!G||!G.length){return }var F=G.join(", ");var H=AJS.I18n.getText("page.perms.error.invalid.entity.names")+" "+F;D("#page-permissions-error-div").find("div").text(H).end().removeClass("hidden");B.refreshLayout()},isDuplicateEntityForType:function(F,H){var G=D("#page-permissions-table ."+H+"-permission-row .permission-entity-name").filter(function(){return D(this).text()==F.name});return G.length>0},resetValidationErrors:function(){D("#page-permissions-error-div").addClass("hidden");B.refreshLayout()}};var A=(function(){var F=D("#page-permissions-names-input");var I=D("#page-permissions-names-hidden");var H=F.val();var G="input-placeholder";F.keypress(function(J){if(J.keyCode==Event.KEY_RETURN){E();F.focus();return false}return true});F.quicksearch("/json/contentnamesearch.action?type=userinfo",null,{dropdownPostprocess:function(J){D("ol.last",J).remove();if(D("ol",J).length==0){J.append(AJS.renderTemplate("permissions-username-no-suggestion-template"))}},dropdownPlacement:function(K){var J=AJS("div");J.addClass("page-perms-name-dropdown-wrapper aui-dd-parent");J.append(K);F.after(J)},ajsDropDownOptions:{selectionHandler:function(L,K){if(K.hasClass("message")){return }var J=D.data(K.find("span")[0],"properties");var M=J.href.substr(J.href.lastIndexOf("/")+2);I.val(unescape(M.replace(/\+/g," ")));F.val("");E();this.hide();L.preventDefault()}}});F.focus(function(){if(F.hasClass(G)){F.removeClass(G).val("")}var L=F.next(".aui-dd-parent");if(!L.length){return }L.show();var J=F.offset().left;if(L.offset().left!=J){L.css("margin-left",0);var N=J-L.offset().left;L.css("margin-left",N+"px")}var M=F.offset().top+F.outerHeight();if(L.offset().top!=M){L.css("margin-top",0);var K=M-L.offset().top;L.css("margin-top",K+"px")}L.css({width:F.outerWidth()});L.hide()});F.blur(function(){if(F.val()==""){F.addClass(G).val(H)}});return{getValue:function(){var J=I.val();if(J){I.val("")}else{J=F.val();if(J==H){J=""}}return J},addPlaceholder:function(){F.addClass(G).val(H)},removeFromNameInput:function(M){if(!M){return }var L=F.val();if(!L){return }var J=L.split(",");for(var K=0;K<J.length;K++){J[K]=D.trim(J[K])}J=D.grep(J,function(N){return N!=""&&N!=M});if(J.length){F.val(J.join(", "))}else{if(document.activeElement==F[0]){F.val("")}else{this.addPlaceholder()}}}}})();var E=function(){C.resetValidationErrors();B.table.clearHighlight();var F=A.getValue();if(!F){return }B.addNames(F)};D("#page-permissions-choose-me").click(function(F){C.resetValidationErrors();B.addNames(D(this).find(".remote-user-name").text());return AJS.stopEvent(F)});D("#permissions-error-div-close").click(function(F){C.resetValidationErrors();return AJS.stopEvent(F)});D("#add-typed-names").click(E);return{validator:C,nameField:A,setVisible:function(F){AJS.setVisible("#page-permissions-editor-form",F);AJS.setVisible(".remove-permission-link",F);if(F){A.addPlaceholder()}},isShowing:function(){return !D("#page-permissions-editor-form").hasClass("hidden")},getPermissionType:function(){return !!D("#restrictViewRadio:checked").length?"view":"edit"}}};
AJS.toInit(function(E){if(!AJS.params.linkToThisPageLink){return }var D=new AJS.Dialog(600,210,"link-page-popup").addHeader(AJS.params.linkToThisPageHeading).addPanel(AJS.params.linkToThisPageHeading,"<form id='link-page-popup-form' class='aui'><fieldset></fieldset></form>").addButton(AJS.params.linkToThisPageClose,function(G){F(G)},"link-page-close-button");var A=function(G){if(G.which==27){F(D)}};var B=[{label:AJS.params.linkToThisPageLink,id:"link",value:E("link[rel=canonical]").attr("href")},{label:AJS.params.linkToThisPageTinyLink,id:"tiny-link",value:E("link[rel=shortlink]").attr("href")},{label:AJS.params.linkToThisPageWikiMarkup,id:"wiki-markup",value:E("meta[name=wikilink]").attr("content")}];E.each(B,function(){E("#link-page-popup-form fieldset").append(AJS.format("<div class='field-group'><label for=''link-popup-field-{0}''>{1}:</label><input id=''link-popup-field-{0}'' readonly=''readonly'' value='''' class=''text'' type=''text''></div>",this.id,this.label)).find("input:last").val(this.value)});var F=function(G){G.hide();E(document).unbind("keydown",A)};E("#link-to-page-link").click(function(G){if(!E("#link-to-page-fields")[0]){alert("Due to customisations made to this space's layout, Confluence is unable to load the links dialog. For details on how to correct this, please visit the 'Upgrading Custom Layouts' page in our Confluence Documentation, or contact your administrators.");return }E(this).parents(".ajs-drop-down")[0].hide();D.show();E(document).keydown(A);E("#link-page-popup-form #link-popup-field-tiny-link").select().focus();return AJS.stopEvent(G)});var C=E("#link-page-popup-form fieldset input.text");C.focus(function(){E(this).select()});C.mouseup(function(G){G.preventDefault()})});
AJS.toInit(function ($){
    var editInWord = $('#edit-in-word');
    var pathAuth = false;
    if (!editInWord.length){
       editInWord = $('#edit-in-word-pathauth');
       pathAuth = true;
    }
    if (editInWord.length){
    	 var originalHref = editInWord.attr('href'); 
    	 editInWord.click(function (e) {
              e.preventDefault();
              return doEditInOffice(contextPath, originalHref, 'Word.Document', pathAuth);
          })    	
    }
});

AJS.toInit(function ($){

    var contextPath = document.getElementById('confluence-context-path').content;

    $("a.office-editable").each(function() {
        var $this = $(this);
        $this.click(function() {
            var href = $this.attr('href')
            return doEditInOffice(contextPath, href, getProgID(href), false);
        })
    });
    
    $("a.office-editable-pathauth").each(function() {
        var $this = $(this);
        $this.click(function() {
            var href = $this.attr('href')
            return doEditInOffice(contextPath, href, getProgID(href), true);
        })
    });
});

function getProgID(href)
{
    var ext = href.substring(href.lastIndexOf('.') + 1);

    switch(ext)
    {
        case "ppt":
        case "pptx":
        case "ppsx":
        case "pot":
        case "potx":
        case "pptm":
            return "PowerPoint.Show";
        case "doc":
        case "docx":
        case "dot":
        case "dotx":
            return "Word.Document";
        case "xls":
        case "xlt":
        case "xlsx":
        case "xlst":
        case "xlsm":
            return "Excel.Sheet";
        default:
            return ''
    }
}

function filterPath(urlPath)
{
    var jsession = getCookie('jsessionid');
    if (!jsession){
        jsession = getCookie('JSESSIONID');
    }
    if (jsession){
        var splitPath = urlPath.split('/');
        var newPath = '';
        for (var i = 0; i < splitPath.length - 1; i++){
            
            if (splitPath[i].length){
                newPath = newPath + '/' + splitPath[i];
            }            
        }
        newPath = newPath + '/ocauth/' + jsession + '/' + splitPath[splitPath.length - 1];
        return newPath        
     }
     else{
        return urlPath
     }
}

function getCookie( check_name ) {
    // first we'll split this cookie up into name/value pairs
    // note: document.cookie only returns name=value, not the other components
    var a_all_cookies = document.cookie.split( ';' );
    var a_temp_cookie = '';
    var cookie_name = '';
    var cookie_value = '';
    var b_cookie_found = false; // set boolean t/f default f

    for ( i = 0; i < a_all_cookies.length; i++ ) {
        // now we'll split apart each name=value pair
        a_temp_cookie = a_all_cookies[i].split( '=' );

        // and trim left/right whitespace while we're at it
        cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');

        // if the extracted name matches passed check_name
        if ( cookie_name == check_name ){
            b_cookie_found = true;
            // we need to handle case where cookie has no value but exists (no = sign, that is):
            if ( a_temp_cookie.length > 1 ){
                cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
            }
            // note that in cases where cookie is initialized but no value, null is returned
            return cookie_value;
            break;
        }
        a_temp_cookie = null;
        cookie_name = '';
    }
    if ( !b_cookie_found ){
        return null;
    }
}

function getBaseUrl(){    
	return location.protocol + "//" + location.host;	
}

function doEditInOffice(contextPath, webDavUrl, progID, usePathAuth)
{
	    var baseUrl = getBaseUrl();
    	if (window.ActiveXObject)// this is IE
    	{
    		var ed; 
    		try
    		{
    			ed = new ActiveXObject('SharePoint.OpenDocuments.1');
    		}
    		catch(err)
    		{
    			window.alert('Unable to create an ActiveX object to open the document. This is most likely because of the security settings for your browser.');
    			return false;
    		}
    		if (ed)
    		{
    			if (usePathAuth)
    			{
    				webDavUrl = filterPath(webDavUrl);
    			}
    			ed.EditDocument(baseUrl + webDavUrl, progID);
    			return false;
    		}
    		else
    		{
    			window.alert('Cannot instantiate the required ActiveX control to open the document. This is most likely because you do not have Office installed or you have an older version of Office.');
    			return false;
    		}  
    	}
    	else if (window.URLLauncher)// this means the OC firefox plugin is installed
    	{
    		var isMac = navigator.appVersion.indexOf("Mac") != -1;
    		if (usePathAuth && !isMac)
			{
				webDavUrl = filterPath(webDavUrl);
			}
    		var wdFile = new URLLauncher();
    		// check and see if they have the function we want.
    		if (wdFile.open2)
    		{
	    		//grok the webdav root path and the remaining path after the root
	    		var regex = new RegExp(contextPath + '/plugins/servlet/[^\/]+/');
	    		var rootPath = webDavUrl.match(regex);
	    		var remainingPath = webDavUrl.substring(rootPath[0].length);	
	    		
	    		wdFile.open2(encodeURI(rootPath[0]), encodeURI(remainingPath));
    		}
    		else
    		{
    			wdFile.open(webDavUrl);
    		}
    	}
    	else if(window.InstallTrigger)
    	{
    		if(window.confirm('A plugin is required to use this feature. Would you like to download it?'))
    		{
    			InstallTrigger.install({'WebDAV Launcher': 'https://update.atlassian.com/office-connector/URLLauncher/latest/webdavloader.xpi'});
    		}
    	}
    	else
    	{
    		window.alert('Firefox or Internet Explorer is required to use this feature.');
    	}
    	return false;
}
function enableEdit(node)
{
	node.style.cursor='pointer';
	node.style.backgroundColor='#cccccc';
	node.style.color='';
	//node.parentNode.style.border='1px solid #cccccc';
}
function disableEdit(node)
{
    node.style.cursor='';
	node.style.backgroundColor='#ffffff';
	node.style.color='#ffffff';
	//node.parentNode.style.border='';	
}
AJS.moreLinkClickHandler=function(B){var A=AJS.$(this),C=A.attr("href"),D=A.closest(".more-link-container");if(!D.length){throw new Error("Could not find more link container when one was expected.")}AJS.$(".waiting-image",D).removeClass("hidden");AJS.$(".more-link-text",A).hide();AJS.$.get(C,function(E){$context=AJS.$(E);D.replaceWith($context);AJS.$(".more-link",$context).click(AJS.moreLinkClickHandler);if(AJS.PageGadget&&AJS.PageGadget.contentsUpdated){AJS.PageGadget.contentsUpdated()}});return AJS.stopEvent(B)};
AJS.toInit(function(A){A(".more-link").click(AJS.moreLinkClickHandler)});
AJS.toInit(function(A){A("select.content-filter").change(function(){A(".filter-control .waiting-image").removeClass("hidden");var B=A(this);A.get(AJS.params.changesUrl,{contentType:A(this).val()},function(E){var D=A(E);var C=B.parent();C.parent().siblings(".results-container").children("ul").html(D);A(".waiting-image",C).addClass("hidden");A(".more-link",D).click(AJS.moreLinkClickHandler)})})});
AJS.toInit(function(E){var B="com.atlassian.confluence.sidebar.hide",D=E("#personal-info-sidebar"),A=D.height(),C=E("#content");function F(){D.toggleClass("collapsed");C.toggleClass("sidebar-collapsed");D.trigger("toggled")}if(getCookie(B)=="true"){F()}E(".sidebar-collapse").click(function(G){F();setCookie(B,D.hasClass("collapsed"));return AJS.stopEvent(G)}).height(A)});
AJS.toInit(function(A){A(".confluence-thumbnail-link").click(function(C){var B=this.className.match(/(^|\s)(\d+)x(\d+)(\s|$)/);window.open(this.href,"thumbnail_popup","width="+(+B[2]+20)+",height="+(+B[3]+20)+",menubar=no,status=no,toolbar=no");return AJS.stopEvent(C)})});
AJS.toInit(function(B){var D=B("#version-comment");if(D.length){var A=B("#show-version-comment");var C=B("#hide-version-comment");A.click(function(E){A.hide();C.show();D.show();return AJS.stopEvent(E)});C.click(function(E){C.hide();A.show();D.hide();return AJS.stopEvent(E)})}});
AJS.toInit(function(A){if(!A("#add-labels-form").length){return }A(".show-labels-editor").click(function(){AJS.safe.ajax({url:AJS.params.contextPath+"/json/suggestlabelsactivity.action",data:{entityIdString:AJS.params.pageId},success:AJS.Labels.suggestedLabelsCallback,error:AJS.Labels.suggestedLabelsErrorHandler,dataType:"json"});A("#labelsString").val("");A("#labels-section").addClass("open");AJS.setVisible(".show-labels-editor",false);AJS.setVisible("a.hide-labels-editor",true);AJS.setVisible("#labels-section-title",true);A("#labelsString").get(0).focus();return false});A(".hide-labels-editor").click(function(){AJS.Labels.labelOperationError("");A("#errorSpan").html("");A("#labels-section").removeClass("open");AJS.setVisible("a.hide-labels-editor",false);AJS.setVisible(".show-labels-editor",true);if(A("#labelsList").children().length==0&&A("#labelsString").val()==""){A(".show-labels-editor").addClass("add").text(AJS.params.addLabel);AJS.setVisible("#labels-section-title",false)}else{A(".show-labels-editor").removeClass("add").text(AJS.params.editLabel);AJS.setVisible("#labels-section-title",true)}AJS.Labels.addLabelFromInput();return false});A("#add-labels-form").submit(AJS.Labels.addLabelFromInput);A(".labels-editor .add-labels").click(AJS.Labels.addLabelFromInput);A(".labels-editor .remove-label").click(AJS.Labels.removeLabel);A("#labelsString").keydown(function(B){if(B.which==13&&!AJS.dropDown.current){AJS.Labels.addLabelFromInput();return AJS.stopEvent(B)}})});
jQuery(function(B){function A(C){return B("script[title='"+C+"']")[0].text}B("#manage-watchers-menu-item").click(function(H){H.preventDefault();var D="manage-watchers-dialog";var I=new AJS.ConfluenceDialog({width:865,height:530,id:D,onCancel:function(){I.hide().remove()}});I.addHeader(AJS.I18n.getText("manage.watchers.dialog.title"));I.addPanel("default",AJS.template.load(D).toString());I.addButton("done.name",function(){I.hide().remove()});I.show();var E=B("#"+D);E.find(".dialog-button-panel").append(AJS.template.load("manage-watchers-help-link").toString());E.find("input:visible, button:visible").each(function(M){B(this).attr("tabindex",M+1)});AJS.applySearchPlaceholders(E);E.bind("remove-list-item.manage-watchers",function(P,O){var M=O.item,N=O.list,Q=O.username;M.addClass("removing");AJS.safe.ajax({dataType:"json",type:"POST",url:AJS.params.contextPath+"/json/removewatch.action",data:{pageId:AJS.params.pageId,username:Q},error:function(){alert(AJS.I18n.getText("manage.watchers.unable.to.remove.error"));M.removeClass("removing")},success:function(){M.slideUp().remove();E.trigger("list-updated.manage-watchers",{list:N})}})});E.bind("list-updated.manage-watchers",function(P,O){var N=O.list;var M=B("li.watch-user",N).length>0;if(!M){N.find(".no-users").removeClass("hidden");return }N.find(".no-users").addClass("hidden");AJS.Confluence.Binder.userHover();N.find(".confluence-userlink").each(function(){B(this).click(function(Q){Q.preventDefault()})})});E.bind("list-data-retrieved.manage-watchers",function(P,O){var N=O.list,M=O.watchers;N.find(".watch-user").remove();if(M&&M.length){B.each(M,function(){var S=this.name;var R={username:S,fullName:this.fullName,url:AJS.params.contextPath+"/display/~"+this.name,iconUrl:AJS.params.contextPath+this.profilePictureDownloadPath};var Q=B(AJS.template(A("manage-watchers-user")).fill(R).toString());N.append(Q);Q.find(".remove-watch").click(function(){E.trigger("remove-list-item.manage-watchers",{username:S,item:Q,list:N})})})}N.find(".loading").hide();E.trigger("list-updated.manage-watchers",{list:N})});var F=E.find(".page-watchers .user-list");var K=E.find(".space-watchers .user-list");AJS.safe.ajax({url:AJS.params.contextPath+"/json/listwatchers.action",dataType:"json",data:{pageId:AJS.params.pageId},error:function(){alert("Failed to retrieve watchers.")},success:function(M){E.trigger("list-data-retrieved.manage-watchers",{list:F,watchers:M.pageWatchers});E.trigger("list-data-retrieved.manage-watchers",{list:K,watchers:M.spaceWatchers})}});var L=E.find("form");var J=L.find("#add-watcher-user");var C=L.find("#add-watcher-username");var G=(function(){var M=L.find("> .status");return{clear:function(){M.addClass("hidden").removeClass("loading error").text("")},loading:function(N){M.addClass("loading").removeClass("hidden error").html(N)},error:function(N){M.addClass("error").removeClass("hidden loading").text(N)}}})();L.ajaxForm({beforeSerialize:function(){if(C.val()==""){C.val(J.val())}},beforeSubmit:function(){J.blur().attr("disabled","disabled");F.addClass("updating");G.loading(AJS.I18n.getText("manage.watchers.status.adding.watcher"))},dataType:"json",error:function(N,M){alert("Failed to add watcher: "+M)},success:function(M){C.val("");J.attr("disabled","").val("").focus();F.removeClass("updating");if(M.actionErrors&&M.actionErrors.length){G.error(M.actionErrors[0]);return }E.trigger("list-data-retrieved.manage-watchers",{list:F,watchers:M.pageWatchers});G.clear()}});AJS.Confluence.Binder.autocompleteUser();J.bind("selected.autocomplete-user",function(N,M){L.submit()});J.focus();return false})});
(function(){var A=jQuery.ajax;AJS.safe={ajax:function(B){if(B.data&&typeof B.data=="object"){B.data.atl_token=jQuery("#atlassian-token").attr("content");return A(B)}},get:function(){jQuery.ajax=AJS.safe.ajax;try{return jQuery.get.apply(jQuery,arguments)}finally{jQuery.ajax=A}},getScript:function(B,C){return AJS.safe.get(B,null,C,"script")},getJSON:function(B,C,D){return AJS.safe.get(B,C,D,"json")},post:function(B,D,E,C){jQuery.ajax=AJS.safe.ajax;try{return jQuery.post.apply(jQuery,arguments)}finally{jQuery.ajax=A}}}})();AJS.safeAjax=function(A){return AJS.safe.ajax(A)};
jQuery.fn.searchResultsGrid=function(A,E,K,C){var F=jQuery,G=this;if(!E.results||E.results.length==0){var M=AJS.format(C.noSearchResults,AJS.escapeEntities(A));G.html("<div class='no-results'>"+M+"</div>");return }G.html(AJS.getTemplate("searchResultsGrid").toString());var J=E.startIndex+1,H=E.startIndex+E.results.length;var I=AJS.format(C.resultsCount,J,H,E.total,AJS.escapeEntities(A));G.prepend(AJS.renderTemplate("searchResultsGridCount",AJS.html(I)));for(var D=0;D<E.results.length;D++){var L=E.results[D];var B=F(AJS.renderTemplate("searchResultsGridRow",[L.title,L.url,L.type,L.spaceName,L.spaceKey,L.friendlyDate,L.date]));B.selectableEffects(G,K.select,L);G.find("table").append(B)}F(".search-result:first",G).click()};
(function(A){A.ui=A.ui||{};A.fn.extend({spinner:function(B){if(!this.is(".ui-spinner")){return new A.ui.spinner(this,B||{})}}});A.ui.spinner=function(E,J){this.anchor=E;var G=AJS.params.staticResourceUrlPrefix||contextPath;this.images=J.images||[G+"/images/ddtree/black spinner/1.png",G+"/images/ddtree/black spinner/2.png",G+"/images/ddtree/black spinner/3.png",G+"/images/ddtree/black spinner/4.png",G+"/images/ddtree/black spinner/5.png",G+"/images/ddtree/black spinner/6.png",G+"/images/ddtree/black spinner/7.png",G+"/images/ddtree/black spinner/8.png",G+"/images/ddtree/black spinner/9.png",G+"/images/ddtree/black spinner/10.png",G+"/images/ddtree/black spinner/11.png",G+"/images/ddtree/black spinner/12.png"];this.width=J.width||"16px";this.height=J.height||J.width||"16px";this.hide=function(){this.anchor.hide();this.stop()};this.show=function(){this.start();this.anchor.show()};this.fadeIn=function(){this.anchor.fadeIn.apply(this.anchor,arguments)};this.fadeOut=function(){this.anchor.fadeOut.apply(this.anchor,arguments)};this.moveTo=function(K,L){this.anchor.css("top",L);this.anchor.css("left",K)};this.putInBox=function(N){var L=N.x||N.x1,O=N.y||N.y1,M=(typeof N.width=="undefined")?N.x2-N.x1:N.width,K=(typeof N.height=="undefined")?N.y2-N.y1:N.height;this.moveTo(L+Math.round((M-this.offsetWidth)/2),O+Math.round((K-this.offsetHeight)/2))};this.start=function(){if(!this.timer){this.timer=setInterval(B,100)}return this.timer};this.stop=function(){clearInterval(this.timer);this.timer=null};this.divs=[];for(var D=0,I=this.images.length;D<I;D++){var C=document.createElement("div");if(!AJS.applyPngFilter(C,this.images[D])){var F=document.createElement("img");F.src=this.images[D];F.style.width=this.width;F.style.height=this.height;C.appendChild(F)}C.style.width=this.width;C.style.height=this.height;this.anchor.append(C);if(!this.offsetWidth){this.offsetWidth=C.offsetWidth;this.offsetHeight=C.offsetHeight}this.divs.push(A(C).hide())}this.frame=0;this.direction=1;var H=this;var B=function(){H.divs[H.frame].hide();H.frame+=H.direction;if(H.frame>=H.divs.length){H.frame=0}if(H.frame<0){H.frame=H.divs.length-1}H.divs[H.frame].show()};this.anchor.css("position","absolute")}})(jQuery);
(function(B){B.ui=B.ui||{};B.fn.extend({tree:function(C){if(!this.is(".ui-tree")){return new B.ui.tree(this,C)}}});var A=function(C){C.preventDefault()};B.ui.tree=function(F,H){var E=F,S=this,e=false,G=arguments;if(!(/^[ou]l$/i.test(E[0].tagName))){e=true;if(!H.url){return false}E.html("<ul></ul>");E=B("ul",E)}var U=E[0];E.addClass("ui-tree");var M={list:E,visibleNodes:[],dim:E.offset(),points:[],win:B(window),timer:null,prev:0,events:{grab:function(){},click:function(){},drag:function(){},drop:function(){},append:function(){},insertabove:function(){},insertbelow:function(){},load:function(){},nodeover:function(){},nodeout:function(){},onready:function(){},order:function(){},orderUndo:function(){},remove:function(){},preview:function(){}}};this.options=H;this.expandPath=function(g,l){l=l||function(){};if(g.length){var k=1,j,h,i=function(){if(k<g.length){for(var m in g[k]){j=S.findNodeBy(m,g[k][m]);if(j){break}}k++;j.open(i)}else{l()}};for(h in g[0]){j=this.findNodeBy(h,g[0][h]);break}if(!j){return }j.open(i)}else{l()}};this.reload=function(g){if(e){E.remove()}for(var h in g){this.options[h]=g[h]}return new G.callee(F,this.options)};this.append=function(g){var h=W(g);E.append(h);C.call(h);N()};this.unhighlight=function(){E.find("li.highlighted").each(function(g,h){B(this).removeClass("highlighted")})};function J(o,n){o=(o+"").toLowerCase();n=(n+"").toLowerCase();var j=/(\d+|\D+)/g,k=o.match(j),g=n.match(j),m=Math.max(k.length,g.length);for(var h=0;h<m;h++){if(h==k.length){return -1}if(h==g.length){return 1}var p=parseInt(k[h],10),l=parseInt(g[h],10);if(p==k[h]&&l==g[h]&&p!=l){return(p-l)/Math.abs(p-l)}if((p!=k[h]||l!=g[h])&&k[h]!=g[h]){return k[h]<g[h]?-1:1}}return 0}function T(i){this[0]=i[0];this.$=i;this.text=i.find("span").text();this.href=i.find("a").attr("href");this.linkClass=i.find("a").attr("class");this.nodeClass=i.attr("class");this.open=function(j){return M.visibleNodes[this[0].num].open(j)};this.insertChild=function(j){j.$&&(j=j[0]);M.visibleNodes[this[0].num].append(j)};this.reorder=function(){M.visibleNodes[this[0].num].order(J)};this.close=function(){M.visibleNodes[this[0].num].close()};this.getAttribute=function(j){return this[0][j]};this.setAttribute=function(j,k){this[0][j]=k};this.highlight=function(){this.$.addClass("highlighted")};this.unhighlight=function(){this.$.removeClass("highlighted")};this.makeDraggable=function(){this.setAttribute("undraggable",false);this.$.removeClass("undraggable")};this.makeUndraggable=function(){this.setAttribute("undraggable",true);this.$.addClass("undraggable")};this.makeClickable=function(k){this.setAttribute("unclickable",false);this.$.removeClass("unclickable");var l=this[0].getElementsByTagName("a");var j;if(k){j=B(l[0])}else{j=B(l)}j.unbind("click",A);j.click(M.events.click)};this.makeUnclickable=function(k){this.setAttribute("unclickable",true);this.$.addClass("unclickable");var l=this[0].getElementsByTagName("a");var j;if(k){j=B(l[0])}else{j=B(l)}j.click(A);j.unbind("click",M.events.click)};this.setText=function(j){this.text=j;this[0].text=j;this.$.find("span").text(j)};this.getParent=function(){if(this.$.parent(":not(.ui-tree)").length){var j=this.$.parent().parent();if(j.length){return new T(B(j[0]))}}return null};this.append=function(l){var k=this.$.find("ul");if(!k.length){if(this[0].toBeLoaded){var m=this;this.open(function(){m.append(l)});return false}this.$.append("<ul></ul>");k=this.$.find("ul")}var j=W(l);k.append(j);C.call(j);if(typeof this[0].closed=="undefined"){this.$.addClass("closed");this[0].closed=true;k.hide()}N()};this.below=function(j){var k=W(j);this.$.after(k);C.call(k);N()};this.above=function(j){var k=W(j);this.$.before(k);C.call(k);N()};this.remove=function(){this.$.remove();N()};this.reload=function(){if(this[0].getElementsByTagName("ul").length){this[0].removeChild(this[0].getElementsByTagName("ul")[0]);this.$.removeClass("opened").addClass("closed");this[0].closed=true;M.visibleNodes[this[0].num].open()}};this.order=function(o){var l=B("ul",this.$),j=this[0];j.ordered=true;if(l.length){var k=[];j.oldorder=[];B("li",this.$).each(function(){k.push(this);j.oldorder.push(this)});function p(r,q){return o(B(r).find("span").html(),B(q).find("span").html())}k.sort(p);j.order=k;for(var m=0,n=k.length;m<n;m++){l.append(k[m])}}N()};this.orderUndo=function(){this[0].ordered=false;var j=B("ul",this.$);if(this[0].oldorder&&j.length){for(var k=0,l=this[0].oldorder.length;k<l;k++){j.append(this[0].oldorder[k])}}this[0].oldorder=null;N()};this.setOrdered=function(j){this[0].ordered=j;B("a.abc:first",this).css("display",j?"none":"block");B("a.rollback:first",this).css("display","none")};if(S.options.parameters&&S.options.parameters.length){for(var g=0,h=S.options.parameters.length;g<h;g++){if(i[0][S.options.parameters[g]]){this[S.options.parameters[g]]=i[0][S.options.parameters[g]]}}}}this.findNodeBy=function(h,m){var k=[],g=U.getElementsByTagName("li");for(var j=0,l=g.length;j<l;j++){if(g[j][h]==m){k.push(new T(B(g[j])))}}if(k.length==0){return null}else{if(k.length==1){return k[0]}else{return k}}};if(H.url){var Q=document.createElement("div");Q.className="tree-spinner";if(H.spinnerId){Q.id=H.spinnerId}B("body").append(Q);M.spinner=B(Q).spinner();M.spinner.hide()}for(var X in M.events){if(typeof H[X]=="function"){M.events[X]=H[X]}}function Y(g){return !(g.tagName.toLowerCase()=="li"&&B("li:not(.tree-helper)",g).length<1)}function D(g){this.$li=B(g);this.height=this.$li.height()}D.prototype.append=function(g){if(this.$li[0]==g){return false}if(this.$li[0].toBeLoaded){var j=this;this.load(function(){j.append(g)});return false}if(this.$li[0].tagName.toLowerCase()=="li"){var i=B("ul:first",this.$li);var h=g.parentNode.parentNode;B(".rollback:first",h).css("display","none");if(i.length){i.append(g);if(this.$li[0].ordered){this.order(J)}}else{i=document.createElement("ul");i.appendChild(g);this.$li[0].appendChild(i);this.$li.addClass("opened");B(".click-zone:first",this.$li).css("display","inline");B(".rollback:first",this.$li).css("display","none")}if(!Y(h)){M.visibleNodes[h.num].notaFolderAnymore()}setTimeout(N,0);M.events.append.call({source:g,target:this.$li[0]})}};D.prototype.below=function(g){var h=g.parentNode.parentNode;this.$li.after(g);B(".rollback:first",h).css("display","none");if(Y(h)){if(!B(g.parentNode).hasClass("ui-tree")&&!g.parentNode.parentNode.undraggable){g.parentNode.parentNode.ordered=false;B(".abc:first",g.parentNode.parentNode).css("display","block");B(".rollback:first",g.parentNode.parentNode).css("display","none")}}else{M.visibleNodes[h.num].notaFolderAnymore()}setTimeout(N,0);M.events.insertbelow.call({source:g,target:this.$li[0]})};D.prototype.above=function(g){var h=g.parentNode.parentNode;this.$li.before(g);B(".rollback:first",h).css("display","none");if(Y(h)){if(!B(g.parentNode).hasClass("ui-tree")&&!g.parentNode.parentNode.undraggable){g.parentNode.parentNode.ordered=false;B(".abc:first",g.parentNode.parentNode).css("display","block");B(".rollback:first",g.parentNode.parentNode).css("display","none")}}else{M.visibleNodes[h.num].notaFolderAnymore()}setTimeout(N,0);M.events.insertabove.call({source:g,target:this.$li[0]})};D.prototype.order=function(m){var g=this.$li[0];g.ordered=true;var j=B("ul:first",this.$li);if(j.length){var h=[];g.oldorder=[];B("li",this.$li).each(function(){if(this.parentNode.parentNode==g){h.push(this);g.oldorder.push(this)}});function n(o,i){var q=B("span",o).text().replace(/^\s+|\s+$/g,""),p=B("span",i).text().replace(/^\s+|\s+$/g,"");return m(q,p)}h.sort(n);g.order=h;for(var k=0,l=h.length;k<l;k++){j.append(h[k])}}N()};D.prototype.orderUndo=function(){var g=this.$li[0];g.ordered=false;var h=B("ul:first",this.$li);if(g.oldorder&&h.length&&h[0].parentNode==g){for(var j=0,k=g.oldorder.length;j<k;j++){h.append(g.oldorder[j])}}g.oldorder=null;g.oldor=null;N()};D.prototype.open=function(h){h=h||function(){};if(this.$li.hasClass("closed")){var g=B("ul:has(li)",this.$li);if(g.length){g.show();this.closed=false;this.$li.removeClass("closed").addClass("opened");N();h(true);return true}else{return this.load(h)}}h(false);return false};D.prototype.close=function(h){h=h||function(){};var g=this.$li.contents().filter("ul:has(li)");if(g.length){g.hide();this.closed=true;this.$li.removeClass("opened").addClass("closed");M.visibleNodes.splice(this.$li[0].num+1,g[0].getElementsByTagName("li").length);N();h()}};D.prototype.load=function(p){var g=S.options.url;if(!g){return false}p=p||function(){};this.$li[0].toBeLoaded=false;this.$li[0].closed=true;var j={};if(H.parameters&&H.parameters.length){for(var k=0,q=H.parameters.length;k<q;k++){j[H.parameters[k]]=(this.$li[0][H.parameters[k]]||"")}}var h=this,n=this.$li[0].getElementsByTagName("span")[0],o=n.offsetWidth,m=Math.round(B(n).offset().left);h.loading=true;M.spinner.putInBox({x:m+o,y:this.top,width:25,height:M.H});M.spinner.show();var l=function(v){var t=B("ul",h.$li);if(!t.length){t=document.createElement("ul");h.$li[0].appendChild(t);t=B(t)}h.ordered=(typeof v[0].position!="number");for(var s=0,u=v.length;s<u;s++){var r=W(v[s]);t[0].appendChild(r);C.call(r)}t.hide();h.open(p);M.events.load();M.spinner.hide();h.$li[0].ordered=h.ordered;B(".abc:first",h.$li[0]).css("display",h.ordered||r.undraggable?"none":"block");B(".rollback:first",h.$li[0]).css("display","none")};B.ajax({url:g,type:"GET",dataType:"json",data:j,success:l});return true};D.prototype.notaFolderAnymore=function(){this.$li.removeClass("closed").removeClass("opened");B(".click-zone:first",this.$li).hide();B(".abc:first",this.$li).css("display","none");B(".rollback:first",this.$li).css("display","none");var g=this.$li[0].getElementsByTagName("ul");this.closed=false;if(g.length){this.$li[0].removeChild(g[0])}};function L(g){var h=M.points[g];if(typeof h!="undefined"){return{visibleNode:M.visibleNodes[h.num],where:h.where,top:h.top}}else{return{visibleNode:new D(U),where:"append",top:M.dim.top}}}function I(){var m={y:0,num:0};M.points=[];for(var h=0,l=M.visibleNodes.length;h<l;h++){var o=M.visibleNodes[h].$li.offset(),p=Math.round(o.top);M.visibleNodes[h].top=p;M.visibleNodes[h].left=Math.round(o.left);if(m.y){var n=(p-m.y)/4;for(var k=m.y;k<p;k++){var g=(k-m.y<n)?"above":(k-m.y<n*3)?"append":"below";M.points[k]={num:m.num,where:g,top:m.y}}}if(h==l-1){var n=(M.visibleNodes[h].height)/4;for(var k=p;k<p+M.visibleNodes[h].height;k++){var g=(k-p<n)?"above":(k-p<n*3)?"append":"below";M.points[k]={num:h,where:g,top:p}}}m.y=p;m.num=h}}function N(){M.visibleNodes=[];var g=B("li:visible",U);for(var h=0,j=g.length;h<j;h++){if(!B(g[h]).hasClass("tree-helper")){g[h].num=M.visibleNodes.length;M.visibleNodes.push(new D(g[h]))}}I()}this.updateVisibleNodes=N;var a=function(){var g={distance:3,helper:"clone",opacity:0.7,cursorAt:{top:M.H/2,left:30},stop:function(l,k){clearInterval(M.timer);clearTimeout(M.opentimer);M.opentimer=null;var i=L(M.prev);i.visibleNode.$li.removeClass("over").removeClass("above").removeClass("append").removeClass("below");i.visibleNode.$li.next().removeClass("over").removeClass("above").removeClass("append").removeClass("below");M.win.unbind("keypress",M.escape);delete M.escape;if(g.revert){g.revert=false;return false}i=L(l.pageY);var j=i.visibleNode.$li[0],h=true;while(j!=U){if(j==this){h=false;break}j=j.parentNode}h=h&&!(i.where=="above"&&i.visibleNode.$li.prev()[0]==this)&&!(i.where=="append"&&i.visibleNode.$li[0]==this.parentNode.parentNode);if(h){i.visibleNode[i.where](this);M.events.drop.call({position:i.where,source:this,target:i.visibleNode.$li[0]})}},start:function(j,h){var i=this;h.helper.append("<strong></strong>").addClass("tree-helper").find(".button-panel").remove();M.events.grab.call(i);if(this.undraggable){h.helper.addClass("no");g.revert=true}M.escape=function(m){if(m.keyCode==27){var k=L(M.prev);k.visibleNode.$li.removeClass("over").removeClass("above").removeClass("append").removeClass("below");k.visibleNode.$li.next().removeClass("over").removeClass("above").removeClass("append").removeClass("below");var l=h.helper.clone();h.helper.before(l);l.animate({left:Math.round(B(i).offset().left)+"px",top:Math.round(B(i).offset().top)+"px",opacity:0},"slow","swing",function(){l.remove()});h.helper.css("display","none");g.revert=true}};M.win.keypress(M.escape)},drag:function(n,m){var h=L(M.prev);h.visibleNode.$li.removeClass("above").removeClass("append").removeClass("below");h.visibleNode.$li.next().removeClass("above").removeClass("append").removeClass("below");if(!g.revert||M.out){M.prev=n.pageY;var k=L(M.prev);if(k.visibleNode.$li[0]==U){g.revert=true;M.out=true;return }else{if(M.out){M.out=false;g.revert=false}}if(k.visibleNode!=h.visibleNode){M.events.nodeout.call(h.visibleNode.$li);if(M.opentimer){clearTimeout(M.opentimer);M.opentimer=false}}M.events.nodeover.call({element:k.visibleNode.$li,position:k.where});var j=k.where,i=k.visibleNode.$li.next();if(j=="below"&&i.length&&!i.hasClass("tree-helper")){i.addClass("above")}else{L(M.prev).visibleNode.$li.addClass(j)}if(k.where=="append"&&(k.visibleNode.closed||k.visibleNode.$li[0].toBeLoaded)&&!M.opentimer){M.opentimer=(function(o){return setTimeout(function(){o.visibleNode.$li.removeClass("append");o.visibleNode.open(function(){M.opentimer=false})},500)})(k)}var l=arguments.callee;if(M.win.height()-n.pageY+M.win.scrollTop()<30){clearInterval(M.timer);M.timer=setInterval(function(){window.scrollBy(0,4);m.helper.css("top",parseInt(m.helper.css("top"))+4+"px");l({pageY:n.pageY+4},m)},M.win.height()-n.pageY+M.win.scrollTop())}else{if(M.win.scrollTop()>0&&(n.pageY-M.win.scrollTop())<30){clearInterval(M.timer);M.timer=setInterval(function(){window.scrollBy(0,-4);l({pageY:n.pageY-4},m);m.helper.css("top",parseInt(m.helper.css("top"))-4+"px")},n.pageY-M.win.scrollTop())}else{if(M.timer){clearInterval(M.timer)}}}M.events.drag.call({element:this,left:n.pageX,top:n.pageY})}}};return g};function C(){var g=B(this);if(S.options.undraggable){g.mousedown(A)}else{g.draggable(a());g[0].undraggable=g.hasClass("undraggable")}var h=B(this.getElementsByTagName("a")[0]);if(S.options.unclickable){g.addClass("unclickable");h.click(A)}else{h.click(M.events.click)}if(S.options.oninsert){S.options.oninsert.call(new T(g),h)}}B.ui.tree.callNumber=0;var P=function(g){if(M.visibleNodes[this.parentNode.num].loading){return }if(B(this.parentNode).hasClass("closed")){M.visibleNodes[this.parentNode.num].open()}else{M.visibleNodes[this.parentNode.num].close()}return false},R=function(g){if(!B(g.target).hasClass("tree-helper")){B(".button-panel:first",this).addClass("hover")}return false},d=function(g){if(!B(g.target).hasClass("tree-helper")){B(".button-panel:first",this).removeClass("hover")}return false},c=function(){var g=M.visibleNodes[this.parentNode.parentNode.num];g.order(J);M.events.order.call({source:g.$li[0]});B(this).hide();B("a.rollback",this.parentNode).show();return false},V=function(h){var g=M.visibleNodes[this.parentNode.parentNode.num];g.orderUndo();M.events.orderUndo.call({source:g.$li[0],orderedChildren:B("ul:first",g.$li[0]).children()});B(this).hide();B("a.abc",this.parentNode).show();return false},f=function(h){h.preventDefault();var g=M.visibleNodes[this.parentNode.parentNode.num];M.events.preview.call({source:preview,node:g.$li[0]})},Z=function(h){h.preventDefault();var g=M.visibleNodes[this.parentNode.parentNode.num];M.events.remove.call({source:g.$li[0]})};function W(i){var t=document.createElement("li");t.className=i.nodeClass;if(S.options.parameters&&S.options.parameters.length){for(var l=0,m=S.options.parameters.length;l<m;l++){if(i[S.options.parameters[l]]){t[S.options.parameters[l]]=i[S.options.parameters[l]]}}}if(S.options.nodeId){t.id="node-"+i[S.options.nodeId]}var r=document.createElement("a"),s=document.createElement("span"),k=document.createElement("i");k.className="decorator";r.href=i.href;s.appendChild(document.createTextNode(i.text));r.appendChild(s);r.appendChild(k);r.className=i.linkClass;var n=document.createElement("div");B(n).addClass("click-zone");B(n).click(P);B(t).mouseover(R).mouseout(d);t.appendChild(n);t.appendChild(r);var g=document.createElement("div");g.className="button-panel";t.appendChild(g);var q=document.createElement("a");q.className="abc";q.title="Sort Alphabetically";g.appendChild(q);var h=document.createElement("a");h.className="rollback";h.title="Undo Sorting";g.appendChild(h);B(q).click(c);B(h).click(V);if(S.options.isAdministrator){var o=document.createElement("a");o.className="preview-node";o.title="Preview";g.appendChild(o);B(o).click(f);var u=document.createElement("a");u.className="remove-node";u.title="Delete";g.appendChild(u);B(u).click(Z)}B(q).css("display","none");B(h).css("display","none");var p=B(t);if(p.hasClass("opened")){p.removeClass("opened").addClass("closed");t.closed=true}else{if(p.hasClass("closed")){t.toBeLoaded=true}else{B(n).css("display","none")}}return t}var O=E.contents().filter("li");if(O.length>0){M.H=O.height();O.each(C);N();M.events.onready.call(this)}else{var K=S.options.initUrl||S.options.url;if(!K){return false}M.spinner.putInBox({x:M.dim.left,y:M.dim.top,width:16,height:16});M.spinner.show();var b=++B.ui.tree.callNumber;B.getJSON(K,function(l){var k=+new Date;for(var h=0,j=l.length;h<j;h++){var g=W(l[h]);U.appendChild(g);if(h==0){M.H=B(g).height()}C.call(g)}N();M.spinner.hide();if(b==B.ui.tree.callNumber){M.events.onready.call(this);B.ui.tree.callNumber=0}})}M.offset=U.offsetTop;setInterval(function(){if(U.offsetTop!=M.offset){I();M.offset=U.offsetTop}},10);return this}})(jQuery);
jQuery.fn.movePageOrdering=function(I,J,G,E){var F=jQuery;var C=F("#confluence-context-path").attr("content");var B=F("#orderingPlaceHolder",this);B.addClass("loading").html(AJS.renderTemplate("movePagePanelLoading"));B.load(C+"/panels/reorderpage.action",{panelName:"reorder",spaceKey:I,title:J,movedPageId:AJS.params.pageId,pageTitle:G},function(){B.removeClass("loading");H(B,E);A(F(".siblings",B))});var D=function(M,O){var L;var N=M.prevAll("li.sibling")[0];if(N){L="below"}else{L="above";N=M.nextAll("li.sibling")[0]}if(N){AJS.log("Reorder: positionIndicator = "+L+" and target = "+N.innerHTML);var K=F("i",N).text();O(K,L)}};var H=function(K,P){var M=F(".dropper",K),O=F(".target",M);var L=0;F("li",M).each(function(Q){!Q&&F(this).before(F('<li class="leading">&nbsp;</li>'));F(this).after(F('<li class="leading">&nbsp;</li>'))});var N=O.next();F(".leading",M).hover(function(Q){F(this).addClass("here")},function(){F(this).removeClass("here")}).click(function(){D(F(this),P);var Q=this;O.hide(150,function(){Q!=N[0]&&F(Q).after(N).after(O);O.show(150)})})};var A=function(K){var M=F(".target",K);if(M.length){var L=M.position().top;var N=K.height();if(L<0||L>N){K.scrollTop(K.scrollTop()+L-N/3)}}}};
jQuery.fn.shortenUntil=function(D){var B=jQuery;var C=0;while(!D()&&C<this.length){var A=B(this[C]).text();if(A=="\u2026"){C++;continue}B(this[C]).text(A.replace(/[^\u2026]\u2026?$/,"\u2026"))}return this};jQuery.fn.renderBreadcrumbs=function(I){var F=jQuery,D=this,H=[],G=0,K=I.length-1;var A=I[G];var B=A.url.indexOf("~")>=0?"personalspacedesc":"spacedesc";H.push(AJS.renderTemplate("movePageBreadcrumb",A.title,A.url,(G==K?"last content-type-"+B:""),A.title));while(G++<K){var J=I[G];H.push(AJS.renderTemplate("movePageBreadcrumb",J.title,J.url,(G==K?"last content-type-"+I.type:""),J.title))}var E=function(){return D.width()<D.closest(".breadcrumbs-container").width()};this.html(H.join(""));var C=F("li a span",this);C.each(function(L){if(L!=0&&L!=K){F(this).shortenUntil(E)}});F(C.get(0)).shortenUntil(E);F(C.get(K)).shortenUntil(E);return this};AJS.toInit(function(D){var B=D("#confluence-context-path").attr("content");function A(E){for(var F=1;F<E.length;F++){if(E[F].title==AJS.params.pageTitle){return false}}return true}if(!AJS.MoveDialog){AJS.MoveDialog={}}var C={};AJS.MoveDialog.getBreadcrumbs=function(F,H,E){var G=F.userName?F.userName:(F.pageId?(F.pageId+":"+F.fileName):(F.spaceKey+":"+F.title+":"+F.postingDay+":"+F.fileName));if(G in C){H(C[G],"success");return }D.ajax({type:"GET",dataType:"json",data:F,url:B+"/pages/breadcrumb.action",error:E||function(){},success:function(J,K){if(!J||!J.breadcrumbs){E(J,K);return }var I=D.makeArray(J.breadcrumbs);while(I[0]&&(/dashboard.action$/.test(I[0].url)||(J.type!="userinfo"&&/peopledirectory.action$/.test(I[0].url)))){I.shift()}I.type=J.type;C[G]=I;H(I,K)}})};AJS.MoveDialog.Breadcrumbs=function(G){var E=0;function F(K,J,I){G.renderBreadcrumbs(J);var H=K!=AJS.params.spaceKey||A(J);if(H){I.clearErrors();D(I.moveButton).attr("disabled","")}else{I.error(AJS.params.movePageDialogInvalidLocation);D("li:last-child",G).addClass("warning")}}return{update:function(I,H){G.html(AJS.renderTemplate("movePageBreadcrumbLoading"));var J=E+=1;var K=function(){if(J!=E){AJS.log("Breadcrumb response for ");AJS.log(I);AJS.log(" is stale, ignoring.");return true}return false};AJS.MoveDialog.getBreadcrumbs(I,function(L,M){if(K()){return }if(M!="success"||!L){G.html(AJS.renderTemplate("movePageBreadcrumbError",M));return }F(I.spaceKey,L,H)},function(L){if(K()){return }G.html(AJS.renderTemplate("movePageBreadcrumbError"));if(L.status==404){H.error(AJS.params.movePageDialogLocationNotFound)}})}}}});
jQuery.fn.movePageAutocomplete=function(D,C,B,A){var F=jQuery;var E=A;AJS.log(D);return F(this).quicksearch(D,null,{dropdownPostprocess:function(G){F("> ol.last",G).remove();if(!F("> ol",G).length){F(G).append(AJS.renderTemplate(B))}F("> ol:last-child",G).addClass("last");F("a",G).attr("tabindex","-1")},dropdownPlacement:function(G){F(C).append(G)},ajsDropDownOptions:{selectionHandler:function(H,G){if(G){this.hide("selected");E(H,G);H.preventDefault()}}}})};jQuery.fn.movePageLocation=function(C){var F=jQuery;var B=F(this);var E=F("#new-space",B);var D=F("#new-space-key",B);var A=F("#new-parent-page",B);var G=function(){if(E.val()==""){E.val(AJS.params.spaceName);D.val(AJS.params.spaceKey)}C.clearErrors();C.select(D.val(),E.val(),A.val())};A.blur(G).focus(function(){C.clearErrors();AJS.dropDown.current&&AJS.dropDown.current.hide()});E.blur(G).focus(function(){AJS.dropDown.current&&AJS.dropDown.current.hide()});E.movePageAutocomplete("/json/contentnamesearch.action?type=spacedesc&type=personalspacedesc",F(".new-space-dropdown",B),"movePageNoMatchingSpaces",function(J,I){var H=I.find("span").data("properties");D.val(H.spaceKey);E.val(AJS("span").html(H.name).text());A.val("");G();A.focus()});A.movePageAutocomplete(function(){return"/json/contentnamesearch.action?type=page&spaceKey="+D.val()},F(".new-parent-page-dropdown",B),"movePageNoMatchingPages",function(I,H){var J=AJS("span").html(H.find("span").data("properties").name).text();A.val(J);G();window.setTimeout(function(){C.moveButton.focus()},50)})};
jQuery.fn.movePageSearch=function(B){var H=jQuery;var C=H("#confluence-context-path").attr("content");var A=this;var E=H("input[type=button]",A);var G=H("input.search-query",A);var F=H(".search-space",A);var D=H(".search-results",A);H([F[0],G[0]]).keydown(function(I){if(I.which==13){E.click()}});H([G[0],D[0]]).keydown(function(J){function I(N){var L=H(".search-result",A);var M=H(".search-result.selected",A);var K=L.index(M)+N;if(K<0){K=L.length-1}if(K>=L.length){K=0}L.eq(K).click()}if(J.which==38){I(-1)}else{if(J.which==40){I(1)}}});E.click(function(){B.clearErrors();var I=G.val();if(I==""){D.empty();return }D.html(AJS.getTemplate("movePageSearchResultsLoading").toString());H.ajax({type:"GET",dataType:"json",data:{queryString:I,where:F.val(),types:["spacedesc","personalspacedesc","page"]},url:C+"/json/search.action",error:function(){B.error(AJS.params.movePageDialogSearchError)},success:function(K,J){if(J!="success"){B.error(AJS.params.movePageDialogSearchError);return }var L={select:function(M,N){if(N.type=="page"){B.select(N.spaceKey,N.spaceName,N.title,N.id)}else{B.select(N.spaceKey,N.spaceName)}}};D.searchResultsGrid(I,K,H(B).extend(L),{noSearchResults:AJS.params.movePageDialogSearchNoResults,resultsCount:AJS.params.movePageDialogSearchResultCount})}})})};
jQuery.fn.movePageHistory=function(B){var E=jQuery;var C=E("#confluence-context-path").attr("content");var A=this;var D=E(".search-results",A);E(D).keydown(function(G){function F(K){var I=E(".search-result",A);var J=E(".search-result.selected",A);var H=I.index(J)+K;if(H<0){H=I.length-1}if(H>=I.length){H=0}I.eq(H).click()}if(G.which==38){F(-1)}else{if(G.which==40){F(1)}}});D.html(AJS.getTemplate("movePageHistoryLoading").toString());E.ajax({type:"GET",dataType:"json",data:{types:["spacedesc","personalspacedesc","page"]},url:C+"/json/history.action",error:function(){B.error(AJS.params.movePageDialogHistoryError)},success:function(G,F){if(F!="success"){B.error(AJS.params.movePageDialogHistoryError);return }if(!G.history||G.history.length==0){D.html("<div class='no-results'>"+AJS.params.movePageDialogHistoryNoResults+"</div>");return }D.html(AJS.getTemplate("searchResultsGrid").toString());E.each(G.history,function(){var I=this;if(I.id==AJS.params.pageId){return }var H=AJS.$(AJS.renderTemplate("searchResultsGridRow",[I.title,C+I.url,I.type,I.spaceName,I.spaceKey,I.friendlyDate,I.date]));E(H).click(function(J){if(I.type=="page"){B.select(I.spaceKey,I.spaceName,I.title,I.id)}else{B.select(I.spaceKey,I.spaceName)}D.find(".selected").removeClass("selected");E(this).addClass("selected");return AJS.stopEvent(J)});E(H).hover(function(){E(this).addClass("hover")},function(){E(this).removeClass("hover")});D.find("table").append(H)});if(E(".search-result",D).length==0){D.html("<div class='no-results'>"+AJS.params.movePageDialogHistoryNoResults+"</div>")}}})};
jQuery.fn.movePageBrowse=function(M,J,B,L,D,F){var E=jQuery;var C=E("#confluence-context-path").attr("content");var A=this;var G=E(".tree",A);G.addClass("loading").html(AJS.renderTemplate("movePagePanelLoading"));var O,K=function(){G.removeClass("rendering").addClass("expanding");E("#parent-selection-tree .dialog-button-panel").remove();H(AJS.params.spaceKey,D,function(R){if(R&&D!=""){var P=O.findNodeBy("text",D);if(P){P.$.find("> a").addClass("current-parent")}}if(R&&AJS.params.pageTitle!=""){var Q=O.findNodeBy("text",AJS.params.pageTitle);if(Q){Q.makeUnclickable();if(AJS.params.pageTitle!=F){Q.setText(F)}}}H(J,L,function(V){if(V){var U=O.findNodeBy("text",L);if(U){U.$.find("> a").addClass("highlighted");var S=U.$.position().top;var T=G.height();if(S<0||S>T){G.scrollTop(G.scrollTop()+S-T/3)}}}G.removeClass("expanding")})})};var I=function(P){P.preventDefault();E("a.highlighted",G).removeClass("highlighted");E(this).addClass("highlighted");J=E("#chosenSpaceKey").val();B=E("#chosenSpaceKey option:selected").text();L=E(this).hasClass("root-node")?"":E(this).find("span").text();M.select(J,B,L)};var N=function(){E("select#chosenSpaceKey").val(J).change(function(){var Q=E(this).val();var P=E(this).find("option:selected").text();E("#tree-root-node-item a").text(P).toggleClass("highlighted",J==Q&&L=="").toggleClass("current-parent",AJS.params.spaceKey==Q&&D=="");G.addClass("rendering");O=O.reload({initUrl:C+"/pages/children.action?spaceKey="+encodeURIComponent(Q)+"&node=root"})});E("#tree-root-div").html(AJS.renderTemplate("movePageBrowsePanelSpace",B)).find("a").click(I).toggleClass("highlighted",L=="").toggleClass("current-parent",AJS.params.spaceKey==J&&D=="")};var H=function(Q,P,R){if(Q!=E("#chosenSpaceKey").val()){R(false);return }console.log("before breadcrumbs");AJS.MoveDialog.getBreadcrumbs({spaceKey:Q,title:P},function(S){var T=E.map(S.slice(1),function(U){return{text:U.title}});console.log("before expandPath");O.expandPath(T,function(){console.log("expandPath callback");R(true)})},function(){M.error("Could not retrieve tree expansion information.");R(false)})};G.load(C+"/panels/browsepagelocation.action",{panelName:"browse",dialogMode:"view",spaceKey:J,parentPageString:L,pageId:AJS.params.pageId},function(){G.removeClass("loading").addClass("rendering");N();O=E("#parent-selection-tree").tree({url:C+"/pages/children.action",initUrl:C+"/pages/children.action?spaceKey="+encodeURIComponent(J)+"&node=root",parameters:["pageId","text"],undraggable:true,spinnerId:"move-page-dialog-spinner",nodeId:"pageId",click:I,onready:K,oninsert:function(){var P=this.$;if(P.parents("li:first").attr("unclickable")){this.makeUnclickable()}}});AJS.MoveDialog.tree=O})};
AJS.toInit(function(C){var D=function(T){T=C.extend({spaceKey:AJS.params.spaceKey,spaceName:AJS.params.spaceName,parentPageTitle:AJS.params.parentPageTitle,title:AJS.params.movePageDialogViewPageTitle,buttonName:AJS.params.movePageDialogMoveButton,moveHandler:function(U){AJS.log("No move handler defined. Closing dialog.");U.remove()},cancelHandler:function(U){U.remove()},pageTitleAccessor:function(){return AJS.params.pageTitle}},T);var S={spaceKey:T.spaceKey,spaceName:T.spaceName,parentPageTitle:T.parentPageTitle};var O=T.spaceKey;var H=T.spaceName;var P=T.parentPageTitle;var Q="";var K="";var E=function(U,V){Q=U;K=V};var I=AJS.ConfluenceDialog({width:800,height:590,id:"move-page-dialog"});I.addHeader(T.title);I.addPanel(AJS.params.movePageDialogLocationPanel,AJS.renderTemplate("movePageDialog"),"location-panel","location-panel-id");I.addPanel(AJS.params.movePageDialogSearchPanel,AJS.renderTemplate("movePageSearchPanel"),"search-panel","search-panel-id");I.addPanel(AJS.params.movePageDialogHistoryPanel,AJS.renderTemplate("movePageHistoryPanel"),"history-panel","history-panel-id");I.addPanel(AJS.params.movePageDialogBrowsePanel,AJS.renderTemplate("movePageBrowsePanel"),"browse-panel","browse-panel-id");I.get("panel:0")[0].onselect=function(){C("#new-space-key").val(O);C("#new-space").val(H);C("#new-parent-page").val(P).select()};I.get("panel:1")[0].onselect=function(){C("#move-page-dialog .search-panel .search-results .selected").removeClass("selected");C("#move-page-dialog input.search-query").focus()};I.get("panel:0").select();gotoReorderPage=function(V){V.nextPage();var U=C("#move-page-dialog");C(".ordering-panel",U).movePageOrdering(O,P,T.pageTitleAccessor(),E)};moveFunction=function(V){var X=C("#new-space:visible").val();var W=C("#new-space-key").val();var U=C("#new-parent-page:visible").val();if(X&&(X!=H||W!=O||U!=P)){AJS.MoveDialog.getBreadcrumbs({spaceKey:W,pageTitle:U},function(){T.moveHandler(V,W,X,U,Q,K,M)},function(Y){C("#new-parent-breadcrumbs").html(AJS.renderTemplate("movePageBreadcrumbError"));if(Y.status==404){R.error(AJS.params.movePageDialogLocationNotFound)}})}else{T.moveHandler(V,O,H,P,Q,K,M)}};executeMove=function(U){if(C("#reorderCheck")[0].checked){gotoReorderPage(U)}else{moveFunction(U)}};I.addButton(T.buttonName,executeMove,"move-button");I.addButton("cancel.name",T.cancelHandler,"move-cancel-button");I.popup.element.find(".dialog-button-panel").append(AJS.renderTemplate("move-help-link"));I.addPage();I.page[1].addHeader(T.title);I.page[1].addPanel(AJS.params.movePageDialogOrderingTitle,AJS.renderTemplate("orderingPagePanel"),"ordering-panel","ordering-panel-id");I.page[1].addButton(AJS.params.movePageDialogBackButton,function(U){U.prevPage()},"back left");I.page[1].addButton(AJS.params.movePageDialogMoveAndOrderButton,moveFunction,"reorder-button");I.page[1].addButton(AJS.params.movePageDialogCancelButton,T.cancelHandler,"move-cancel-button");var G=I.get("button#"+T.buttonName)[0].item;C("button.move-button").before(AJS.renderTemplate("reorderCheckbox"));I.gotoPage(0);I.show();var N=C("#move-page-dialog");C(".location-panel .location-info",N).appendTo(C(".dialog-page-body:first",N));C(".dialog-button-panel:visible",N).prepend(AJS.renderTemplate("movePageErrors"));var F=new AJS.MoveDialog.Breadcrumbs(C("#new-parent-breadcrumbs"));function M(U){if(!U||U.length==0){C("#move-errors").addClass("hidden");C(G).attr("disabled","");return }if(!C.isArray(U)){U=[U]}C("#move-errors").text(U[0]).attr("title",U.join("\n")).removeClass("hidden");I.gotoPage(0)}var R={moveButton:G,clearErrors:function(){M([])},error:M,select:function(W,V,U){AJS.log("select: "+[W,V,U].join());O=W;H=V;P=U||"";C(G).attr("disabled","disabled");F.update({spaceKey:O,title:P},R)}};var J=AJS.params.parentPageTitle!=""?AJS.params.parentPageTitle:AJS.params.fromPageTitle;var L=new AJS.MoveDialog.Breadcrumbs(C("#current-parent-breadcrumbs"));L.update({spaceKey:AJS.params.spaceKey,title:J},R);C(".location-panel",N).movePageLocation(R);C(".search-panel",N).movePageSearch(R);C(".history-panel",N).movePageHistory(R);I.get("panel:2")[0].onselect=function(){C(".history-panel",N).movePageHistory(R)};I.get("panel:3")[0].onselect=function(){AJS.log("browse: "+[O,H,P].join());C(".browse-panel",N).movePageBrowse(R,O,H,P,J,T.pageTitleAccessor())};C("#new-parent-page").select();return N};var B=function(G,F,H,E){var I={pageId:AJS.params.pageId,spaceKey:G};if(H){I.position=E;I.targetId=H}else{if(F!=""){I.targetTitle=F;I.position="append"}else{I.position="topLevel"}}return I};function A(I,K,E,L,N,F,H){I=I.popup.element;I.addClass("waiting");C("button",I).attr("disabled","disabled");var G=C("<div class='throbber'></div>");I.append(G);var M=Raphael.spinner(G[0],100,"#666");function J(O){H(O);I.removeClass("waiting");M();C("button",I).attr("disabled","")}C.ajax({url:contextPath+"/pages/movepage.action",type:"GET",dataType:"json",data:new B(K,L,N,F),error:function(){J(AJS.params.movePageDialogMoveFailed)},success:function(O){var P=[].concat(O.validationErrors||[]).concat(O.actionErrors||[]).concat(O.errorMessage||[]);if(P.length>0){J(P);return }window.location.href=contextPath+O.page.url+(O.page.url.indexOf("?")>=0?"&":"?")+"moved=true"}})}C("#action-move-page-dialog-link").click(function(E){E.preventDefault();if(C("#move-page-dialog").length>0){C("#move-page-dialog, body > .shadow, body > .aui-blanket").remove()}new D({moveHandler:A});return false});C("#edit-move-page-dialog-link").click(function(E){E.preventDefault();if(C("#move-page-dialog").length>0){C("#move-page-dialog, body > .shadow, body > .aui-blanket").remove()}new D({spaceKey:C("#newSpaceKey").val(),spaceName:C("#space_content").text(),parentPageTitle:C("#parentPageString").val(),buttonName:AJS.params.movePageDialogOkButton,title:AJS.params.movePageDialogEditPageTitle,moveHandler:function(J,G,K,L,I,H,F){C("#space_content").text(K);C("#newSpaceKey").val(G);C("#parentPageString").val(L);C("#parent_content").text(L);if(L!=""){C("#position").val("append");C("#parent_info").removeClass("hidden")}else{C("#parent_info").addClass("hidden");C("#position").val("topLevel")}if(I){C("#targetId").val(I);C("#position").val(H)}J.remove()},pageTitleAccessor:function(){return C("#content-title").val()}});return false})});
var AJS=AJS||{};AJS.animation={running:[],queue:[],timer:null,duration:300,period:20,add:function(A){this.queue.push(A)},start:function(){if(this.timer!=null){return }this.running=this.queue;this.queue=[];jQuery.each(this.running,function(){if(this.onStart){this.onStart()}});var C=this;var B=new Date().getTime();var A=B+this.duration;this.timer=setInterval(function(){var D=new Date().getTime();var E=(D-B)/(A-B);if(E<=1){C.animate(E)}if(E>=1&&C.timer!=null){C.finish()}},this.period);return this.timer},finish:function(){clearInterval(this.timer);jQuery.each(this.running,function(){if(this.onFinish){this.onFinish()}});this.running=[];this.timer=null;if(this.queue.length>0){this.start()}},animate:function(A){jQuery.each(this.running,function(){if(this.animate){this.animate(AJS.animation.interpolate(A,this.start,this.end,this.reverse))}})},interpolate:function(D,C,A,B){if(typeof C!="undefined"&&typeof A!="undefined"){if(B){return A+D*(C-A)}else{return C+D*(A-C)}}return D},combine:function(A){return{animations:A,append:function(B){this.animations.push(B);return this},onStart:function(){jQuery.each(this.animations,function(){if(this.onStart){this.onStart()}})},onFinish:function(){jQuery.each(this.animations,function(){if(this.onFinish){this.onFinish()}})},animate:function(B){jQuery.each(this.animations,function(){if(this.animate){this.animate(AJS.animation.interpolate(B,this.start,this.end,this.reverse))}})}}}};
AJS.toInit(function(A){A("#ellipsis").click(function(){try{A(".hidden-crumb",A("#breadcrumbs")).removeClass("hidden-crumb");A(this).addClass("hidden-crumb")}catch(B){AJS.log(B)}})});
AJS.toInit(function(C){var A=function(F){return function(G){F.closest("form").find(".quick-nav-drop-down").append(G)}};var B=C("#quick-search-query"),E=C("#space-blog-search-query"),D=C("#confluence-space-key");B.quicksearch("/json/contentnamesearch.action",null,{dropdownPlacement:A(B)});if(E.length&&D.length){E.quicksearch("/json/contentnamesearch.action?type=blogpost&spaceKey="+AJS("i").html(D.attr("content")).text(),null,{dropdownPlacement:A(E)})}});
(function(A){AJS.contentHover=function(J,I,D,F,M){var B=A.extend(false,AJS.contentHover.opts,M);var H,L,C=A("#content-hover-"+I);if(!C.length){A(B.container).append(A('<div id="content-hover-'+I+'" class="ajs-content-hover"><div class="contents"></div></div>'));C=A("#content-hover-"+I);H=C.find(".contents");H.css("width",B.width+"px").mouseover(function(){clearTimeout(E.hideDelayTimer);C.unbind("mouseover")}).mouseout(function(){G()})}else{H=C.find(".contents")}var E=C[0];var K=function(){if(C.is(":visible")){return }E.showTimer=setTimeout(function(){if(!E.contentLoaded||!E.shouldShow){return }E.beingShown=true;var P=A(window),N=L.x-3,R=L.y+15;if(N+B.width+30>P.width()){C.css({right:"20px",left:"auto"})}else{C.css({left:N+"px",right:"auto"})}var O=(window.pageYOffset||document.documentElement.scrollTop)+P.height();if((R+C.height())>O){R=O-C.height()-5;C.mouseover(function(){clearTimeout(E.hideDelayTimer)}).mouseout(function(){G()})}C.css({top:R+"px"});var Q=A("#content-hover-shadow").appendTo(C).show();C.fadeIn(B.fadeTime,function(){E.beingShown=false});Q.css({width:H.outerWidth()+32+"px",height:H.outerHeight()+25+"px"});A(".b",Q).css("width",H.outerWidth()-26+"px");A(".l, .r",Q).css("height",H.outerHeight()-21+"px")},B.showDelay)};var G=function(){E.beingShown=false;E.shouldShow=false;clearTimeout(E.hideDelayTimer);clearTimeout(E.showTimer);clearTimeout(E.loadTimer);E.contentLoading=false;E.shouldLoadContent=false;E.hideDelayTimer=setTimeout(function(){C.fadeOut(B.fadeTime)},B.hideDelay)};A(J).mousemove(function(N){L={x:N.pageX,y:N.pageY};if(!E.beingShown){clearTimeout(E.showTimer)}E.shouldShow=true;if(!E.contentLoaded){if(E.contentLoading){if(E.shouldLoadContent){var O=(L.x-E.initialMousePosition.x)*(L.x-E.initialMousePosition.x)+(L.y-E.initialMousePosition.y)*(L.y-E.initialMousePosition.y);if(O>(B.mouseMoveThreshold*B.mouseMoveThreshold)){E.contentLoading=false;E.shouldLoadContent=false;clearTimeout(E.loadTimer);return }}}else{E.initialMousePosition=L;E.shouldLoadContent=true;E.contentLoading=true;E.loadTimer=setTimeout(function(){if(!E.shouldLoadContent){return }H.load(D,function(){E.contentLoaded=true;E.contentLoading=false;F.call(C,I);K()})},B.loadDelay)}}clearTimeout(E.hideDelayTimer);if(!E.beingShown){K()}}).mouseout(function(){G()});H.click(function(N){N.stopPropagation()});A("body").click(function(){E.beingShown=false;clearTimeout(E.hideDelayTimer);clearTimeout(E.showTimer);C.hide()});return C};AJS.contentHover.opts={fadeTime:100,hideDelay:500,showDelay:700,loadDelay:50,width:300,mouseMoveThreshold:10,container:"body"};AJS.toInit(function(){A("body").append(A('<div id="content-hover-shadow"><div class="tl"></div><div class="tr"></div><div class="l"></div><div class="r"></div><div class="bl"></div><div class="br"></div><div class="b"></div></div>'));A("#content-hover-shadow").hide()})})(jQuery);if(typeof AJS.followCallbacks=="undefined"){AJS.followCallbacks=[]}if(typeof AJS.favouriteCallbacks=="undefined"){AJS.favouriteCallbacks=[]}AJS.toInit(function(A){A(self).bind("hover-user.follow",function(E,D){for(var B=0,C=AJS.followCallbacks.length;B<C;B++){AJS.followCallbacks[B](D.username)}})});
AJS.Labels=(function(A){return{operationInProgress:false,updateStatus:function(B){A("#labelOperationStatus").html(B);if(B!=""){A("#waitImageAndStatus").addClass("open")}else{A("#waitImageAndStatus").removeClass("open")}},startOperation:function(B){AJS.Labels.operationInProgress=true;A("#errorSpan").html("");AJS.Labels.labelOperationError("");AJS.Labels.updateStatus(B)},finishOperation:function(){AJS.Labels.updateStatus("");AJS.Labels.operationInProgress=false},handleError:function(B){AJS.Labels.operationInProgress=false;AJS.Labels.updateStatus("");A("#errorSpan").html(B)},labelOperationError:function(B){A("#labelOperationErrorMessage").html(B);if(B!=""){AJS.setVisible("#labelOperationErrorContainer",true)}else{AJS.setVisible("#labelOperationErrorContainer",false)}},addLabelFromInput:function(){return AJS.Labels.addLabel(A("#labelsString").val())},addLabel:function(B){if(!AJS.Labels.operationInProgress&&B&&B!=""){AJS.Labels.startOperation("Adding label...");var C={entityIdString:AJS.params.pageId,labelString:B};AJS.safe.ajax({type:"POST",url:AJS.params.contextPath+"/json/addlabelactivity.action",data:C,success:AJS.Labels.addLabelCallback,error:AJS.Labels.addLabelErrorHandler,dataType:"json"})}return false},addLabelCallback:function(B){if(B.success){A("#labelsList").html(A("#labelsList").html()+B.response);A(".labels-editor .remove-label").unbind("click");A(".labels-editor .remove-label").click(AJS.Labels.removeLabel);A("#labelsString").val("")}else{AJS.Labels.labelOperationError(B.response)}A("#labelsString").focus();AJS.safe.ajax({url:AJS.params.contextPath+"/json/suggestlabelsactivity.action",data:{entityIdString:AJS.params.pageId},success:AJS.Labels.suggestedLabelsCallback,error:AJS.Labels.suggestedLabelsErrorHandler,dataType:"json"});AJS.Labels.finishOperation()},addLabelErrorHandler:function(){AJS.Labels.handleError("[41a] Error connecting to the server. The labels have not been updated.")},removeLabel:function(){if(!AJS.Labels.operationInProgress){AJS.Labels.startOperation("Removing label ...");var C=AJS.$(this).parent().attr("id").replace(/^label-/,"");var B={entityIdString:AJS.params.pageId,labelIdString:C};AJS.safe.ajax({type:"POST",url:AJS.params.contextPath+"/json/removelabelactivity.action",data:B,success:AJS.Labels.removeLabelCallback(C),error:AJS.Labels.removeLabelErrorHandler,dataType:"json"})}return false},removeLabelCallback:function(B){return function(C){if(C.success){var D=A("#label-"+B);D.fadeOut("slow",function(){D.remove()})}else{AJS.Labels.labelOperationError(C.response)}AJS.Labels.finishOperation()}},removeLabelErrorHandler:function(B){var C="Error connecting to the server. The labels have not been updated";if(B){C+=": "+B}AJS.Labels.handleError(C)},suggestedLabelsCallback:function(B){if(!B.success){return }A("#suggestedLabelsSpan").html(B.response);A("#suggestedLabelsSpan .suggested-label").click(function(D){var E=A("#labelsString").val();if(E.length>0){E+=" "}E+=A(this).text();A("#labelsString").val(E);var C=this;if(A(this).parent().find("a").length==1){C=A(this).parent()}A(C).fadeOut(function(){A(this).remove()});D.preventDefault()})},suggestedLabelsErrorHandler:function(B){var C="Error finding suggested labels. The labels have not been updated";if(B){C+=": "+B}AJS.Labels.handleError(C)},bindAutocomplete:function(){var G=A("#labelsString"),F=G.parents("#add-labels-form").length;if(!G.length){return }var D=function(H){A("#labelsAutocompleteList").append(H)};var E=function(O){if(O.find("a.label-suggestion").length){var P=A("span",O);var L=A.data(P[0],"properties");if(F){AJS.Labels.addLabel(L.name)}else{var N=G.val();var M=AJS.Labels.queryTokens;var R=-1,J="";for(var K=0;K<M.length;K++){J=M[K];var I=N.lastIndexOf(J);if(I>R){R=I}}if(R!=-1){var Q=N.substr(0,R);var H=N.substr(R+J.length).match(/^\s+/);if(H){Q+=H[0]}G.val(Q+L.name)}else{G.val(L.name)}}}};var B=function(){if(!A("#labelsAutocompleteList .label-suggestion").length){this.hide()}else{if(!F){var J=A("#labelsAutocompleteList a.label-suggestion");for(var H=0,I=J.length;H<I;H++){J.get(H).href="#"}}}};var C="/labels/autocompletelabel.action";A(window).bind("quicksearch.ajax-success",function(I,H){if(H.url==C){AJS.Labels.queryTokens=(H.json&&H.json.queryTokens)||[];return false}});A(window).bind("quicksearch.ajax-error",function(I,H){if(H.url==C){AJS.Labels.queryTokens=[];return false}});G.quicksearch(C,B,{makeParams:function(H){return{query:H,contentId:AJS.params.pageId||""}},dropdownPlacement:D,ajsDropDownOptions:{selectionHandler:function(I,H){E(H);this.hide();I.preventDefault()}}})},TagExtractor:function(B,C){this.tagPrefix=B;this.extractFromUrls=C;this.TAG_END=" ";this.parseTagsTo=function(J,G){var I=function(L,N){var M=L;while(M>0){switch(N[M]){case"/":case"&":return true;case" ":return false;default:M--}}return false};var F=0;while(F<J.length){var E=J.indexOf(this.tagPrefix,F);if(E==-1){return }if(!this.extractFromUrls&&I(E,J)){F=E+1}else{var H=E+this.tagPrefix.length;var D=J.indexOf(this.TAG_END,H);var K=J.indexOf(this.tagPrefix,H);if(K!=-1&&(D==-1||K<D)){D=K}if(D==-1){D=J.length}if(D!=E+this.tagPrefix.length){G(J.substring(H,D),H,D)}F=D}}}}}})(AJS.$);AJS.toInit(function(){AJS.Labels.bindAutocomplete()});
AJS.toInit(function(C){var B=function(D){C("#labels_div").toggleClass("hidden");C("#labels_info").toggleClass("hidden");if(C("#labels_div").hasClass("hidden")){C("#labels_info").html(C("#labelsString").val().toLowerCase());C("#labels_edit_link").html(AJS.params.editLabel)}else{AJS.safe.ajax({url:AJS.Data.get("context-path")+"/json/suggestlabelsactivity.action",data:{entityIdString:AJS.params.pageId},success:AJS.Labels.suggestedLabelsCallback,error:AJS.Labels.suggestedLabelsErrorHandler,dataType:"json"});C("#labels_edit_link").html(AJS.params.doneLabel)}if(D){D.preventDefault()}};var A=C("#labelsShowing");if(A.length&&A.val()=="true"){B()}C("#labels_edit_link").click(B)});
AJS.toInit(function(G){function D(I){return G.trim(I).length==0}var C,F=140;function E(){var I=new AJS.Dialog(650,200,"update-user-status-dialog");I.addHeader(AJS.params.statusDialogHeading||"What are you working on?");I.addPanel("Set Status","<form class='aui update-status'><fieldset><legend class='assistive'>Status Update</legend><label for='status-text' class='assistive'>"+AJS.params.statusDialogAccessibilityLabel+"</label><textarea name='status-text' id='status-text'></textarea><span id='update-status-chars-left'>"+F+"</span><div id='dialog-current-status' class='current-user-latest-status'>"+(AJS.params.statusDialogLatestLabel||"Latest:")+" <span class='status-text'></span></div></fieldset></form>");I.addButton(AJS.params.statusDialogUpdateButtonLabel||"Update",A,"status-update-button");I.addButton(AJS.params.statusDialogCancelButtonLabel||"Cancel",function(J){J.hide()},"status-cancel-button");I.popup.element.find(".dialog-button-panel").append("<span class='error-message'></span>");I.setError=function(J){G("#update-user-status-dialog .error-message").html(J)};return I}function B(I){G(".current-user-latest-status .status-text").html(I.text);G(".current-user-latest-status a[id^=view]").each(function(){var K=G(this),J=K.attr("href");K.attr("href",J.replace(/\d+$/,I.id)).text(I.friendlyDate).attr("title",new Date(I.date).toLocaleString())})}function H(){G.getJSON(AJS.Confluence.getContextPath()+"/status/current.action",function(I){if(I.errorMessage!=null){C.setError(I.errorMessage)}else{B(I)}})}var A=function(){var I=G("#update-user-status-dialog #status-text").attr("disabled","disabled").attr("readonly","readonly").blur();var J=I.val();G(".status-update-button").attr("disabled","disabled");if(J.length>F||D(J)){return false}AJS.safe.ajax({url:AJS.Confluence.getContextPath()+"/status/update.action",type:"POST",dataType:"json",data:{text:J},success:function(K){if(K.errorMessage!=null){C.setError(K.errorMessage)}else{B(K);I.val("");setTimeout(function(){C.hide()},1000)}},error:function(M,L,K){AJS.log("Error updating status: "+L);AJS.log(K);C.setError("There was an error - "+K)}})};G("#set-user-status-link").click(function(K){var J=G(this).parents(".ajs-drop-down")[0];J&&J.hide();if(typeof C=="undefined"){C=E();var L=G("#update-status-chars-left");var I=G(".status-update-button").attr("disabled","disabled");G("#update-user-status-dialog form.update-status #status-text").keydown(function(M){if(M.which==13){A()}}).bind("blur focus change "+(G.browser.mozilla?"paste input":"keyup"),function(){var M=F-G(this).val().length;L.removeClass("over-limit").removeClass("close-to-limit").text(M);I.removeAttr("disabled");if(D(G(this).val())){I.attr("disabled","disabled")}if(M<0){L.addClass("over-limit").html("&minus;"+-M);I.attr("disabled","disabled")}else{if(M<20){L.addClass("close-to-limit")}}});G("#update-user-status-dialog form.update-status").submit(function(M){A();return AJS.stopEvent(M)})}C.setError("");H();C.show();G("#update-user-status-dialog #status-text").removeAttr("readonly").removeAttr("disabled").focus();return AJS.stopEvent(K)})});
var GADGET_DIRECTORY = null;

GadgetDirectory = function() {};
GadgetDirectory.prototype = {
    dlg: null,
    gadget_list: null,

    showDialog: function() {
        //Create the dialog
        this.dlg.addHeader(GADGET_DIRECTORY.translations.header);
        this.dlg.addButton(GADGET_DIRECTORY.translations.closeButton, function(dlg) {dlg.hide();}, "button1");

        AJS.$(".throbber").hide();
        this.dlg.getCurrentPanel().html(this.buildPanel());
    },

    buildPanel: function() {
        return AJS.$("<div/>").addClass("directory-panel").append(this.buildDirectoryHelp()).append(this.buildDirectoryList());
    },

    buildDirectoryHelp: function() {
        var helpPanel = AJS.$("<div/>").addClass("directory-help");
        AJS.$("<h3/>").addClass("directory-help-title").html(GADGET_DIRECTORY.translations.helpTitle1).appendTo(helpPanel);
        AJS.$("<p/>").addClass("directory-help-text").html(GADGET_DIRECTORY.translations.helpBody1).appendTo(helpPanel);
        AJS.$("<h3/>").addClass("directory-help-title").html(GADGET_DIRECTORY.translations.helpTitle2).appendTo(helpPanel);
        AJS.$("<p/>").addClass("directory-help-text").html(GADGET_DIRECTORY.translations.helpBody2).appendTo(helpPanel);
        AJS.$("<p/>").html(GADGET_DIRECTORY.translations.moreInfo).appendTo(helpPanel);
        return helpPanel;
    },

    buildDirectoryList: function() {
        if (!GADGET_DIRECTORY.gadget_list)
            return AJS.$("<div/>").addClass("no-gadgets").html("No gadgets found.");

        var directory_list = AJS.$("<ol/>").addClass("macro-list");
        AJS.$.each(GADGET_DIRECTORY.gadget_list, function(i, gadget_item) {
            var directory_item = AJS.$("<li/>").attr("id", "macro-" + gadget_item.title.split(' ').join('')).addClass("macro-list-item");

            var title = AJS.$("<h3/>").addClass("macro-title").html(gadget_item.title);

            var gadgetUrl = AJS.$("<p/>").append(AJS.$("<span/>").append(AJS.$("<a/>").addClass("macro-uri").attr("href", gadget_item.url).attr("target", "_blank").attr("title", gadget_item.url).html(GADGET_DIRECTORY.translations.gadgetUrl)));
            var author = AJS.$("<p/>").addClass("macro-author");
            if (gadget_item.author) {
                author.html("By " + gadget_item.author);
            } else {
                author.html(GADGET_DIRECTORY.translations.noAuthor);
            }
            var description = AJS.$("<p/>").addClass("macro-desc");
            if (gadget_item.description) {
                description.html(gadget_item.description);
            } else {
                description.html(GADGET_DIRECTORY.translations.noDescription);
            }

            if (gadget_item.thumbnail) {
                var thumbnail = AJS.$("<img/>").addClass("macro-icon").attr({
                       height: 60,
                       width: 120,
                       alt: "",
                       src: gadget_item.thumbnail
                   });
                directory_item.append(thumbnail);
            }
            directory_item.append(title);
            directory_item.append(gadgetUrl);
            directory_item.append(author);
            directory_item.append(description);
            
            directory_list.append(directory_item);
        });

        return directory_list;
    },

    buildThrobber: function() {
        var throbber = AJS.$("<div/>").addClass("throbber");
        Raphael.spinner(throbber[0], 60, "#666");
        return throbber;
    },

    loadDirectory: function() {
        AJS.$(document).keyup(function (e) {
            if (e.keyCode == 27)  {
                GADGET_DIRECTORY.dlg.hide();
                AJS.$(document).unbind("keyup", arguments.callee);
                return AJS.stopEvent(e);
            }
        });
        if (this.dlg) {
            this.dlg.show();
        } else {
            this.dlg = new AJS.Dialog(865, 530, "gadget-directory-dialog");
            this.dlg.addPanel("", "panel1");
            this.dlg.getCurrentPanel().html(this.buildThrobber());
            this.dlg.getCurrentPanel().setPadding(0);
            this.dlg.getCurrentPanel().body.css("overflow", "hidden");
            this.dlg.show();

            AJS.$.ajax({
                    url: contextPath + "/rest/gadget/1.0/published/gadgetsdirectory",
                    type: "GET",
                    dataType: "json",
                    success: function(data) {
                        if (data.directoryList)
                            GADGET_DIRECTORY.gadget_list = data.directoryList;
                        GADGET_DIRECTORY.translations = data.translations;
                        GADGET_DIRECTORY.showDialog();
                    },
                    error: function() {
                        GADGET_DIRECTORY.dlg.getCurrentPanel().html(AJS.$("<div/>").addClass("loading-error").html("An error has occurred while trying to load the gadget directory."));
                    },
                    timeout: 12000
            });
        }
    }
};


AJS.toInit(function ($)
{
    GADGET_DIRECTORY = new GadgetDirectory();
    AJS.$("#gadget-directory-link").click(function (e) {
        GADGET_DIRECTORY.loadDirectory();
        e.preventDefault();
    });
});
function placeFocus(){if(document.location.hash||document.getElementById("editpageform")||document.getElementById("createpageform")||document.getElementById("upload-attachments")||document.getElementById("addcomment")){return }var I="";var A=window.location.search.substring(1);var E=A.split("&");for(var D=0;D<E.length;D++){var J=E[D].split("=")[0];var G=E[D].split("=")[1];if(J=="autofocus"&&(G!=null&&G.length>0)){I="'"+G+"'"}}var C=false;for(var D=0;D<document.forms.length;D++){var H=document.forms[D].elements;if(document.forms[D].id!="quick-search"&&document.forms[D].id!="space-blog-quick-search"&&document.forms[D].name!="inlinecommentform"){for(var B=0;B<H.length;B++){if((H[B].type=="text"||H[B].type=="password"||H[B].type=="textarea")&&!H[B].disabled&&!(H[B].style.display=="none")){try{if(I!=null&&I.length>0){if(H[B].id==I){H[B].focus();C=true;break}}else{H[B].focus();C=true;break}}catch(F){}}}}if(C){break}}}function setCookie(B,G,I,F,H,J,E,A){var D=B+"="+escape(G);if(I){var C=new Date(I,F,H);D+="; expires="+C.toGMTString()}if(J){D+="; path="+escape(J)}else{D+="; path=/"}if(E){D+="; domain="+escape(E)}if(A){D+="; secure"}document.cookie=D}function getCookie(B){var A=document.cookie.match(B+"=(.*?)(;|$)");if(A){return(unescape(A[1]))}else{return null}}function highlight(A){new Effect.Highlight(A,{endcolor:"#f0f0f0"})};

