(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F);},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this;}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H);}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E);}var F=o(I||[]);F.context=document;F.selector=E;return F;}}else{return o(H).find(E);}}else{if(o.isFunction(E)){return o(document).ready(E);}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context;}return this.setArray(o.isArray(E)?E:o.makeArray(E));},selector:"",jquery:"1.3.2",size:function(){return this.length;},get:function(E){return E===g?Array.prototype.slice.call(this):this[E];},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E;}else{if(H){G.selector=this.selector+"."+H+"("+E+")";}}return G;},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this;},each:function(F,E){return o.each(this,F,E);},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this);},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F);}else{E={};E[F]=H;}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F));}});},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g;}return this.attr(E,F,"curCSS");},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F));}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this]);}});});return E;},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0]);}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild;}return G;}).append(this);}return this;},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E);});},wrap:function(E){return this.each(function(){o(this).wrapAll(E);});},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E);}});},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild);}});},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this);});},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling);});},end:function(){return this.prevObject||o([]);},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F;}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G);})),"find",E);}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML;}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0];}else{return this.cloneNode(true);}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return;}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data);}}F++;});}return E;},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F);})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1;})),"filter",E);},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H;}H=H.parentNode;F++;}});},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E);}else{E=o.multiFilter(E,this);}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E;});},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))));},is:function(E){return !!E&&o.multiFilter(E,this).length>0;},hasClass:function(E){return !!E&&this.is("."+E);},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text;}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null;}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K;}L.push(K);}}return L;}return(E.value||"").replace(/\r/g,"");}return g;}if(typeof K==="number"){K+="";}return this.each(function(){if(this.nodeType!=1){return;}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0);}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0);});if(!N.length){this.selectedIndex=-1;}}else{this.value=K;}}});},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E);},replaceWith:function(E){return this.after(E).remove();},eq:function(E){return this.slice(E,+E+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","));},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G);}));},andSelf:function(){return this.add(this.prevObject);},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I);}}if(F){o.each(F,z);}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N;}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"});}else{o.globalEval(F.text||F.textContent||F.innerHTML||"");}if(F.parentNode){F.parentNode.removeChild(F);}}function e(){return +new Date;}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2;}if(typeof J!=="object"&&!o.isFunction(J)){J={};}if(I==H){J=this;--H;}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue;}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L);}else{if(L!==g){J[F]=L;}}}}}return J;};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y;}return o;},isFunction:function(E){return s.call(E)==="[object Function]";},isArray:function(E){return s.call(E)==="[object Array]";},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument);},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G));}else{E.text=G;}F.insertBefore(E,F.firstChild);F.removeChild(E);}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase();},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break;}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break;}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break;}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G;},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F);}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I;},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H;}});},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G);}).join(" "):"";}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1;}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F];}I.call(H);for(var F in G){H.style[F]=E[F];}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return;}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0;}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0;}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0;}});}if(H.offsetWidth!==0){I();}else{o.swap(H,G,I);}return Math.max(0,Math.round(L));}return o.curCSS(H,F,J);},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L;}if(F.match(/float/i)){F=w;}if(!G&&E&&E[F]){L=E[F];}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float";}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F);}if(F=="opacity"&&L==""){L="1";}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase();});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K;}}}}return L;},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document;}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])];}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+="";}if(!S){return;}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">";});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild;}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M]);}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild);}S=o.makeArray(L.childNodes);}if(S.nodeType){G.push(S);}else{G=o.merge(G,S);}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J]);}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))));}I.appendChild(G[J]);}}return E;}return G;},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g;}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex;}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed";}J[G]=K;}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue;}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g;}return J[G];}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K);}if(L){J.setAttribute(G,""+K);}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E;}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")");}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":"";}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase();});if(L){J[G]=K;}return J[G];},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"");},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G;}else{while(F){E[--F]=G[F];}}}return E;},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E;}}return -1;},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G;}}}else{while((G=E[F++])!=null){H[I++]=G;}}return H;},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G]);}}}catch(I){F=K;}return F;},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H]);}}return G;},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I;}}return F.concat.apply([],F);}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode;},parents:function(E){return o.dir(E,"parentNode");},next:function(E){return o.nth(E,2,"nextSibling");},prev:function(E){return o.nth(E,2,"previousSibling");},nextAll:function(E){return o.dir(E,"nextSibling");},prevAll:function(E){return o.dir(E,"previousSibling");},siblings:function(E){return o.sibling(E.parentNode.firstChild,E);},children:function(E){return o.sibling(E.firstChild);},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes);}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H);}return this.pushStack(o.unique(H),E,G);};});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I);}return this.pushStack(J,E,G);};});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E);}},addClass:function(E){o.className.add(this,E);},removeClass:function(E){o.className.remove(this,E);},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F);}o.className[E?"add":"remove"](this,F);},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this);});if(this.parentNode){this.parentNode.removeChild(this);}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild);}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments);};});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0;}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v;}if(E&&!o.cache[H]){o.cache[H]={};}if(G!==g){o.cache[H][E]=G;}return E?o.cache[H][E]:H;},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break;}if(!E){o.removeData(F);}}}else{try{delete F[h];}catch(G){if(F.removeAttribute){F.removeAttribute(h);}}delete o.cache[H];}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H));}else{if(H){G.push(H);}}}return G;},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0];}if(F!==g){F.call(H);}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E);}return F===g&&H[1]?this.data(H[0]):F;}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G);});}},removeData:function(E){return this.each(function(){o.removeData(this,E);});},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx";}if(F===g){return o.queue(this[0],E);}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this);}});},dequeue:function(E){return this.each(function(){o.dequeue(this,E);});}});(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[];}if(!Y||typeof Y!=="string"){return ab;}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break;}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U);}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift();}af=J(Y,af);}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af);}else{X=false;}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah="";}else{ag=Z.pop();}if(ag==null){ag=U;}I.relative[ah](ai,ag,Q(U));}}if(!ai){ai=af;}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y);}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai);}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa]);}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa]);}}}}}else{E(ai,ab);}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1);}}}}}return ab;};F.matches=function(T,U){return F(T,null,null,U);};F.find=function(aa,T,ab){var Z,X;if(!aa){return[];}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break;}}}}if(!Z){Z=T.getElementsByTagName("*");}return{set:Z,expr:aa};};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[];}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true;}else{if(Y===true){continue;}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true;}else{aa[X]=false;}}else{if(ae){ai.push(af);T=true;}}}}}if(ah!==g){if(!ag){aa=ai;}ad=ad.replace(I.match[ab],"");if(!T){return[];}break;}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad;}else{break;}}V=ad;}return aa;};var I=F.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\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href");}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase();}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T;}}if(Y){F.filter(T,aa,true);}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false;}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U;}}if(X){F.filter(U,Z,true);}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P;}T("parentNode",U,V,W,X,Y);},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P;}T("previousSibling",U,V,W,X,Y);}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[];}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W]);}}return U.length===0?null:U;}},TAG:function(T,U){return U.getElementsByTagName(T[1]);}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W;}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y);}}else{if(V){U[X]=false;}}}}return false;},ID:function(T){return T[1].replace(/\\/g,"");},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase();},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0;}T[0]=L++;return T;},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W];}if(X[2]==="~="){X[4]=" "+X[4]+" ";}return X;},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U);}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W);}return false;}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true;}}return X;},POS:function(T){T.unshift(true);return T;}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden";},disabled:function(T){return T.disabled===true;},checked:function(T){return T.checked===true;},selected:function(T){T.parentNode.selectedIndex;return T.selected===true;},parent:function(T){return !!T.firstChild;},empty:function(T){return !T.firstChild;},has:function(V,U,T){return !!F(T[3],V).length;},header:function(T){return/h\d/i.test(T.nodeName);},text:function(T){return"text"===T.type;},radio:function(T){return"radio"===T.type;},checkbox:function(T){return"checkbox"===T.type;},file:function(T){return"file"===T.type;},password:function(T){return"password"===T.type;},submit:function(T){return"submit"===T.type;},image:function(T){return"image"===T.type;},reset:function(T){return"reset"===T.type;},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON";},input:function(T){return/input|select|textarea|button/i.test(T.nodeName);}},setFilters:{first:function(U,T){return T===0;},last:function(V,U,T,W){return U===W.length-1;},even:function(U,T){return T%2===0;},odd:function(U,T){return T%2===1;},lt:function(V,U,T){return U<T[3]-0;},gt:function(V,U,T){return U>T[3]-0;},nth:function(V,U,T){return T[3]-0==U;},eq:function(V,U,T){return T[3]-0==U;}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa);}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0;}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false;}}return true;}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false;}}if(Z=="first"){return true;}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false;}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true;}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X;}}ab.sizcache=Y;}var aa=T.nodeIndex-ac;if(V==0){return aa==0;}else{return(aa%V==0&&aa/V>=0);}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T;},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T;},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1;},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false;},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y);}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source);}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T;}return U;};try{Array.prototype.slice.call(document.documentElement.childNodes);}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X);}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V]);}}else{for(var V=0;X[V];V++){U.push(X[V]);}}}return U;};}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true;}return V;};}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true;}return V;};}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true;}return X;};}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[];}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W;};}T.removeChild(U);})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V]);}}X=W;}return X;};}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2);};}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return;}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V);}catch(Z){}}return T(Y,X,V,W);};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches;})();}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return;}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return;}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1]);}};})();}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W;}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break;}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W;}if(T.nodeName===Z){X=T;break;}T=T[U];}ad[W]=X;}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W;}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break;}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W;}if(typeof Z!=="string"){if(T===Z){X=true;break;}}else{if(F.filter(Z,[T]).length>0){X=T;break;}}}T=T[U];}ad[W]=X;}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16;}:function(U,T){return U!==T&&(U.contains?U.contains(T):true);};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument);};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"");}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W);}return F.filter(X,W);};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0;};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0;};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem;}).length;};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")";}return F.matches(V,T);};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W);}W=W[U];}return T;};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break;}}return X;};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V);}}return T;};return;l.Sizzle=F;})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return;}if(I.setInterval&&I!=l){I=l;}if(!H.guid){H.guid=this.guid++;}if(K!==g){var G=H;H=this.proxy(G);H.data=K;}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g;});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O);}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false);}else{if(I.attachEvent){I.attachEvent("on"+N,J);}}}}L[H.guid]=H;o.event.global[N]=true;});I=null;},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return;}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""));}}else{if(H.type){J=H.handler;H=H.type;}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid];}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P];}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q);}for(F in G[O]){break;}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false);}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"));}}}F=null;delete G[O];}}});}for(F in G){break;}if(!F){var L=o.data(K,"handle");if(L){L.elem=null;}o.removeData(K,"events");o.removeData(K,"handle");}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true;}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem);}});}}if(!H||H.nodeType==3||H.nodeType==8){return g;}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I);}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K);}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false;}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]();}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true);}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation();}}if(K.isImmediatePropagationStopped()){break;}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H;}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J];}if(!H.target){H.target=H.srcElement||document;}if(H.target.nodeType==3){H.target=H.target.parentNode;}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement;}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0);}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode;}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey;}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)));}return H;},proxy:function(F,E){E=E||function(){return F.apply(this,arguments);};E.guid=F.guid=F.guid||E.guid||this.guid++;return E;},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c);},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++;}});if(E<1){o.event.remove(this,G[0],c);}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E);}if(E&&E.type){this.originalEvent=E;this.type=E.type;}else{this.type=E;}this.timeStamp=e();this[h]=true;};function k(){return false;}function u(){return true;}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return;}if(E.preventDefault){E.preventDefault();}E.returnValue=false;},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return;}if(E.stopPropagation){E.stopPropagation();}E.cancelBubble=true;},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation();},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode;}catch(G){E=this;}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments);}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E);},teardown:function(){o.event.remove(this,F,a);}};});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G);});},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments);});return this.each(function(){o.event.add(this,G,E,F&&H);});},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E);});},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this);});},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result;}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++]);}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(E,F){return this.mouseenter(E).mouseleave(F);},ready:function(E){B();if(o.isReady){E.call(document,o);}else{o.readyList.push(E);}return this;},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this;},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this;}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J});}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest");});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false);}});return G;}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".");}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o);});o.readyList=null;}o(document).triggerHandler("ready");}}});var x=false;function B(){if(x){return;}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready();},false);}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready();}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return;}try{document.documentElement.doScroll("left");}catch(E){setTimeout(arguments.callee,0);return;}o.ready();})();}}}o.event.add(l,"load",o.ready);}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E);};});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem);}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return;}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"));}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J];}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee);});K.cloneNode(true).fireEvent("onclick");}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none";});})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G);}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I);}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null;}else{if(typeof J==="object"){J=o.param(J);H="POST";}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText);}if(K){F.each(K,[M.responseText,L,M]);}}});return this;},serialize:function(){return o.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type));}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I};}):{name:F.name,value:G};}).get();}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G);};});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null;}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F});},getScript:function(E,F){return o.get(E,null,F,"script");},getJSON:function(E,F,G){return o.get(E,F,G,"json");},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={};}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F});},ajaxSetup:function(E){o.extend(o.ajaxSettings,E);},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data);}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?";}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?";}}M.dataType="json";}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1");}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W];}catch(Y){}if(H){H.removeChild(T);}};}if(M.dataType=="script"&&M.cache==null){M.cache=false;}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"");}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null;}if(M.global&&!o.active++){o.event.trigger("ajaxStart");}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset;}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T);}};}H.appendChild(T);return g;}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password);}else{J.open(G,M.url,M.async);}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType);}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT");}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default);}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop");}J.abort();return false;}if(M.global){o.event.trigger("ajaxSend",[J,M]);}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop");}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null;}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M);}catch(Z){R="parsererror";}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified");}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y;}if(!W){I();}}else{o.handleError(M,J,R);}L();if(X){J.abort();}if(M.async){J=null;}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout");}},M.timeout);}}try{J.send(M.data);}catch(S){o.handleError(M,J,null,S);}if(!M.async){N();}function I(){if(M.success){M.success(V,R);}if(M.global){o.event.trigger("ajaxSuccess",[J,M]);}}function L(){if(M.complete){M.complete(J,R);}if(M.global){o.event.trigger("ajaxComplete",[J,M]);}if(M.global&&!--o.active){o.event.trigger("ajaxStop");}}return J;},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G);}if(F.global){o.event.trigger("ajaxError",[H,F,G]);}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223;}catch(E){}return false;},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E];}catch(F){}return false;},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror";}if(G&&G.dataFilter){I=G.dataFilter(I,H);}if(typeof I==="string"){if(H=="script"){o.globalEval(I);}if(H=="json"){I=l["eval"]("("+I+")");}}return I;},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J);}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value);});}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this);});}else{H(F,o.isFunction(E[F])?E[F]():E[F]);}}}return G.join("&").replace(/%20/g,"+");}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F;});return G;}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L);}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G];}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block";}I.remove();m[G]=K;}o.data(this[H],"olddisplay",K);}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||"";}return this;}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I);}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"));}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none";}return this;}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]();}):this.animate(t("toggle",3),G,F);},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F);},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this);}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow;}}if(K.overflow!=null){this.style.overflow="hidden";}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I);}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P;}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T;}R.custom(T,N,P);}else{R.custom(T,S,"");}}});return true;});},stop:function(F,E){var G=o.timers;if(F){this.queue([]);}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true);}G.splice(H,1);}}});if(!E){this.dequeue();}return this;}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H);};});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue();}if(o.isFunction(E.old)){E.old.call(this);}};return E;},easing:{linear:function(G,H,E,F){return E+F*G;},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E;}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={};}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this);}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block";}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop];}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0;},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J);}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1);}}if(!K.length){clearInterval(n);n=g;}},13);}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show();},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false;}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block";}}if(this.options.hide){o(this.elem).hide();}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I]);}}this.options.complete.call(this.elem);}return false;}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now);},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit;}else{E.elem[E.prop]=E.now;}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0};}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0]);}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H};};}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0};}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0]);}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0;}F=G,G=J.offsetParent;}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0;}E=M;}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft;}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft);}return{top:N,left:I};};}o.offset={initialize:function(){if(this.initialized){return;}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<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>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E];}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true;},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0;}return{top:G,left:F};}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left};}return F;},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent;}return o(E);}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null;}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H;}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G];};});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null;};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null;};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px");};});})();jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]]);}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return;}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k);}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j);},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false;}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){return true;}m[j]=1;l=(m[j]>0);m[j]=0;return l;},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l));},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l);},keyCode:{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}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)));};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""));}):e.call(this,j));};}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove");});return i.apply(this,arguments);},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui");},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false;});},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=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);}else{j=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"))||!j.length?c(document):j;}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3]);},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length;},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable");}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p);}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"));}return(c.inArray(o,j)!=-1);}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this;}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined);}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o));});};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r);}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p);}}).bind("remove",function(){return m.destroy();});};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option";};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled");},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l);}k={};k[l]=m;}c.each(k,function(n,o){j._setData(n,o);});},_getData:function(j){return this.options[j];},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k);}},enable:function(){this._setData("disabled",false);},disable:function(){this._setData("disabled",true);},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o];}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented());}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k);}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false;}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on");}this.started=false;},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable));},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return;}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true;}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true;},this.options.delay);}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true;}}this._mouseMoveDelegate=function(n){return k._mouseMove(n);};this._mouseUpDelegate=function(n){return k._mouseUp(n);};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true;},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j);}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault();}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j));}return !this._mouseStarted;},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j);}return false;},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance);},_mouseDelayMet:function(j){return this.mouseDelayMet;},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true;}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0};})(jQuery);(function(c){var b={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"},a="ui-dialog ui-widget ui-widget-content ui-corner-all ";c.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr("title");var l=this,m=this.options,j=m.title||this.originalTitle||"&nbsp;",e=c.ui.dialog.getTitleId(this.element),k=(this.uiDialog=c("<div/>")).appendTo(document.body).hide().addClass(a+m.dialogClass).css({position:"absolute",overflow:"hidden",zIndex:m.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(n){(m.closeOnEscape&&n.keyCode&&n.keyCode==c.ui.keyCode.ESCAPE&&l.close(n));}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(n){l.moveToTop(false,n);}),g=this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(k),f=(this.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(k),i=c('<a href="#"/>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){i.addClass("ui-state-hover");},function(){i.removeClass("ui-state-hover");}).focus(function(){i.addClass("ui-state-focus");}).blur(function(){i.removeClass("ui-state-focus");}).mousedown(function(n){n.stopPropagation();}).click(function(n){l.close(n);return false;}).appendTo(f),h=(this.uiDialogTitlebarCloseText=c("<span/>")).addClass("ui-icon ui-icon-closethick").text(m.closeText).appendTo(i),d=c("<span/>").addClass("ui-dialog-title").attr("id",e).html(j).prependTo(f);f.find("*").add(f).disableSelection();(m.draggable&&c.fn.draggable&&this._makeDraggable());(m.resizable&&c.fn.resizable&&this._makeResizable());this._createButtons(m.buttons);this._isOpen=false;(m.bgiframe&&c.fn.bgiframe&&k.bgiframe());(m.autoOpen&&this.open());},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");this.uiDialog.remove();(this.originalTitle&&this.element.attr("title",this.originalTitle));},close:function(f){var d=this;if(false===d._trigger("beforeclose",f)){return;}(d.overlay&&d.overlay.destroy());d.uiDialog.unbind("keypress.ui-dialog");(d.options.hide?d.uiDialog.hide(d.options.hide,function(){d._trigger("close",f);}):d.uiDialog.hide()&&d._trigger("close",f));c.ui.dialog.overlay.resize();d._isOpen=false;if(d.options.modal){var e=0;c(".ui-dialog").each(function(){if(this!=d.uiDialog[0]){e=Math.max(e,c(this).css("z-index"));}});c.ui.dialog.maxZ=e;}},isOpen:function(){return this._isOpen;},moveToTop:function(f,e){if((this.options.modal&&!f)||(!this.options.stack&&!this.options.modal)){return this._trigger("focus",e);}if(this.options.zIndex>c.ui.dialog.maxZ){c.ui.dialog.maxZ=this.options.zIndex;}(this.overlay&&this.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=++c.ui.dialog.maxZ));var d={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};this.uiDialog.css("z-index",++c.ui.dialog.maxZ);this.element.attr(d);this._trigger("focus",e);},open:function(){if(this._isOpen){return;}var e=this.options,d=this.uiDialog;this.overlay=e.modal?new c.ui.dialog.overlay(this):null;(d.next().length&&d.appendTo("body"));this._size();this._position(e.position);d.show(e.show);this.moveToTop(true);(e.modal&&d.bind("keypress.ui-dialog",function(h){if(h.keyCode!=c.ui.keyCode.TAB){return;}var g=c(":tabbable",this),i=g.filter(":first")[0],f=g.filter(":last")[0];if(h.target==f&&!h.shiftKey){setTimeout(function(){i.focus();},1);}else{if(h.target==i&&h.shiftKey){setTimeout(function(){f.focus();},1);}}}));c([]).add(d.find(".ui-dialog-content :tabbable:first")).add(d.find(".ui-dialog-buttonpane :tabbable:first")).add(d).filter(":first").focus();this._trigger("open");this._isOpen=true;},_createButtons:function(g){var f=this,d=false,e=c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiDialog.find(".ui-dialog-buttonpane").remove();(typeof g=="object"&&g!==null&&c.each(g,function(){return !(d=true);}));if(d){c.each(g,function(h,i){c('<button type="button"></button>').addClass("ui-state-default ui-corner-all").text(h).click(function(){i.apply(f.element[0],arguments);}).hover(function(){c(this).addClass("ui-state-hover");},function(){c(this).removeClass("ui-state-hover");}).focus(function(){c(this).addClass("ui-state-focus");}).blur(function(){c(this).removeClass("ui-state-focus");}).appendTo(e);});e.appendTo(this.uiDialog);}},_makeDraggable:function(){var d=this,f=this.options,e;this.uiDialog.draggable({cancel:".ui-dialog-content",handle:".ui-dialog-titlebar",containment:"document",start:function(){e=f.height;c(this).height(c(this).height()).addClass("ui-dialog-dragging");(f.dragStart&&f.dragStart.apply(d.element[0],arguments));},drag:function(){(f.drag&&f.drag.apply(d.element[0],arguments));},stop:function(){c(this).removeClass("ui-dialog-dragging").height(e);(f.dragStop&&f.dragStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize();}});},_makeResizable:function(g){g=(g===undefined?this.options.resizable:g);var d=this,f=this.options,e=typeof g=="string"?g:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",alsoResize:this.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:f.minHeight,start:function(){c(this).addClass("ui-dialog-resizing");(f.resizeStart&&f.resizeStart.apply(d.element[0],arguments));},resize:function(){(f.resize&&f.resize.apply(d.element[0],arguments));},handles:e,stop:function(){c(this).removeClass("ui-dialog-resizing");f.height=c(this).height();f.width=c(this).width();(f.resizeStop&&f.resizeStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize();}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se");},_position:function(i){var e=c(window),f=c(document),g=f.scrollTop(),d=f.scrollLeft(),h=g;if(c.inArray(i,["center","top","right","bottom","left"])>=0){i=[i=="right"||i=="left"?i:"center",i=="top"||i=="bottom"?i:"middle"];}if(i.constructor!=Array){i=["center","middle"];}if(i[0].constructor==Number){d+=i[0];}else{switch(i[0]){case"left":d+=0;break;case"right":d+=e.width()-this.uiDialog.outerWidth();break;default:case"center":d+=(e.width()-this.uiDialog.outerWidth())/2;}}if(i[1].constructor==Number){g+=i[1];}else{switch(i[1]){case"top":g+=0;break;case"bottom":g+=e.height()-this.uiDialog.outerHeight();break;default:case"middle":g+=(e.height()-this.uiDialog.outerHeight())/2;}}g=Math.max(g,h);this.uiDialog.css({top:g,left:d});},_setData:function(e,f){(b[e]&&this.uiDialog.data(b[e],f));switch(e){case"buttons":this._createButtons(f);break;case"closeText":this.uiDialogTitlebarCloseText.text(f);break;case"dialogClass":this.uiDialog.removeClass(this.options.dialogClass).addClass(a+f);break;case"draggable":(f?this._makeDraggable():this.uiDialog.draggable("destroy"));break;case"height":this.uiDialog.height(f);break;case"position":this._position(f);break;case"resizable":var d=this.uiDialog,g=this.uiDialog.is(":data(resizable)");(g&&!f&&d.resizable("destroy"));(g&&typeof f=="string"&&d.resizable("option","handles",f));(g||this._makeResizable(f));break;case"title":c(".ui-dialog-title",this.uiDialogTitlebar).html(f||"&nbsp;");break;case"width":this.uiDialog.width(f);break;}c.widget.prototype._setData.apply(this,arguments);},_size:function(){var e=this.options;this.element.css({height:0,minHeight:0,width:"auto"});var d=this.uiDialog.css({height:"auto",width:e.width}).height();this.element.css({minHeight:Math.max(e.minHeight-d,0),height:e.height=="auto"?"auto":Math.max(e.height-d,0)});}});c.extend(c.ui.dialog,{version:"1.7.2",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},getter:"isOpen",uuid:0,maxZ:0,getTitleId:function(d){return"ui-dialog-title-"+(d.attr("id")||++this.uuid);},overlay:function(d){this.$el=c.ui.dialog.overlay.create(d);}});c.extend(c.ui.dialog.overlay,{instances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(d){return d+".dialog-overlay";}).join(" "),create:function(e){if(this.instances.length===0){setTimeout(function(){if(c.ui.dialog.overlay.instances.length){c(document).bind(c.ui.dialog.overlay.events,function(f){var g=c(f.target).parents(".ui-dialog").css("zIndex")||0;return(g>c.ui.dialog.overlay.maxZ);});}},1);c(document).bind("keydown.dialog-overlay",function(f){(e.options.closeOnEscape&&f.keyCode&&f.keyCode==c.ui.keyCode.ESCAPE&&e.close(f));});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize);}var d=c("<div></div>").appendTo(document.body).addClass("ui-widget-overlay").css({width:this.width(),height:this.height()});(e.options.bgiframe&&c.fn.bgiframe&&d.bgiframe());this.instances.push(d);return d;},destroy:function(d){this.instances.splice(c.inArray(this.instances,d),1);if(this.instances.length===0){c([document,window]).unbind(".dialog-overlay");}d.remove();var e=0;c.each(this.instances,function(){e=Math.max(e,this.css("z-index"));});this.maxZ=e;},height:function(){if(c.browser.msie&&c.browser.version<7){var e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var d=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(e<d){return c(window).height()+"px";}else{return e+"px";}}else{return c(document).height()+"px";}},width:function(){if(c.browser.msie&&c.browser.version<7){var d=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var e=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(d<e){return c(window).width()+"px";}else{return d+"px";}}else{return c(document).width()+"px";}},resize:function(){var d=c([]);c.each(c.ui.dialog.overlay.instances,function(){d=d.add(this);});d.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()});}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el);}});})(jQuery);(function(a){a.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable;}this._tabify(true);},_setData:function(b,c){if(b=="selected"){if(this.options.collapsible&&c==this.options.selected){return;}this.select(c);}else{this.options[b]=c;if(b=="deselectable"){this.options.collapsible=c;}this._tabify();}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+a.data(b);},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:");},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+a.data(this.list[0]));return a.cookie.apply(null,[b].concat(a.makeArray(arguments)));},_ui:function(c,b){return{tab:c,panel:b,index:this.anchors.index(c)};},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs");});},_tabify:function(n){this.list=this.element.children("ul:first");this.lis=a("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0];});this.panels=a([]);var p=this,d=this.options;var c=/^#.+/;this.anchors.each(function(r,o){var q=a(o).attr("href");var s=q.split("#")[0],u;if(s&&(s===location.toString().split("#")[0]||(u=a("base")[0])&&s===u.href)){q=o.hash;o.href=q;}if(c.test(q)){p.panels=p.panels.add(p._sanitizeSelector(q));}else{if(q!="#"){a.data(o,"href.tabs",q);a.data(o,"load.tabs",q.replace(/#.*$/,""));var w=p._tabId(o);o.href="#"+w;var v=a("#"+w);if(!v.length){v=a(d.panelTemplate).attr("id",w).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(p.panels[r-1]||p.list);v.data("destroy.tabs",true);}p.panels=p.panels.add(v);}else{d.disabled.push(r);}}});if(n){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(d.selected===undefined){if(location.hash){this.anchors.each(function(q,o){if(o.hash==location.hash){d.selected=q;return false;}});}if(typeof d.selected!="number"&&d.cookie){d.selected=parseInt(p._cookie(),10);}if(typeof d.selected!="number"&&this.lis.filter(".ui-tabs-selected").length){d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));}d.selected=d.selected||0;}else{if(d.selected===null){d.selected=-1;}}d.selected=((d.selected>=0&&this.anchors[d.selected])||d.selected<0)?d.selected:0;d.disabled=a.unique(d.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(q,o){return p.lis.index(q);}))).sort();if(a.inArray(d.selected,d.disabled)!=-1){d.disabled.splice(a.inArray(d.selected,d.disabled),1);}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(d.selected>=0&&this.anchors.length){this.panels.eq(d.selected).removeClass("ui-tabs-hide");this.lis.eq(d.selected).addClass("ui-tabs-selected ui-state-active");p.element.queue("tabs",function(){p._trigger("show",null,p._ui(p.anchors[d.selected],p.panels[d.selected]));});this.load(d.selected);}a(window).bind("unload",function(){p.lis.add(p.anchors).unbind(".tabs");p.lis=p.anchors=p.panels=null;});}else{d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));}this.element[d.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(d.cookie){this._cookie(d.selected,d.cookie);}for(var g=0,m;(m=this.lis[g]);g++){a(m)[a.inArray(g,d.disabled)!=-1&&!a(m).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");}if(d.cache===false){this.anchors.removeData("cache.tabs");}this.lis.add(this.anchors).unbind(".tabs");if(d.event!="mouseover"){var f=function(o,i){if(i.is(":not(.ui-state-disabled)")){i.addClass("ui-state-"+o);}};var j=function(o,i){i.removeClass("ui-state-"+o);};this.lis.bind("mouseover.tabs",function(){f("hover",a(this));});this.lis.bind("mouseout.tabs",function(){j("hover",a(this));});this.anchors.bind("focus.tabs",function(){f("focus",a(this).closest("li"));});this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"));});}var b,h;if(d.fx){if(a.isArray(d.fx)){b=d.fx[0];h=d.fx[1];}else{b=h=d.fx;}}function e(i,o){i.css({display:""});if(a.browser.msie&&o.opacity){i[0].style.removeAttribute("filter");}}var k=h?function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.hide().removeClass("ui-tabs-hide").animate(h,h.duration||"normal",function(){e(o,h);p._trigger("show",null,p._ui(i,o[0]));});}:function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");p._trigger("show",null,p._ui(i,o[0]));};var l=b?function(o,i){i.animate(b,b.duration||"normal",function(){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");e(i,b);p.element.dequeue("tabs");});}:function(o,i,q){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");p.element.dequeue("tabs");};this.anchors.bind(d.event+".tabs",function(){var o=this,r=a(this).closest("li"),i=p.panels.filter(":not(.ui-tabs-hide)"),q=a(p._sanitizeSelector(this.hash));if((r.hasClass("ui-tabs-selected")&&!d.collapsible)||r.hasClass("ui-state-disabled")||r.hasClass("ui-state-processing")||p._trigger("select",null,p._ui(this,q[0]))===false){this.blur();return false;}d.selected=p.anchors.index(this);p.abort();if(d.collapsible){if(r.hasClass("ui-tabs-selected")){d.selected=-1;if(d.cookie){p._cookie(d.selected,d.cookie);}p.element.queue("tabs",function(){l(o,i);}).dequeue("tabs");this.blur();return false;}else{if(!i.length){if(d.cookie){p._cookie(d.selected,d.cookie);}p.element.queue("tabs",function(){k(o,q);});p.load(p.anchors.index(this));this.blur();return false;}}}if(d.cookie){p._cookie(d.selected,d.cookie);}if(q.length){if(i.length){p.element.queue("tabs",function(){l(o,i);});}p.element.queue("tabs",function(){k(o,q);});p.load(p.anchors.index(this));}else{throw"jQuery UI Tabs: Mismatching fragment identifier.";}if(a.browser.msie){this.blur();}});this.anchors.bind("click.tabs",function(){return false;});},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var c=a.data(this,"href.tabs");if(c){this.href=c;}var d=a(this).unbind(".tabs");a.each(["href","load","cache"],function(e,f){d.removeData(f+".tabs");});});this.lis.unbind(".tabs").add(this.panels).each(function(){if(a.data(this,"destroy.tabs")){a(this).remove();}else{a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "));}});if(b.cookie){this._cookie(null,b.cookie);}},add:function(e,d,c){if(c===undefined){c=this.anchors.length;}var b=this,g=this.options,i=a(g.tabTemplate.replace(/#\{href\}/g,e).replace(/#\{label\}/g,d)),h=!e.indexOf("#")?e.replace("#",""):this._tabId(a("a",i)[0]);i.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var f=a("#"+h);if(!f.length){f=a(g.panelTemplate).attr("id",h).data("destroy.tabs",true);}f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(c>=this.lis.length){i.appendTo(this.list);f.appendTo(this.list[0].parentNode);}else{i.insertBefore(this.lis[c]);f.insertBefore(this.panels[c]);}g.disabled=a.map(g.disabled,function(k,j){return k>=c?++k:k;});this._tabify();if(this.anchors.length==1){i.addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[0],b.panels[0]));});this.load(0);}this._trigger("add",null,this._ui(this.anchors[c],this.panels[c]));},remove:function(b){var d=this.options,e=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();if(e.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(b+(b+1<this.anchors.length?1:-1));}d.disabled=a.map(a.grep(d.disabled,function(g,f){return g!=b;}),function(g,f){return g>=b?--g:g;});this._tabify();this._trigger("remove",null,this._ui(e.find("a")[0],c[0]));},enable:function(b){var c=this.options;if(a.inArray(b,c.disabled)==-1){return;}this.lis.eq(b).removeClass("ui-state-disabled");c.disabled=a.grep(c.disabled,function(e,d){return e!=b;});this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]));},disable:function(c){var b=this,d=this.options;if(c!=d.selected){this.lis.eq(c).addClass("ui-state-disabled");d.disabled.push(c);d.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]));}},select:function(b){if(typeof b=="string"){b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));}else{if(b===null){b=-1;}}if(b==-1&&this.options.collapsible){b=this.options.selected;}this.anchors.eq(b).trigger(this.options.event+".tabs");},load:function(e){var c=this,g=this.options,b=this.anchors.eq(e)[0],d=a.data(b,"load.tabs");this.abort();if(!d||this.element.queue("tabs").length!==0&&a.data(b,"cache.tabs")){this.element.dequeue("tabs");return;}this.lis.eq(e).addClass("ui-state-processing");if(g.spinner){var f=a("span",b);f.data("label.tabs",f.html()).html(g.spinner);}this.xhr=a.ajax(a.extend({},g.ajaxOptions,{url:d,success:function(i,h){a(c._sanitizeSelector(b.hash)).html(i);c._cleanup();if(g.cache){a.data(b,"cache.tabs",true);}c._trigger("load",null,c._ui(c.anchors[e],c.panels[e]));try{g.ajaxOptions.success(i,h);}catch(j){}c.element.dequeue("tabs");}}));},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr;}this._cleanup();},url:function(c,b){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",b);},length:function(){return this.anchors.length;}});a.extend(a.ui.tabs,{version:"1.7.2",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:"click",fx:null,idPrefix:"ui-tabs-",panelTemplate:"<div></div>",spinner:"<em>Loading&#8230;</em>",tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>'}});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(d,f){var b=this,g=this.options;var c=b._rotate||(b._rotate=function(h){clearTimeout(b.rotation);b.rotation=setTimeout(function(){var i=g.selected;b.select(++i<b.anchors.length?i:0);},d);if(h){h.stopPropagation();}});var e=b._unrotate||(b._unrotate=!f?function(h){if(h.clientX){b.rotate(null);}}:function(h){t=g.selected;c();});if(d){this.element.bind("tabsshow",c);this.anchors.bind(g.event+".tabs",e);c();}else{clearTimeout(b.rotation);this.element.unbind("tabsshow",c);this.anchors.unbind(g.event+".tabs",e);delete this._rotate;delete this._unrotate;}}});})(jQuery);(function($){$.extend($.fn,{livequery:function(type,fn,fn2){var self=this,q;if($.isFunction(type)){fn2=fn,fn=type,type=undefined;}$.each($.livequery.queries,function(i,query){if(self.selector==query.selector&&self.context==query.context&&type==query.type&&(!fn||fn.$lqguid==query.fn.$lqguid)&&(!fn2||fn2.$lqguid==query.fn2.$lqguid)){return(q=query)&&false;}});q=q||new $.livequery(this.selector,this.context,type,fn,fn2);q.stopped=false;$.livequery.run(q.id);return this;},expire:function(type,fn,fn2){var self=this;if($.isFunction(type)){fn2=fn,fn=type,type=undefined;}$.each($.livequery.queries,function(i,query){if(self.selector==query.selector&&self.context==query.context&&(!type||type==query.type)&&(!fn||fn.$lqguid==query.fn.$lqguid)&&(!fn2||fn2.$lqguid==query.fn2.$lqguid)&&!this.stopped){$.livequery.stop(query.id);}});return this;}});$.livequery=function(selector,context,type,fn,fn2){this.selector=selector;this.context=context||document;this.type=type;this.fn=fn;this.fn2=fn2;this.elements=[];this.stopped=false;this.id=$.livequery.queries.push(this)-1;fn.$lqguid=fn.$lqguid||$.livequery.guid++;if(fn2){fn2.$lqguid=fn2.$lqguid||$.livequery.guid++;}return this;};$.livequery.prototype={stop:function(){var query=this;if(this.type){this.elements.unbind(this.type,this.fn);}else{if(this.fn2){this.elements.each(function(i,el){query.fn2.apply(el);});}}this.elements=[];this.stopped=true;},run:function(){if(this.stopped){return;}var query=this;var oEls=this.elements,els=$(this.selector,this.context),nEls=els.not(oEls);this.elements=els;if(this.type){nEls.bind(this.type,this.fn);if(oEls.length>0){$.each(oEls,function(i,el){if($.inArray(el,els)<0){$.event.remove(el,query.type,query.fn);}});}}else{nEls.each(function(){query.fn.apply(this);});if(this.fn2&&oEls.length>0){$.each(oEls,function(i,el){if($.inArray(el,els)<0){query.fn2.apply(el);}});}}}};$.extend($.livequery,{guid:0,queries:[],queue:[],running:false,timeout:null,checkQueue:function(){if($.livequery.running&&$.livequery.queue.length){var length=$.livequery.queue.length;while(length--){$.livequery.queries[$.livequery.queue.shift()].run();}}},pause:function(){$.livequery.running=false;},play:function(){$.livequery.running=true;$.livequery.run();},registerPlugin:function(){$.each(arguments,function(i,n){if(!$.fn[n]){return;}var old=$.fn[n];$.fn[n]=function(){var r=old.apply(this,arguments);$.livequery.run();return r;};});},run:function(id){if(id!=undefined){if($.inArray(id,$.livequery.queue)<0){$.livequery.queue.push(id);}}else{$.each($.livequery.queries,function(id){if($.inArray(id,$.livequery.queue)<0){$.livequery.queue.push(id);}});}if($.livequery.timeout){clearTimeout($.livequery.timeout);}$.livequery.timeout=setTimeout($.livequery.checkQueue,20);},stop:function(id){if(id!=undefined){$.livequery.queries[id].stop();}else{$.each($.livequery.queries,function(id){$.livequery.queries[id].stop();});}}});$.livequery.registerPlugin("append","prepend","after","before","wrap","attr","removeAttr","addClass","removeClass","toggleClass","empty","remove");$(function(){$.livequery.play();});var init=$.prototype.init;$.prototype.init=function(a,c){var r=init.apply(this,arguments);if(a&&a.selector){r.context=a.context,r.selector=a.selector;}if(typeof a=="string"){r.context=c||document,r.selector=a;}return r;};$.prototype.init.prototype=$.prototype;})(jQuery);var Claypool={Logging:{},extend:function(t,$class,args){$class.apply(t,args||[]);}};(function($,$$){$$.Logging.NullLogger=function(){var nullFunction=function(){return this;};$.extend(this,{debug:nullFunction,info:nullFunction,warn:nullFunction,error:nullFunction,exception:nullFunction});return this;};$.extend($$.Logging.NullLogger.prototype,{getLogger:function(){return new $$.Logging.NullLogger();}});})(jQuery,Claypool);(function($,$$){$$.Configuration={ioc:[],aop:[],logging:[],mvc:{"hijax:a":[],"hijax:form":[],"hijax:button":[],"hijax:event":[]},env:{dev:{},prod:{},test:{}}};})(jQuery,Claypool);(function($,$$){$$.CachingStrategy$Interface={cache:null,size:null,clear:function(){throw new $$.MethodNotImplementedError();},add:function(id,object){throw new $$.MethodNotImplementedError();},remove:function(id){throw new $$.MethodNotImplementedError();},find:function(id){throw new $$.MethodNotImplementedError();}};})(jQuery,Claypool);(function($,$$){$$.SimpleCachingStrategy=function(options){$.extend(true,this,options);this.logger=new $$.Logging.NullLogger();this.clear();return this;};$.extend($$.SimpleCachingStrategy.prototype,$$.CachingStrategy$Interface,{clear:function(){this.logger.debug("Clearing Cache.");this.cache=null;this.cache={};this.size=0;},add:function(id,object){this.logger.debug("Adding To Cache: %s",id);if(!this.cache[id]){this.cache[id]=object;this.size++;return id;}return null;},remove:function(id){this.logger.debug("Removing From Cache id: %s",id);if(this.find(id)){return(delete this.cache[id])?--this.size:-1;}return null;},find:function(id){this.logger.debug("Searching Cache for id: %s",id);return this.cache[id]||null;}});})(jQuery,Claypool);(function($,$$){$$.Context=function(options){$$.extend(this,$$.SimpleCachingStrategy);$.extend(true,this,options);this.logger=new $$.Logging.NullLogger();};$.extend($$.Context.prototype,$$.SimpleCachingStrategy.prototype,{get:function(id){throw new $$.MethodNotImplementedError();},put:function(id,object){throw new $$.MethodNotImplementedError();}});})(jQuery,Claypool);(function($,$$){$$.ContextContributor=function(options){$$.extend(this,$$.Context);$.extend(true,this,options);this.logger=$.logger("Claypool.ContextContributor");};$.extend($$.ContextContributor.prototype,$$.Context.prototype,{registerContext:function(id){throw new $$.MethodNotImplementedError();}});})(jQuery,Claypool);(function($,$$){$$.Router=function(options){$$.extend(this,$$.SimpleCachingStrategy);$.extend(true,this,options);this.logger=$$.Logging.getLogger("Claypool.Router");};$.extend($$.Router.prototype,$$.SimpleCachingStrategy.prototype,{compile:function(patternMap,patternKey){this.logger.debug("compiling patterns for match strategies");var pattern,routable,params;var i,j;patternKey=patternKey.split("|");for(i=0;i<patternMap.length;i++){for(j=0;j<patternKey.length;j++){pattern=patternMap[i][patternKey[j]];params=[];if(pattern){this.logger.debug("Compiling \n\tpattern: %s for \n\ttarget.",pattern);pattern=pattern.replace(/\<\:(.+?)\:\>/g,function(){var name,i=arguments[0].indexOf("(");name=arguments[0].substring(2,i);params.push(name);return arguments[0].substring(i,arguments[0].length-2);});pattern=pattern.replace(/\|\:\w+\|/g,function(){var name;name=arguments[0].substring(2,arguments[0].length-1);params.push(name);return"(\\w+)";});this.add(String($.guid()),{pattern:new RegExp(pattern),payload:patternMap[i],params:params});}}}return this;},first:function(string){this.logger.debug("Using strategy 'first'");var route,id,map={};for(id in this.cache){route=this.find(id);this.logger.debug("checking pattern %s for string %s",route.pattern,string);if(route&&route.pattern&&route.pattern.test&&route.pattern.test(string)){this.logger.debug("found match for \n\tpattern: %s \n\ttarget : %s ",route.pattern,route.payload.controller||route.payload.rewrite);if(route.params&&route.params.length>0){string.replace(route.pattern,function(){var i;for(i=1;i<arguments.length-2;i++){map[route.params[i-1]]=arguments[i];}});}return[$.extend({map:map},route)];}}this.logger.debug("found no match for \n\tpattern: %s",string);return[];},all:function(string){this.logger.debug("Using strategy 'all'");var routeList=[];var route,id,map={};for(id in this.cache){route=this.find(id);this.logger.debug("checking pattern: %s for string %s",route.pattern,string);if(route&&route.pattern&&route.pattern.test&&route.pattern.test(string)){this.logger.debug("found match for \n\tpattern: %s \n\ttarget : %s ",route.pattern,route.payload.controller);if(route.params&&route.params.length>0){string.replace(route.pattern,function(){var i;for(i=1;i<arguments.length-2;i++){map[route.params[i-1]]=arguments[i];}});}routeList.push($.extend({map:map},route));}}if(routeList.length===0){this.logger.debug("found no match for \n\tpattern: %s",string);}return routeList;}});})(jQuery,Claypool);(function($,$$){$$.Factory$Interface={create:function(){throw new $$.MethodNotImplementedError();}};})(jQuery,Claypool);(function($,$$){$$.Configurable$Interface={configurationId:null,configuration:null,configurationUrl:null,configurationType:null,getConfig:function(){throw new $$.MethodNotImplementedError();},loadConfig:function(){throw new $$.MethodNotImplementedError();},setConfig:function(){throw new $$.MethodNotImplementedError();},updateConfig:function(){throw new $$.MethodNotImplementedError();}};})(jQuery,Claypool);(function($,$$){$$.Scanner$Interface={scan:function(){throw new $$.MethodNotImplementedError();}};})(jQuery,Claypool);(function($,$$){$$.BaseFactory=function(options){$$.extend(this,$$.SimpleCachingStrategy);$.extend(true,this,{configurationUrl:"./app/configs/config.js",configurationType:"json"},options);this.logger=new $$.Logging.NullLogger();return this;};$.extend($$.BaseFactory.prototype,$$.SimpleCachingStrategy.prototype,$$.Factory$Interface,$$.Configurable$Interface,$$.Scanner$Interface,{getConfig:function(){if(!this.configuration){this.logger.warn("Configuration for <%s> has not been set explicitly or has been updated implicitly.",this.configurationId);try{this.logger.debug("$$.Configuration: \n %o",$$.Configuration);if($$.Configuration[this.configurationId]){this.logger.info("Found Claypool.Configuration");this.configuration=$$.Configuration[this.configurationId];}else{if(!$$.Configuration){this.loadConfig();}}}catch(e){this.logger.exception(e);throw new $$.ConfigurationError(e);}}return this.configuration;},loadConfig:function(options){options=options||{};this.configurationUrl=options.url||this.configurationUrl;this.logger.info("Attempting to load configuration from: %s",this.configurationUrl);var _this=this;try{jQuery.ajax({type:"Get",url:this.configurationUrl,async:false,data:{},dataType:"json",success:function(json){if(_this.configurationUrl=="./app/configs/config.js"){$$.Configuration=$$.Configuration||{};$.extend(true,$$.Configuration,json);}else{_this.setConfig(_this.configurationId,json?json:null);}if(options.callback){options.callback($$.Configuration);}}});}catch(e){this.logger.exception(e);throw new $$.ConfigurationError(e);}},setConfig:function(id,configuration){this.logger.info("Setting configuration");this.configuration=configuration;$$.Configuration[id]=configuration;},updateConfig:function(id){throw new $$.MethodNotImplementedError();}});})(jQuery,Claypool);(function($,$$){$$.Error=function(e,options){$.extend(true,this,e||new Error());this.name=(options&&options.name?options.name:"Claypool.UnknownError")+" > Claypool.Error"+(this.name?(" > "+this.name):"");this.message=(options&&options.name?options.name:"No Message Provided \n Nested exception is:\n\t")+(this.message||"UnknownError");};})(jQuery,Claypool);(function($,$$){$$.ConfigurationError=function(e,options){var details={name:"Claypool.ConfigurationError",message:"An error occured trying to locate or load the system configuration."};$.extend(this,new $$.Error(e,options?{name:(options.name?(options.name+" > "):"")+details.name,message:(options.message?(options.message+" \n "):"")+details.message}:details));};})(jQuery,Claypool);(function($,$$){$$.MethodNotImplementedError=function(e,options){var details={name:"Claypool.MethodNotImplementedError",message:"Method not implemented."};$.extend(this,new $$.Error(e,options?{name:(options.name?(options.name+" > "):"")+details.name,message:(options.message?(options.message+" \n "):"")+details.message}:details));};})(jQuery,Claypool);(function($,$$){$$.NameResolutionError=function(e,options){var details={name:"Claypool.NameResolutionError",message:"Unexpected error resolving name."};$.extend(this,new $$.Error(e,options?{name:(options.name?(options.name+" > "):"")+details.name,message:(options.message?(options.message+" \n "):"")+details.message}:details));};})(jQuery,Claypool);(function($,$$){var globalContext=[],guid=0,plugins={},env;$.extend(plugins,{$:function(id,value){var a,i;if(value===undefined){a=null;for(i=0;i<globalContext.length;i++){a=globalContext[i]().get(id);if(a){return a;}}return null;}else{if(globalContext[0]().find(id)){globalContext[0]().remove(id);}globalContext[0]().put(id,value);}},register:function(context,priority){if(Math.abs(priority)>(globalContext.length-1)/2){if(priority===0&&$.isFunction(context.getContext)){globalContext[0]=context.getContext;}else{if(priority!==0){if($.isFunction(context.getContext)){globalContext.push(context.getContext);}if($.isFunction(context.getCachedContext)){globalContext.unshift(context.getCachedContext);}}}}},guid:function(){return(++guid)+"_"+new Date().getTime()+"_"+Math.round(Math.random()*100000000);},resolve:function(namespacedName){var _resolver;var namespaces;var target;var i;try{_resolver=function(name){return this[name];};namespaces=namespacedName.split(".");target=null;for(i=0;i<namespaces.length;i++){target=_resolver.call(target,namespaces[i]);if(target===undefined){return target;}}return target;}catch(e){throw new $$.NameResolutionError(e);}},config:function(){var config,subconfig;if(arguments.length===0){return $$.Configuration;}else{if(arguments.length===1&&typeof(arguments[0])=="string"){return $.resolve("Claypool.Configuration."+arguments[0]);}else{config=$.resolve("Claypool.Configuration."+arguments[0]);if(config){subconfig=arguments[1];if(subconfig instanceof Array){config=$.merge(config,subconfig);}else{if(subconfig instanceof Object){config=$.extend(true,config,subconfig);}}}}}return this;},env:function(){if(arguments.length==2){env=$.extend(true,env||{},$.config("env."+arguments[0]),$.config("env."+arguments[1]));return env;}else{if(arguments.length===1&&!(typeof(arguments[0])=="string")){return $.config("env",arguments[0]);}return env[arguments[0]]||null;}}});$.extend($$,plugins);$.extend($,plugins);})(jQuery,Claypool);Claypool.Logging={NullLogger:null,getLogger:null};(function($,$$,$$Log){$.extend($$Log,{loggerFactory:null,getLogger:function(category){if(!$$Log.loggerFactory){$$Log.loggerFactory=new $$Log.Factory();$$Log.loggerFactory.updateConfig();}else{if($$Log.updated){$$Log.loggerFactory.updateConfig();$$Log.updated=false;}}return $$Log.loggerFactory.create(category);}});})(jQuery,Claypool,Claypool.Logging);(function($,$$,$$Log){$$Log.Level={DEBUG:0,INFO:1,WARN:2,ERROR:3,NONE:4};})(jQuery,Claypool,Claypool.Logging);(function($,$$,$$Log){$$Log.Logger$Interface={debug:function(){throw new $$.MethodNotImplementedError();},info:function(){throw new $$.MethodNotImplementedError();},warn:function(){throw new $$.MethodNotImplementedError();},error:function(){throw new $$.MethodNotImplementedError();},exception:function(){throw new $$.MethodNotImplementedError();}};})(jQuery,Claypool,Claypool.Logging);(function($,$$,$$Log){$$Log.NullLogger=function(){var nullFunction=function(){return this;};$.extend(this,{debug:nullFunction,info:nullFunction,warn:nullFunction,error:nullFunction,exception:nullFunction});};})(jQuery,Claypool,Claypool.Logging);(function($,$$,$$Log){$$Log.Logger=function(options){this.category="root";this.level=null;try{$.extend(true,this,options);this.level=$$Log.Level[this.level?this.level:"NONE"];try{this.appender=new ($.resolve(this.appender||"Claypool.Logging.ConsoleAppender"))(options);}catch(e){try{this.appender=new $$Log.ConsoleAppender(options);}catch(e){this.appender=new $$Log.SysOutAppender(options);}}return this;}catch(e){return new $$Log.NullLogger();}};$.extend($$Log.Logger.prototype,$$Log.Logger$Interface,{debug:function(){if(this.level<=$$Log.Level.DEBUG){this.appender.append("DEBUG",this.category,arguments);return this;}else{this.debug=function(){return this;};}return this;},info:function(){if(this.level<=$$Log.Level.INFO){this.appender.append("INFO",this.category,arguments);return this;}else{this.debug=function(){return this;};}return this;},warn:function(){if(this.level<=$$Log.Level.WARN){this.appender.append("WARN",this.category,arguments);return this;}else{this.debug=function(){return this;};}return this;},error:function(){if(this.level<=$$Log.Level.ERROR){this.appender.append("ERROR",this.category,arguments);return this;}else{this.debug=function(){return this;};}return this;},exception:function(e){if(this.level<$$Log.Level.NONE){if(e){this.appender.append("EXCEPTION",this.category,e);return this;}}else{this.debug=function(){return this;};}return this;}});})(jQuery,Claypool,Claypool.Logging);(function($,$$,$$Log){$$Log.Appender$Interface={formatter:null,append:function(level,category,message){throw new $$.MethodNotImplementedError();}};})(jQuery,Claypool,Claypool.Logging);(function($,$$,$$Log){$$Log.SysOutAppender=function(options){var rhinoCheck=function(){var isRhino=null;isRhino.toString();};if($.isFunction(print)&&(window.load!==undefined)&&$.isFunction(window.load)){try{rhinoCheck();}catch(caught){if(caught.rhinoException){$.extend(true,this,options);this.formatter=new $$Log.DefaultFormatter(options);return this;}}}throw new $$Log.NoAppendersAvailableError();};$.extend($$Log.SysOutAppender.prototype,$$Log.Appender$Interface,{append:function(level,category,message){switch(level){case"DEBUG":print(this.formatter.format(level,category,message));break;case"INFO":print(this.formatter.format(level,category,message));break;case"WARN":print(this.formatter.format(level,category,message));break;case"ERROR":print(this.formatter.format(level,category,message));break;case ("EXCEPTION"):var msg=message&&message.rhinoException?"\n\t"+message.rhinoException.message+"\tcolumn: "+message.rhinoException.columnNumber()+"\tline: "+message.rhinoException.lineNumber():"UNKNOWN RUNTIME ERROR";print(this.formatter.format(level,category,msg));break;}}});})(jQuery,Claypool,Claypool.Logging);(function($,$$,$$Log){$$Log.ConsoleAppender=function(options){try{if(window&&window.console&&window.console.log){$.extend(true,this,options);this.formatter=new $$Log.FireBugFormatter(options);return this;}else{return new $$Log.SysOutAppender(options);}}catch(e){throw e;}return this;};$.extend($$Log.ConsoleAppender.prototype,$$Log.Appender$Interface,{append:function(level,category,message){switch(level){case ("DEBUG"):console.log.apply(console,this.formatter.format(level,category,message));break;case ("INFO"):console.info.apply(console,this.formatter.format(level,category,message));break;case ("WARN"):console.warn.apply(console,this.formatter.format(level,category,message));break;case ("ERROR"):console.error.apply(console,this.formatter.format(level,category,message));break;case ("EXCEPTION"):console.error.apply(console,this.formatter.format(level,category,message.message?[message.message]:[]));console.trace();break;}}});})(jQuery,Claypool,Claypool.Logging);(function($,$$,$$Log){$$Log.Formatter$Interface={format:function(level,category,objects){throw new $.MethodNotImplementedError();}};})(jQuery,Claypool,Claypool.Logging);(function($,$$,$$Log){$$Log.FireBugFormatter=function(options){$.extend(true,this,options);};$.extend($$Log.FireBugFormatter.prototype,$$Log.Formatter$Interface,{getDateString:function(){return" ["+new Date().toUTCString()+"] ";},format:function(level,category,objects){var msgPrefix=category+" "+level+": "+this.getDateString();objects=(objects&&objects.length&&(objects.length>0))?objects:[];var msgFormat=(objects.length>0)?objects[0]:null;if(typeof(msgFormat)!="string"){objects.unshift(msgPrefix);}else{objects[0]=msgPrefix+msgFormat;}return objects;}});})(jQuery,Claypool,Claypool.Logging);(function($,$$,$$Log){var parseFormatRegExp=/((^%|[^\\]%)(\d+)?(\.)([a-zA-Z]))|((^%|[^\\]%)([a-zA-Z]))/,functionRenameRegExp=/function ?(.*?)\(/,objectRenameRegExp=/\[object (.*?)\]/;$$Log.DefaultFormatter=function(options){$.extend(true,this,options);};$.extend($$Log.DefaultFormatter.prototype,$$Log.Formatter$Interface,{getDateString:function(){return" ["+new Date().toUTCString()+"] ";},format:function(level,category,objects){var msgPrefix=" "+level+":  "+this.getDateString()+"{"+category+"} ";var msg=[msgPrefix?msgPrefix:""];var format=objects[0];var objIndex=0;if(typeof(format)!="string"){format="";objIndex=-1;}var parts=this.parseFormat(format);var i;for(i=0;i<parts.length;++i){if(parts[i]&&typeof(parts[i])=="object"){parts[i].appender.call(this,objects[++objIndex],msg);}else{this.appendText(parts[i],msg);}}for(i=objIndex+1;i<objects.length;++i){this.appendText(" ",msg);if(typeof(objects[i])=="string"){this.appendText(objects[i],msg);}else{this.appendObject(objects[i],msg);}}return msg.join("");},parseFormat:function(format){var parts=[];var appenderMap={s:this.appendText,d:this.appendInteger,i:this.appendInteger,f:this.appendFloat};var type;var appender;var precision;var m;for(m=parseFormatRegExp.exec(format);m;m=parseFormatRegExp.exec(format)){type=m[8]?m[8]:m[5];appender=type in appenderMap?appenderMap[type]:this.appendObject;precision=m[3]?parseInt(m[3],10):(m[4]=="."?-1:0);parts.push(format.substr(0,m[0][0]=="%"?m.index:m.index+1));parts.push({appender:appender,precision:precision});format=format.substr(m.index+m[0].length);}parts.push(format);return parts;},objectToString:function(object){try{return object+"";}catch(e){return null;}},appendText:function(object,msg){msg.push(this.objectToString(object));},appendNull:function(object,msg){msg.push(this.objectToString(object));},appendString:function(object,msg){msg.push(this.objectToString(object));},appendInteger:function(object,msg){msg.push(this.objectToString(object));},appendFloat:function(object,msg){msg.push(this.objectToString(object));},appendFunction:function(object,msg){var m=functionRenameRegExp.exec(this.objectToString(object));var name=m?m[1]:"function";msg.push(this.objectToString(name));},appendObject:function(object,msg){try{if(object===undefined){this.appendNull("undefined",msg);}else{if(object===null){this.appendNull("null",msg);}else{if(typeof object=="string"){this.appendString(object,msg);}else{if(typeof object=="number"){this.appendInteger(object,msg);}else{if(typeof object=="function"){this.appendFunction(object,msg);}else{if(object.nodeType==1){this.appendSelector(object,msg);}else{if(typeof object=="object"){this.appendObjectFormatted(object,msg);}else{this.appendText(object,msg);}}}}}}}}catch(e){}},appendObjectFormatted:function(object,msg){var text=this.objectToString(object);var m=objectRenameRegExp.exec(text);msg.push(m?m[1]:text);},appendSelector:function(object,msg){msg.push(object.nodeName.toLowerCase());if(object.id){msg.push(object.id);}if(object.className){msg.push(object.className);}msg.push("</span>");},appendNode:function(node,msg){var attr;var i;var child;if(node.nodeType==1){msg.push("<",node.nodeName.toLowerCase(),">");for(i=0;i<node.attributes.length;++i){attr=node.attributes[i];if(!attr.specified){continue;}msg.push(attr.nodeName.toLowerCase(),'="',attr.nodeValue,'"');}if(node.firstChild){for(child=node.firstChild;child;child=child.nextSibling){this.appendNode(child,html);}msg.push("</",node.nodeName.toLowerCase(),">");}else{msg.push("/>");}}else{if(node.nodeType==3){msg.push(node.nodeValue);}}}});})(jQuery,Claypool,Claypool.Logging);(function($,$$,$$Log){$$Log.Factory=function(options){$$.extend(this,$$.BaseFactory);this.configurationId="logging";$.extend(true,this,options);this.logger=new $$Log.Logger({category:"Claypool.Logging.Factory",level:"INFO",appender:"Claypool.Logging.ConsoleAppender"});this.attemptedConfigure=false;};$.extend($$Log.Factory.prototype,$$.BaseFactory.prototype,{create:function(category){var categoryParts,subcategory,loggerConf,rootLoggerConf;if(!this.configuration){if(!this.attemptedConfigure){this.logger.warn("Claypool Logging was not initalized correctly.  Logging will not occur unless initialized.");}this.attemptedConfigure=true;return new $$Log.NullLogger();}else{categoryParts=category.split(".");for(i=0;i<categoryParts.length;i++){subcategory=categoryParts.slice(0,categoryParts.length-i).join(".");loggerConf=this.find(subcategory);if(loggerConf!==null){loggerConf.category=category;return new $$Log.Logger(loggerConf);}}rootLoggerConf=this.find("root");if(rootLoggerConf!==null){rootLoggerConf.category=category;return new $$Log.Logger(rootLoggerConf);}}this.logger.warn("No Matching category: %s Please configure a root logger.",category);return new $$Log.NullLogger();},updateConfig:function(){var loggingConfiguration;var logconf;var i;try{this.logger.info("Configuring Claypool Logging");this.clear();loggingConfiguration=this.getConfig()||[];for(i=0;i<loggingConfiguration.length;i++){try{logconf=loggingConfiguration[i];this.add(logconf.category,logconf);}catch(ee){this.logger.exception(ee);return false;}}}catch(e){this.logger.exception(e);throw new $$Log.ConfigurationError(e);}return true;}});})(jQuery,Claypool,Claypool.Logging);(function($,$$,$$Log){$$Log.ConfigurationError=function(e,options){$.extend(this,new $$.ConfigurationError(e,options||{name:"Claypool.Logging.ConfigurationError",message:"An error occured trying to configure the logging system."}));};})(jQuery,Claypool,Claypool.Logging);(function($,$$,$$Log){$$Log.NoAppendersAvailableError=function(e,options){$.extend(this,new $$.Error(e,options||{name:"Claypool.Logging.NoAppendersAvailableError",message:"An error occured trying to configure the logging system."}));};})(jQuery,Claypool,Claypool.Logging);(function($,$$,$$Log){$.extend($,{logger:function(name){return $$Log.getLogger(name);},logging:function(){if(arguments.length===0){return $.config("logging");}else{$$Log.updated=true;return $.config("logging",arguments[0]);}}});var $log;$.extend($,{debug:function(){$log=$log||$.logger("jQuery");$log.debug.apply($log,arguments);return this;},info:function(){$log=$log||$.logger("jQuery");$log.info.apply($log,arguments);return this;},warn:function(){$log=$log||$.logger("jQuery");$log.warn.apply($log,arguments);return this;},error:function(){$log=$log||$.logger("jQuery");$log.error.apply($log,arguments);return this;},exception:function(){$log=$log||$.logger("jQuery");$log.exception.apply($log,arguments);return this;}});})(jQuery,Claypool,Claypool.Logging);Claypool.Application={};(function($,$$,$$App){var CONTEXT_PRIORITY=0;$$App.context=null;$.extend($$App,{getContext:function(){if(!$$App.context){$$App.context=new $$App.Context();}return $$App.context;},Initialize:function(callback){$(document).trigger("claypool:initialize",[$$App]);if(callback){callback();}$(document).trigger("ApplicationLoaded");return $$App.getContext();},Reinitialize:function(callback){$(document).trigger("claypool:reinitialize",[$$App]);if(callback){callback();}$(document).trigger("ApplicationReloaded");return $$App.getContext();}});$.register($$App,CONTEXT_PRIORITY);})(jQuery,Claypool,Claypool.Application);(function($,$$,$$App){$$App.Context=function(options){$$.extend(this,$$.Context);this.contextContributors={};$.extend(true,this,options);this.logger=$.logger("Claypool.Application.Context");};$.extend($$App.Context.prototype,$$.Context.prototype,{get:function(id){var contextObject;var contributor;try{this.logger.debug("Searching application context for object: %s",id);contextObject=null;contextObject=this.find(id);if(contextObject!==null){this.logger.debug("Found object in global application context. Object id: %s",id);return contextObject;}else{this.logger.debug("Searching for object in contributed application context. Object id: %s",id);for(contributor in this.contextContributors){this.logger.debug("Checking Application Context Contributor %s.",contributor);contextObject=this.contextContributors[contributor].get(id);if(contextObject!==null){this.logger.debug("Found object in contributed application context. Object id: %s",id);return contextObject;}}}this.logger.debug("Cannot find object in any application context. Object id: %s",id);return null;}catch(e){throw new $$App.ContextError(e);}},put:function(id,object){this.logger.debug("Adding object to global application context %s",id);this.add(id,object);}});})(jQuery,Claypool,Claypool.Application);(function($,$$,$$App){$$App.ContextContributor=function(options){$$.extend(this,$$.ContextContributor);$.extend(true,this,options);this.logger=$.logger("Claypool.Application.ContextContributor");return this;};$.extend($$App.ContextContributor.prototype,$$.ContextContributor.prototype,{registerContext:function(id){this.logger.info("Registering Context id: %s",id);$$App.getContext().contextContributors[id]=this;}});})(jQuery,Claypool,Claypool.Application);(function($,$$,$$App){$$App.Aware=function(options){$.extend(this,options);this.logger=$.logger("Claypool.Application.Aware");};$.extend($$App.Aware.prototype,{$:function(){return $$App.getContext();}});})(jQuery,Claypool,Claypool.Application);(function($,$$,$$App){$$App.ContextError=function(e,options){var details={name:"Claypool.Application.ContextError",message:"An unexpected error occured while searching the application context."};$.extend(this,new $$.Error(e,options?{name:(options.name?(options.name+" > "):"")+details.name,message:(options.message?(options.message+" \n "):"")+details.message}:details));};})(jQuery,Claypool,Claypool.Application);(function($,$$,$$App){$.extend($,{app:function(){return $$App.getContext();},boot:function(cb){$$App.Initialize(cb);return this;},reboot:function(cb){$$App.Reinitialize(cb);return this;},manage:function(containerName,managedId,callback){$(document).bind("claypool:initialize",function(event,context){if(!context[managedId]){context[managedId]=new ($.resolve(containerName))();if(context.ContextContributor&&$.isFunction(context.ContextContributor)){context[managedId].registerContext(containerName);}}else{context[managedId].factory.updateConfig();}if(callback&&$.isFunction(callback)){callback(context[managedId]);}}).bind("claypool:reinitialize",function(event,context){context[managedId]=new ($.resolve(containerName))();if(context.ContextContributor&&$.isFunction(context.ContextContributor)){context[managedId].registerContext(containerName);}if(callback&&$.isFunction(callback)){callback(context[managedId]);}});return this;}});})(jQuery,Claypool,Claypool.Application);Claypool.AOP={};(function($,$$,$$AOP){$.manage("Claypool.AOP.Container","claypool:AOP");})(jQuery,Claypool,Claypool.AOP);(function($,$$,$$AOP){$$AOP.Aspect=function(options){this.id=null;this.type=null;$$.extend(this,$$.SimpleCachingStrategy);$.extend(true,this,options);this.logger=$.logger("Claypool.AOP.Aspect");this.strategy=this.strategy||"all";};$.extend($$AOP.Aspect.prototype,$$.SimpleCachingStrategy.prototype,{weave:function(){var _this=this;var pattern;var targetObject;if(!this.target){_this.logger.warn("No pointcut was specified.  Cant weave aspect.");return;}var _weave=function(methodName){var pointcut,cutline;try{_this.logger.info("Weaving Advice %s for Aspect %s",methodName,_this.id);_this.hasPrototype=typeof(_this.target.prototype)!="undefined";cutline=_this.hasPrototype?_this.target.prototype[methodName]:_this.target[methodName];pointcut=_this.advise(cutline);if(!_this.hasPrototype){_this.target[methodName]=pointcut;}else{_this.target.prototype[methodName]=pointcut;}return{pointcut:pointcut,cutline:cutline};}catch(e){throw new $$AOP.WeaveError(e,"Weave");}};if(this.size===0){pattern=new RegExp(this[this.type?this.type:"method"]);targetObject=this.target.prototype?this.target.prototype:this.target;for(var f in targetObject){if($.isFunction(targetObject[f])&&pattern.test(f)){this.logger.debug("Adding aspect to method %s",f);this.add($.guid(),_weave(f));if(this.strategy==="first"){break;}}}}return this;},unweave:function(){var aspect;try{for(var id in this.cache){aspect=this.find(id);if(!this.hasPrototype){this.target[this.method]=aspect.cutline;}else{this.target.prototype[this.method]=aspect.cutline;}this.hasPrototype=null;}this.clear();}catch(e){throw new $$AOP.WeaveError(e,"Unweave");}return true;},advise:function(cutline){throw new $$.MethodNotImplementedError();}});})(jQuery,Claypool,Claypool.AOP);(function($,$$,$$AOP){$$AOP.After=function(options){$$.extend(this,$$AOP.Aspect);$.extend(true,this,options);this.logger=$.logger("Claypool.AOP.After");this.type="after";};$.extend($$AOP.After.prototype,$$AOP.Aspect.prototype,{advise:function(cutline){var _this=this;try{return function(){var returnValue=cutline.apply(this,arguments);return _this.advice.apply(_this,[returnValue]);};}catch(e){throw new $$AOP.AspectError(e,"After");}}});})(jQuery,Claypool,Claypool.AOP);(function($,$$,$$AOP){$$AOP.Before=function(options){$$.extend(this,$$AOP.Aspect);$.extend(true,this,options);this.logger=$.logger("Claypool.AOP.Before");this.type="before";};$.extend($$AOP.Before.prototype,$$AOP.Aspect.prototype,{advise:function(cutline){var _this=this;try{return function(){_this.advice.apply(_this,arguments);return cutline.apply(this,arguments);};}catch(e){throw new $$AOP.AspectError(e,"Before");}}});})(jQuery,Claypool,Claypool.AOP);(function($,$$,$$AOP){$$AOP.Around=function(options){$$.extend(this,$$AOP.Aspect);$.extend(true,this,options);this.logger=$.logger("Claypool.AOP.Around");this.type="around";};$.extend($$AOP.Around.prototype,$$AOP.Aspect.prototype,{advise:function(cutline){var _this=this;try{return function(){var invocation={object:this,args:arguments};return _this.advice.apply(_this,[{object:invocation.object,arguments:invocation.args,proceed:function(){var returnValue=cutline.apply(invocation.object,invocation.args);return returnValue;}}]);};}catch(e){throw new $$AOP.AspectError(e,"Around");}}});})(jQuery,Claypool,Claypool.AOP);(function($,$$,$$AOP){$$AOP.Factory=function(options){$$.extend(this,$$.BaseFactory);$.extend(true,this,options);this.configurationId="aop";this.aspectCache=null;this.logger=$.logger("Claypool.AOP.Factory");this.aspectCache=new $$.SimpleCachingStrategy();};$.extend($$AOP.Factory.prototype,$$.BaseFactory.prototype,{updateConfig:function(){var _this=this;var aopConfiguration;var aopconf;var i;var targetRef,namespace,prop,genconf;try{this.logger.debug("Configuring Claypool AOP AspectFactory");aopConfiguration=this.getConfig()||[];this.logger.debug("AOP Configurations: %d",aopConfiguration.length);for(i=0;i<aopConfiguration.length;i++){try{aopconf=aopConfiguration[i];if(!$.isFunction(aopconf.advice)){aopconf.advice=$.resolve(aopconf.advice);}if(aopconf.target.match("^ref://")){targetRef=aopconf.target.substr(6,aopconf.target.length);$(document).bind("claypool:ioc:"+targetRef,function(event,id,iocContainer){_this.logger.debug("Creating aspect id %s for instance %s",aopconf.id);var instance=iocContainer.find(id);aopconf.target=instance._this;_this.add(aopconf.id,aopconf);var aspect=_this.create(aopconf.id);instance._this=aspect.target;iocContainer.remove(id);iocContainer.add(id,instance);_this.logger.debug("Created aspect \n%s, \n%s");}).bind("claypool:predestroy:"+targetRef,function(event,instance){_this.logger.debug("Destroying aspect id %s for instance %s",aopconf.id);var aspect=_this.aspectCache.find(aopconf.id);if(aspect&&aspect.unweave){aspect.unweave();}});}else{if(aopconf.target.match(/\.\*$/)){this.logger.debug("Broad aspect target %s",aopconf.target);namespace=$.resolve(aopconf.target.substring(0,aopconf.target.length-2));for(prop in namespace){if($.isFunction(namespace[prop])){genconf=$.extend({},aopconf,{id:aopconf.id+$.guid(),target:namespace[prop]});this.logger.debug("Creating aspect id %s [%s] (%s)",aopconf.target,prop,genconf.id);this.add(genconf.id,genconf);this.create(genconf.id);}}}else{this.logger.debug("Creating aspect id %s",aopconf.id);aopconf.target=$.resolve(aopconf.target);this.add(aopconf.id,aopconf);this.create(aopconf.id);}}}catch(e){this.logger.exception(e);}}}catch(e){this.logger.exception(e);throw new $$AOP.ConfigurationError(e);}return true;},create:function(id){var configuration;var _continuation;var aspect=this.aspectCache.find(id);var _this=this;var createWeave=function(options){var aspect=null;if(options.after){aspect=new $$AOP.After(options);}else{if(options.before){aspect=new $$AOP.Before(options);}else{if(options.around){aspect=new $$AOP.Around(options);}}}return aspect.weave();};if(aspect){return aspect;}else{try{this.logger.debug("Looking for configuration for aspect %s",id);configuration=this.find(id);if(configuration===undefined||configuration===null){this.logger.debug("%s is not an Aspect.",id);return null;}else{this.logger.debug("Found configuration for instance %s",id);if(configuration.selector){this.logger.debug("Attaching contructor to an active selector");_this=this;_continuation=function(){aspect=createWeave(configuration);_this.aspectCache.add(configuration.id+"#"+this.toString(),aspect);return aspect;};if(configuration.active){$(configuration.selector).livequery(_continuation);}else{$(configuration.selector).each(_continuation);}}else{aspect=createWeave(configuration);this.aspectCache.add(id,aspect);}return aspect;}}catch(e){this.logger.exception(e);throw new $$AOP.FactoryError(e);}}}});})(jQuery,Claypool,Claypool.AOP);(function($,$$,$$AOP){$$AOP.Container=function(options){$$.extend(this,$$.Application.ContextContributor);$.extend(true,this,options);this.factory=null;this.logger=$.logger("Claypool.AOP.Container");this.logger.debug("Configuring Claypool AOP Container");this.factory=new $$AOP.Factory(options);this.factory.updateConfig();};$.extend($$AOP.Container.prototype,$$.Application.ContextContributor.prototype,{get:function(id){var aspect;try{this.logger.debug("Search for a container managed aspect :%s",id);aspect=this.find(id);if(aspect===undefined||aspect===null){this.logger.debug("Can't find a container managed aspect :%s",id);aspect=this.factory.create(id);if(aspect!==null){this.add(id,aspect);return aspect;}}else{this.logger.debug("Found container managed instance :%s",id);return aspect;}}catch(e){this.logger.exception(e);throw new $$AOP.ContainerError(e);}return null;}});})(jQuery,Claypool,Claypool.AOP);(function($,$$,$$AOP){$$AOP.ContainerError=function(e,options){var details={name:"Claypool.AOP.ContainerError",message:"An error occured inside the aop container."};$.extend(this,new $$.Error(e,options?{name:(options.name?(options.name+" > "):"")+details.name,message:(options.message?(options.message+" \n "):"")+details.message}:details));};})(jQuery,Claypool,Claypool.AOP);(function($,$$,$$AOP){$$AOP.ConfigurationError=function(e,options){var details={name:"Claypool.AOP.ConfigurationError",message:"An error occured updating the aop container configuration."};$.extend(this,new $$.ConfigurationError(e,options?{name:(options.name?(options.name+" > "):"")+details.name,message:(options.message?(options.message+" \n "):"")+details.message}:details));};})(jQuery,Claypool,Claypool.AOP);(function($,$$,$$AOP){$$AOP.FactoryError=function(e,options){var details={name:"Claypool.AOP.FactoryError",message:"An error occured creating the aspect from the configuration."};$.extend(this,new $$.Error(e,options?{name:(options.name?(options.name+" > "):"")+details.name,message:(options.message?(options.message+" \n "):"")+details.message}:details));};})(jQuery,Claypool,Claypool.AOP);(function($,$$,$$AOP){$$AOP.WeaveError=function(e,options){var details={name:"Claypool.AOP.WeaveError",message:"An error occured weaving or unweaving the aspect."};$.extend(this,new $$.Error(e,options?{name:(options.name?(options.name+" > "):"")+details.name,message:(options.message?(options.message+" \n "):"")+details.message}:details));};})(jQuery,Claypool,Claypool.AOP);(function($,$$,$$AOP){$$AOP.AspectError=function(e,options){var details={name:"Claypool.AOP.AspectError",message:"An error occured while applying an aspect."};$.extend(this,new $$.Error(e,options?{name:(options.name?(options.name+" > "):"")+details.name,message:(options.message?(options.message+" \n "):"")+details.message}:details));};})(jQuery,Claypool,Claypool.AOP);(function($,$$,$AOP){$.extend($,{filters:function(){if(arguments.length===0){return $.config("aop");}else{return $.config("aop",arguments[0]);}}});})(jQuery,Claypool,Claypool.AOP);Claypool.IoC={};(function($,$$,$$IoC){$.manage("Claypool.IoC.Container","claypool:IoC");})(jQuery,Claypool,Claypool.IoC);(function($,$$,$$IoC){$$IoC.Instance=function(id,configuration){$.extend(this,{_this:null,id:null,configuration:null,guid:$.guid(),type:null,id:id,configuration:configuration||{},logger:$.logger("Claypool.IoC.Instance")});this.logger.category=this.logger.category+"."+this.id;};$.extend($$IoC.Instance.prototype,{precreate:function(){try{this._this={claypoolId:this.id};this.logger.debug("Precreating Instance");$(document).trigger("claypool:precreate",[this._this,this.id]);$(document).trigger("claypool:precreate:"+this.id,[this._this]);return this;}catch(e){this.logger.error("An Error occured in the Pre-Create LifeCycle Phase");this.logger.exception(e);throw new $$IoC.LifeCycleError(e);}},create:function(){var factory,factoryClass,factoryMethod,retVal;var _this,_thisOrUndefined,C_onstructor,args;var injections,injectionValue;try{this.logger.debug("Applying Selector to Instance");if(this.configuration.selector){this._this=$(this.configuration.selector);this.logger.debug("Result for selector : ",this._this);}else{this.logger.debug("Using default empty object");this._this={};}if(this.configuration.factory){factory={};if(this.configuration.factory.substring(6,0)=="ref://"){this.logger.debug("Retreiving Factory from Application Context");factory=$.$(this.configuration.factory);}else{this.logger.info("Creating Instance from Factory");factoryClass=this.resolveConstructor(this.configuration.factory);retval=factoryClass.apply(factory,this.configuration.options);factory=retval||factory;}this.logger.debug("Applying factory creation method");factoryMethod=this.configuration.factoryMethod||"create";_this=factory[factoryMethod].apply(factory,this.configuration.options);this._this=$.extend(true,_this,this._this);}else{this.logger.info("Creating Instance simulating constructor: %s",this.configuration.clazz);C_onstructor=this.resolveConstructor(this.configuration.clazz);args=this.configuration.options||[];_this={};switch(args.length){case 0:_this=new C_onstructor();break;case 1:_this=new C_onstructor(args[0]);break;case 2:_this=new C_onstructor(args[0],args[1]);break;case 3:_this=new C_onstructor(args[0],args[1],args[2]);break;case 4:_this=new C_onstructor(args[0],args[1],args[2],args[3]);break;case 5:_this=new C_onstructor(args[0],args[1],args[2],args[3],args[4]);break;case 6:_this=new C_onstructor(args[0],args[1],args[2],args[3],args[4],args[5]);break;case 7:_this=new C_onstructor(args[0],args[1],args[2],args[3],args[4],args[5],args[6]);break;case 8:_this=new C_onstructor(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7]);break;case 9:_this=new C_onstructor(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8]);break;default:_thisOrUndefined=C_onstructor.apply(_this,args);_this=_thisOrUndefined||_this;}_this.$ns=this.configuration.clazz;_this.$log=$.logger(_this.$ns);_this.$log.info("Created new instance of %s",_this.$ns);this._this=$.extend(true,_this,this._this);}injections=this.configuration.inject||{};for(var dependency in injections){injectionValue=injections[dependency];if($.isFunction(injectionValue.substring)&&(injectionValue.substring(0,6)=="ref://")){injections[dependency]=$.$(injectionValue.substring(6,injectionValue.length));}}$.extend(this._this,injections);$(document).trigger("claypool:create",[this._this,this.id]);$(document).trigger("claypool:create:"+this.id,[this._this]);return this._this;}catch(e){this.logger.error("An Error occured in the Create LifeCycle Phase");this.logger.exception(e);throw new $$IoC.LifeCycleError(e);}},postcreate:function(){try{this.logger.debug("PostCreate invoked");$(document).trigger("claypool:postcreate",[this._this,this.id]);$(document).trigger("claypool:postcreate:"+this.id,[this._this]);return this._this;}catch(e){this.logger.error("An Error occured in the Post-Create LifeCycle Phase");this.logger.exception(e);throw new $$IoC.LifeCycleError(e);}},predestroy:function(){try{this.logger.debug("Predestory invoked");$(document).trigger("claypool:predestroy",[this._this,this.id]);$(document).trigger("claypool:predestroy:"+this.id,[this._this]);return this._this;}catch(e){this.logger.exception(e);throw new $$IoC.LifeCycleError(e);}},destroy:function(){try{this.logger.info("Destroy invoked");$(document).trigger("claypool:destroy",[this._this,this.id]);$(document).trigger("claypool:destroy:"+this.id,[this._this]);return delete this._this;}catch(e){this.logger.exception(e);throw new $$IoC.LifeCycleError(e);}},postdestroy:function(){try{this.logger.debug("Postdestory invoked");$(document).trigger("claypool:postdestroy",[this.id]);$(document).trigger("claypool:postdestroy:"+this.id);return this;}catch(e){this.logger.exception(e);throw new $$IoC.LifeCycleError(e);}},resolveConstructor:function(constructorName){var constructor;try{constructor=$.resolve(constructorName);if($.isFunction(constructor)){this.logger.debug(" Resolved "+constructorName+" to a function");return constructor;}else{throw new Error("Constructor is not a function: "+constructorName);}}catch(e){this.logger.exception(e);throw new $$IoC.ConstructorResolutionError(e);}}});})(jQuery,Claypool,Claypool.IoC);(function($,$$,$$IoC){$$IoC.Factory=function(options){$$.extend(this,$$.BaseFactory);$.extend(true,this,options);this.configurationId="ioc";this.logger=$.logger("Claypool.IoC.Factory");};$.extend($$IoC.Factory.prototype,$$.BaseFactory.prototype,{createLifeCycle:function(instance){try{instance.precreate();instance.create();instance.postcreate();}catch(e){this.logger.error("An Error occured in the Creation Lifecycle.");this.logger.exception(e);throw new $$IoC.LifeCycleError(e);}},destroyLifeCycle:function(instance){try{instance.predestroy();instance.destroy();instance.postdestroy();}catch(e){this.logger.error("An Error occured in the Destory Lifecycle.");this.logger.exception(e);throw new $$IoC.LifeCycleError(e);}},create:function(id){var configuration;var instance;var _this=this;try{this.logger.debug("Looking for configuration for instance %s",id);configuration=this.find(id);if(configuration===null){this.logger.warn("No known configuration for instance %s",id);return null;}else{this.logger.debug("Found configuration for instance %s",id);instance=new $$IoC.Instance(configuration.id,configuration);if(configuration.active&&configuration.selector){this.logger.debug("Attaching contructor to an active selector");instance.precreate();instance._this["@claypool:activeobject"]=configuration.selector;instance._this["@claypool:id"]=instance.id;jQuery(configuration.selector).livequery(function(){_this.logger.debug("Processing Creation Lifecycle.");_this.createLifeCycle(instance);},function(){_this.logger.debug("Processing Destruction Lifecycle.");_this.destroyLifeCycle(instance);});}else{this.logger.debug("Processing Creation Lifecycle.");this.createLifeCycle(instance);}return instance;}}catch(e){this.logger.exception(e);throw new $$IoC.FactoryError(e);}},updateConfig:function(){var iocConfiguration;var iocconf;var i;try{this.logger.debug("Configuring Claypool IoC Factory");iocConfiguration=this.getConfig()||[];this.logger.debug("IoC Configurations: %d",iocConfiguration.length);for(i=0;i<iocConfiguration.length;i++){try{iocconf=iocConfiguration[i];if(iocconf.scan&&iocconf.factory){this.logger.debug("Scanning %s with %s",iocconf.scan,iocconf.factory);iocConfiguration=iocConfiguration.concat(iocconf.factory.scan(iocconf.scan));}else{this.logger.debug("IoC Configuration for Id: %s",iocconf.id);this.add(iocconf.id,iocconf);}}catch(e){this.logger.exception(e);return false;}}}catch(e){this.logger.exception(e);throw new $$IoC.ConfigurationError(e);}return true;}});})(jQuery,Claypool,Claypool.IoC);(function($,$$,$$IoC){$$IoC.Container=function(options){$$.extend(this,$$.Application.ContextContributor);$.extend(true,this,options);this.factory=null;this.logger=$.logger("Claypool.IoC.Container");this.logger.debug("Configuring Claypool IoC Container");this.factory=new $$IoC.Factory();this.factory.updateConfig();};$.extend($$IoC.Container.prototype,$$.Application.ContextContributor.prototype,{get:function(id){var instance;var _this=this;try{this.logger.debug("Search for a container managed instance :%s",id);instance=this.find(id);if(!instance){this.logger.debug("Can't find a container managed instance :%s",id);instance=this.factory.create(id);if(instance){this.logger.debug("Storing managed instance %s in container",id);this.add(id,instance);if(instance._this["@claypool:activeobject"]){$(document).bind("claypool:postcreate:"+instance.id,function(event,reattachedObject,id){_this.logger.info("Reattached Active Object Inside IoC Container");instance._this=reattachedObject;});$(document).bind("claypool:postdestroy:"+instance.id,function(){_this.logger.info("Removed Active Object Inside IoC Container");_this.remove(id);});}else{$(document).trigger("claypool:ioc",[id,this]);$(document).trigger("claypool:ioc:"+id,[id,this]);}return this.find(id)._this;}}else{this.logger.debug("Found container managed instance :%s",id);return instance._this;}}catch(e){this.logger.exception(e);throw new $$IoC.ContainerError(e);}return null;}});})(jQuery,Claypool,Claypool.IoC);(function($,$$,$$IoC){$$IoC.ContainerError=function(e){$.extend(this,new $$.Error(e,{name:"Claypool.IoC.ContainerError",message:"An error occured in the ioc instance factory."}));};})(jQuery,Claypool,Claypool.IoC);(function($,$$,$$IoC){$$IoC.FactoryError=function(e){$.extend(this,new $$.Error(e,{name:"Claypool.IoC.FactoryError",message:"An error occured in the ioc factory."}));};})(jQuery,Claypool,Claypool.IoC);(function($,$$,$$IoC){$$IoC.ConfigurationError=function(e){$.extend(this,new $$.ConfigurationError(e,{name:"Claypool.IoC.ConfigurationError",message:"An error occured updating the ioc container configuration."}));};})(jQuery,Claypool,Claypool.IoC);(function($,$$,$$IoC){$$IoC.LifeCycleError=function(e){$.extend(this,new $$.Error(e,{name:"Claypool.IoC.LifeCycleError",message:"An error occured during the lifecycle process."}));};})(jQuery,Claypool,Claypool.IoC);(function($,$$,$$IoC){$$IoC.ConstructorResolutionError=function(e){$.extend(this,new $$.NameResolutionError(e,{name:"Claypool.IoC.ConstructorResolutionError",message:"An error occured trying to resolve the constructor."}));};})(jQuery,Claypool,Claypool.IoC);(function($,$$,$$IoC){$.extend($,{scan:function(){var scanPaths,i;if(arguments.length===0){return $.config("ioc");}else{scanPaths=[];for(i=0;i<arguments[0].length;i++){scanPaths.push({scan:arguments[0][i],factory:$$.MVC.Factory.prototype});}return $.config("ioc",scanPaths);}},invert:function(){if(arguments.length===0){return $.config("ioc");}else{return $.config("ioc",arguments[0]);}}});})(jQuery,Claypool,Claypool.IoC);Claypool.MVC={};(function($){$.manage("Claypool.MVC.Container","claypool:MVC",function(container){var i,id,router,config=container.factory.getConfig(),type;for(type in config){container.logger.debug("eagerly loading mvc routers: %s",type);for(i=0;i<config[type].length;i++){id=config[type][i].id;controller=container.get(id);container.logger.debug("attaching mvc core controller: %s",id);if(controller&&!controller.attached){controller.attach();controller.attached=true;}}}});})(jQuery);(function($,$$,$$MVC){$$MVC.View$Interface={update:function(model){throw new $$.MethodNotImplementedError();},think:function(){throw new $$.MethodNotImplementedError();}};})(jQuery,Claypool,Claypool.MVC);(function($,$$,$$MVC){$$MVC.Controller=function(options){this.model=null;this.view=null;$$.extend(this,$$.SimpleCachingStrategy);$.extend(true,this,options);this.logger=$.logger("Claypool.MVC.Controller");};$.extend($$MVC.Controller.prototype,$$.SimpleCachingStrategy.prototype,{handle:function(event){throw new $$.MethodNotImplementedError();}});})(jQuery,Claypool,Claypool.MVC);(function($,$$,$$MVC){$$MVC.HijaxController=function(options){$$.extend(this,$$MVC.Controller);$.extend(true,this,{forwardingList:[],selector:"",filter:"",active:true,preventDefault:true,stopPropagation:true,hijaxMap:[],resolveQueue:[],strategy:null},options);this.router=new $$.Router();this.bindCache=new $$.SimpleCachingStrategy();this.logger=$.logger("Claypool.MVC.HijaxController");};$.extend($$MVC.HijaxController.prototype,$$MVC.Controller.prototype,{handle:function(data){this.logger.debug("Handling pattern: %s",data.pattern);this.forwardingList=this.router[this.strategy||"all"](data.pattern);this.logger.debug("Resolving matched paterns");var _this=this;return jQuery(this.forwardingList).each(function(){var target,action,defaultView;try{_this.logger.info("Forwaring to registered controller %s",this.payload.controller);target=$.$(this.payload.controller);defaultView=this.payload.controller.match("Controller")?this.payload.controller.replace("Controller","View"):null;defaultView=this.payload.controller.match("Service")?this.payload.controller.replace("Service","View"):defaultView;(function(t){var _event=data.args[0],extra=[],m={flash:[],length:0},v=defaultView,c=target;for(var i=1;i<data.args.length;i++){extra[i-1]=data.args[i];}var eventflow=$.extend({},_event,{m:function(){if(arguments.length===0){return m;}else{if(arguments.length===1){if(typeof(arguments[0])=="string"){return m[arguments[0]];}else{if(arguments[0] instanceof Array){m.length+=arguments[0].length;Array.prototype.push.apply(m,arguments[0]);}else{if(arguments[0] instanceof Object){$.extend(true,m,arguments[0]);}}}}else{if(arguments.length===2){if(arguments[1] instanceof Array){if(typeof(arguments[0])=="string"&&!(arguments[0] in m)){m[arguments[0]]=[];}$.merge(m[arguments[0]],arguments[1]);}else{if(arguments[1] instanceof XML||arguments[1] instanceof XMLList){m[arguments[0]]=arguments[1];}else{if(arguments[1] instanceof Object){if(typeof(arguments[0])=="string"&&!(arguments[0] in m)){m[arguments[0]]={};}$.extend(true,m[arguments[0]],arguments[1]);}}}}}}return this;},v:function(view){if(!view){return v;}if(view&&typeof(view)=="string"){view=view.split(".");if(view.length===1){v=view;}else{if(view.length===2){if(view[0]!==""){v=view.join(".");}else{v=v.split(".")[0]+"."+view[1];}}}}return this;},c:function(){var target,action,controller;if(arguments.length===0){return c;}else{if(arguments.length>0&&typeof(arguments[0]=="string")){target=arguments[0].split(".");c=target[0];v=c.match("Controller")?c.replace("Controller","View"):null;v=c.match("Service")?c.replace("Service","View"):v;action=(target.length>1&&target[1].length>0)?target[1]:"handle";controller=_this.find(target[0]);if(controller===null){controller=$.$(target[0]);_this.add(target[0],controller);}controller[action||"handle"].apply(controller,[this].concat(extra));}}return this;},render:_this.renderer(),reset:function(){m={flash:[],length:0};v=defaultView;c=target;return this;},params:function(param){if(arguments.length===0){return t.map?t.map:{};}else{return t.map&&t.map[param]?t.map[param]:null;}}});target[t.payload.action||"handle"].apply(target,[eventflow].concat(extra));})(this);}catch(e){e=e?e:new Error();if(e.name&&e.name.indexOf("Claypool.Application.ContextError")>-1){_this.logger.warn("No controller with id: %s",this.payload.controller);}else{_this.logger.exception(e);throw e;}}});},attach:function(){this.router.compile(this.hijaxMap,this.routerKeys);var _this=this;if(this.active&&(this.selector!==""||this.filter!=="")){this.logger.debug("Actively Hijaxing %s's %s%s",this.hijaxKey,this.selector,this.filter);$(this.selector+this.filter).livequery(function(){_this.hijax(this);});}else{if(this.selector!==""||this.filter!==""){this.logger.debug("Hijaxing Current %s's.",this.hijaxKey);$(this.selector+this.filter).each(function(){_this.hijax(this);});}else{if(document!==undefined){this.logger.debug("Hijaxing Document For %s's.",this.hijaxKey);_this.hijax(document);}else{this.logger.warn("Unable to attach controller: %s",options.id);}}}},hijax:function(target){this.logger.debug("Hijaxing %s: %s",this.hijaxKey,target);var _this=this;var _hijax=function(event){var retVal=true;_this.logger.info("Hijaxing %s: ",_this.hijaxKey);if(_this.stopPropagation){_this.logger.debug("Stopping propogation of event");event.stopPropagation();}if(_this.preventDefault){_this.logger.debug("Preventing default event behaviour");event.preventDefault();retVal=false;}_this.handle({pattern:_this.target.apply(_this,arguments),args:arguments});return retVal;};if(this.event){$(this.event.split("|")).each(function(){$(target).bind(this+"."+_this.eventNamespace,_hijax);_this.logger.debug("Binding event %s to hijax controller on target",this,target);});}else{$(this.hijaxMap).each(function(){if(this.event&&!_this.bindCache.find(this.event)){_this.bindCache.add(this.event,_this);_this.logger.debug("Binding event %s to controller %s on target %s",this.event,this.controller,target);$(target).bind(this.event+"."+_this.eventNamespace,_hijax);}});}return true;},renderer:function(){var _this=this;var callbackStack=[];return function(callback){var target,controller,action,view,viewMethod,guidedEventRegistration;if(callback&&$.isFunction(callback)){callbackStack.push(callback);}_this.logger.debug(" - Resolving Control - %s)",this.c());try{view=this.v();viewMethod=$.isFunction(this.write)?"render":"update";if(view.indexOf(".")>-1){viewMethod=view.split(".");view=viewMethod[0];viewMethod=viewMethod[viewMethod.length-1];}_this.logger.debug("Calling View %s.%s",view,viewMethod);view=$.$(view);if(view){if($.isFunction(view[viewMethod])){if(this.write){view.write=this.write;view.append=this.append;view[viewMethod](this.m());}else{view[viewMethod](this.m());}_this.logger.debug("Cascading callbacks");while(callbackStack.length>0){(callbackStack.pop())();}}else{if(view["@claypool:activeobject"]){guidedEventRegistration="claypool:postcreate:"+view["@claypool:id"]+"."+$.guid();$(document).bind(guidedEventRegistration,function(event,newView){_this.logger.warn("The view is reattached to the dom.");$(document).unbind(guidedEventRegistration);newView.update(this.m());_this.logger.debug("Cascading callbacks");while(callbackStack.length>0){(callbackStack.pop())();}});}else{_this.logger.debug("View method cannot be resolve",viewMethod);}}}else{_this.logger.warn("Cant resolve view %s. ",this.v());}}catch(e){_this.logger.error("Error resolving flow %s => %s",this.c(),this.v()).exception(e);throw e;}return this;};},target:function(event){throw new $$.MethodNotImplementedError();}});})(jQuery,Claypool,Claypool.MVC);(function($,$$,$$MVC){$$MVC.Factory=function(options){$$.extend(this,$$.IoC.Factory);$.extend(true,this,options);this.configurationId="mvc";this.logger=$.logger("Claypool.MVC.Factory");};$.extend($$MVC.Factory.prototype,$$.IoC.Factory.prototype,{updateConfig:function(){var mvcConfig,controller,type,id,i;try{this.logger.debug("Configuring Claypool MVC Controller Factory");mvcConfig=this.getConfig()||{};$(document).trigger("claypool:hijax",[this,this.initializeHijaxController,mvcConfig]);}catch(e){this.logger.exception(e);throw new $$MVC.ConfigurationError(e);}},scan:function(name){var log=this.logger||$.logger("Claypool.MVC.Factory");log.debug("Scanning %s",name);var prop,scanBase,configsByConvention=[],idNamingConvention=function(localName,type){return("#"+localName.substring(0,1).toLowerCase()+localName.substring(1)+type);},domNamingConvention=function(localName){return("#"+localName.substring(0,1).toLowerCase()+localName.substring(1));};try{scanBase=$.resolve(name);for(prop in scanBase){log.debug("Scan Checking %s.%s",name,prop);if($.isFunction(scanBase[prop])){log.debug("Found Function Definition on %s.%s",name,prop);if(name.match(".Models")){log.debug("Configuring by Convention %s.%s",name,prop);configsByConvention.push({id:idNamingConvention(prop,"Model"),clazz:name+"."+prop});}else{if(name.match(".Views")){log.debug("Configuring by Convention %s.%s",name,prop);configsByConvention.push({id:idNamingConvention(prop,"View"),clazz:name+"."+prop,selector:domNamingConvention(prop)});}else{if(name.match(".Controllers")){log.debug("Configuring by Convention %s.%s",name,prop);configsByConvention.push({id:idNamingConvention(prop,"Controller"),clazz:name+"."+prop});}else{if(name.match(".Services")){log.debug("Configuring by Convention %s.%s",name,prop);configsByConvention.push({id:idNamingConvention(prop,"Service"),clazz:name+"."+prop});}}}}}}}catch(e){log.error("Error Scanning %s!!",name).exception(e);}return configsByConvention;},initializeHijaxController:function(mvcConfig,key,clazz,options){var configuration,i;if(mvcConfig[key]){for(i=0;i<mvcConfig[key].length;i++){configuration={};configuration.id=mvcConfig[key][i].id;configuration.clazz=clazz;configuration.options=[$.extend(true,{},options,mvcConfig[key][i])];this.logger.debug("Adding MVC Configuration for Controller Id: %s",configuration.id);this.add(configuration.id,configuration);}}}});})(jQuery,Claypool,Claypool.MVC);(function($,$$,$$MVC){$$MVC.Container=function(options){$$.extend(this,$$.Application.ContextContributor);$.extend(true,this,options);this.factory=null;this.logger=$.logger("Claypool.MVC.Container").debug("Configuring Claypool MVC Container");this.factory=new $$MVC.Factory();this.factory.updateConfig();};$.extend($$MVC.Container.prototype,$$.Application.ContextContributor.prototype,{get:function(id){var controller;try{this.logger.debug("Search for a container managed controller : %s",id);controller=this.find(id);if(controller===undefined||controller===null){this.logger.debug("Can't find a container managed controller : %s",id);controller=this.factory.create(id);if(controller!==null){this.add(id,controller);return controller._this;}else{return null;}}else{this.logger.debug("Found container managed controller : %s",id);return controller._this;}}catch(e){this.logger.exception(e);throw new $$MVC.ContainerError();}throw new $$MVC.FactoryError(id);}});})(jQuery,Claypool,Claypool.MVC);(function($,$$,$$MVC){$$MVC.ContainerError=function(e){$.extend(this,new $$.Error(e,{name:"Claypool.MVC.ContainerError",message:"An error occurred trying to retreive a container managed object."}));};})(jQuery,Claypool,Claypool.MVC);(function($,$$,$$MVC){$$MVC.FactoryError=function(e){$.extend(this,new $$.Error(e,{name:"Claypool.MVC.FactoryError",message:"An error occured trying to create the factory object."}));};})(jQuery,Claypool,Claypool.MVC);(function($,$$,$$MVC){$$MVC.ConfigurationError=function(e){$.extend(this,new $$.ConfigurationError(e,{name:"Claypool.MVC.ConfigurationError",message:"An error occured during the configuration."}));};})(jQuery,Claypool,Claypool.MVC);(function($,$$,$$MVC){var log;$.extend($,{router:function(confId,options){$(document).bind("claypool:hijax",function(event,_this,registrationFunction,configuration){log=log||$.logger("Claypool.MVC.Plugins");log.debug("registering router plugin: %s",confId);registrationFunction.apply(_this,[configuration,confId,"Claypool.MVC.HijaxController",options]);});return this;},mvc:function(){var prop,config;if(arguments.length===0){return $.config("mvc");}else{config=$.config("mvc");for(prop in arguments[0]){if(prop in config){$.merge(config[prop],arguments[0][prop]);}else{config[prop]=arguments[0][prop];}}return this;}}});$.routes=$.mvc;$.router("hijax:a",{selector:"a",event:"click",strategy:"first",routerKeys:"urls",hijaxKey:"link",eventNamespace:"Claypool:MVC:HijaxLinkController",target:function(event){var link=event.target||event.currentTarget;while(link.tagName.toUpperCase()!="A"){link=$(link).parent()[0];}return $(link).attr("href");}}).router("hijax:button",{selector:":button",event:"click",strategy:"all",routerKeys:"ids",hijaxKey:"button",eventNamespace:"Claypool:MVC:HijaxButtonController",target:function(event){return event.target.id;}}).router("hijax:input",{selector:"input",event:"blur|focus",strategy:"all",routerKeys:"ids",hijaxKey:"input",eventNamespace:"Claypool:MVC:HijaxInputController",target:function(event){return event.target.id;}}).router("hijax:form",{selector:"form",event:"submit",strategy:"first",routerKeys:"urls",hijaxKey:"form",eventNamespace:"Claypool:MVC:HijaxFormController",target:function(event){return event.target.action;}}).router("hijax:event",{strategy:"all",routerKeys:"event",hijaxKey:"event",eventNamespace:"Claypool:MVC:HijaxEventController",target:function(event){return event.type;}});$.mvc_scanner=$$MVC.Factory.prototype;})(jQuery,Claypool,Claypool.MVC);(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&/6.0/.test(navigator.userAgent)){s=$.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},s||{});var prop=function(n){return n&&n.constructor==Number?n+"px":n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"style="display:block;position:absolute;z-index:-1;'+(s.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(s.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":prop(s.top))+";left:"+(s.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":prop(s.left))+";width:"+(s.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":prop(s.width))+";height:"+(s.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":prop(s.height))+';"/>';return this.each(function(){if($("> iframe.bgiframe",this).length==0){this.insertBefore(document.createElement(html),this.firstChild);}});}return this;};})(jQuery);(function(){(function($){var f=function(){},emptyInstance=function(c){f.prototype=(c._constructor||c).prototype;return new f();},callConstructor=function(obj,args){return obj.init.apply(emptyInstance(obj),args);},getConstructor=function(){return(function(list){var constructor=arguments.callee,obj=this instanceof constructor?this:emptyInstance(constructor);if(list&&list._constructor===constructor){return obj.setArray(list.get());}return obj.init.apply(obj,arguments);});};var $collection=$.collection=getConstructor();$.extend($collection,{extend:$.extend,fn:$collection.prototype,statics:"extend,build,include,implement",build:function(){var constr=getConstructor();this.include(constr,this,$collection.statics);constr.prototype=constr.fn=emptyInstance(this);constr._constructor=constr.fn._constructor=constr.fn.constructor=constr;return constr;},include:function(target,source,methods,parse){if(!methods||!methods.slice){var args=Array.prototype.slice.call(arguments);args.unshift(this);return this.include.apply(this,args);}$.each(methods.split?methods.split(/\s?,\s?/):methods,function(i,func){target[func]=parse?parse(source[func],func,source):source[func];});return target;},implement:function(source,methods){this.fn.include(source,methods,function(method){return function(){var args=arguments;return this.map(function(){return method.apply(this,args);});};});}});$collection.extend($collection.fn,{extend:$collection.extend,include:$collection.include,init:function(els){var items=typeof els=="object"&&"length" in els?els:arguments;return this.setArray(items);},filter:function(filter){if(typeof filter!="function"){var out=filter.constructor==Array?filter:[filter];filter=function(){return $.inArray(this,out)!=-1;};}return this.pushStack($.grep(this,function(e,i){return filter.call(e,i);}));},not:function(right){right=this.filter(right);return this.filter(function(){return $.inArray(this,right)==-1;});},is:function(s){return !!(s&&this.filter(s).length);},add:function(){return this.pushStack($.merge(this.get(),callConstructor(this,arguments)));},pushStack:function(items){var ret=emptyInstance(this).setArray(items.get?items.get():items);ret.prevObject=this;return ret;},end:function(){return this.prevObject||callConstructor(this);},attr:function(key,value){return value===undefined?this[0]!=null&&this[0][key]:this.each(function(){this[key]=value;});}});$collection.fn.include($.fn,"each,extend,index,setArray,get,size,eq,slice,map,andSelf");})(jQuery);if(window.jsPath){var _jsPath=window.jsPath;}jsPath=jQuery.collection.build();if(window._){var $_=window._;}window._=jsPath;var __context__={};jsPath.fn.init=function(path,jsObject,pathOrResult){if(arguments.length===0){return this.setArray(__context__.length?__context__:[__context__]);}if(!jsObject){jsObject=__context__;}if(!(typeof path=="string")){__context__=path;return this.setArray(__context__.length?__context__:[__context__]);}else{path="$"+path;}var result=jsonPath(jsObject,path,pathOrResult)||[];return this.setArray(result);};jsPath.fn.include(Array.prototype,"join,push");jsPath.fn.toString=function(js){return Array.prototype.join.apply(this,[" "]);};jsPath.fn.x=function(js){return"{"+Array.prototype.join.apply(this,[" "])+"}";};function jsonPath(obj,expr,arg){var P={resultType:arg&&arg.resultType||"VALUE",pathStyle:arg&&arg.pathStyle||"ARRAY",result:[],normalize:function(expr){var subx=[];return expr.replace(/[\['](\??\(.*?\))[\]']/g,function($0,$1){return"[#"+(subx.push($1)-1)+"]";}).replace(/'?\.'?|\['?/g,";").replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,"").replace(/#([0-9]+)/g,function($0,$1){return subx[$1];});},asPath:function(path){var x=path.split(";"),p="$";for(var i=1,n=x.length;i<n;i++){p+=(P.pathStyle=="DOT")?((/^[0-9*]+$/).test(x[i])?("["+x[i]+"]"):("."+x[i])):((/^[0-9*]+$/).test(x[i])?("["+x[i]+"]"):("['"+x[i]+"']"));}return p;},store:function(p,v){if(p){P.result[P.result.length]=(P.resultType=="VALUE")?v:(P.resultType=="PATH")?P.asPath(p):(P.resultType=="MAP")?[P.asPath(p),(v instanceof Array?"[]":v instanceof Object?"{}":"'"+v+"'")]:(P.resultType=="JSAM")?P.asPath(p)+"="+(v instanceof Array?"[]":v instanceof Object?"{}":"'"+v+"'"):null;}return !!p;},trace:function(expr,val,path){if(expr){var x=expr.split(";"),loc=x.shift();x=x.join(";");if(val&&val.hasOwnProperty(loc)){P.trace(x,val[loc],path+";"+loc);}else{if(loc==="*"){P.walk(loc,x,val,path,function(m,l,x,v,p){P.trace(m+";"+x,v,p);});}else{if(loc===".."){P.trace(x,val,path);P.walk(loc,x,val,path,function(m,l,x,v,p){typeof v[m]==="object"&&P.trace("..;"+x,v[m],p+";"+m);});}else{if(/,/.test(loc)){for(var s=loc.split(/'?,'?/),i=0,n=s.length;i<n;i++){P.trace(s[i]+";"+x,val,path);}}else{if(/^\(.*?\)$/.test(loc)){P.trace(P.eval(loc,val,path.substr(path.lastIndexOf(";")+1))+";"+x,val,path);}else{if(/^\?\(.*?\)$/.test(loc)){P.walk(loc,x,val,path,function(m,l,x,v,p){if(P.eval(l.replace(/^\?\((.*?)\)$/,"$1"),v[m],m)){P.trace(m+";"+x,v,p);}});}else{if(/^(-?[0-9]*):(-?[0-9]*):?([0-9]*)$/.test(loc)){P.slice(loc,x,val,path);}}}}}}}}else{P.store(path,val);}},walk:function(loc,expr,val,path,f){if(val instanceof Array){for(var i=0,n=val.length;i<n;i++){if(i in val){f(i,loc,expr,val,path);}}}else{if(typeof val==="object"){for(var m in val){if(val.hasOwnProperty(m)){f(m,loc,expr,val,path);}}}}},slice:function(loc,expr,val,path){if(val instanceof Array){var len=val.length,start=0,end=len,step=1;loc.replace(/^(-?[0-9]*):(-?[0-9]*):?(-?[0-9]*)$/g,function($0,$1,$2,$3){start=parseInt($1||start,10);end=parseInt($2||end,10);step=parseInt($3||step,10);});start=(start<0)?Math.max(0,start+len):Math.min(len,start);end=(end<0)?Math.max(0,end+len):Math.min(len,end);for(var i=start;i<end;i+=step){P.trace(i+";"+expr,val,path);}}},eval:function(x,_v,_vname){try{return $&&_v&&eval(x.replace(/@/g,"_v"));}catch(e){throw new SyntaxError("jsonPath: "+e.message+": "+x.replace(/@/g,"_v").replace(/\^/g,"_a"));}}};var $=obj;if(expr&&obj){P.trace(P.normalize(expr).replace(/^\$;/,""),obj,"$");return P.result.length?P.result:false;}}})();(function(_){_.objtree=function(opts){ObjTree.prototype.xmlDecl=opts.xmlDecl||ObjTree.prototype.xmlDecl;ObjTree.prototype.attr_prefix=opts.attr_prefix||ObjTree.prototype.attr_prefix;ObjTree.prototype.ns_colon=opts.ns_colon||ObjTree.prototype.ns_colon;ObjTree.prototype.mixed_content_name=opts.ns_colon||ObjTree.prototype.mixed_content_name;};_.xml2js=function(xml,opts){var objtree=_.extend(new ObjTree(),opts||{});var obj=objtree.parseXML(xml);};_.dom2js=function(dom,opts){var objtree=_.extend(new ObjTree(),opts||{});return objtree.parseDOM(dom);};_.x=_.js2xml=function(js,opts){var objtree=_.extend(new ObjTree(),opts||{});return objtree.writeXML(js);};_.fn.x=function(i){var xml="";if(i&&this[i]){xml=_.js2xml(this[i]);}else{for(i=0;i<this.length;i++){xml+=_.js2xml(this[i]);}}return xml;};_.escape=function(xml){return ObjTree.prototype.xml_escape(xml);};_.e3x=function(xml,model){var t=jQuery(xml).clone();jQuery(".e3x",t).each(function(){var result,e3x=jQuery(this).text().replace("{","{__$__:");with(model||{}){eval("result = "+e3x);}jQuery(this).html(_.x(result.__$__));});return t;};var ObjTree=function(){return this;};ObjTree.VERSION="0.24";ObjTree.prototype.xmlDecl='<?xml version="1.0" encoding="UTF-8" ?>\n';ObjTree.prototype.attr_prefix="$";ObjTree.prototype.ns_colon="$";ObjTree.prototype.mixed_content_name="$";ObjTree.prototype.parseXML=function(xml){var root;if(window.DOMParser){var xmldom=new DOMParser();var dom=xmldom.parseFromString(xml,"application/xml");if(!dom){return;}root=dom.documentElement;}else{if(window.ActiveXObject){xmldom=new ActiveXObject("Microsoft.XMLDOM");xmldom.async=false;xmldom.loadXML(xml);root=xmldom.documentElement;}}if(!root){return;}return this.parseDOM(root);};ObjTree.prototype.parseDOM=function(root){if(!root){return;}this.__force_array={};if(this.force_array){for(var i=0;i<this.force_array.length;i++){this.__force_array[this.force_array[i]]=1;}}var json=this.parseElement(root);if(this.__force_array[root.nodeName]){json=[json];}if(root.nodeType!=11){var tmp={};tmp[root.nodeName]=json;json=tmp;}return json;};ObjTree.prototype.parseElement=function(elem){if(elem.nodeType==7){return;}if(elem.nodeType==3||elem.nodeType==4){var bool=elem.nodeValue.match(/[^\x00-\x20]/);if(bool==null){return;}return elem.nodeValue;}var retval;var cnt={};if(elem.attributes&&elem.attributes.length){retval={};for(var i=0;i<elem.attributes.length;i++){var key=elem.attributes[i].nodeName;if(typeof(key)!="string"){continue;}var val=elem.attributes[i].nodeValue;if(!val){continue;}key=this.attr_prefix+key;if(typeof(cnt[key])=="undefined"){cnt[key]=0;}cnt[key]++;this.addNode(retval,key,cnt[key],val);}}if(elem.childNodes&&elem.childNodes.length){var textonly=true;if(retval){textonly=false;}for(var i=0;i<elem.childNodes.length&&textonly;i++){var ntype=elem.childNodes[i].nodeType;if(ntype==3||ntype==4){continue;}textonly=false;}if(textonly){if(!retval){retval="";}for(var i=0;i<elem.childNodes.length;i++){retval+=elem.childNodes[i].nodeValue;}}else{if(!retval){retval={};}for(var i=0;i<elem.childNodes.length;i++){var key=elem.childNodes[i].nodeName;if(typeof(key)!="string"){continue;}var val=this.parseElement(elem.childNodes[i]);if(!val){continue;}if(typeof(cnt[key])=="undefined"){cnt[key]=0;}cnt[key]++;this.addNode(retval,key,cnt[key],val);}}}return retval;};ObjTree.prototype.addNode=function(hash,key,cnts,val){key=this.removeColon(key);if(this.__force_array[key]){if(cnts==1){hash[key]=[];}hash[key][hash[key].length]=val;}else{if(cnts==1){hash[key]=val;}else{if(cnts==2){hash[key]=[hash[key],val];}else{hash[key][hash[key].length]=val;}}}};ObjTree.prototype.writeXML=function(tree){var xml="",i;if(typeof(tree)=="undefined"||tree==null){xml="";}else{if(typeof(tree)=="object"&&tree.constructor==Array){for(i=0;i<tree.length;i++){xml+="\n"+this.writeXML(tree[i]);}}else{if(typeof(tree)=="object"){xml=this.hash_to_xml(null,tree);}else{xml=tree;}}}return xml;};ObjTree.prototype.replaceColon=function(name){return name?(name.substring(0,1)+name.substring(1).replace(this.ns_colon,":")):name;};ObjTree.prototype.removeColon=function(name){return name?(name.replace(":",this.ns_colon)):name;};ObjTree.prototype.hash_to_xml=function(name,tree){var elem=[];var attr=[];name=this.replaceColon(name);for(var key in tree){if(!tree.hasOwnProperty(key)){continue;}var val=tree[key];if(key.charAt(0)!=this.attr_prefix){if(typeof(val)=="undefined"||val==null){elem[elem.length]="<"+key+" />";}else{if(typeof(val)=="object"&&val.constructor==Array){elem[elem.length]=this.array_to_xml(key,val);}else{if(typeof(val)=="object"){elem[elem.length]=this.hash_to_xml(key,val);}else{elem[elem.length]=this.scalar_to_xml(key,val);}}}}else{if(key==this.mixed_content_name){if(typeof(val)=="undefined"||val==null){elem[elem.length]=" ";}else{if(typeof(val)=="object"&&val.constructor==Array){elem[elem.length]=this.writeXML(val);}else{if(typeof(val)=="object"){elem[elem.length]=this.hash_to_xml(key,val);}else{elem[elem.length]=this.scalar_to_xml(key,val);}}}}else{attr[attr.length]=" "+(this.replaceColon(key).substring(1))+'="'+(this.xml_escape(val))+'"';}}}var jattr=attr.join("");var jelem=elem.join("");if(typeof(name)=="undefined"||name==null){}else{if(elem.length>0){if(jelem.match(/\n/)){jelem="<"+name+jattr+">\n"+jelem+"</"+name+">\n";}else{jelem="<"+name+jattr+">"+jelem+"</"+name+">\n";}}else{jelem="<"+name+jattr+" />\n";}}return jelem;};ObjTree.prototype.array_to_xml=function(name,array){var out=[];if(!(name==this.mixed_content_name)){name=this.replaceColon(name);}for(var i=0;i<array.length;i++){var val=array[i];if(typeof(val)=="undefined"||val==null){out[out.length]="<"+name+" />";}else{if(typeof(val)=="object"&&val.constructor==Array&&name!=this.mixed_content_name){out[out.length]=this.array_to_xml(name,val);}else{if(typeof(val)=="object"){out[out.length]=this.hash_to_xml(name,val);}else{out[out.length]=this.scalar_to_xml(name,val);}}}}return out.join("");};ObjTree.prototype.scalar_to_xml=function(name,text){if(name=="$"){return this.xml_escape(text);}else{name=this.replaceColon(name);return"<"+name+">"+this.xml_escape(text)+"</"+name+">\n";}};ObjTree.prototype.xml_escape=function(text){return String(text).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");};})(jsPath);(function(_){_.json=_.js2json=function(js,filter,indentValue){return __JSON__.stringify(js,filter,indentValue||"");};_.fn.json=_.fn.js2json=function(filter,indentValue){var i,str="[";for(i=0;i<this.length;i++){str+=__JSON__.stringify(this[i],filter,indentValue||"");if(!(i+1==this.length)){str+=",\n";}}return str+"]";};_.eval=_.json2js=function(json,filter){return JSON.parse(json,filter);};_.fn.eval=_.fn.json2js=function(filter){var i,js=[];for(i=0;i<this.length;i++){js[i]=JSON.parse(this[i],filter);}return js;};_.strip=_.stripjs=function(js,filter){return _.eval(_.js2json(js,filter,""));};_.fn.strip=_.fn.stripjs=function(filter){return _.eval(this.js2json(filter,""));};var __json__=null;if(typeof JSON!=="undefined"){__json__=JSON;}var JSON={parse:function(text,safe){if(__json__!==null||safe){return(__json__!==null)?__json__.parse(text):__JSON__.parse(text);}if(browser.gecko){return new Function("return "+text)();}return eval("("+text+")");}};var __JSON__=function(){function f(n){return n<10?"0"+n:n;}Date.prototype.toJSON=function(key){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z";};String.prototype.toJSON=function(key){return String(this);};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,escapeable=/[\\\"\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){escapeable.lastIndex=0;return escapeable.test(string)?'"'+string.replace(escapeable,function(a){var c=meta[a];if(typeof c==="string"){return c;}return"\\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(typeof value.length==="number"&&!(value.propertyIsEnumerable("length"))){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;}}return{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});},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");}};}();var Browser=function(){var o={ie:0,opera:0,gecko:0,webkit:0};var ua=navigator.userAgent,m;if((/KHTML/).test(ua)){o.webkit=1;}m=ua.match(/AppleWebKit\/([^\s]*)/);if(m&&m[1]){o.webkit=parseFloat(m[1]);}if(!o.webkit){m=ua.match(/Opera[\s\/]([^\s]*)/);if(m&&m[1]){o.opera=parseFloat(m[1]);}else{m=ua.match(/MSIE\s([^;]*)/);if(m&&m[1]){o.ie=parseFloat(m[1]);}else{m=ua.match(/Gecko\/([^\s]*)/);if(m){o.gecko=1;m=ua.match(/rv:([^\s\)]*)/);if(m&&m[1]){o.gecko=parseFloat(m[1]);}}}}}return o;};var browser=Browser();})(jsPath);$.extend({URLEncode:function(c){var o="";var x=0;c=c.toString();var r=/(^[a-zA-Z0-9_.]*)/;while(x<c.length){var m=r.exec(c.substr(x));if(m!=null&&m.length>1&&m[1]!=""){o+=m[1];x+=m[1].length;}else{if(c[x]==" "){o+="+";}else{var d=c.charCodeAt(x);var h=d.toString(16);o+="%"+(h.length<2?"0":"")+h.toUpperCase();}x++;}}return o;},URLDecode:function(s){var o=s;var binVal,t;var r=/(%[^%]{2})/;while((m=r.exec(o))!=null&&m.length>1&&m[1]!=""){b=parseInt(m[1].substr(1),16);t=String.fromCharCode(b);o=o.replace(m[1],t);}return o;}});var LOCShare={Models:{},Views:{},Controllers:{}};(function($){$.scan(["LOCShare.Models","LOCShare.Views","LOCShare.Controllers"]);})(jQuery);(function($){$.env({defaults:{locshare:{root:"/share/",app_id:"Jl2ctw2m",request_type:"POST",request_datatype:"json",site_name:"loc.gov",subscribe_url:"/share/sites/Jl2ctw2m/subscribe.php",default_subscribe_url:"/share/sites/Jl2ctw2m/subscribe.php",link:window.location.href,title:window.document.title,object_type:"page",embed_type:null,embed_detail:null,embed_alt:null,download_links:null,download_link_label:null,img_alt_prefix:"Share to ",action:"share",message_max_chars:500,field_defaults:{to_email:"Recipient's e-mail address",from_email:"Your e-mail address"}}},dev:{client:{locshare:{root:"/",subscribe_url:"/sites/Jl2ctw2m/subscribe.php"}}},prod:{client:{}},test:{client:{}},"8usedrUw":{client:{locshare:{root:"/share/",app_id:"8usedrUw",site_name:"TEST",subscribe_url:"/share/sites/8usedrUw/subscribe.php"}}},Bapu4ruC:{client:{locshare:{root:"/share/",app_id:"Bapu4ruC",site_name:"loc.gov",subscribe_url:"/share/sites/Bapu4ruC/subscribe.php"}}},g8Z9nutR:{client:{locshare:{root:"/share/",app_id:"g8Z9nutR",site_name:"read.gov",subscribe_url:"/share/sites/g8Z9nutR/subscribe.php"}}},"3hekApRE":{client:{locshare:{root:"/share/",app_id:"3hekApRE",site_name:"the Wise Guide",subscribe_url:"/share/sites/3hekApRE/subscribe.php"}}},mURa6AC7:{client:{locshare:{root:"/share/",app_id:"mURa6AC7",site_name:"PPOC",subscribe_url:"/share/sites/mURa6AC7/subscribe.php"}}},pHetuv88:{client:{locshare:{root:"/share/",app_id:"pHetuv88",site_name:"THOMAS",subscribe_url:"/share/sites/pHetuv88/subscribe.php"}}},tRE2reSw:{client:{locshare:{root:"/share/",app_id:"tRE2reSw",site_name:"Law Library",subscribe_url:"/share/sites/tRE2reSw/subscribe.php"}}},dUcuwr5p:{client:{locshare:{root:"/share/",app_id:"dUcuwr5p",site_name:"Chronicling America",subscribe_url:"/share/sites/dUcuwr5p/subscribe.php"}}},zawrE2Ra:{client:{locshare:{root:"/share/",app_id:"zawrE2Ra",site_name:"Performing Arts Division",subscribe_url:"/share/sites/zawrE2Ra/subscribe.php"}}},pUn2Wr7Q:{client:{locshare:{root:"/share/",app_id:"pUn2Wr7Q",site_name:"Library of Congress Blogs",subscribe_url:"/share/sites/pUn2Wr7Q/subscribe.php"}}},"6wek3sPa":{client:{locshare:{root:"http://www.loc.gov/share/",app_id:"6wek3sPa",site_name:"MyLOC",subscribe_url:"http://www.loc.gov/share/sites/6wek3sPa/subscribe.php",request_type:"GET",request_datatype:"jsonp"}}},JaMa3r5p:{client:{locshare:{root:"/share/",app_id:"JaMa3r5p",site_name:"African American Heritage Month",subscribe_url:"/share/sites/JaMa3r5p/subscribe.php"}}},Ge8apusT:{client:{locshare:{root:"/share/",app_id:"Ge8apusT",site_name:"Women's History Month",subscribe_url:"/share/sites/Ge8apusT/subscribe.php"}}},bUpu6Upe:{client:{locshare:{root:"/share/",app_id:"bUpu6Upe",site_name:"Asian Pacific American Heritage Month",subscribe_url:"/share/sites/bUpu6Upe/subscribe.php"}}},"3aruveVE":{client:{locshare:{root:"/share/",app_id:"3aruveVE",site_name:"National Jewish Heritage Month ",subscribe_url:"/share/sites/3aruveVE/subscribe.php"}}},CH8cepHa:{client:{locshare:{root:"/share/",app_id:"CH8cepHa",site_name:"National Hispanic Heritage Month",subscribe_url:"/share/sites/CH8cepHa/subscribe.php"}}},"6ESPuvam":{client:{locshare:{root:"/share/",app_id:"6ESPuvam",site_name:"National Disability Employee Awareness Month",subscribe_url:"/share/sites/6ESPuvam/subscribe.php"}}},wR6sWus2:{client:{locshare:{root:"/share/",app_id:"wR6sWus2",site_name:"Native American Heritage Month",subscribe_url:"/share/sites/wR6sWus2/subscribe.php"}}}});})(jQuery);(function($){$.logging([{category:"LOCShare",level:"ERROR"},{category:"LOCShare.Models",level:"ERROR"},{category:"LOCShare.Views",level:"ERROR"},{category:"LOCShare.Controllers",level:"ERROR"},{category:"Claypool",level:"ERROR"},{category:"root",level:"WARN"}]);})(jQuery);(function($){$.routes({"hijax:a":[{id:"#locshare-hash-routes",active:true,filter:"[href*=#locshare]",stopPropagation:true,preventDefault:true,strategy:"first",hijaxMap:[{urls:"print$",controller:"#printController",action:"print"},{urls:"subscribe/close/|:id|$",controller:"#subscribeController",action:"close"},{urls:"subscribe$",controller:"#subscribeController"},{urls:"share/close/|:id|$",controller:"#shareController",action:"close"},{urls:"share/addfavorite/|:id|$",controller:"#shareController",action:"addFavorite"},{urls:"share/showlink/|:id|$",controller:"#shareController",action:"showLink"},{urls:"share/showembed/|:id|$",controller:"#shareController",action:"showEmbed"},{urls:"share/email/confirm/|:id|$",controller:"#shareController",action:"confirmEmail"},{urls:"share$",controller:"#shareController"}]}],"hijax:event":[{id:"#locshare-event-routes",stopPropagation:true,strategy:"all",hijaxMap:[{event:"locshare-attach",controller:"#toolbarController",action:"create"},{event:"locshare-open",controller:"#shareController",action:"closeAll"},{event:"locshare-open",controller:"#subscribeController",action:"closeAll"}]}],"hijax:form":[{id:"#locshare-form-routes",active:true,filter:"[action*=#locshare]",stopPropagation:true,preventDefault:true,hijaxMap:[{urls:"share/email/|:id|$",controller:"#shareController",action:"email"}]}]});})(jQuery);(function($){var log,logModel,shareModel,fieldDefaults;$("div.locshare-share-tab-link-list > div > a").livequery("click",function(event){if(!log){log=$.logger("LOCShare");logModel=$.$("#logModel");shareModel=$.$("#shareModel");}var id=$(event.target).attr("rel"),options=shareModel.get(id),target=$(event.target).text();log.debug("logging share %s:%s",target,options.link);logModel.post({root:options.root,app_id:options.app_id,request_type:options.request_type,request_datatype:options.request_datatype,object_type:options.object_type,action:"share",target:target,title:options.title,link:options.link,embed_type:null,embed_detail:null,download_link_label:null});});$("div.locshare-save-tab-downloads > div > div > p > a").livequery("click",function(event){if(!log){log=$.logger("LOCShare");logModel=$.$("#logModel");shareModel=$.$("#shareModel");}var id=$(event.target).attr("rel"),options=shareModel.get(id),target=$(event.target).text(),link=$(event.target).attr("href");log.debug("logging share %s:%s",target,link);logModel.post({root:options.root,app_id:options.app_id,request_type:options.request_type,request_datatype:options.request_datatype,object_type:options.object_type,action:"download_file",target:null,title:options.title,link:link,embed_type:null,embed_detail:null,download_link_label:target});});$("textarea.locshare-email-tab-form-field-message").livequery("keyup",function(event){if(!log){log=$.logger("LOCShare");}var max=$.env("locshare").message_max_chars,current=$(event.target).attr("value").length,remaining=max-current;if(max<current){log.debug("string too long. trimming %s characters",(current-max));$(event.target).attr("value",$(event.target).attr("value").substring(0,max));}else{log.debug("field contains %s characters, %s remaining",current,remaining);$("span.locshare-email-tab-field-message-remaining-chars",$(event.target).parent("div.locshare-email-tab-input")).text(remaining);}return false;});$("textarea.locshare-email-tab-form-field-message").livequery("keypress",function(event){if(!log){log=$.logger("LOCShare");}if((!event.keyCode||(event.keyCode>46&&event.keyCode<90))&&$(event.target).attr("value").length>=$.env("locshare").message_max_chars){log.debug("preventing keypress");return false;}});$("input.locshare-email-tab-form-field-defaults").livequery("focus",function(event){if(!log){log=$.logger("LOCShare");}if(!fieldDefaults){fieldDefaults=$.env("locshare").field_defaults;}if($(event.target).attr("value")==fieldDefaults[$(event.target).attr("name")]){log.debug("clearing %s",$(event.target).attr("name"));$(event.target).attr("value","");}});$("input.locshare-email-tab-form-field-defaults").livequery("blur",function(event){if(!log){log=$.logger("LOCShare");}if(!fieldDefaults){fieldDefaults=$.env("locshare").field_defaults;}if($(event.target).attr("value")==""){log.debug("resetting %s",$(event.target).attr("name"));$(event.target).attr("value",fieldDefaults[$(event.target).attr("name")]);}});})(jQuery);(function($,$V){var log,template="			<div class='locshare-toolbar'>	            <span class='locshare-print-button'>	            	<a href='#locshare/print'>	            		Print					</a>				</span>	            <span class='locshare-subscribe-button'>	            	<a href='#locshare/subscribe'>	            		Subscribe					</a>				</span>	            <span class='locshare-share-button'>	        		<a href='#locshare/share'>	        			Share/Save					</a>				</span>	        </div>		";$V.Toolbar=function(options){$.extend(true,this,options);log=$.logger("LOCShare.Views.Toolbar");};$.extend($V.Toolbar.prototype,{think:function(model){},update:function(model){var shareToolbar=$(template);$(shareToolbar).attr("id",model.id);$(model.target).replaceWith(shareToolbar);}});})(jQuery,LOCShare.Views);(function($,$V){var log,cache,subscribeModel,template="			<div class='locshare-dialog-inner'>				<div class='locshare-dialog-head'>					<a href='#' class='locshare-dialog-close'>Close</a>				</div>				<div class='locshare-dialog-title'>					<h2>SUBSCRIBE</h2>					<p>You can subscribe to regular updates from <span class='locshare-dialog-title-site'>Loc.gov</span> by RSS and e-mail</p>				</div>				<div class='locshare-dialog-content locshare-dialog-content-scrolling'>					<div class='locshare-dialog-subscribe-content'>						Loading...					</div>					<div class='locshare-dialog-close-hidden'>						<a href='#' class='locshare-dialog-close'>Close</a>					</div>				</div>								<div class='locshare-dialog-footer'>					<a href='http://www.loc.gov/rss/faq.html' target='_blank'>About RSS</a> | <a href='http://www.loc.gov/rss/' target='_blank'>All Library of Congress Subscriptions</a>				</div>			</div>		";$V.Subscribe=function(options){$.extend(true,this,options);log=$.logger("LOCShare.Views.Subscribe");cache={};subscribeModel=$.$("#subscribeModel");};$.extend($V.Subscribe.prototype,{think:function(model){},update:function(model){var subscribeDialog,id;if(!(model&&model.id)){log.debug("closing all subscribe dialogs");for(id in cache){if($(cache[id]).dialog("isOpen")){$(cache[id]).dialog("close");}}}else{if(!(model.id in cache)){log.debug("creating new subscribe dialog for id %s",model.id);subscribeDialog=$(template);$(subscribeDialog).attr("id",model.id+"-subscribe-dialog");$("a.locshare-dialog-close",subscribeDialog).attr("href","#locshare/subscribe/close/"+model.id);$("span.locshare-dialog-title-site",subscribeDialog).html(model.options.site_name);log.debug("lazy loading content for subscribe dialog from %s",model.options.subscribe_url);subscribeModel.get({id:model.id,url:model.options.subscribe_url,fallback_url:model.options.default_subscribe_url,request_type:model.options.request_type,request_datatype:model.options.request_datatype},function(content){$("div.locshare-dialog-subscribe-content",subscribeDialog).html(content);});$(subscribeDialog).dialog({autoOpen:false,resizable:false,bgiframe:true,width:"510px",dialogClass:"locshare-dialog locshare-subscribe-arrow",close:function(){$("#"+model.id+" a[href*=locshare/subscribe]").focus();}}).parent().css({backgroundPosition:model.arrowPosition});cache[model.id]=subscribeDialog;}else{subscribeDialog=cache[model.id];}}if(model&&model.id){if($(subscribeDialog).dialog("isOpen")){log.debug("opening subscribe dialog for id %s",model.id);$(subscribeDialog).dialog("close");}else{log.debug("opening subscribe dialog for id %s",model.id);model.position.top=model.position.top-$(document).scrollTop();$(subscribeDialog).dialog("option","position",[model.position.left,model.position.top]);$(subscribeDialog).dialog("open");$(subscribeDialog).parents(".ui-dialog").appendTo("#"+model.id).focus();}}}});})(jQuery,LOCShare.Views);(function($,$V,_){var log,cache,template="		<div class='locshare-dialog-inner'>			<div class='locshare-dialog-head'>				<ul class='locshare-dialog-menu'>					<li class='locshare-dialog-menu-item locshare-dialog-menu-item-share locshare-dialog-menu-item-active'><a href='#'><span>SHARE</span></a></li>					<li class='locshare-dialog-menu-item locshare-dialog-menu-item-email'><a href='#'><span>E-MAIL</span></a></li>					<li class='locshare-dialog-menu-item locshare-dialog-menu-item-save'><a href='#'><span>SAVE</span></a></li>				</ul>				<a href='#' class='locshare-dialog-close'>Close</a>			</div>			<div class='locshare-share-tab'>				<div class='locshare-dialog-content'>					<div class='locshare-share-tab-link-list e3x'>{						_('.*',options.urls).map(function(index, value){							return {								div:{									$class:(index!==0&&index%3==0)?'locshare-share-tab-item-clear':'',									a:{										$rel:id,										$href:this.url,										$target:'_blank',										$:[											this.name,											{img:{												$src:options.root+this.icon,												$alt:options.img_alt_prefix+this.name											}}										]									}								}							};						}).x()					}</div>				</div>				<div class='locshare-dialog-footer'>					<a href='http://www.loc.gov/homepage/legal.html#privacy_policy'					   target='_blank' class='locshare-privacy'>Privacy Policy</a>					<a href='http://www.loc.gov/global/disclaim.html'					   target='_blank' class='locshare-disclaimer'>Disclaimer</a>				</div>			</div>			<div class='locshare-email-tab'>				<div class='locshare-dialog-content'>					<div class='locshare-email-tab-form-container'>						<form name='locshare-share_form_email' class='locshare-email-tab-form' method='post' action='#locshare/share/email'>							<div class='locshare-email-tab-input'>								<div class='locshare-email-tab-input-2col first'>									<label class='locshare-email-table-label'>To</label>									<input value='' name='to_email' type='text' 										class='locshare-email-tab-form-field-to_email locshare-email-tab-form-field-defaults' />								</div>								<div class='locshare-email-tab-input-2col'>									<label class='locshare-email-table-label'>From</label>									<input value='' name='from_email' type='text' 										class='locshare-email-tab-form-field-from_email locshare-email-tab-form-field-defaults' />								</div>							</div>							<div class='locshare-email-tab-input'>								<label class='locshare-email-table-label'>									Message <span>									(<span class='locshare-email-tab-field-message-remaining-chars'></span> 									remaining)</span>								</label>								<textarea value='' class='locshare-email-tab-form-field-message'									name='message'></textarea>							</div>							<div class='locshare-email-tab-input locshare-right'>								<input value=''									   name='send_copy'									   type='checkbox' />								<label>									Send me a copy								</label>								<input src=''										class='locshare-button'										value='Send'										name='locshare_email_submit'										type='image' />							</div>							<div class='locshare-email-tab-message'>								<p class=''></p>							</div>						</form>					</div>					<div class='locshare-email-tab-confirm-container'>						<div class='locshare-email-tab-confirm-box'>							<p class='locshare-email-tab-confirm-message locshare-message-success'>								Your message has been sent successfully.							</p>							<p class='locshare-email-tab-confirm-button'>								<a href='#locshare/share/email/confirm/'>Continue</a>							</p>						</div>					</div>				</div>				<div class='locshare-dialog-footer'>					<a href='http://www.loc.gov/homepage/legal.html#privacy_policy'					   target='_blank' class='locshare-privacy'>Privacy Policy</a>				</div>			</div>			<div class='locshare-save-tab'>				<div class='locshare-dialog-content'>					<div class='locshare-save-tab-links'>						<h3>To link to or embed this content, copy and paste this into your Web site or blog.</h3>						<div class='locshare-save-tab-link-list'>							<span class='locshare-save-tab-link-list-first'>								<a href='#locshare/share/showlink'>Link</a>							</span>							<span>								<a href='#locshare/share/showembed'>Embed</a>							</span>						</div>						<p class='locshare-save-tab-link-instruction'>							Paste this code into your Website or blog.						</p>						<input type='text' name='locshare-save-tab-copy-box'							class='locshare-save-tab-copy-box'							value='Click on the links above to update this field.'>					</div>					<div class='locshare-save-tab-addfavorite'>						<h3>Save to Favorites</h3>						<p class='locshare-save-tab-save-box'>							<em>Save to my Browser</em> 							<a href='#locshare/share/addfavorite'>Save</a>						</p>					</div>					<div class='locshare-save-tab-downloads'>						<h3>Download</h3>						<div class='locshare-save-tab-downloads-scroll'>							<div class='e3x'>								{options.download_links?_('.*',options.download_links).map(function(index, value){									return {										p:{											a:{												$href:value.link,												$target:'_blank',												$:value.label,												$rel:id											},											span:{												$class:'locshare-download-meta',												$:(value.meta!=undefined&&value.meta!='')?'('+value.meta+')':''											}										}									};								}).x():''}							</div>						</div>					</div>				</div>				<div class='locshare-dialog-footer'>					<a href='http://www.loc.gov/homepage/legal.html#privacy_policy'					   target='_blank' class='locshare-privacy'>Privacy Policy</a>				</div>			</div>		</div>	";$V.Share=function(options){$.extend(true,this,options);log=$.logger("LOCShare.Views.Share");cache={};};$.extend($V.Share.prototype,{think:function(model){},update:function(model){var shareDialog;if(!(model&&model.id)){log.debug("closing all share dialogs");for(id in cache){if($(cache[id]).dialog("isOpen")){$(cache[id]).dialog("close");}}}else{if(!(model.id in cache)){log.debug("creating new share dialog for id %s",model.id);shareDialog=$(_.e3x(template,model));log.debug("rendering template");$("div.locshare-share-tab",shareDialog).attr("id",model.id+"-share-tab");$("li.locshare-dialog-menu-item-share a",shareDialog).attr("href","#"+model.id+"-share-tab");$("div.locshare-email-tab",shareDialog).attr("id",model.id+"-email-tab");$("li.locshare-dialog-menu-item-email a",shareDialog).attr("href","#"+model.id+"-email-tab");$("div.locshare-save-tab",shareDialog).attr("id",model.id+"-save-tab");$("li.locshare-dialog-menu-item-save a",shareDialog).attr("href","#"+model.id+"-save-tab");$(shareDialog).attr("id",model.id+"-share-dialog");$("a.locshare-dialog-close",shareDialog).attr("href","#locshare/share/close/"+model.id);$("form.locshare-email-tab-form",shareDialog).attr("action","#locshare/share/email/"+model.id);$("span.locshare-email-tab-field-message-remaining-chars",shareDialog).text(model.options.message_max_chars);$("input.locshare-email-tab-form-field-defaults",shareDialog).each(function(){$(this).attr("value",model.options.field_defaults[$(this).attr("name")]);});$("div.locshare-email-tab-message",shareDialog).hide();$("div.locshare-email-tab-confirm-container",shareDialog).hide();$("p.locshare-email-tab-confirm-button > a",shareDialog).attr("href","#locshare/share/email/confirm/"+model.id);$("input[name=locshare_email_submit]",shareDialog).attr("src",model.options.root+"images/btn-submit.png");$("p.locshare-save-tab-save-box > a",shareDialog).attr("href","#locshare/share/addfavorite/"+model.id);$("p.locshare-save-tab-link-instruction",shareDialog).hide();if(model.options.embed_type&&model.options.embed_detail){$("div.locshare-save-tab-link-list > span > a",shareDialog).each(function(){var href=$(this).attr("href");$(this).attr("href",href+"/"+model.id);});}else{$("div.locshare-save-tab-link-list",shareDialog).hide();$("input.locshare-save-tab-copy-box",shareDialog).attr("value",model.options.link);}if(!($.isArray(model.options.download_links)&&model.options.download_links.length)){$("div.locshare-save-tab-downloads",shareDialog).hide();}$(shareDialog).dialog({autoOpen:false,resizable:false,bgiframe:true,width:"510px",dialogClass:"locshare-dialog locshare-share-arrow",close:function(){$("#"+model.id+" a[href*=locshare/share]").focus();}}).parent().css({backgroundPosition:model.arrowPosition});($("div.locshare-dialog-head",shareDialog)).tabs();cache[model.id]=shareDialog;}else{shareDialog=cache[model.id];}}if(model&&model.id){if($(shareDialog).dialog("isOpen")){log.debug("opening share dialog for id %s",model.id);$(shareDialog).dialog("close");}else{log.debug("opening share dialog for id %s",model.id);model.position.top-=$(document).scrollTop();$(shareDialog).dialog("option","position",[model.position.left,model.position.top]);$(shareDialog).dialog("open");$(shareDialog).parents(".ui-dialog").appendTo("#"+model.id).focus();}}},showLink:function(model){var shareDialog=cache[model.id];$("div.locshare-save-tab-link-list span",shareDialog).removeClass("locshare-selected");$(model.target).parent().addClass("locshare-selected");$("p.locshare-save-tab-link-instruction",shareDialog).hide();$("input.locshare-save-tab-copy-box",shareDialog).attr("value",model.options.link);},showEmbed:function(model){var shareDialog=cache[model.id],embedText;switch(model.options.embed_type){case"video":embedText='<script src="http://www.loc.gov/videoplayer.js?video='+model.options.embed_detail+'&other_options" type="text/javascript"><\/script><noscript>Embedded video from <a href="http://loc.gov">Library of Congress</a></noscript>';break;case"audio":embedText='<script src="http://www.loc.gov/audioplayer.js?audio='+model.options.embed_detail+'&other_options" type="text/javascript"><\/script><noscript>Embedded audio from <a href="http://loc.gov">Library of Congress</a></noscript>';break;case"image":if(model.options.embed_alt==null){model.options.embed_alt="Image shared from Library Of Congress";}embedText='<a href="'+model.options.link+'" target="_blank"><img src="'+model.options.embed_detail+'" alt="'+model.options.embed_alt+'" /></a>';break;default:embedText="Embed code is not available for this item.";break;}$("div.locshare-save-tab-link-list span",shareDialog).removeClass("locshare-selected");$(model.target).parent().addClass("locshare-selected");$("input.locshare-save-tab-copy-box",shareDialog).attr("value",embedText);},updateStatus:function(model){var shareDialog=cache[model.id],form_status=$("div.locshare-email-tab-message > p",shareDialog);if(model.success){var form_container=$("div.locshare-email-tab-form-container",shareDialog),confirm_container=$("div.locshare-email-tab-confirm-container",shareDialog);$("p.locshare-email-tab-confirm-message",shareDialog).text(model.text);form_status.text("");if(form_status.hasClass("locshare-message-error")){form_status.removeClass("locshare-message-error");}$("[name=to_email]",form_container).attr("value",model.options.field_defaults.to_email);$("[name=from_email]",form_container).attr("value",model.options.field_defaults.from_email);$("[name=message]",form_container).attr("value","");$("[name=send_copy]",form_container).attr("checked",false);$("span.locshare-email-tab-field-message-remaining-chars",form_container).text(model.options.message_max_chars);form_container.hide();confirm_container.show();}else{form_status.text(model.text);if(form_status.hasClass("locshare-message-success")){form_status.removeClass("locshare-message-success");}form_status.addClass("locshare-message-error");$("div.locshare-email-tab-message",shareDialog).show();}},confirmEmail:function(model){var shareDialog=cache[model.id];$("div.locshare-email-tab-confirm-container",shareDialog).hide();$("div.locshare-email-tab-form-container",shareDialog).show();}});})(jQuery,LOCShare.Views,jsPath);(function($,$C){var log,cache;$C.Toolbar=function(options){$.extend(true,this,options);log=$.logger("LOCShare.Controllers.Toolbar");};$.extend($C.Toolbar.prototype,{create:function(event){var id=$(event.target).attr("id");log.debug("creating loc share toolbar for id %s",id);var data=$("> code",event.target);$.$("#shareModel").put(id,data.length?$(data).text():"{}");event.m({id:id,target:event.target}).render();}});})(jQuery,LOCShare.Controllers);(function($,$C){var log,logModel,shareModel;$C.Subscribe=function(options){$.extend(true,this,options);log=$.logger("LOCShare.Controllers.Subscribe");logModel=$.$("#logModel");shareModel=$.$("#shareModel");};$.extend($C.Subscribe.prototype,{handle:function(event){var id=$(event.target).parents("div").attr("id"),config=shareModel.get(id),position=$(event.target).position(),arrowPosition="40px 0";if(position.left+511>$(document).width()){position.left=position.left-450;arrowPosition="484px 0";}position.top+=18;log.debug("subscribe clicked for id %s",id);$(document).trigger("locshare-open");logModel.post({root:config.root,app_id:config.app_id,request_type:config.request_type,request_datatype:config.request_datatype,object_type:config.object_type,action:"view_subscribe",target:null,title:config.title,link:config.link,embed_type:null,embed_detail:null,download_link_label:null});event.m({id:id,options:config,position:position,arrowPosition:arrowPosition}).render();},close:function(event){var id=event.params().id;log.debug("close clicked for id %s",id);event.m({id:id}).render(function(){$(document).trigger("locshare-close");});},closeAll:function(event){log.debug("closing all");event.render();}});})(jQuery,LOCShare.Controllers);(function($,$C){var log,logModel,shareModel;$C.Share=function(options){$.extend(true,this,options);log=$.logger("LOCShare.Controllers.Share");logModel=$.$("#logModel");shareModel=$.$("#shareModel");};$.extend($C.Share.prototype,{handle:function(event){var id=$(event.target).parents("div").attr("id"),config=shareModel.get(id),position=$(event.target).position(),arrowPosition="40px 0";if(position.left+511>$(document).width()){position.left=position.left-450;arrowPosition="484px 0";}position.top+=18;log.debug("share clicked for id %s",id);$(document).trigger("locshare-open");logModel.post({root:config.root,app_id:config.app_id,request_type:config.request_type,request_datatype:config.request_datatype,object_type:config.object_type,action:"view_save_share",target:null,title:config.title,link:config.link,embed_type:null,embed_detail:null,download_link_label:null});event.m({id:id,options:config,position:position,arrowPosition:arrowPosition}).render();},closeAll:function(event){log.debug("closing all");event.render();},addFavorite:function(event){var id=event.params("id"),config=shareModel.get(id);log.debug("addfavorite clicked");logModel.post({root:config.root,app_id:config.app_id,request_type:config.request_type,request_datatype:config.request_datatype,object_type:config.object_type,action:"save_browser",target:null,title:config.title,link:config.link,embed_type:null,embed_detail:null,download_link_label:null});if(window.sidebar){window.sidebar.addPanel(config.title,config.link,"");}else{if(window.external){window.external.AddFavorite(config.link,config.title);}else{alert("Press Command/CTRL-D to bookmark this page.");}}},showLink:function(event){var id=event.params("id"),config=shareModel.get(id);log.debug("show link clicked for id %s",id);logModel.post({root:config.root,app_id:config.app_id,request_type:config.request_type,request_datatype:config.request_datatype,object_type:config.object_type,action:"link_view",target:null,title:config.title,link:config.link,embed_type:null,embed_detail:null,download_link_label:null});event.m({id:id,options:config,target:event.target}).v(".showLink").render();},showEmbed:function(event){var id=event.params("id"),config=shareModel.get(id);log.debug("show embed clicked for id %s",id);logModel.post({root:config.root,app_id:config.app_id,request_type:config.request_type,request_datatype:config.request_datatype,object_type:config.object_type,action:"embed_view",target:null,title:config.title,link:config.link,embed_type:config.embed_type,embed_detail:config.embed_detail,download_link_label:null});event.m({id:id,options:config,target:event.target}).v(".showEmbed").render();},email:function(event){var id=event.params("id"),config=shareModel.get(id),emailModel=$.$("#emailModel"),resultSuccess=false,resultText="An Unknown Error Has Occured";log.debug("email clicked");emailModel.send({root:config.root,app_id:config.app_id,request_type:config.request_type,request_datatype:config.request_datatype,to_email:$("[name=to_email]",event.target).attr("value"),from_email:$("[name=from_email]",event.target).attr("value"),title:config.title,link:config.link,message:$("[name=message]",event.target).attr("value"),send_copy:$("[name=send_copy]",event.target).attr("checked")},function(status,result){log.debug("got e-mail response: %s, %s",status,result);if(status=="success"){resultSuccess=true;logModel.post({root:config.root,app_id:config.app_id,request_type:config.request_type,request_datatype:config.request_datatype,object_type:config.object_type,action:"email",target:null,title:config.title,link:config.link,embed_type:null,embed_detail:null,download_link_label:null});}resultText=result;event.m({id:id,options:config,success:resultSuccess,text:resultText}).v(".updateStatus").render();});},confirmEmail:function(event){var id=event.params("id");log.debug("email confirm clicked for id %s",id);event.m({id:id}).v(".confirmEmail").render();},close:function(event){var id=event.params("id");log.debug("close clicked for id %s",id);event.m({id:id}).render(function(){$(document).trigger("locshare-close");});}});})(jQuery,LOCShare.Controllers);(function($,$C){var log;$C.Print=function(options){$.extend(true,this,options);log=$.logger("LOCShare.Controllers.Print");};$.extend($C.Print.prototype,{print:function(event){window.print();}});})(jQuery,LOCShare.Controllers);(function($,$M){var log;$M.Log=function(options){$.extend(true,this,options);log=$.logger("LOCShare.Models.Log");};$.extend($M.Log.prototype,{post:function(data){var _this=this;if(data.request_type==undefined){data.request_type="POST";}if(data.request_datatype==undefined){data.request_datatype="json";}log.debug("running log using root: %s",data.root);$.ajax({type:data.request_type,url:data.root+"log.php",dataType:data.request_datatype,data:{app_id:$.trim(data.app_id),object_type:$.trim(data.object_type),action:$.trim(data.action),target:$.trim(data.target),title:$.trim(data.title),link:$.trim(data.link),embed_type:$.trim(data.embed_type),embed_detail:$.trim(data.embed_detail),download_link_label:$.trim(data.download_link_label)},success:function(result){_this.$log.debug("Successfully posted log record.");}});}});})(jQuery,LOCShare.Models);(function($,$M){var log;$M.Email=function(options){$.extend(true,this,options);log=$.logger("LOCShare.Models.Log");};$.extend($M.Email.prototype,{send:function(data,callback){var _this=this,field_defaults=$.env("locshare").field_defaults;if(data.request_type==undefined){data.request_type="POST";}if(data.request_datatype==undefined){data.request_datatype="json";}if(data.to_email==field_defaults.to_email){data.to_email="";}if(data.from_email==field_defaults.from_email){data.from_email="";}$.ajax({type:data.request_type,url:data.root+"email.php",dataType:data.request_datatype,data:{app_id:data.app_id,to_email:data.to_email,from_email:data.from_email,title:data.title,link:data.link,message:data.message,send_copy:data.send_copy},success:function(result){_this.$log.debug("Successfully sent e-mail.");if(callback&&$.isFunction(callback)){callback(result.status,result.message);}},error:function(request,status,error){_this.$log.debug("Failed to sent e-mail.");if(callback&&$.isFunction(callback)){callback(status,request.responseText);}}});}});})(jQuery,LOCShare.Models);(function($,$M){var log,cache,template=function(url,title){url=$.URLEncode(url);title=$.URLEncode(title);return[{name:"Delicious",url:"http://del.icio.us/post?&url="+url+"&title="+title+"",icon:"images/icons/bm_delicious.gif"},{name:"Digg",url:"http://digg.com/submit/?url="+url+"&title="+title+"",icon:"images/icons/bm_digg.gif"},{name:"Facebook",url:"http://www.facebook.com/share.php?src=bm&u="+url+"&t="+title+"&v=3",icon:"images/icons/bm_facebook.gif"},{name:"Google",url:"http://www.google.com/bookmarks/mark?op=add&title="+title+"&bkmk="+url+"",icon:"images/icons/bm_google.gif"},{name:"Live",url:"http://favorites.live.com/quickadd.aspx?url="+url+"&title="+title+"",icon:"images/icons/bm_live.gif"},{name:"Mixx",url:"http://www.mixx.com/submit?page_url="+url+"",icon:"images/icons/bm_mixx.gif"},{name:"MySpace",url:"http://www.myspace.com/Modules/PostTo/Pages/?t="+title+"&c=%20&u="+url+"&l=2",icon:"images/icons/bm_myspace.gif"},{name:"Reddit",url:"http://reddit.com/submit?url="+url+"&title="+title+"",icon:"images/icons/bm_reddit.gif"},{name:"StumbleUpon",url:"http://www.stumbleupon.com/submit?url="+url+"&title="+title+"",icon:"images/icons/bm_stumbleupon.gif"},{name:"Technorati",url:"http://technorati.com/faves?add="+url+"",icon:"images/icons/bm_technorati.gif"},{name:"Twitter",url:"http://twitter.com/home?status="+title+"%20-%20"+url+"",icon:"images/icons/bm_twitter.gif"},{name:"Yahoo!",url:"http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&u="+url+"&t="+title+"&d=",icon:"images/icons/bm_yahoo.gif"}];};$M.Share=function(){log=$.logger("LOCShare.Models.Share");cache={};};$.extend($M.Share.prototype,{get:function(id){if(!(id in cache)){this.put(id,"{}");}return cache[id];},put:function(id,config){if(!(id in cache)){var _;config=$.extend(true,{},$.env("locshare"),jsPath.json2js(config));cache[id]=$.extend(config,{urls:template(config.link,config.title)});_=null;}}});})(jQuery,LOCShare.Models);(function($,$M){var log,cache;$M.Subscribe=function(){log=$.logger("LOCShare.Models.Subscribe");cache={};};$.extend($M.Subscribe.prototype,{get:function(data,callback){var _this=this;if(data.url==undefined&&data.fallback_url!=undefined){data.url=data.fallback_url;}if(!(data.id in cache)){_this.$log.debug("Page data not cached, sending request");_this.put(data,callback);}else{if(callback&&$.isFunction(callback)){callback(cache[data.id]);}}},put:function(data,callback){var _this=this;if(!(data.id in cache)){if(data.request_type==undefined||data.request_type=="POST"){data.request_type="GET";}if(data.request_datatype==undefined){data.request_datatype="json";}$.ajax({type:data.request_type,url:data.url,dataType:data.request_datatype,success:function(result){_this.$log.debug("Successfully got subscribe content.");cache[data.id]=result.content;if(callback&&$.isFunction(callback)){callback(cache[data.id]);}},error:function(request,status,error){_this.$log.debug("Failed to get subscribe content.");cache[data.id]="An error occured. Please try again later.";if(callback&&$.isFunction(callback)){callback(cache[data.id]);}}});}}});})(jQuery,LOCShare.Models);jQuery.noConflict();(function($){var log,boostrapped,ready,start=new Date().getTime();$.env("defaults","3hekApRE.client");$(document).ready(function(){ready=new Date().getTime();$.boot(function(){bootstrapped=new Date().getTime();log=$.logger("LOCShare");log.info("document ready %s",start-ready).info("app boot strapped %s",bootstrapped-ready);$("div.locshare-this").livequery(function(){$(this).trigger("locshare-attach");});});});})(jQuery);