var CD=CD||{v:{cache:"v20120207",js:".v20120217",css:".v20120217",images:".v20120212"}};(function(){var f="";while(f.length<100){f+=" "}var c=Date.now||function(){return(new Date).getTime()};var d=function(k,g){return String(k)+f.slice(0,g-k.length)};var b=function(){this.clear()};b.prototype.start=function(g){this.current[g]=c();this._label_len=Math.max(this._label_len,g.length)};b.prototype.end=function(g){if(typeof(this.current[g])==="undefined"){return}var k=c()-this.current[g];this.totals[g]=this.totals[g]||0;this.intervals[g]=this.intervals[g]||[];this.intervals[g].push(k);this.totals[g]+=k};b.prototype.clear=function(){this._label_len=0;this.current={};this.intervals={};this.totals={}};b.prototype.watch=function(g,k){return function(){M.start(g);var n=k.apply(this,arguments);M.end(g);return n}};b.prototype.report=function(){var g,k="";for(g in this.totals){if(this.totals.hasOwnProperty(g)){k+="\n"+d(g,this._label_len)+d(" ("+this.intervals[g].length+")",6)+" : "+this.totals[g]}}return k+"\n"};M=new b();var a=function(){M.end("DOCUMENT")};M.start("DOCUMENT");if(window.addEventListener){window.addEventListener("load",a,false)}else{if(window.attachEvent){window.attachEvent("onload",a)}}}());function define(b,d){var a=d;if(("__defineSetter__" in this)&&this.__defineSetter__.call){this.__defineSetter__(b,function(f){});this.__defineGetter__(b,function(){return a})}else{if(Object.defineProperty&&Object.defineProperty.call){try{Object.defineProperty(this,b,{get:function(){return a},set:function(f){}})}catch(c){this[b]=d}}else{this[b]=d}}}function ns(b,d,a){if(typeof d==="undefined"){d={}}if(typeof a==="undefined"){a=window}function f(n,k){var g=n.shift();if(typeof k[g]==="undefined"){k[g]={}}if(typeof k[g]!=="object"&&typeof k[g]!=="function"){throw"window.[...]."+g+" can not be extended"}if(n.length>0){f(n,k[g])}else{if(typeof d==="object"){for(var o in d){if(d.hasOwnProperty(o)){k[g][o]=d[o]}}}else{k[g]=d;if(typeof k[g]==="function"){k[g].prototype.namespace=b;k[g].prototype.ns=function(){return this.namespace};k[g].ns=function(){return this.prototype.namespace}}}}return k[g]}var c;for(c=0;c<ns.plugins.length;c++){ns.plugins[c].apply(null,arguments)}return f(b.split("."),a)}ns.plugins=[];function resolve(b,a){if(typeof b==="undefined"){return undefined}if(typeof a==="undefined"){a=window}function c(g,f){if(!f){return f}var d=g.shift();return g.length==0?f[d]:c(g,f[d])}return c(b.split("."),a)}(function(){var a=function(){};var b=function(d,c,f){var g;if(c&&c.hasOwnProperty("constructor")){g=c.constructor}else{g=function(){return d.apply(this,arguments)}}_.extend(g,d);a.prototype=d.prototype;g.prototype=new a();if(c){_.extend(g.prototype,c)}if(f){_.extend(g,f)}g.prototype.constructor=g;g.__super__=d.prototype;return g};clsextend=function(c,d){var f=b(this,c,d);f.extend=this.extend;return f}}());(function(){var a=window.benchmark?window.benchmark.split(","):[];if(a.length){ns.plugins.push(function(d,g,c){if(g){var f,b;for(f=0,b=a.length;f<b;f++){if(g.prototype&&g.prototype[a[f]]){g.prototype[a[f]]=M.watch(d+"."+a[f],g.prototype[a[f]])}if(g[a[f]]){g[a[f]]=M.watch(d+"."+a[f],g[a[f]])}}}})}}());window.Modernizr=function(aq,ap,ao){function P(){am.input=function(f){for(var d=0,g=f.length;d<g;d++){U[f[d]]=f[d] in af}return U}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),am.inputtypes=function(b){for(var o=0,n,k,g,c=b.length;o<c;o++){af.setAttribute("type",k=b[o]),n=af.type!=="text",n&&(af.value=ae,af.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(k)&&af.style.WebkitAppearance!==ao?(ak.appendChild(af),g=ap.defaultView,n=g.getComputedStyle&&g.getComputedStyle(af,null).WebkitAppearance!=="textfield"&&af.offsetHeight!==0,ak.removeChild(af)):/^(search|tel)$/.test(k)||(/^(url|email)$/.test(k)?n=af.checkValidity&&af.checkValidity()===!1:/^color$/.test(k)?(ak.appendChild(af),ak.offsetWidth,n=af.value!=ae,ak.removeChild(af)):n=af.value!=ae)),W[b[o]]=!!n}return W}("search tel url email datetime date month week time datetime-local number range color".split(" "))}function T(g,f){var n=g.charAt(0).toUpperCase()+g.substr(1),k=(g+" "+aa.join(n+" ")+n).split(" ");return V(k,f)}function V(f,c){for(var g in f){if(ag[f[g]]!==ao){return c=="pfx"?f[g]:!0}}return !1}function X(d,c){return !!~(""+d).indexOf(c)}function Z(d,c){return typeof d===c}function ab(d,c){return I(ac.join(d+";")+(c||""))}function I(b){ag.cssText=b}var an="2.0.6",am={},al=!0,ak=ap.documentElement,aj=ap.head||ap.getElementsByTagName("head")[0],ai="modernizr",ah=ap.createElement(ai),ag=ah.style,af=ap.createElement("input"),ae=":)",ad=Object.prototype.toString,ac=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),aa="Webkit Moz O ms Khtml".split(" "),Y={},W={},U={},S=[],R=function(b,s,r,q){var p,o,n,g=ap.createElement("div");if(parseInt(r,10)){while(r--){n=ap.createElement("div"),n.id=q?q[r]:ai+(r+1),g.appendChild(n)}}p=["&shy;","<style>",b,"</style>"].join(""),g.id=ai,g.innerHTML+=p,ak.appendChild(g),o=s(g,b),g.parentNode.removeChild(g);return !!o},O=function(){function c(k,g){g=g||ap.createElement(b[k]||"div"),k="on"+k;var a=k in g;a||(g.setAttribute||(g=ap.createElement("div")),g.setAttribute&&g.removeAttribute&&(g.setAttribute(k,""),a=Z(g[k],"function"),Z(g[k],ao)||(g[k]=ao),g.removeAttribute(k))),g=null;return a}var b={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return c}(),N,K={}.hasOwnProperty,J;!Z(K,ao)&&!Z(K.call,ao)?J=function(d,c){return K.call(d,c)}:J=function(d,c){return c in d&&Z(d.constructor.prototype[c],ao)};var Q=function(b,n){var k=b.join(""),g=n.length;R(k,function(f,s){if(typeof ap!=="undefined"&&typeof r!=="undefined"){var r=ap.styleSheets[ap.styleSheets.length-1],q=r.cssRules&&r.cssRules[0]?r.cssRules[0].cssText:r.cssText||"",p=f.childNodes,o={};while(g--){o[p[g].id]=p[g]}am.csstransforms3d=o.csstransforms3d.offsetLeft===9,am.generatedcontent=o.generatedcontent.offsetHeight>=1,am.fontface=/src/i.test(q)&&q.indexOf(s.split(" ")[0])===0}},g,n)}(['@font-face {font-family:"font";src:url("https://")}',["@media (",ac.join("transform-3d),("),ai,")","{#csstransforms3d{left:9px;position:absolute}}"].join(""),['#generatedcontent:after{content:"',ae,'";visibility:hidden}'].join("")],["fontface","csstransforms3d","generatedcontent"]);Y.flexbox=function(){function o(p,f,r,q){p.style.cssText=ac.join(f+":"+r+";")+(q||"")}function b(p,f,r,q){f+=":",p.style.cssText=(f+ac.join(r+";"+f)).slice(0,-f.length)+(q||"")}var n=ap.createElement("div"),k=ap.createElement("div");b(n,"display","box","width:42px;padding:0;"),o(k,"box-flex","1","width:10px;"),n.appendChild(k),ak.appendChild(n);var g=k.offsetWidth===42;n.removeChild(k),ak.removeChild(n);return g},Y.canvas=function(){var b=ap.createElement("canvas");return !!b.getContext&&!!b.getContext("2d")},Y.canvastext=function(){return !!am.canvas&&!!Z(ap.createElement("canvas").getContext("2d").fillText,"function")},Y.postmessage=function(){return !!aq.postMessage},Y.websqldatabase=function(){var a=!!aq.openDatabase;return a},Y.indexedDB=function(){for(var a=-1,d=aa.length;++a<d;){if(aq[aa[a].toLowerCase()+"IndexedDB"]){return !0}}return !!aq.indexedDB},Y.hashchange=function(){return O("hashchange",aq)&&(ap.documentMode===ao||ap.documentMode>7)},Y.history=function(){return !!aq.history&&!!history.pushState},Y.draganddrop=function(){return O("dragstart")&&O("drop")},Y.websockets=function(){for(var a=-1,d=aa.length;++a<d;){if(aq[aa[a]+"WebSocket"]){return !0}}return"WebSocket" in aq},Y.rgba=function(){I("background-color:rgba(150,255,150,.5)");return X(ag.backgroundColor,"rgba")},Y.hsla=function(){I("background-color:hsla(120,40%,100%,.5)");return X(ag.backgroundColor,"rgba")||X(ag.backgroundColor,"hsla")},Y.multiplebgs=function(){I("background:url(https://),url(https://),red url(https://)");return/(url\s*\(.*?){3}/.test(ag.background)},Y.backgroundsize=function(){return T("backgroundSize")},Y.borderimage=function(){return T("borderImage")},Y.borderradius=function(){return T("borderRadius")},Y.boxshadow=function(){return T("boxShadow")},Y.textshadow=function(){return ap.createElement("div").style.textShadow===""},Y.opacity=function(){ab("opacity:.55");return/^0.55$/.test(ag.opacity)},Y.cssanimations=function(){return T("animationName")},Y.csscolumns=function(){return T("columnCount")},Y.cssgradients=function(){var f="background-image:",d="gradient(linear,left top,right bottom,from(#9f9),to(white));",g="linear-gradient(left top,#9f9, white);";I((f+ac.join(d+f)+ac.join(g+f)).slice(0,-f.length));return X(ag.backgroundImage,"gradient")},Y.cssreflections=function(){return T("boxReflect")},Y.csstransforms=function(){return !!V(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])},Y.csstransforms3d=function(){var b=!!V(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);b&&"webkitPerspective" in ak.style&&(b=am.csstransforms3d);return b},Y.csstransitions=function(){return T("transitionProperty")},Y.fontface=function(){return am.fontface},Y.generatedcontent=function(){return am.generatedcontent},Y.video=function(){var b=ap.createElement("video"),k=!1;try{if(k=!!b.canPlayType){k=new Boolean(k),k.ogg=b.canPlayType('video/ogg; codecs="theora"');var g='video/mp4; codecs="avc1.42E01E';k.h264=b.canPlayType(g+'"')||b.canPlayType(g+', mp4a.40.2"'),k.webm=b.canPlayType('video/webm; codecs="vp8, vorbis"')}}catch(f){}return k},Y.audio=function(){var b=ap.createElement("audio"),g=!1;try{if(g=!!b.canPlayType){g=new Boolean(g),g.ogg=b.canPlayType('audio/ogg; codecs="vorbis"'),g.mp3=b.canPlayType("audio/mpeg;"),g.wav=b.canPlayType('audio/wav; codecs="1"'),g.m4a=b.canPlayType("audio/x-m4a;")||b.canPlayType("audio/aac;")}}catch(f){}return g},Y.localstorage=function(){try{return !!localStorage.getItem}catch(b){return !1}},Y.sessionstorage=function(){try{return !!sessionStorage.getItem}catch(b){return !1}},Y.webworkers=function(){return !!aq.Worker},Y.applicationcache=function(){return !!aq.applicationCache};for(var L in Y){J(Y,L)&&(N=L.toLowerCase(),am[N]=Y[L](),S.push((am[N]?"":"no-")+N))}am.input||P(),am.addTest=function(f,c){if(typeof f=="object"){for(var g in f){J(f,g)&&am.addTest(g,f[g])}}else{f=f.toLowerCase();if(am[f]!==ao){return}c=typeof c=="boolean"?c:!!c(),ak.className+=" "+(c?"":"no-")+f,am[f]=c}return am},I(""),ah=af=null,aq.attachEvent&&function(){var b=ap.createElement("div");b.innerHTML="<elem></elem>";return b.childNodes.length!==1}()&&function(au,at){function c(f){var d=-1;while(++d<F){f.createElement(G[d])}}au.iepp=au.iepp||{};var ar=au.iepp,H=ar.html5elements||"abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",G=H.split("|"),F=G.length,E=new RegExp("(^|\\s)("+H+")","gi"),D=new RegExp("<(/*)("+H+")","gi"),C=/^\s*[\{\}]\s*$/,B=new RegExp("(^|[^\\n]*?\\s)("+H+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),A=at.createDocumentFragment(),z=at.documentElement,y=z.firstChild,w=at.createElement("body"),v=at.createElement("style"),u=/print|all/,t;ar.getCSS=function(k,d){if(k+""===ao){return""}var q=-1,p=k.length,o,n=[];while(++q<p){o=k[q];if(o.disabled){continue}d=o.media||d,u.test(d)&&n.push(ar.getCSS(o.imports,d),o.cssText),d="all"}return n.join("")},ar.parseCSS=function(f){var d=[],g;while((g=B.exec(f))!=null){d.push(((C.exec(g[1])?"\n":g[1])+g[2]+g[3]).replace(E,"$1.iepp_$2")+g[4])}return d.join("\n")},ar.writeHTML=function(){var b=-1;t=t||at.body;while(++b<F){var k=at.getElementsByTagName(G[b]),g=k.length,f=-1;while(++f<g){k[f].className.indexOf("iepp_")<0&&(k[f].className+=" iepp_"+G[b])}}A.appendChild(t),z.appendChild(w),w.className=t.className,w.id=t.id,w.innerHTML=t.innerHTML.replace(D,"<$1font")},ar._beforePrint=function(){v.styleSheet.cssText=ar.parseCSS(ar.getCSS(at.styleSheets,"all")),ar.writeHTML()},ar.restoreHTML=function(){w.innerHTML="",z.removeChild(w),z.appendChild(t)},ar._afterPrint=function(){ar.restoreHTML(),v.styleSheet.cssText=""},c(at),c(A);ar.disablePP||(y.insertBefore(v,y.firstChild),v.media="print",v.className="iepp-printshim",au.attachEvent("onbeforeprint",ar._beforePrint),au.attachEvent("onafterprint",ar._afterPrint))}(aq,ap),am._version=an,am._prefixes=ac,am._domPrefixes=aa,am.hasEvent=O,am.testProp=function(b){return V([b])},am.testAllProps=T,am.testStyles=R,ak.className=ak.className.replace(/\bno-js\b/,"")+(al?" js "+S.join(" "):"");return am}(this,this.document),function(aq,ap,ao){function ag(b){return !b||b=="loaded"||b=="complete"}function ah(){var d=1,c=-1;while(ab.length- ++c){if(ab[c].s&&!(d=ab[c].r)){break}}d&&ak()}function ai(b){var g=ap.createElement("script"),f;g.src=b.s,g.onreadystatechange=g.onload=function(){!f&&ag(g.readyState)&&(f=1,ah(),g.onload=g.onreadystatechange=null)},ae(function(){f||(f=1,ah())},L.errorTimeout),b.e?g.onload():ad.parentNode.insertBefore(g,ad)}function aj(b){var k=ap.createElement("link"),g;k.href=b.s,k.rel="stylesheet",k.type="text/css";if(!b.e&&(N||X)){var f=function(c){ae(function(){if(!g){try{c.sheet.cssRules.length?(g=1,ah()):f(c)}catch(a){a.code==1000||a.message=="security"||a.message=="denied"?(g=1,ae(function(){ah()},0)):f(c)}}},0)};f(k)}else{k.onload=function(){g||(g=1,ae(function(){ah()},0))},b.e&&k.onload()}ae(function(){g||(g=1,ah())},L.errorTimeout),!b.e&&ad.parentNode.insertBefore(k,ad)}function ak(){var b=ab.shift();Z=1,b?b.t?ae(function(){b.t=="c"?aj(b):ai(b)},0):(b(),ah()):Z=0}function al(v,u,t,s,q,p){function n(){!g&&ag(k.readyState)&&(b.r=g=1,!Z&&ah(),k.onload=k.onreadystatechange=null,ae(function(){R.removeChild(k)},0))}var k=ap.createElement(v),g=0,b={t:t,s:u,e:p};k.src=k.data=u,!V&&(k.style.display="none"),k.width=k.height="0",v!="object"&&(k.type=t),k.onload=k.onreadystatechange=n,v=="img"?k.onerror=n:v=="script"&&(k.onerror=function(){b.e=b.r=1,ak()}),ab.splice(s,0,b),R.insertBefore(k,V?null:ad),ae(function(){g||(R.removeChild(k),b.r=b.e=g=1,ah())},L.errorTimeout)}function am(g,f,n){var k=f=="c"?I:J;Z=0,f=f||"j",W(g)?al(k,g,f,this.i++,af,n):(ab.splice(this.i++,0,g),ab.length==1&&ak());return this}function an(){var b=L;b.loader={load:am,i:0};return b}var af=ap.documentElement,ae=aq.setTimeout,ad=ap.getElementsByTagName("script")[0],ac={}.toString,ab=[],Z=0,X="MozAppearance" in af.style,V=X&&!!ap.createRange().compareNode,T=X&&!V,R=V?af:ad.parentNode,P=aq.opera&&ac.call(aq.opera)=="[object Opera]",N="webkitAppearance" in af.style,K=N&&"async" in ap.createElement("script"),J=X?"object":P||K?"img":"script",I=N?"img":J,aa=Array.isArray||function(b){return ac.call(b)=="[object Array]"},Y=function(b){return Object(b)===b},W=function(b){return typeof b=="string"},U=function(b){return ac.call(b)=="[object Function]"},S=[],Q={},O,L;L=function(d){function p(s){var r=s.split("!"),z=S.length,y=r.pop(),w=r.length,v={url:y,origUrl:y,prefixes:r},u,t;for(t=0;t<w;t++){u=Q[r[t]],u&&(v=u(v))}for(t=0;t<z;t++){v=S[t](v)}return v}function q(r,f,w,v,u){var t=p(r),s=t.autoCallback;if(!t.bypass){f&&(f=U(f)?f:f[r]||f[v]||f[r.split("/").pop().split("?")[0]]);if(t.instead){return t.instead(r,f,w,v,u)}w.load(t.url,t.forceCSS||!t.forceJS&&/css$/.test(t.url)?"c":ao,t.noexec),(U(f)||U(s))&&w.load(function(){an(),f&&f(t.origUrl,u,v),s&&s(t.origUrl,u,v)})}}function c(s,r){function z(b){if(W(b)){q(b,u,r,0,y)}else{if(Y(b)){for(t in b){b.hasOwnProperty(t)&&q(b[t],u,r,t,y)}}}}var y=!!s.test,w=y?s.yep:s.nope,v=s.load||s.both,u=s.callback,t;z(w),z(v),s.complete&&r.load(s.complete)}var o,n,k=this.yepnope.loader;if(W(d)){q(d,0,k,0)}else{if(aa(d)){for(o=0;o<d.length;o++){n=d[o],W(n)?q(n,0,k,0):aa(n)?L(n):Y(n)&&c(n,k)}}else{Y(d)&&c(d,k)}}},L.addPrefix=function(d,c){Q[d]=c},L.addFilter=function(b){S.push(b)},L.errorTimeout=10000,ap.readyState==null&&ap.addEventListener&&(ap.readyState="loading",ap.addEventListener("DOMContentLoaded",O=function(){ap.removeEventListener("DOMContentLoaded",O,0),ap.readyState="complete"},0)),aq.yepnope=an()}(this,this.document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};(function(){var b=/(chrome)[ \/]([\w.]+)/,f=/(webkit)[ \/]([\w.]+)/,k=/(opera)(?:.*version)?[ \/]([\w.]+)/,d=/(msie) ([\w.]+)/,g=/(mozilla)(?:.*? rv:([\w.]+))?/;var c=navigator.userAgent.toLowerCase();var a=b.exec(c)||f.exec(c)||k.exec(c)||d.exec(c)||c.indexOf("compatible")<0&&g.exec(c)||[];if(a[1].toLowerCase()==="msie"){Modernizr.addTest("ie",true);Modernizr.addTest("ie"+a[2].split(".").slice(0,1),true)}}());(function(){var B=this;var y=B._;var b={};var o=Array.prototype,I=Object.prototype,K=Function.prototype;var z=o.slice,D=o.unshift,C=I.toString,u=I.hasOwnProperty;var s=o.forEach,n=o.map,G=o.reduce,f=o.reduceRight,r=o.filter,a=o.every,F=o.some,A=o.indexOf,g=o.lastIndexOf,c=Array.isArray,H=Object.keys,p=K.bind;var J=function(L){return new k(L)};if(typeof module!=="undefined"&&module.exports){module.exports=J;J._=J}else{B._=J}J.VERSION="1.1.7";var d=J.each=J.forEach=function(R,Q,P){if(R==null){return}if(s&&R.forEach===s){R.forEach(Q,P)}else{if(R.length===+R.length){for(var O=0,L=R.length;O<L;O++){if(O in R&&Q.call(P,R[O],O,R)===b){return}}}else{for(var N in R){if(u.call(R,N)){if(Q.call(P,R[N],N,R)===b){return}}}}}};J.map=function(P,O,N){var L=[];if(P==null){return L}if(n&&P.map===n){return P.map(O,N)}d(P,function(S,Q,R){L[L.length]=O.call(N,S,Q,R)});return L};J.reduce=J.foldl=J.inject=function(Q,P,L,O){var N=L!==void 0;if(Q==null){Q=[]}if(G&&Q.reduce===G){if(O){P=J.bind(P,O)}return N?Q.reduce(P,L):Q.reduce(P)}d(Q,function(T,R,S){if(!N){L=T;N=true}else{L=P.call(O,L,T,R,S)}});if(!N){throw new TypeError("Reduce of empty array with no initial value")}return L};J.reduceRight=J.foldr=function(P,O,L,N){if(P==null){P=[]}if(f&&P.reduceRight===f){if(N){O=J.bind(O,N)}return L!==void 0?P.reduceRight(O,L):P.reduceRight(O)}var Q=(J.isArray(P)?P.slice():J.toArray(P)).reverse();return J.reduce(Q,O,L,N)};J.find=J.detect=function(P,O,N){var L;v(P,function(S,Q,R){if(O.call(N,S,Q,R)){L=S;return true}});return L};J.filter=J.select=function(P,O,N){var L=[];if(P==null){return L}if(r&&P.filter===r){return P.filter(O,N)}d(P,function(S,Q,R){if(O.call(N,S,Q,R)){L[L.length]=S}});return L};J.reject=function(P,O,N){var L=[];if(P==null){return L}d(P,function(S,Q,R){if(!O.call(N,S,Q,R)){L[L.length]=S}});return L};J.every=J.all=function(P,O,N){var L=true;if(P==null){return L}if(a&&P.every===a){return P.every(O,N)}d(P,function(S,Q,R){if(!(L=L&&O.call(N,S,Q,R))){return b}});return L};var v=J.some=J.any=function(P,O,N){O=O||J.identity;var L=false;if(P==null){return L}if(F&&P.some===F){return P.some(O,N)}d(P,function(S,Q,R){if(L|=O.call(N,S,Q,R)){return b}});return !!L};J.include=J.contains=function(O,N){var L=false;if(O==null){return L}if(A&&O.indexOf===A){return O.indexOf(N)!=-1}v(O,function(P){if(L=P===N){return true}});return L};J.invoke=function(N,O){var L=z.call(arguments,2);return J.map(N,function(P){return(O.call?O||P:P[O]).apply(P,L)})};J.pluck=function(N,L){return J.map(N,function(O){return O[L]})};J.max=function(P,O,N){if(!O&&J.isArray(P)){return Math.max.apply(Math,P)}var L={computed:-Infinity};d(P,function(T,Q,S){var R=O?O.call(N,T,Q,S):T;R>=L.computed&&(L={value:T,computed:R})});return L.value};J.min=function(P,O,N){if(!O&&J.isArray(P)){return Math.min.apply(Math,P)}var L={computed:Infinity};d(P,function(T,Q,S){var R=O?O.call(N,T,Q,S):T;R<L.computed&&(L={value:T,computed:R})});return L.value};J.sortBy=function(O,N,L){return J.pluck(J.map(O,function(R,P,Q){return{value:R,criteria:N.call(L,R,P,Q)}}).sort(function(S,R){var Q=S.criteria,P=R.criteria;return Q<P?-1:Q>P?1:0}),"value")};J.groupBy=function(O,N){var L={};d(O,function(R,P){var Q=N(R,P);(L[Q]||(L[Q]=[])).push(R)});return L};J.sortedIndex=function(R,Q,O){O||(O=J.identity);var L=0,P=R.length;while(L<P){var N=(L+P)>>1;O(R[N])<O(Q)?L=N+1:P=N}return L};J.toArray=function(L){if(!L){return[]}if(L.toArray){return L.toArray()}if(J.isArray(L)){return z.call(L)}if(J.isArguments(L)){return z.call(L)}return J.values(L)};J.size=function(L){return J.toArray(L).length};J.first=J.head=function(O,N,L){return(N!=null)&&!L?z.call(O,0,N):O[0]};J.rest=J.tail=function(O,L,N){return z.call(O,(L==null)||N?1:L)};J.last=function(L){return L[L.length-1]};J.compact=function(L){return J.filter(L,function(N){return !!N})};J.flatten=function(L){return J.reduce(L,function(N,O){if(J.isArray(O)){return N.concat(J.flatten(O))}N[N.length]=O;return N},[])};J.without=function(L){return J.difference(L,z.call(arguments,1))};J.uniq=J.unique=function(N,L){return J.reduce(N,function(O,Q,P){if(0==P||(L===true?J.last(O)!=Q:!J.include(O,Q))){O[O.length]=Q}return O},[])};J.union=function(){return J.uniq(J.flatten(arguments))};J.intersection=J.intersect=function(N){var L=z.call(arguments,1);return J.filter(J.uniq(N),function(O){return J.every(L,function(P){return J.indexOf(P,O)>=0})})};J.difference=function(N,L){return J.filter(N,function(O){return !J.include(L,O)})};J.zip=function(){var L=z.call(arguments);var P=J.max(J.pluck(L,"length"));var O=new Array(P);for(var N=0;N<P;N++){O[N]=J.pluck(L,""+N)}return O};J.indexOf=function(Q,O,P){if(Q==null){return -1}var N,L;if(P){N=J.sortedIndex(Q,O);return Q[N]===O?N:-1}if(A&&Q.indexOf===A){return Q.indexOf(O)}for(N=0,L=Q.length;N<L;N++){if(Q[N]===O){return N}}return -1};J.lastIndexOf=function(O,N){if(O==null){return -1}if(g&&O.lastIndexOf===g){return O.lastIndexOf(N)}var L=O.length;while(L--){if(O[L]===N){return L}}return -1};J.range=function(R,P,Q){if(arguments.length<=1){P=R||0;R=0}Q=arguments[2]||1;var N=Math.max(Math.ceil((P-R)/Q),0);var L=0;var O=new Array(N);while(L<N){O[L++]=R;R+=Q}return O};J.bind=function(N,O){if(N.bind===p&&p){return p.apply(N,z.call(arguments,1))}var L=z.call(arguments,2);return function(){return N.apply(O,L.concat(z.call(arguments)))}};J.bindAll=function(N){var L=z.call(arguments,1);if(L.length==0){L=J.functions(N)}d(L,function(O){N[O]=J.bind(N[O],N)});return N};J.memoize=function(O,N){var L={};N||(N=J.identity);return function(){var P=N.apply(this,arguments);return u.call(L,P)?L[P]:(L[P]=O.apply(this,arguments))}};J.delay=function(N,O){var L=z.call(arguments,2);return setTimeout(function(){return N.apply(N,L)},O)};J.defer=function(L){return J.delay.apply(J,[L,1].concat(z.call(arguments,1)))};var E=function(N,P,L){var O;return function(){var R=this,Q=arguments;var S=function(){O=null;N.apply(R,Q)};if(L){clearTimeout(O)}if(L||!O){O=setTimeout(S,P)}}};J.throttle=function(L,N){return E(L,N,false)};J.debounce=function(L,N){return E(L,N,true)};J.once=function(O){var L=false,N;return function(){if(L){return N}L=true;return N=O.apply(this,arguments)}};J.wrap=function(L,N){return function(){var O=[L].concat(z.call(arguments));return N.apply(this,O)}};J.compose=function(){var L=z.call(arguments);return function(){var N=z.call(arguments);for(var O=L.length-1;O>=0;O--){N=[L[O].apply(this,N)]}return N[0]}};J.after=function(N,L){return function(){if(--N<1){return L.apply(this,arguments)}}};J.keys=H||function(O){if(O!==Object(O)){throw new TypeError("Invalid object")}var N=[];for(var L in O){if(u.call(O,L)){N[N.length]=L}}return N};J.values=function(L){return J.map(L,J.identity)};J.functions=J.methods=function(O){var N=[];for(var L in O){if(J.isFunction(O[L])){N.push(L)}}return N.sort()};J.extend=function(L){d(z.call(arguments,1),function(N){for(var O in N){if(N[O]!==void 0){L[O]=N[O]}}});return L};J.defaults=function(L){d(z.call(arguments,1),function(N){for(var O in N){if(L[O]==null){L[O]=N[O]}}});return L};J.clone=function(L){return J.isArray(L)?L.slice():J.extend({},L)};J.tap=function(N,L){L(N);return N};J.isEqual=function(N,L){if(N===L){return true}var Q=typeof(N),S=typeof(L);if(Q!=S){return false}if(N==L){return true}if((!N&&L)||(N&&!L)){return false}if(N._chain){N=N._wrapped}if(L._chain){L=L._wrapped}if(N.isEqual){return N.isEqual(L)}if(L.isEqual){return L.isEqual(N)}if(J.isDate(N)&&J.isDate(L)){return N.getTime()===L.getTime()}if(J.isNaN(N)&&J.isNaN(L)){return false}if(J.isRegExp(N)&&J.isRegExp(L)){return N.source===L.source&&N.global===L.global&&N.ignoreCase===L.ignoreCase&&N.multiline===L.multiline}if(Q!=="object"){return false}if(N.length&&(N.length!==L.length)){return false}var O=J.keys(N),R=J.keys(L);if(O.length!=R.length){return false}for(var P in N){if(!(P in L)||!J.isEqual(N[P],L[P])){return false}}return true};J.isEmpty=function(N){if(J.isArray(N)||J.isString(N)){return N.length===0}for(var L in N){if(u.call(N,L)){return false}}return true};J.isElement=function(L){return !!(L&&L.nodeType==1)};J.isArray=c||function(L){return C.call(L)==="[object Array]"};J.isObject=function(L){return L===Object(L)};J.isArguments=function(L){return !!(L&&u.call(L,"callee"))};J.isFunction=function(L){return !!(L&&L.constructor&&L.call&&L.apply)};J.isString=function(L){return !!(L===""||(L&&L.charCodeAt&&L.substr))};J.isNumber=function(L){return !!(L===0||(L&&L.toExponential&&L.toFixed))};J.isNaN=function(L){return L!==L};J.isBoolean=function(L){return L===true||L===false};J.isDate=function(L){return !!(L&&L.getTimezoneOffset&&L.setUTCFullYear)};J.isRegExp=function(L){return !!(L&&L.test&&L.exec&&(L.ignoreCase||L.ignoreCase===false))};J.isNull=function(L){return L===null};J.isUndefined=function(L){return L===void 0};J.noConflict=function(){B._=y;return this};J.identity=function(L){return L};J.times=function(P,O,N){for(var L=0;L<P;L++){O.call(N,L)}};J.mixin=function(L){d(J.functions(L),function(N){w(N,J[N]=L[N])})};var q=0;J.uniqueId=function(L){var N=q++;return L?L+N:N};J.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g};J.template=function(P,O){var Q=J.templateSettings;var L="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+P.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(Q.interpolate,function(R,S){return"',"+S.replace(/\\'/g,"'")+",'"}).replace(Q.evaluate||null,function(R,S){return"');"+S.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');";var N=new Function("obj",L);return O?N(O):N};var k=function(L){this._wrapped=L};J.prototype=k.prototype;var t=function(N,L){return L?J(N).chain():N};var w=function(L,N){k.prototype[L]=function(){var O=z.call(arguments);D.call(O,this._wrapped);return t(N.apply(J,O),this._chain)}};J.mixin(J);d(["pop","push","reverse","shift","sort","splice","unshift"],function(L){var N=o[L];k.prototype[L]=function(){N.apply(this._wrapped,arguments);return t(this._wrapped,this._chain)}});d(["concat","join","slice"],function(L){var N=o[L];k.prototype[L]=function(){return t(N.apply(this._wrapped,arguments),this._chain)}});k.prototype.chain=function(){this._chain=true;return this};k.prototype.value=function(){return this._wrapped}})();var Prototype={Version:"1.7",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div"),b=document.createElement("form"),a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Class=(function(){var d=(function(){for(var f in {toString:1}){if(f==="toString"){return false}}return true})();function a(){}function b(){var n=null,k=$A(arguments);if(Object.isFunction(k[0])){n=k.shift()}function f(){this.initialize.apply(this,arguments)}Object.extend(f,Class.Methods);f.superclass=n;f.subclasses=[];if(n){a.prototype=n.prototype;f.prototype=new a;n.subclasses.push(f)}for(var g=0,o=k.length;g<o;g++){f.addMethods(k[g])}if(!f.prototype.initialize){f.prototype.initialize=Prototype.emptyFunction}f.prototype.constructor=f;return f}function c(q){var k=this.superclass&&this.superclass.prototype,g=Object.keys(q);if(d){if(q.toString!=Object.prototype.toString){g.push("toString")}if(q.valueOf!=Object.prototype.valueOf){g.push("valueOf")}}for(var f=0,n=g.length;f<n;f++){var p=g[f],o=q[p];if(k&&Object.isFunction(o)&&o.argumentNames()[0]=="$super"){var r=o;o=(function(s){return function(){return k[s].apply(this,arguments)}})(p).wrap(r);o.valueOf=r.valueOf.bind(r);o.toString=r.toString.bind(r)}this.prototype[p]=o}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var J=Object.prototype.toString,I="Null",u="Undefined",C="Boolean",g="Number",z="String",P="Object",A="[object Function]",F="[object Boolean]",k="[object Number]",r="[object String]",n="[object Array]",E="[object Date]",o=window.JSON&&typeof JSON.stringify==="function"&&JSON.stringify(0)==="0"&&typeof JSON.stringify(Prototype.K)==="undefined";function q(R){switch(R){case null:return I;case (void 0):return u}var Q=typeof R;switch(Q){case"boolean":return C;case"number":return g;case"string":return z}return P}function G(Q,S){for(var R in S){Q[R]=S[R]}return Q}function O(Q){try{if(c(Q)){return"undefined"}if(Q===null){return"null"}return Q.inspect?Q.inspect():String(Q)}catch(R){if(R instanceof RangeError){return"..."}throw R}}function K(Q){return N("",{"":Q},[])}function N(Z,W,X){var Y=W[Z],V=typeof Y;if(q(Y)===P&&typeof Y.toJSON==="function"){Y=Y.toJSON(Z)}var S=J.call(Y);switch(S){case k:case F:case r:Y=Y.valueOf()}switch(Y){case null:return"null";case true:return"true";case false:return"false"}V=typeof Y;switch(V){case"string":return Y.inspect(true);case"number":return isFinite(Y)?String(Y):"null";case"object":for(var R=0,Q=X.length;R<Q;R++){if(X[R]===Y){throw new TypeError()}}X.push(Y);var U=[];if(S===n){for(var R=0,Q=Y.length;R<Q;R++){var T=N(R,Y,X);U.push(typeof T==="undefined"?"null":T)}U="["+U.join(",")+"]"}else{var aa=Object.keys(Y);for(var R=0,Q=aa.length;R<Q;R++){var Z=aa[R],T=N(Z,Y,X);if(typeof T!=="undefined"){U.push(Z.inspect(true)+":"+T)}}U="{"+U.join(",")+"}"}X.pop();return U}}function D(Q){return JSON.stringify(Q)}function p(Q){return $H(Q).toQueryString()}function v(Q){return Q&&Q.toHTML?Q.toHTML():String.interpret(Q)}function y(Q){if(q(Q)!==P){throw new TypeError()}var R=[];for(var S in Q){if(Q.hasOwnProperty(S)){R.push(S)}}return R}function d(Q){var R=[];for(var S in Q){R.push(Q[S])}return R}function H(Q){return G({},Q)}function B(Q){return !!(Q&&Q.nodeType==1)}function s(Q){return J.call(Q)===n}var b=(typeof Array.isArray=="function")&&Array.isArray([])&&!Array.isArray({});if(b){s=Array.isArray}function f(Q){return Q instanceof Hash}function a(Q){return J.call(Q)===A}function t(Q){return J.call(Q)===r}function w(Q){return J.call(Q)===k}function L(Q){return J.call(Q)===E}function c(Q){return typeof Q==="undefined"}G(Object,{extend:G,inspect:O,toJSON:o?D:K,toQueryString:p,toHTML:v,keys:Object.keys||y,values:d,clone:H,isElement:B,isArray:s,isHash:f,isFunction:a,isString:t,isNumber:w,isDate:L,isUndefined:c})})();Object.extend(Function.prototype,(function(){var q=Array.prototype.slice;function d(u,r){var t=u.length,s=r.length;while(s--){u[t+s]=r[s]}return u}function o(s,r){s=q.call(s,0);return d(s,r)}function k(){var r=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return r.length==1&&!r[0]?[]:r}function n(t){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var r=this,s=q.call(arguments,1);return function(){var u=o(s,arguments);return r.apply(t,u)}}function g(t){var r=this,s=q.call(arguments,1);return function(v){var u=d([v||window.event],s);return r.apply(t,u)}}function p(){if(!arguments.length){return this}var r=this,s=q.call(arguments,0);return function(){var t=o(s,arguments);return r.apply(this,t)}}function f(t){var r=this,s=q.call(arguments,1);t=t*1000;return window.setTimeout(function(){return r.apply(r,s)},t)}function a(){var r=d([0.01],arguments);return this.delay.apply(this,r)}function c(s){var r=this;return function(){var t=d([r.bind(this)],arguments);return s.apply(this,t)}}function b(){if(this._methodized){return this._methodized}var r=this;return this._methodized=function(){var s=d([this],arguments);return r.apply(null,s)}}return{argumentNames:k,bind:n,bindAsEventListener:g,curry:p,delay:f,defer:a,wrap:c,methodize:b}})());(function(c){function b(){return this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+"Z"}function a(){return this.toISOString()}if(!c.toISOString){c.toISOString=b}if(!c.toJSON){c.toJSON=a}})(Date.prototype);RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};var PeriodicalExecuter=Class.create({initialize:function(b,a){this.callback=b;this.frequency=a;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},execute:function(){this.callback(this)},stop:function(){if(!this.timer){return}clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute();this.currentlyExecuting=false}catch(a){this.currentlyExecuting=false;throw a}}}});Object.extend(String,{interpret:function(a){return a==null?"":String(a)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,(function(){var NATIVE_JSON_PARSE_SUPPORT=window.JSON&&typeof JSON.parse==="function"&&JSON.parse('{"test": true}').test;function prepareReplacement(replacement){if(Object.isFunction(replacement)){return replacement}var template=new Template(replacement);return function(match){return template.evaluate(match)}}function gsub(pattern,replacement){var result="",source=this,match;replacement=prepareReplacement(replacement);if(Object.isString(pattern)){pattern=RegExp.escape(pattern)}if(!(pattern.length||pattern.source)){replacement=replacement("");return replacement+source.split("").join(replacement)+replacement}while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length)}else{result+=source,source=""}}return result}function sub(pattern,replacement,count){replacement=prepareReplacement(replacement);count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0){return match[0]}return replacement(match)})}function scan(pattern,iterator){this.gsub(pattern,iterator);return String(this)}function truncate(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?"...":truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this)}function strip(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function stripTags(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")}function stripScripts(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")}function extractScripts(){var matchAll=new RegExp(Prototype.ScriptFragment,"img"),matchOne=new RegExp(Prototype.ScriptFragment,"im");return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||["",""])[1]})}function evalScripts(){return this.extractScripts().map(function(script){return eval(script)})}function escapeHTML(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function unescapeHTML(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function toQueryParams(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match){return{}}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift()),value=pair.length>1?pair.join("="):pair[0];if(value!=undefined){value=decodeURIComponent(value)}if(key in hash){if(!Object.isArray(hash[key])){hash[key]=[hash[key]]}hash[key].push(value)}else{hash[key]=value}}return hash})}function toArray(){return this.split("")}function succ(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)}function times(count){return count<1?"":new Array(count+1).join(this)}function camelize(){return this.replace(/-+(.)?/g,function(match,chr){return chr?chr.toUpperCase():""})}function capitalize(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()}function underscore(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()}function dasherize(){return this.replace(/_/g,"-")}function inspect(useDoubleQuotes){var escapedString=this.replace(/[\x00-\x1f\\]/g,function(character){if(character in String.specialChar){return String.specialChar[character]}return"\\u00"+character.charCodeAt().toPaddedString(2,16)});if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'}return"'"+escapedString.replace(/'/g,"\\'")+"'"}function unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")}function isJSON(){var str=this;if(str.blank()){return false}str=str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@");str=str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");str=str.replace(/(?:^|:|,)(?:\s*\[)+/g,"");return(/^[\],:{}\s]*$/).test(str)}function evalJSON(sanitize){var json=this.unfilterJSON(),cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;if(cx.test(json)){json=json.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())}function parseJSON(){var json=this.unfilterJSON();return JSON.parse(json)}function include(pattern){return this.indexOf(pattern)>-1}function startsWith(pattern){return this.lastIndexOf(pattern,0)===0}function endsWith(pattern){var d=this.length-pattern.length;return d>=0&&this.indexOf(pattern,d)===d}function empty(){return this==""}function blank(){return/^\s*$/.test(this)}function interpolate(object,pattern){return new Template(this,pattern).evaluate(object)}return{gsub:gsub,sub:sub,scan:scan,truncate:truncate,strip:String.prototype.trim||strip,stripTags:stripTags,stripScripts:stripScripts,extractScripts:extractScripts,evalScripts:evalScripts,escapeHTML:escapeHTML,unescapeHTML:unescapeHTML,toQueryParams:toQueryParams,parseQuery:toQueryParams,toArray:toArray,succ:succ,times:times,camelize:camelize,capitalize:capitalize,underscore:underscore,dasherize:dasherize,inspect:inspect,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:NATIVE_JSON_PARSE_SUPPORT?parseJSON:evalJSON,include:include,startsWith:startsWith,endsWith:endsWith,empty:empty,blank:blank,interpolate:interpolate}})());var Template=Class.create({initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(a){if(a&&Object.isFunction(a.toTemplateReplacements)){a=a.toTemplateReplacements()}return this.template.gsub(this.pattern,function(d){if(a==null){return(d[1]+"")}var g=d[1]||"";if(g=="\\"){return d[2]}var b=a,k=d[3],f=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;d=f.exec(k);if(d==null){return g}while(d!=null){var c=d[1].startsWith("[")?d[2].replace(/\\\\]/g,"]"):d[1];b=b[c];if(null==b||""==d[3]){break}k=k.substring("["==d[3]?d[1].length:d[0].length);d=f.exec(k)}return g+String.interpret(b)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function c(F,E){var D=0;try{this._each(function(H){F.call(E,H,D++)})}catch(G){if(G!=$break){throw G}}return this}function y(G,F,E){var D=-G,H=[],I=this.toArray();if(G<1){return I}while((D+=G)<I.length){H.push(I.slice(D,D+G))}return H.collect(F,E)}function b(F,E){F=F||Prototype.K;var D=true;this.each(function(H,G){D=D&&!!F.call(E,H,G);if(!D){throw $break}});return D}function o(F,E){F=F||Prototype.K;var D=false;this.each(function(H,G){if(D=!!F.call(E,H,G)){throw $break}});return D}function p(F,E){F=F||Prototype.K;var D=[];this.each(function(H,G){D.push(F.call(E,H,G))});return D}function A(F,E){var D;this.each(function(H,G){if(F.call(E,H,G)){D=H;throw $break}});return D}function n(F,E){var D=[];this.each(function(H,G){if(F.call(E,H,G)){D.push(H)}});return D}function k(G,F,E){F=F||Prototype.K;var D=[];if(Object.isString(G)){G=new RegExp(RegExp.escape(G))}this.each(function(I,H){if(G.match(I)){D.push(F.call(E,I,H))}});return D}function a(D){if(Object.isFunction(this.indexOf)){if(this.indexOf(D)!=-1){return true}}var E=false;this.each(function(F){if(F==D){E=true;throw $break}});return E}function w(E,D){D=Object.isUndefined(D)?null:D;return this.eachSlice(E,function(F){while(F.length<E){F.push(D)}return F})}function r(D,F,E){this.each(function(H,G){D=F.call(E,D,H,G)});return D}function C(E){var D=$A(arguments).slice(1);return this.map(function(F){return F[E].apply(F,D)})}function v(F,E){F=F||Prototype.K;var D;this.each(function(H,G){H=F.call(E,H,G);if(D==null||H>=D){D=H}});return D}function t(F,E){F=F||Prototype.K;var D;this.each(function(H,G){H=F.call(E,H,G);if(D==null||H<D){D=H}});return D}function f(G,E){G=G||Prototype.K;var F=[],D=[];this.each(function(I,H){(G.call(E,I,H)?F:D).push(I)});return[F,D]}function g(E){var D=[];this.each(function(F){D.push(F[E])});return D}function d(F,E){var D=[];this.each(function(H,G){if(!F.call(E,H,G)){D.push(H)}});return D}function s(E,D){return this.map(function(G,F){return{value:G,criteria:E.call(D,G,F)}}).sort(function(I,H){var G=I.criteria,F=H.criteria;return G<F?-1:G>F?1:0}).pluck("value")}function u(){return this.map()}function z(){var E=Prototype.K,D=$A(arguments);if(Object.isFunction(D.last())){E=D.pop()}var F=[this].concat(D).map($A);return this.map(function(H,G){return E(F.pluck(G))})}function q(){return this.toArray().length}function B(){return"#<Enumerable:"+this.toArray().inspect()+">"}return{each:c,eachSlice:y,all:b,every:b,any:o,some:o,collect:p,map:p,detect:A,findAll:n,select:n,filter:n,grep:k,include:a,member:a,inGroupsOf:w,inject:r,invoke:C,max:v,min:t,partition:f,pluck:g,reject:d,sortBy:s,toArray:u,entries:u,zip:z,size:q,inspect:B,find:A}})();function $A(c){if(!c){return[]}if("toArray" in Object(c)){return c.toArray()}var b=c.length||0,a=new Array(b);while(b--){a[b]=c[b]}return a}function $w(a){if(!Object.isString(a)){return[]}a=a.strip();return a?a.split(/\s+/):[]}Array.from=$A;(function(){var y=Array.prototype,s=y.slice,u=y.forEach;function b(D,C){for(var B=0,E=this.length>>>0;B<E;B++){if(B in this){D.call(C,this[B],B,this)}}}if(!u){u=b}function r(){this.length=0;return this}function d(){return this[0]}function k(){return this[this.length-1]}function o(){return this.select(function(B){return B!=null})}function A(){return this.inject([],function(C,B){if(Object.isArray(B)){return C.concat(B.flatten())}C.push(B);return C})}function n(){var B=s.call(arguments,0);return this.select(function(C){return !B.include(C)})}function g(B){return(B===false?this.toArray():this)._reverse()}function q(B){return this.inject([],function(E,D,C){if(0==C||(B?E.last()!=D:!E.include(D))){E.push(D)}return E})}function v(B){return this.uniq().findAll(function(C){return B.detect(function(D){return C===D})})}function w(){return s.call(this,0)}function p(){return this.length}function z(){return"["+this.map(Object.inspect).join(", ")+"]"}function a(D,B){B||(B=0);var C=this.length;if(B<0){B=C+B}for(;B<C;B++){if(this[B]===D){return B}}return -1}function t(C,B){B=isNaN(B)?this.length:(B<0?this.length+B:B)+1;var D=this.slice(0,B).reverse().indexOf(C);return(D<0)?D:B-D-1}function c(){var G=s.call(this,0),E;for(var C=0,D=arguments.length;C<D;C++){E=arguments[C];if(Object.isArray(E)&&!("callee" in E)){for(var B=0,F=E.length;B<F;B++){G.push(E[B])}}else{G.push(E)}}return G}Object.extend(y,Enumerable);if(!y._reverse){y._reverse=y.reverse}Object.extend(y,{_each:u,clear:r,first:d,last:k,compact:o,flatten:A,without:n,reverse:g,uniq:q,intersect:v,clone:w,toArray:w,size:p,inspect:z});var f=(function(){return[].concat(arguments)[0][0]!==1})(1,2);if(f){y.concat=c}if(!y.indexOf){y.indexOf=a}if(!y.lastIndexOf){y.lastIndexOf=t}})();function $H(a){return new Hash(a)}var Hash=Class.create(Enumerable,(function(){function f(v){this._object=Object.isHash(v)?v.toObject():Object.clone(v)}function g(w){for(var v in this._object){var y=this._object[v],z=[v,y];z.key=v;z.value=y;w(z)}}function p(v,w){return this._object[v]=w}function c(v){if(this._object[v]!==Object.prototype[v]){return this._object[v]}}function s(v){var w=this._object[v];delete this._object[v];return w}function u(){return Object.clone(this._object)}function t(){return this.pluck("key")}function r(){return this.pluck("value")}function k(w){var v=this.detect(function(y){return y.value===w});return v&&v.key}function o(v){return this.clone().update(v)}function d(v){return new Hash(v).inject(this,function(w,y){w.set(y.key,y.value);return w})}function b(v,w){if(Object.isUndefined(w)){return v}return v+"="+encodeURIComponent(String.interpret(w))}function a(){return this.inject([],function(A,D){var z=encodeURIComponent(D.key),w=D.value;if(w&&typeof w=="object"){if(Object.isArray(w)){var C=[];for(var y=0,v=w.length,B;y<v;y++){B=w[y];C.push(b(z,B))}return A.concat(C)}}else{A.push(b(z,w))}return A}).join("&")}function q(){return"#<Hash:{"+this.map(function(v){return v.map(Object.inspect).join(": ")}).join(", ")+"}>"}function n(){return new Hash(this)}return{initialize:f,_each:g,set:p,get:c,unset:s,toObject:u,toTemplateReplacements:u,keys:t,values:r,index:k,merge:o,update:d,toQueryString:a,inspect:q,toJSON:u,clone:n}})());Hash.from=$H;Object.extend(Number.prototype,(function(){function d(){return this.toPaddedString(2,16)}function b(){return this+1}function n(p,o){$R(0,this,true).each(p,o);return this}function k(q,p){var o=this.toString(p||10);return"0".times(q-o.length)+o}function a(){return Math.abs(this)}function c(){return Math.round(this)}function f(){return Math.ceil(this)}function g(){return Math.floor(this)}return{toColorPart:d,succ:b,times:n,toPaddedString:k,abs:a,round:c,ceil:f,floor:g}})());function $R(c,a,b){return new ObjectRange(c,a,b)}var ObjectRange=Class.create(Enumerable,(function(){function b(g,d,f){this.start=g;this.end=d;this.exclusive=f}function c(d){var f=this.start;while(this.include(f)){d(f);f=f.succ()}}function a(d){if(d<this.start){return false}if(this.exclusive){return d<this.end}return d<=this.end}return{initialize:b,_each:c,include:a}})());var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(a){this.responders._each(a)},register:function(a){if(!this.include(a)){this.responders.push(a)}},unregister:function(a){this.responders=this.responders.without(a)},dispatch:function(d,b,c,a){this.each(function(f){if(Object.isFunction(f[d])){try{f[d].apply(f,[b,c,a])}catch(g){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(a){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};Object.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,b,a){$super(a);this.transport=Ajax.getTransport();this.request(b)},request:function(b){this.url=b;this.method=this.options.method;var d=Object.isString(this.options.parameters)?this.options.parameters:Object.toQueryString(this.options.parameters);if(!["get","post"].include(this.method)){d+=(d?"&":"")+"_method="+this.method;this.method="post"}if(d&&this.method==="get"){this.url+=(this.url.include("?")?"&":"?")+d}this.parameters=d.toQueryParams();try{var a=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(a)}Ajax.Responders.dispatch("onCreate",this,a);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||d):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(c){this.dispatchException(c)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var f={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){f["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){f.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var c=this.options.requestHeaders;if(Object.isFunction(c.push)){for(var b=0,d=c.length;b<d;b+=2){f[c[b]]=c[b+1]}}else{$H(c).each(function(g){f[g.key]=g.value})}}for(var a in f){this.transport.setRequestHeader(a,f[a])}},success:function(){var a=this.getStatus();return !a||(a>=200&&a<300)||a==304},getStatus:function(){try{if(this.transport.status===1223){return 204}return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){var c=Ajax.Request.Events[a],b=new Ajax.Response(this);if(c=="Complete"){try{this._complete=true;(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(b,b.headerJSON)}catch(d){this.dispatchException(d)}var f=b.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&f&&f.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+c]||Prototype.emptyFunction)(b,b.headerJSON);Ajax.Responders.dispatch("on"+c,this,b,b.headerJSON)}catch(d){this.dispatchException(d)}if(c=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var a=this.url.match(/^\s*https?:\/\/[^\/]*/);return !a||(a[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))},getHeader:function(a){try{return this.transport.getResponseHeader(a)||null}catch(b){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);Ajax.Responders.dispatch("onException",this,a)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(c){this.request=c;var d=this.transport=c.transport,a=this.readyState=d.readyState;if((a>2&&!Prototype.Browser.IE)||a==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(d.responseText);this.headerJSON=this._getHeaderJSON()}if(a==4){var b=d.responseXML;this.responseXML=Object.isUndefined(b)?null:b;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(a){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(a){return null}},getResponseHeader:function(a){return this.transport.getResponseHeader(a)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var a=this.getHeader("X-JSON");if(!a){return null}a=decodeURIComponent(escape(a));try{return a.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}},_getResponseJSON:function(){var a=this.request.options;if(!a.evalJSON||(a.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(a.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,a,c,b){this.container={success:(a.success||a),failure:(a.failure||(a.success?null:a))};b=Object.clone(b);var d=b.onComplete;b.onComplete=(function(f,g){this.updateContent(f.responseText);if(Object.isFunction(d)){d(f,g)}}).bind(this);$super(c,b)},updateContent:function(d){var c=this.container[this.success()?"success":"failure"],a=this.options;if(!a.evalScripts){d=d.stripScripts()}if(c=$(c)){if(a.insertion){if(Object.isString(a.insertion)){var b={};b[a.insertion]=d;c.insert(b)}else{a.insertion(c,d)}}else{c.update(d)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,a,c,b){$super(b);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=a;this.url=c;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=a.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(b){if(arguments.length>1){for(var a=0,d=[],c=arguments.length;a<c;a++){d.push($(arguments[a]))}return d}if(Object.isString(b)){b=document.getElementById(b)}return Element.extend(b)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(g,a){var c=[];var f=document.evaluate(g,$(a)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var b=0,d=f.snapshotLength;b<d;b++){c.push(Element.extend(f.snapshotItem(b)))}return c}}if(!Node){var Node={}}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})}(function(c){function d(g,f){if(g==="select"){return false}if("type" in f){return false}return true}var b=(function(){try{var f=document.createElement('<input name="x">');return f.tagName.toLowerCase()==="input"&&f.name==="x"}catch(g){return false}})();var a=c.Element;c.Element=function(k,g){g=g||{};k=k.toLowerCase();var f=Element.cache;if(b&&g.name){k="<"+k+' name="'+g.name+'">';delete g.name;return Element.writeAttribute(document.createElement(k),g)}if(!f[k]){f[k]=Element.extend(document.createElement(k))}var n=d(k,g)?f[k].cloneNode(false):document.createElement(k);return Element.writeAttribute(n,g)};Object.extend(c.Element,a||{});if(a){c.Element.prototype=a.prototype}})(this);Element.idCounter=1;Element.cache={};Element._purgeElement=function(b){var a=b._prototypeUID;if(a){Element.stopObserving(b);b._prototypeUID=void 0;delete Element.Storage[a]}};Element.Methods={visible:function(a){return $(a).style.display!="none"},toggle:function(a){a=$(a);Element[Element.visible(a)?"hide":"show"](a);return a},hide:function(a){a=$(a);a.style.display="none";return a},show:function(a){a=$(a);a.style.display="";return a},remove:function(a){a=$(a);a.parentNode.removeChild(a);return a},update:(function(){var d=(function(){var k=document.createElement("select"),n=true;k.innerHTML='<option value="test">test</option>';if(k.options&&k.options[0]){n=k.options[0].nodeName.toUpperCase()!=="OPTION"}k=null;return n})();var b=(function(){try{var k=document.createElement("table");if(k&&k.tBodies){k.innerHTML="<tbody><tr><td>test</td></tr></tbody>";var o=typeof k.tBodies[0]=="undefined";k=null;return o}}catch(n){return true}})();var a=(function(){try{var k=document.createElement("div");k.innerHTML="<link>";var o=(k.childNodes.length===0);k=null;return o}catch(n){return true}})();var c=d||b||a;var g=(function(){var k=document.createElement("script"),o=false;try{k.appendChild(document.createTextNode(""));o=!k.firstChild||k.firstChild&&k.firstChild.nodeType!==3}catch(n){o=true}k=null;return o})();function f(q,r){q=$(q);var k=Element._purgeElement;var s=q.getElementsByTagName("*"),p=s.length;while(p--){k(s[p])}if(r&&r.toElement){r=r.toElement()}if(Object.isElement(r)){return q.update().insert(r)}r=Object.toHTML(r);var o=q.tagName.toUpperCase();if(o==="SCRIPT"&&g){q.text=r;return q}if(c){if(o in Element._insertionTranslations.tags){while(q.firstChild){q.removeChild(q.firstChild)}Element._getContentFromAnonymousElement(o,r.stripScripts()).each(function(t){q.appendChild(t)})}else{if(a&&Object.isString(r)&&r.indexOf("<link")>-1){while(q.firstChild){q.removeChild(q.firstChild)}var n=Element._getContentFromAnonymousElement(o,r.stripScripts(),true);n.each(function(t){q.appendChild(t)})}else{q.innerHTML=r.stripScripts()}}}else{q.innerHTML=r.stripScripts()}r.evalScripts.bind(r).defer();return q}return f})(),replace:function(b,c){b=$(b);if(c&&c.toElement){c=c.toElement()}else{if(!Object.isElement(c)){c=Object.toHTML(c);var a=b.ownerDocument.createRange();a.selectNode(b);c.evalScripts.bind(c).defer();c=a.createContextualFragment(c.stripScripts())}}b.parentNode.replaceChild(c,b);return b},insert:function(c,f){c=$(c);if(Object.isString(f)||Object.isNumber(f)||Object.isElement(f)||(f&&(f.toElement||f.toHTML))){f={bottom:f}}var d,g,b,k;for(var a in f){d=f[a];a=a.toLowerCase();g=Element._insertionTranslations[a];if(d&&d.toElement){d=d.toElement()}if(Object.isElement(d)){g(c,d);continue}d=Object.toHTML(d);b=((a=="before"||a=="after")?c.parentNode:c).tagName.toUpperCase();k=Element._getContentFromAnonymousElement(b,d.stripScripts());if(a=="top"||a=="after"){k.reverse()}k.each(g.curry(c));d.evalScripts.bind(d).defer()}return c},wrap:function(b,c,a){b=$(b);if(Object.isElement(c)){$(c).writeAttribute(a||{})}else{if(Object.isString(c)){c=new Element(c,a)}else{c=new Element("div",c)}}if(b.parentNode){b.parentNode.replaceChild(c,b)}c.appendChild(b);return c},inspect:function(b){b=$(b);var a="<"+b.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(g){var f=g.first(),c=g.last(),d=(b[f]||"").toString();if(d){a+=" "+c+"="+d.inspect(true)}});return a+">"},recursivelyCollect:function(a,c,d){a=$(a);d=d||-1;var b=[];while(a=a[c]){if(a.nodeType==1){b.push(Element.extend(a))}if(b.length==d){break}}return b},ancestors:function(a){return Element.recursivelyCollect(a,"parentNode")},descendants:function(a){return Element.select(a,"*")},firstDescendant:function(a){a=$(a).firstChild;while(a&&a.nodeType!=1){a=a.nextSibling}return $(a)},immediateDescendants:function(b){var a=[],c=$(b).firstChild;while(c){if(c.nodeType===1){a.push(Element.extend(c))}c=c.nextSibling}return a},previousSiblings:function(a,b){return Element.recursivelyCollect(a,"previousSibling")},nextSiblings:function(a){return Element.recursivelyCollect(a,"nextSibling")},siblings:function(a){a=$(a);return Element.previousSiblings(a).reverse().concat(Element.nextSiblings(a))},match:function(b,a){b=$(b);if(Object.isString(a)){return Prototype.Selector.match(b,a)}return a.match(b)},up:function(b,d,a){b=$(b);if(arguments.length==1){return $(b.parentNode)}var c=Element.ancestors(b);return Object.isNumber(d)?c[d]:Prototype.Selector.find(c,d,a)},down:function(b,c,a){b=$(b);if(arguments.length==1){return Element.firstDescendant(b)}return Object.isNumber(c)?Element.descendants(b)[c]:Element.select(b,c)[a||0]},previous:function(b,c,a){b=$(b);if(Object.isNumber(c)){a=c,c=false}if(!Object.isNumber(a)){a=0}if(c){return Prototype.Selector.find(b.previousSiblings(),c,a)}else{return b.recursivelyCollect("previousSibling",a+1)[a]}},next:function(b,d,a){b=$(b);if(Object.isNumber(d)){a=d,d=false}if(!Object.isNumber(a)){a=0}if(d){return Prototype.Selector.find(b.nextSiblings(),d,a)}else{var c=Object.isNumber(a)?a+1:1;return b.recursivelyCollect("nextSibling",a+1)[a]}},select:function(a){a=$(a);var b=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(b,a)},adjacent:function(a){a=$(a);var b=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(b,a.parentNode).without(a)},identify:function(a){a=$(a);var b=Element.readAttribute(a,"id");if(b){return b}do{b="anonymous_element_"+Element.idCounter++}while($(b));Element.writeAttribute(a,"id",b);return b},readAttribute:function(c,a){c=$(c);if(Prototype.Browser.IE){var b=Element._attributeTranslations.read;if(b.values[a]){return b.values[a](c,a)}if(b.names[a]){a=b.names[a]}if(a.include(":")){return(!c.attributes||!c.attributes[a])?null:c.attributes[a].value}}return c.getAttribute(a)},writeAttribute:function(f,c,g){f=$(f);var b={},d=Element._attributeTranslations.write;if(typeof c=="object"){b=c}else{b[c]=Object.isUndefined(g)?true:g}for(var a in b){c=d.names[a]||a;g=b[a];if(d.values[a]){c=d.values[a](f,g)}if(g===false||g===null){f.removeAttribute(c)}else{if(g===true){f.setAttribute(c,c)}else{f.setAttribute(c,g)}}}return f},getHeight:function(a){return Element.getDimensions(a).height},getWidth:function(a){return Element.getDimensions(a).width},classNames:function(a){return new Element.ClassNames(a)},hasClassName:function(a,b){if(!(a=$(a))){return}var c=a.className;return(c.length>0&&(c==b||new RegExp("(^|\\s)"+b+"(\\s|$)").test(c)))},addClassName:function(a,b){if(!(a=$(a))){return}if(!Element.hasClassName(a,b)){a.className+=(a.className?" ":"")+b}return a},removeClassName:function(a,b){if(!(a=$(a))){return}a.className=a.className.replace(new RegExp("(^|\\s+)"+b+"(\\s+|$)")," ").strip();return a},toggleClassName:function(a,b){if(!(a=$(a))){return}return Element[Element.hasClassName(a,b)?"removeClassName":"addClassName"](a,b)},cleanWhitespace:function(b){b=$(b);var c=b.firstChild;while(c){var a=c.nextSibling;if(c.nodeType==3&&!/\S/.test(c.nodeValue)){b.removeChild(c)}c=a}return b},empty:function(a){return $(a).innerHTML.blank()},descendantOf:function(b,a){b=$(b),a=$(a);if(b.compareDocumentPosition){return(b.compareDocumentPosition(a)&8)===8}if(a.contains){return a.contains(b)&&a!==b}while(b=b.parentNode){if(b==a){return true}}return false},scrollTo:function(a){a=$(a);var b=Element.cumulativeOffset(a);window.scrollTo(b[0],b[1]);return a},getStyle:function(b,c){b=$(b);c=c=="float"?"cssFloat":c.camelize();var d=b.style[c];if(!d||d=="auto"){var a=document.defaultView.getComputedStyle(b,null);d=a?a[c]:null}if(c=="opacity"){return d?parseFloat(d):1}return d=="auto"?null:d},getOpacity:function(a){return $(a).getStyle("opacity")},setStyle:function(b,c){b=$(b);var f=b.style,a;if(Object.isString(c)){b.style.cssText+=";"+c;return c.include("opacity")?b.setOpacity(c.match(/opacity:\s*(\d?\.?\d*)/)[1]):b}for(var d in c){if(d=="opacity"){b.setOpacity(c[d])}else{f[(d=="float"||d=="cssFloat")?(Object.isUndefined(f.styleFloat)?"cssFloat":"styleFloat"):d]=c[d]}}return b},setOpacity:function(a,b){a=$(a);a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;return a},makePositioned:function(a){a=$(a);var b=Element.getStyle(a,"position");if(b=="static"||!b){a._madePositioned=true;a.style.position="relative";if(Prototype.Browser.Opera){a.style.top=0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=""}return a},makeClipping:function(a){a=$(a);if(a._overflow){return a}a._overflow=Element.getStyle(a,"overflow")||"auto";if(a._overflow!=="hidden"){a.style.overflow="hidden"}return a},undoClipping:function(a){a=$(a);if(!a._overflow){return a}a.style.overflow=a._overflow=="auto"?"":a._overflow;a._overflow=null;return a},clonePosition:function(b,d){var a=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});d=$(d);var f=Element.viewportOffset(d),g=[0,0],c=null;b=$(b);if(Element.getStyle(b,"position")=="absolute"){c=Element.getOffsetParent(b);g=Element.viewportOffset(c)}if(c==document.body){g[0]-=document.body.offsetLeft;g[1]-=document.body.offsetTop}if(a.setLeft){b.style.left=(f[0]-g[0]+a.offsetLeft)+"px"}if(a.setTop){b.style.top=(f[1]-g[1]+a.offsetTop)+"px"}if(a.setWidth){b.style.width=d.offsetWidth+"px"}if(a.setHeight){b.style.height=d.offsetHeight+"px"}return b}};Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(d,b,c){switch(c){case"height":case"width":if(!Element.visible(b)){return null}var f=parseInt(d(b,c),10);if(f!==b["offset"+c.capitalize()]){return f+"px"}var a;if(c==="height"){a=["border-top-width","padding-top","padding-bottom","border-bottom-width"]}else{a=["border-left-width","padding-left","padding-right","border-right-width"]}return a.inject(f,function(g,k){var n=d(b,k);return n===null?g:g-parseInt(n,10)})+"px";default:return d(b,c)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(c,a,b){if(b==="title"){return a.title}return c(a,b)})}else{if(Prototype.Browser.IE){Element.Methods.getStyle=function(a,b){a=$(a);b=(b=="float"||b=="cssFloat")?"styleFloat":b.camelize();var c=a.style[b];if(!c&&a.currentStyle){c=a.currentStyle[b]}if(b=="opacity"){if(c=(a.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(c[1]){return parseFloat(c[1])/100}}return 1}if(c=="auto"){if((b=="width"||b=="height")&&(a.getStyle("display")!="none")){return a["offset"+b.capitalize()]+"px"}return null}return c};Element.Methods.setOpacity=function(b,f){function g(k){return k.replace(/alpha\([^\)]*\)/gi,"")}b=$(b);var a=b.currentStyle;if((a&&!a.hasLayout)||(!a&&b.style.zoom=="normal")){b.style.zoom=1}var d=b.getStyle("filter"),c=b.style;if(f==1||f===""){(d=g(d))?c.filter=d:c.removeAttribute("filter");return b}else{if(f<0.00001){f=0}}c.filter=g(d)+"alpha(opacity="+(f*100)+")";return b};Element._attributeTranslations=(function(){var b="className",a="for",c=document.createElement("div");c.setAttribute(b,"x");if(c.className!=="x"){c.setAttribute("class","x");if(c.className==="x"){b="class"}}c=null;c=document.createElement("label");c.setAttribute(a,"x");if(c.htmlFor!=="x"){c.setAttribute("htmlFor","x");if(c.htmlFor==="x"){a="htmlFor"}}c=null;return{read:{names:{"class":b,className:b,"for":a,htmlFor:a},values:{_getAttr:function(d,f){return d.getAttribute(f)},_getAttr2:function(d,f){return d.getAttribute(f,2)},_getAttrNode:function(d,g){var f=d.getAttributeNode(g);return f?f.value:""},_getEv:(function(){var d=document.createElement("div"),k;d.onclick=Prototype.emptyFunction;var g=d.getAttribute("onclick");if(String(g).indexOf("{")>-1){k=function(f,n){n=f.getAttribute(n);if(!n){return null}n=n.toString();n=n.split("{")[1];n=n.split("}")[0];return n.strip()}}else{if(g===""){k=function(f,n){n=f.getAttribute(n);if(!n){return null}return n.strip()}}}d=null;return k})(),_flag:function(d,f){return $(d).hasAttribute(f)?f:null},style:function(d){return d.style.cssText.toLowerCase()},title:function(d){return d.title}}}}})();Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(a,b){a.checked=!!b},style:function(a,b){a.style.cssText=b?b:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(a){Element._attributeTranslations.write.names[a.toLowerCase()]=a;Element._attributeTranslations.has[a.toLowerCase()]=a});(function(a){Object.extend(a,{href:a._getAttr2,src:a._getAttr2,type:a._getAttr,action:a._getAttrNode,disabled:a._flag,checked:a._flag,readonly:a._flag,multiple:a._flag,onload:a._getEv,onunload:a._getEv,onclick:a._getEv,ondblclick:a._getEv,onmousedown:a._getEv,onmouseup:a._getEv,onmouseover:a._getEv,onmousemove:a._getEv,onmouseout:a._getEv,onfocus:a._getEv,onblur:a._getEv,onkeypress:a._getEv,onkeydown:a._getEv,onkeyup:a._getEv,onsubmit:a._getEv,onreset:a._getEv,onselect:a._getEv,onchange:a._getEv})})(Element._attributeTranslations.read.values);if(Prototype.BrowserFeatures.ElementExtensions){(function(){function a(f){var b=f.getElementsByTagName("*"),d=[];for(var c=0,g;g=b[c];c++){if(g.tagName!=="!"){d.push(g)}}return d}Element.Methods.down=function(c,d,b){c=$(c);if(arguments.length==1){return c.firstDescendant()}return Object.isNumber(d)?a(c)[d]:Element.select(c,d)[b||0]}})()}}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=(b==1)?0.999999:(b==="")?"":(b<0.00001)?0:b;return a}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;if(b==1){if(a.tagName.toUpperCase()=="IMG"&&a.width){a.width++;a.width--}else{try{var d=document.createTextNode(" ");a.appendChild(d);a.removeChild(d)}catch(c){}}}return a}}}}}if("outerHTML" in document.documentElement){Element.Methods.replace=function(c,f){c=$(c);if(f&&f.toElement){f=f.toElement()}if(Object.isElement(f)){c.parentNode.replaceChild(f,c);return c}f=Object.toHTML(f);var d=c.parentNode,b=d.tagName.toUpperCase();if(Element._insertionTranslations.tags[b]){var g=c.next(),a=Element._getContentFromAnonymousElement(b,f.stripScripts());d.removeChild(c);if(g){a.each(function(k){d.insertBefore(k,g)})}else{a.each(function(k){d.appendChild(k)})}}else{c.outerHTML=f.stripScripts()}f.evalScripts.bind(f).defer();return c}}Element._returnOffset=function(b,c){var a=[b,c];a.left=b;a.top=c;return a};Element._getContentFromAnonymousElement=function(f,d,g){var k=new Element("div"),c=Element._insertionTranslations.tags[f];var a=false;if(c){a=true}else{if(g){a=true;c=["","",0]}}if(a){k.innerHTML="&nbsp;"+c[0]+d+c[1];k.removeChild(k.firstChild);for(var b=c[2];b--;){k=k.firstChild}}else{k.innerHTML=d}return $A(k.childNodes)};Element._insertionTranslations={before:function(a,b){a.parentNode.insertBefore(b,a)},top:function(a,b){a.insertBefore(b,a.firstChild)},bottom:function(a,b){a.appendChild(b)},after:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};(function(){var a=Element._insertionTranslations.tags;Object.extend(a,{THEAD:a.TBODY,TFOOT:a.TBODY,TH:a.TD})})();Element.Methods.Simulated={hasAttribute:function(a,c){c=Element._attributeTranslations.has[c]||c;var b=$(a).getAttributeNode(c);return !!(b&&b.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);(function(a){if(!Prototype.BrowserFeatures.ElementExtensions&&a.__proto__){window.HTMLElement={};window.HTMLElement.prototype=a.__proto__;Prototype.BrowserFeatures.ElementExtensions=true}a=null})(document.createElement("div"));Element.extend=(function(){function c(k){if(typeof window.Element!="undefined"){var o=window.Element.prototype;if(o){var q="_"+(Math.random()+"").slice(2),n=document.createElement(k);o[q]="x";var p=(n[q]!=="x");delete o[q];n=null;return p}}return false}function b(n,k){for(var p in k){var o=k[p];if(Object.isFunction(o)&&!(p in n)){n[p]=o.methodize()}}}var d=c("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(d){return function(n){if(n&&typeof n._extendedByPrototype=="undefined"){var k=n.tagName;if(k&&(/^(?:object|applet|embed)$/i.test(k))){b(n,Element.Methods);b(n,Element.Methods.Simulated);b(n,Element.Methods.ByTag[k.toUpperCase()])}}return n}}return Prototype.K}var a={},f=Element.Methods.ByTag;var g=Object.extend(function(o){if(!o||typeof o._extendedByPrototype!="undefined"||o.nodeType!=1||o==window){return o}var k=Object.clone(a),n=o.tagName.toUpperCase();if(f[n]){Object.extend(k,f[n])}b(o,k);o._extendedByPrototype=Prototype.emptyFunction;return o},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(a,Element.Methods);Object.extend(a,Element.Methods.Simulated)}}});g.refresh();return g})();if(document.documentElement.hasAttribute){Element.hasAttribute=function(a,b){return a.hasAttribute(b)}}else{Element.hasAttribute=Element.Methods.Simulated.hasAttribute}Element.addMethods=function(c){var o=Prototype.BrowserFeatures,d=Element.Methods.ByTag;if(!c){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods),BUTTON:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var b=c;c=arguments[1]}if(!b){Object.extend(Element.Methods,c||{})}else{if(Object.isArray(b)){b.each(k)}else{k(b)}}function k(q){q=q.toUpperCase();if(!Element.Methods.ByTag[q]){Element.Methods.ByTag[q]={}}Object.extend(Element.Methods.ByTag[q],c)}function a(s,r,q){q=q||false;for(var u in s){var t=s[u];if(!Object.isFunction(t)){continue}if(!q||!(u in r)){r[u]=t.methodize()}}}function f(t){var q;var s={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};if(s[t]){q="HTML"+s[t]+"Element"}if(window[q]){return window[q]}q="HTML"+t+"Element";if(window[q]){return window[q]}q="HTML"+t.capitalize()+"Element";if(window[q]){return window[q]}var r=document.createElement(t),u=r.__proto__||r.constructor.prototype;r=null;return u}var n=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(o.ElementExtensions){a(Element.Methods,n);a(Element.Methods.Simulated,n,true)}if(o.SpecificElementExtensions){for(var p in Element.Methods.ByTag){var g=f(p);if(Object.isUndefined(g)){continue}a(d[p],g.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){return{width:this.getWidth(),height:this.getHeight()}},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};(function(b){var k=Prototype.Browser,f=document,c,d={};function a(){if(k.WebKit&&!f.evaluate){return document}if(k.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body}return document.documentElement}function g(n){if(!c){c=a()}d[n]="client"+n;b["get"+n]=function(){return c[d[n]]};return b["get"+n]()}b.getWidth=g.curry("Width");b.getHeight=g.curry("Height")})(document.viewport);Element.Storage={UID:1};Element.addMethods({getStorage:function(b){if(!(b=$(b))){return}var a;if(b===window){a=0}else{if(typeof b._prototypeUID==="undefined"){b._prototypeUID=Element.Storage.UID++}a=b._prototypeUID}if(!Element.Storage[a]){Element.Storage[a]=$H()}return Element.Storage[a]},store:function(b,a,c){if(!(b=$(b))){return}if(arguments.length===2){Element.getStorage(b).update(a)}else{Element.getStorage(b).set(a,c)}return b},retrieve:function(c,b,a){if(!(c=$(c))){return}var f=Element.getStorage(c),d=f.get(b);if(Object.isUndefined(d)){f.set(b,a);d=a}return d},clone:function(c,a){if(!(c=$(c))){return}var f=c.cloneNode(a);f._prototypeUID=void 0;if(a){var d=Element.select(f,"*"),b=d.length;while(b--){d[b]._prototypeUID=void 0}}return Element.extend(f)},purge:function(c){if(!(c=$(c))){return}var a=Element._purgeElement;a(c);var d=c.getElementsByTagName("*"),b=d.length;while(b--){a(d[b])}return null}});(function(){function n(C){var B=C.match(/^(\d+)%?$/i);if(!B){return null}return(Number(B[1])/100)}function u(N,O,C){var F=null;if(Object.isElement(N)){F=N;N=F.getStyle(O)}if(N===null){return null}if((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(N)){return window.parseFloat(N)}var H=N.include("%"),D=(C===document.viewport);if(/\d/.test(N)&&F&&F.runtimeStyle&&!(H&&D)){var B=F.style.left,L=F.runtimeStyle.left;F.runtimeStyle.left=F.currentStyle.left;F.style.left=N||0;N=F.style.pixelLeft;F.style.left=B;F.runtimeStyle.left=L;return N}if(F&&H){C=C||F.parentNode;var E=n(N);var I=null;var G=F.getStyle("position");var K=O.include("left")||O.include("right")||O.include("width");var J=O.include("top")||O.include("bottom")||O.include("height");if(C===document.viewport){if(K){I=document.viewport.getWidth()}else{if(J){I=document.viewport.getHeight()}}}else{if(K){I=$(C).measure("width")}else{if(J){I=$(C).measure("height")}}}return(I===null)?0:I*E}return 0}function k(B){if(Object.isString(B)&&B.endsWith("px")){return B}return B+"px"}function p(C){var B=C;while(C&&C.parentNode){var D=C.getStyle("display");if(D==="none"){return false}C=$(C.parentNode)}return true}var d=Prototype.K;if("currentStyle" in document.documentElement){d=function(B){if(!B.currentStyle.hasLayout){B.style.zoom=1}return B}}function g(B){if(B.include("border")){B=B+"-width"}return B.camelize()}Element.Layout=Class.create(Hash,{initialize:function($super,C,B){$super();this.element=$(C);Element.Layout.PROPERTIES.each(function(D){this._set(D,null)},this);if(B){this._preComputing=true;this._begin();Element.Layout.PROPERTIES.each(this._compute,this);this._end();this._preComputing=false}},_set:function(C,B){return Hash.prototype.set.call(this,C,B)},set:function(C,B){throw"Properties of Element.Layout are read-only."},get:function($super,C){var B=$super(C);return B===null?this._compute(C):B},_begin:function(){if(this._prepared){return}var F=this.element;if(p(F)){this._prepared=true;return}var H={position:F.style.position||"",width:F.style.width||"",visibility:F.style.visibility||"",display:F.style.display||""};F.store("prototype_original_styles",H);var I=F.getStyle("position"),B=F.getStyle("width");if(B==="0px"||B===null){F.style.display="block";B=F.getStyle("width")}var C=(I==="fixed")?document.viewport:F.parentNode;F.setStyle({position:"absolute",visibility:"hidden",display:"block"});var D=F.getStyle("width");var E;if(B&&(D===B)){E=u(F,"width",C)}else{if(I==="absolute"||I==="fixed"){E=u(F,"width",C)}else{var J=F.parentNode,G=$(J).getLayout();E=G.get("width")-this.get("margin-left")-this.get("border-left")-this.get("padding-left")-this.get("padding-right")-this.get("border-right")-this.get("margin-right")}}F.setStyle({width:E+"px"});this._prepared=true},_end:function(){var C=this.element;var B=C.retrieve("prototype_original_styles");C.store("prototype_original_styles",null);C.setStyle(B);this._prepared=false},_compute:function(C){var B=Element.Layout.COMPUTATIONS;if(!(C in B)){throw"Property not found."}return this._set(C,B[C].call(this,this.element))},toObject:function(){var B=$A(arguments);var C=(B.length===0)?Element.Layout.PROPERTIES:B.join(" ").split(" ");var D={};C.each(function(E){if(!Element.Layout.PROPERTIES.include(E)){return}var F=this.get(E);if(F!=null){D[E]=F}},this);return D},toHash:function(){var B=this.toObject.apply(this,arguments);return new Hash(B)},toCSS:function(){var B=$A(arguments);var D=(B.length===0)?Element.Layout.PROPERTIES:B.join(" ").split(" ");var C={};D.each(function(E){if(!Element.Layout.PROPERTIES.include(E)){return}if(Element.Layout.COMPOSITE_PROPERTIES.include(E)){return}var F=this.get(E);if(F!=null){C[g(E)]=F+"px"}},this);return C},inspect:function(){return"#<Element.Layout>"}});Object.extend(Element.Layout,{PROPERTIES:$w("height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height"),COMPOSITE_PROPERTIES:$w("padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height"),COMPUTATIONS:{height:function(D){if(!this._preComputing){this._begin()}var B=this.get("border-box-height");if(B<=0){if(!this._preComputing){this._end()}return 0}var E=this.get("border-top"),C=this.get("border-bottom");var G=this.get("padding-top"),F=this.get("padding-bottom");if(!this._preComputing){this._end()}return B-E-C-G-F},width:function(D){if(!this._preComputing){this._begin()}var C=this.get("border-box-width");if(C<=0){if(!this._preComputing){this._end()}return 0}var G=this.get("border-left"),B=this.get("border-right");var E=this.get("padding-left"),F=this.get("padding-right");if(!this._preComputing){this._end()}return C-G-B-E-F},"padding-box-height":function(C){var B=this.get("height"),E=this.get("padding-top"),D=this.get("padding-bottom");return B+E+D},"padding-box-width":function(B){var C=this.get("width"),D=this.get("padding-left"),E=this.get("padding-right");return C+D+E},"border-box-height":function(C){if(!this._preComputing){this._begin()}var B=C.offsetHeight;if(!this._preComputing){this._end()}return B},"border-box-width":function(B){if(!this._preComputing){this._begin()}var C=B.offsetWidth;if(!this._preComputing){this._end()}return C},"margin-box-height":function(C){var B=this.get("border-box-height"),D=this.get("margin-top"),E=this.get("margin-bottom");if(B<=0){return 0}return B+D+E},"margin-box-width":function(D){var C=this.get("border-box-width"),E=this.get("margin-left"),B=this.get("margin-right");if(C<=0){return 0}return C+E+B},top:function(B){var C=B.positionedOffset();return C.top},bottom:function(B){var E=B.positionedOffset(),C=B.getOffsetParent(),D=C.measure("height");var F=this.get("border-box-height");return D-F-E.top},left:function(B){var C=B.positionedOffset();return C.left},right:function(D){var F=D.positionedOffset(),E=D.getOffsetParent(),B=E.measure("width");var C=this.get("border-box-width");return B-C-F.left},"padding-top":function(B){return u(B,"paddingTop")},"padding-bottom":function(B){return u(B,"paddingBottom")},"padding-left":function(B){return u(B,"paddingLeft")},"padding-right":function(B){return u(B,"paddingRight")},"border-top":function(B){return u(B,"borderTopWidth")},"border-bottom":function(B){return u(B,"borderBottomWidth")},"border-left":function(B){return u(B,"borderLeftWidth")},"border-right":function(B){return u(B,"borderRightWidth")},"margin-top":function(B){return u(B,"marginTop")},"margin-bottom":function(B){return u(B,"marginBottom")},"margin-left":function(B){return u(B,"marginLeft")},"margin-right":function(B){return u(B,"marginRight")}}});if("getBoundingClientRect" in document.documentElement){Object.extend(Element.Layout.COMPUTATIONS,{right:function(C){var D=d(C.getOffsetParent());var E=C.getBoundingClientRect(),B=D.getBoundingClientRect();return(B.right-E.right).round()},bottom:function(C){var D=d(C.getOffsetParent());var E=C.getBoundingClientRect(),B=D.getBoundingClientRect();return(B.bottom-E.bottom).round()}})}Element.Offset=Class.create({initialize:function(C,B){this.left=C.round();this.top=B.round();this[0]=this.left;this[1]=this.top},relativeTo:function(B){return new Element.Offset(this.left-B.left,this.top-B.top)},inspect:function(){return"#<Element.Offset left: #{left} top: #{top}>".interpolate(this)},toString:function(){return"[#{left}, #{top}]".interpolate(this)},toArray:function(){return[this.left,this.top]}});function y(C,B){return new Element.Layout(C,B)}function b(B,C){return $(B).getLayout().get(C)}function t(C){C=$(C);var G=Element.getStyle(C,"display");if(G&&G!=="none"){return{width:C.offsetWidth,height:C.offsetHeight}}var D=C.style;var B={visibility:D.visibility,position:D.position,display:D.display};var F={visibility:"hidden",display:"block"};if(B.position!=="fixed"){F.position="absolute"}Element.setStyle(C,F);var E={width:C.offsetWidth,height:C.offsetHeight};Element.setStyle(C,B);return E}function r(B){B=$(B);if(f(B)||c(B)||s(B)||q(B)){return $(document.body)}var C=(Element.getStyle(B,"display")==="inline");if(!C&&B.offsetParent){return $(B.offsetParent)}while((B=B.parentNode)&&B!==document.body){if(Element.getStyle(B,"position")!=="static"){return q(B)?$(document.body):$(B)}}return $(document.body)}function A(C){C=$(C);var B=0,D=0;if(C.parentNode){do{B+=C.offsetTop||0;D+=C.offsetLeft||0;C=C.offsetParent}while(C)}return new Element.Offset(D,B)}function v(C){C=$(C);var D=C.getLayout();var B=0,F=0;do{B+=C.offsetTop||0;F+=C.offsetLeft||0;C=C.offsetParent;if(C){if(s(C)){break}var E=Element.getStyle(C,"position");if(E!=="static"){break}}}while(C);F-=D.get("margin-top");B-=D.get("margin-left");return new Element.Offset(F,B)}function a(C){var B=0,D=0;do{B+=C.scrollTop||0;D+=C.scrollLeft||0;C=C.parentNode}while(C);return new Element.Offset(D,B)}function z(F){C=$(C);var B=0,E=0,D=document.body;var C=F;do{B+=C.offsetTop||0;E+=C.offsetLeft||0;if(C.offsetParent==D&&Element.getStyle(C,"position")=="absolute"){break}}while(C=C.offsetParent);C=F;do{if(C!=D){B-=C.scrollTop||0;E-=C.scrollLeft||0}}while(C=C.parentNode);return new Element.Offset(E,B)}function w(B){B=$(B);if(Element.getStyle(B,"position")==="absolute"){return B}var F=r(B);var E=B.viewportOffset(),C=F.viewportOffset();var G=E.relativeTo(C);var D=B.getLayout();B.store("prototype_absolutize_original_styles",{left:B.getStyle("left"),top:B.getStyle("top"),width:B.getStyle("width"),height:B.getStyle("height")});B.setStyle({position:"absolute",top:G.top+"px",left:G.left+"px",width:D.get("width")+"px",height:D.get("height")+"px"});return B}function o(C){C=$(C);if(Element.getStyle(C,"position")==="relative"){return C}var B=C.retrieve("prototype_absolutize_original_styles");if(B){C.setStyle(B)}return C}if(Prototype.Browser.IE){r=r.wrap(function(D,C){C=$(C);if(f(C)||c(C)||s(C)||q(C)){return $(document.body)}var B=C.getStyle("position");if(B!=="static"){return D(C)}C.setStyle({position:"relative"});var E=D(C);C.setStyle({position:B});return E});v=v.wrap(function(E,C){C=$(C);if(!C.parentNode){return new Element.Offset(0,0)}var B=C.getStyle("position");if(B!=="static"){return E(C)}var D=C.getOffsetParent();if(D&&D.getStyle("position")==="fixed"){d(D)}C.setStyle({position:"relative"});var F=E(C);C.setStyle({position:B});return F})}else{if(Prototype.Browser.Webkit){A=function(C){C=$(C);var B=0,D=0;do{B+=C.offsetTop||0;D+=C.offsetLeft||0;if(C.offsetParent==document.body){if(Element.getStyle(C,"position")=="absolute"){break}}C=C.offsetParent}while(C);return new Element.Offset(D,B)}}}Element.addMethods({getLayout:y,measure:b,getDimensions:t,getOffsetParent:r,cumulativeOffset:A,positionedOffset:v,cumulativeScrollOffset:a,viewportOffset:z,absolutize:w,relativize:o});function s(B){return B.nodeName.toUpperCase()==="BODY"}function q(B){return B.nodeName.toUpperCase()==="HTML"}function f(B){return B.nodeType===Node.DOCUMENT_NODE}function c(B){return B!==document.body&&!Element.descendantOf(B,document.body)}if("getBoundingClientRect" in document.documentElement){Element.addMethods({viewportOffset:function(B){B=$(B);if(c(B)){return new Element.Offset(0,0)}var C=B.getBoundingClientRect(),D=document.documentElement;return new Element.Offset(C.left-D.clientLeft,C.top-D.clientTop)}})}})();window.$$=function(){var a=$A(arguments).join(", ");return Prototype.Selector.select(a,document)};Prototype.Selector=(function(){function a(){throw new Error('Method "Prototype.Selector.select" must be defined.')}function c(){throw new Error('Method "Prototype.Selector.match" must be defined.')}function d(q,r,n){n=n||0;var k=Prototype.Selector.match,p=q.length,g=0,o;for(o=0;o<p;o++){if(k(q[o],r)&&n==g++){return Element.extend(q[o])}}}function f(n){for(var g=0,k=n.length;g<k;g++){Element.extend(n[g])}return n}var b=Prototype.K;return{select:a,match:c,find:d,extendElements:(Element.extend===b)?b:f,extendElement:Element.extend}})();
/*
 * Sizzle CSS Selector Engine - v1.0
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var v=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,o=0,d=Object.prototype.toString,t=false,n=true;[0,0].sort(function(){n=false;return 0});var b=function(L,B,I,D){I=I||[];var y=B=B||document;if(B.nodeType!==1&&B.nodeType!==9){return[]}if(!L||typeof L!=="string"){return I}var J=[],K,G,Q,P,H,A,z=true,E=u(B),O=L;while((v.exec(""),K=v.exec(O))!==null){O=K[3];J.push(K[1]);if(K[2]){A=K[3];break}}if(J.length>1&&p.exec(L)){if(J.length===2&&f.relative[J[0]]){G=g(J[0]+J[1],B)}else{G=f.relative[J[0]]?[B]:b(J.shift(),B);while(J.length){L=J.shift();if(f.relative[L]){L+=J.shift()}G=g(L,G)}}}else{if(!D&&J.length>1&&B.nodeType===9&&!E&&f.match.ID.test(J[0])&&!f.match.ID.test(J[J.length-1])){var R=b.find(J.shift(),B,E);B=R.expr?b.filter(R.expr,R.set)[0]:R.set[0]}if(B){var R=D?{expr:J.pop(),set:a(D)}:b.find(J.pop(),J.length===1&&(J[0]==="~"||J[0]==="+")&&B.parentNode?B.parentNode:B,E);G=R.expr?b.filter(R.expr,R.set):R.set;if(J.length>0){Q=a(G)}else{z=false}while(J.length){var C=J.pop(),F=C;if(!f.relative[C]){C=""}else{F=J.pop()}if(F==null){F=B}f.relative[C](Q,F,E)}}else{Q=J=[]}}if(!Q){Q=G}if(!Q){throw"Syntax error, unrecognized expression: "+(C||L)}if(d.call(Q)==="[object Array]"){if(!z){I.push.apply(I,Q)}else{if(B&&B.nodeType===1){for(var N=0;Q[N]!=null;N++){if(Q[N]&&(Q[N]===true||Q[N].nodeType===1&&k(B,Q[N]))){I.push(G[N])}}}else{for(var N=0;Q[N]!=null;N++){if(Q[N]&&Q[N].nodeType===1){I.push(G[N])}}}}}else{a(Q,I)}if(A){b(A,y,I,D);b.uniqueSort(I)}return I};b.uniqueSort=function(z){if(c){t=n;z.sort(c);if(t){for(var y=1;y<z.length;y++){if(z[y]===z[y-1]){z.splice(y--,1)}}}}return z};b.matches=function(y,z){return b(y,null,null,z)};b.find=function(F,y,G){var E,C;if(!F){return[]}for(var B=0,A=f.order.length;B<A;B++){var D=f.order[B],C;if((C=f.leftMatch[D].exec(F))){var z=C[1];C.splice(1,1);if(z.substr(z.length-1)!=="\\"){C[1]=(C[1]||"").replace(/\\/g,"");E=f.find[D](C,y,G);if(E!=null){F=F.replace(f.match[D],"");break}}}}if(!E){E=y.getElementsByTagName("*")}return{set:E,expr:F}};b.filter=function(I,H,L,B){var A=I,O=[],F=H,D,y,E=H&&H[0]&&u(H[0]);while(I&&H.length){for(var G in f.filter){if((D=f.match[G].exec(I))!=null){var z=f.filter[G],N,K;y=false;if(F==O){O=[]}if(f.preFilter[G]){D=f.preFilter[G](D,F,L,O,B,E);if(!D){y=N=true}else{if(D===true){continue}}}if(D){for(var C=0;(K=F[C])!=null;C++){if(K){N=z(K,D,C,F);var J=B^!!N;if(L&&N!=null){if(J){y=true}else{F[C]=false}}else{if(J){O.push(K);y=true}}}}}if(N!==undefined){if(!L){F=O}I=I.replace(f.match[G],"");if(!y){return[]}break}}}if(I==A){if(y==null){throw"Syntax error, unrecognized expression: "+I}else{break}}A=I}return F};var f=b.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\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(y){return y.getAttribute("href")}},relative:{"+":function(F,y,E){var C=typeof y==="string",G=C&&!/\W/.test(y),D=C&&!G;if(G&&!E){y=y.toUpperCase()}for(var B=0,A=F.length,z;B<A;B++){if((z=F[B])){while((z=z.previousSibling)&&z.nodeType!==1){}F[B]=D||z&&z.nodeName===y?z||false:z===y}}if(D){b.filter(y,F,true)}},">":function(E,z,F){var C=typeof z==="string";if(C&&!/\W/.test(z)){z=F?z:z.toUpperCase();for(var A=0,y=E.length;A<y;A++){var D=E[A];if(D){var B=D.parentNode;E[A]=B.nodeName===z?B:false}}}else{for(var A=0,y=E.length;A<y;A++){var D=E[A];if(D){E[A]=C?D.parentNode:D.parentNode===z}}if(C){b.filter(z,E,true)}}},"":function(B,z,D){var A=o++,y=w;if(!/\W/.test(z)){var C=z=D?z:z.toUpperCase();y=s}y("parentNode",z,A,B,C,D)},"~":function(B,z,D){var A=o++,y=w;if(typeof z==="string"&&!/\W/.test(z)){var C=z=D?z:z.toUpperCase();y=s}y("previousSibling",z,A,B,C,D)}},find:{ID:function(z,A,B){if(typeof A.getElementById!=="undefined"&&!B){var y=A.getElementById(z[1]);return y?[y]:[]}},NAME:function(A,D,E){if(typeof D.getElementsByName!=="undefined"){var z=[],C=D.getElementsByName(A[1]);for(var B=0,y=C.length;B<y;B++){if(C[B].getAttribute("name")===A[1]){z.push(C[B])}}return z.length===0?null:z}},TAG:function(y,z){return z.getElementsByTagName(y[1])}},preFilter:{CLASS:function(B,z,A,y,E,F){B=" "+B[1].replace(/\\/g,"")+" ";if(F){return B}for(var C=0,D;(D=z[C])!=null;C++){if(D){if(E^(D.className&&(" "+D.className+" ").indexOf(B)>=0)){if(!A){y.push(D)}}else{if(A){z[C]=false}}}}return false},ID:function(y){return y[1].replace(/\\/g,"")},TAG:function(z,y){for(var A=0;y[A]===false;A++){}return y[A]&&u(y[A])?z[1]:z[1].toUpperCase()},CHILD:function(y){if(y[1]=="nth"){var z=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(y[2]=="even"&&"2n"||y[2]=="odd"&&"2n+1"||!/\D/.test(y[2])&&"0n+"+y[2]||y[2]);y[2]=(z[1]+(z[2]||1))-0;y[3]=z[3]-0}y[0]=o++;return y},ATTR:function(C,z,A,y,D,E){var B=C[1].replace(/\\/g,"");if(!E&&f.attrMap[B]){C[1]=f.attrMap[B]}if(C[2]==="~="){C[4]=" "+C[4]+" "}return C},PSEUDO:function(C,z,A,y,D){if(C[1]==="not"){if((v.exec(C[3])||"").length>1||/^\w/.test(C[3])){C[3]=b(C[3],null,null,z)}else{var B=b.filter(C[3],z,A,true^D);if(!A){y.push.apply(y,B)}return false}}else{if(f.match.POS.test(C[0])||f.match.CHILD.test(C[0])){return true}}return C},POS:function(y){y.unshift(true);return y}},filters:{enabled:function(y){return y.disabled===false&&y.type!=="hidden"},disabled:function(y){return y.disabled===true},checked:function(y){return y.checked===true},selected:function(y){y.parentNode.selectedIndex;return y.selected===true},parent:function(y){return !!y.firstChild},empty:function(y){return !y.firstChild},has:function(A,z,y){return !!b(y[3],A).length},header:function(y){return/h\d/i.test(y.nodeName)},text:function(y){return"text"===y.type},radio:function(y){return"radio"===y.type},checkbox:function(y){return"checkbox"===y.type},file:function(y){return"file"===y.type},password:function(y){return"password"===y.type},submit:function(y){return"submit"===y.type},image:function(y){return"image"===y.type},reset:function(y){return"reset"===y.type},button:function(y){return"button"===y.type||y.nodeName.toUpperCase()==="BUTTON"},input:function(y){return/input|select|textarea|button/i.test(y.nodeName)}},setFilters:{first:function(z,y){return y===0},last:function(A,z,y,B){return z===B.length-1},even:function(z,y){return y%2===0},odd:function(z,y){return y%2===1},lt:function(A,z,y){return z<y[3]-0},gt:function(A,z,y){return z>y[3]-0},nth:function(A,z,y){return y[3]-0==z},eq:function(A,z,y){return y[3]-0==z}},filter:{PSEUDO:function(E,A,B,F){var z=A[1],C=f.filters[z];if(C){return C(E,B,A,F)}else{if(z==="contains"){return(E.textContent||E.innerText||"").indexOf(A[3])>=0}else{if(z==="not"){var D=A[3];for(var B=0,y=D.length;B<y;B++){if(D[B]===E){return false}}return true}}}},CHILD:function(y,B){var E=B[1],z=y;switch(E){case"only":case"first":while((z=z.previousSibling)){if(z.nodeType===1){return false}}if(E=="first"){return true}z=y;case"last":while((z=z.nextSibling)){if(z.nodeType===1){return false}}return true;case"nth":var A=B[2],H=B[3];if(A==1&&H==0){return true}var D=B[0],G=y.parentNode;if(G&&(G.sizcache!==D||!y.nodeIndex)){var C=0;for(z=G.firstChild;z;z=z.nextSibling){if(z.nodeType===1){z.nodeIndex=++C}}G.sizcache=D}var F=y.nodeIndex-H;if(A==0){return F==0}else{return(F%A==0&&F/A>=0)}}},ID:function(z,y){return z.nodeType===1&&z.getAttribute("id")===y},TAG:function(z,y){return(y==="*"&&z.nodeType===1)||z.nodeName===y},CLASS:function(z,y){return(" "+(z.className||z.getAttribute("class"))+" ").indexOf(y)>-1},ATTR:function(D,B){var A=B[1],y=f.attrHandle[A]?f.attrHandle[A](D):D[A]!=null?D[A]:D.getAttribute(A),E=y+"",C=B[2],z=B[4];return y==null?C==="!=":C==="="?E===z:C==="*="?E.indexOf(z)>=0:C==="~="?(" "+E+" ").indexOf(z)>=0:!z?E&&y!==false:C==="!="?E!=z:C==="^="?E.indexOf(z)===0:C==="$="?E.substr(E.length-z.length)===z:C==="|="?E===z||E.substr(0,z.length+1)===z+"-":false},POS:function(C,z,A,D){var y=z[2],B=f.setFilters[y];if(B){return B(C,A,z,D)}}}};var p=f.match.POS;for(var r in f.match){f.match[r]=new RegExp(f.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source);f.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+f.match[r].source)}var a=function(z,y){z=Array.prototype.slice.call(z,0);if(y){y.push.apply(y,z);return y}return z};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(q){a=function(C,B){var z=B||[];if(d.call(C)==="[object Array]"){Array.prototype.push.apply(z,C)}else{if(typeof C.length==="number"){for(var A=0,y=C.length;A<y;A++){z.push(C[A])}}else{for(var A=0;C[A];A++){z.push(C[A])}}}return z}}var c;if(document.documentElement.compareDocumentPosition){c=function(z,y){if(!z.compareDocumentPosition||!y.compareDocumentPosition){if(z==y){t=true}return 0}var A=z.compareDocumentPosition(y)&4?-1:z===y?0:1;if(A===0){t=true}return A}}else{if("sourceIndex" in document.documentElement){c=function(z,y){if(!z.sourceIndex||!y.sourceIndex){if(z==y){t=true}return 0}var A=z.sourceIndex-y.sourceIndex;if(A===0){t=true}return A}}else{if(document.createRange){c=function(B,z){if(!B.ownerDocument||!z.ownerDocument){if(B==z){t=true}return 0}var A=B.ownerDocument.createRange(),y=z.ownerDocument.createRange();A.setStart(B,0);A.setEnd(B,0);y.setStart(z,0);y.setEnd(z,0);var C=A.compareBoundaryPoints(Range.START_TO_END,y);if(C===0){t=true}return C}}}}(function(){var z=document.createElement("div"),A="script"+(new Date).getTime();z.innerHTML="<a name='"+A+"'/>";var y=document.documentElement;y.insertBefore(z,y.firstChild);if(!!document.getElementById(A)){f.find.ID=function(C,D,E){if(typeof D.getElementById!=="undefined"&&!E){var B=D.getElementById(C[1]);return B?B.id===C[1]||typeof B.getAttributeNode!=="undefined"&&B.getAttributeNode("id").nodeValue===C[1]?[B]:undefined:[]}};f.filter.ID=function(D,B){var C=typeof D.getAttributeNode!=="undefined"&&D.getAttributeNode("id");return D.nodeType===1&&C&&C.nodeValue===B}}y.removeChild(z);y=z=null})();(function(){var y=document.createElement("div");y.appendChild(document.createComment(""));if(y.getElementsByTagName("*").length>0){f.find.TAG=function(z,D){var C=D.getElementsByTagName(z[1]);if(z[1]==="*"){var B=[];for(var A=0;C[A];A++){if(C[A].nodeType===1){B.push(C[A])}}C=B}return C}}y.innerHTML="<a href='#'></a>";if(y.firstChild&&typeof y.firstChild.getAttribute!=="undefined"&&y.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(z){return z.getAttribute("href",2)}}y=null})();if(document.querySelectorAll){(function(){var y=b,A=document.createElement("div");A.innerHTML="<p class='TEST'></p>";if(A.querySelectorAll&&A.querySelectorAll(".TEST").length===0){return}b=function(E,D,B,C){D=D||document;if(!C&&D.nodeType===9&&!u(D)){try{return a(D.querySelectorAll(E),B)}catch(F){}}return y(E,D,B,C)};for(var z in y){b[z]=y[z]}A=null})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var y=document.createElement("div");y.innerHTML="<div class='test e'></div><div class='test'></div>";if(y.getElementsByClassName("e").length===0){return}y.lastChild.className="e";if(y.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(z,A,B){if(typeof A.getElementsByClassName!=="undefined"&&!B){return A.getElementsByClassName(z[1])}};y=null})()}function s(z,E,D,I,F,H){var G=z=="previousSibling"&&!H;for(var B=0,A=I.length;B<A;B++){var y=I[B];if(y){if(G&&y.nodeType===1){y.sizcache=D;y.sizset=B}y=y[z];var C=false;while(y){if(y.sizcache===D){C=I[y.sizset];break}if(y.nodeType===1&&!H){y.sizcache=D;y.sizset=B}if(y.nodeName===E){C=y;break}y=y[z]}I[B]=C}}}function w(z,E,D,I,F,H){var G=z=="previousSibling"&&!H;for(var B=0,A=I.length;B<A;B++){var y=I[B];if(y){if(G&&y.nodeType===1){y.sizcache=D;y.sizset=B}y=y[z];var C=false;while(y){if(y.sizcache===D){C=I[y.sizset];break}if(y.nodeType===1){if(!H){y.sizcache=D;y.sizset=B}if(typeof E!=="string"){if(y===E){C=true;break}}else{if(b.filter(E,[y]).length>0){C=y;break}}}y=y[z]}I[B]=C}}}var k=document.compareDocumentPosition?function(z,y){return z.compareDocumentPosition(y)&16}:function(z,y){return z!==y&&(z.contains?z.contains(y):true)};var u=function(y){return y.nodeType===9&&y.documentElement.nodeName!=="HTML"||!!y.ownerDocument&&y.ownerDocument.documentElement.nodeName!=="HTML"};var g=function(y,F){var B=[],C="",D,A=F.nodeType?[F]:F;while((D=f.match.PSEUDO.exec(y))){C+=D[0];y=y.replace(f.match.PSEUDO,"")}y=f.relative[y]?y+"*":y;for(var E=0,z=A.length;E<z;E++){b(y,A[E],B)}return b.filter(C,B)};window.Sizzle=b})();Prototype._original_property=window.Sizzle;(function(c){var d=Prototype.Selector.extendElements;function a(f,g){return d(c(f,g||document))}function b(g,f){return c.matches(f,[g]).length==1}Prototype.Selector.engine=c;Prototype.Selector.select=a;Prototype.Selector.match=b})(Sizzle);window.Sizzle=Prototype._original_property;delete Prototype._original_property;var Form={reset:function(a){a=$(a);a.reset();return a},serializeElements:function(n,d){if(typeof d!="object"){d={hash:!!d}}else{if(Object.isUndefined(d.hash)){d.hash=true}}var f,k,a=false,g=d.submit,b,c;if(d.hash){c={};b=function(o,p,q){if(p in o){if(!Object.isArray(o[p])){o[p]=[o[p]]}o[p].push(q)}else{o[p]=q}return o}}else{c="";b=function(o,p,q){return o+(o?"&":"")+encodeURIComponent(p)+"="+encodeURIComponent(q)}}return n.inject(c,function(o,p){if(!p.disabled&&p.name){f=p.name;k=$(p).getValue();if(k!=null&&p.type!="file"&&(p.type!="submit"||(!a&&g!==false&&(!g||f==g)&&(a=true)))){o=b(o,f,k)}}return o})}};Form.Methods={serialize:function(b,a){return Form.serializeElements(Form.getElements(b),a)},getElements:function(f){var g=$(f).getElementsByTagName("*"),d,a=[],c=Form.Element.Serializers;for(var b=0;d=g[b];b++){a.push(d)}return a.inject([],function(k,n){if(c[n.tagName.toLowerCase()]){k.push(Element.extend(n))}return k})},getInputs:function(k,c,d){k=$(k);var a=k.getElementsByTagName("input");if(!c&&!d){return $A(a).map(Element.extend)}for(var f=0,n=[],g=a.length;f<g;f++){var b=a[f];if((c&&b.type!=c)||(d&&b.name!=d)){continue}n.push(Element.extend(b))}return n},disable:function(a){a=$(a);Form.getElements(a).invoke("disable");return a},enable:function(a){a=$(a);Form.getElements(a).invoke("enable");return a},findFirstElement:function(b){var c=$(b).getElements().findAll(function(d){return"hidden"!=d.type&&!d.disabled});var a=c.findAll(function(d){return d.hasAttribute("tabIndex")&&d.tabIndex>=0}).sortBy(function(d){return d.tabIndex}).first();return a?a:c.find(function(d){return/^(?:input|select|textarea)$/i.test(d.tagName)})},focusFirstElement:function(b){b=$(b);var a=b.findFirstElement();if(a){a.activate()}return b},request:function(b,a){b=$(b),a=Object.clone(a||{});var d=a.parameters,c=b.readAttribute("action")||"";if(c.blank()){c=window.location.href}a.parameters=b.serialize(true);if(d){if(Object.isString(d)){d=d.toQueryParams()}Object.extend(a.parameters,d)}if(b.hasAttribute("method")&&!a.method){a.method=b.method}return new Ajax.Request(c,a)}};Form.Element={focus:function(a){$(a).focus();return a},select:function(a){$(a).select();return a}};Form.Element.Methods={serialize:function(a){a=$(a);if(!a.disabled&&a.name){var b=a.getValue();if(b!=undefined){var c={};c[a.name]=b;return Object.toQueryString(c)}}return""},getValue:function(a){a=$(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)},setValue:function(a,b){a=$(a);var c=a.tagName.toLowerCase();Form.Element.Serializers[c](a,b);return a},clear:function(a){$(a).value="";return a},present:function(a){return $(a).value!=""},activate:function(a){a=$(a);try{a.focus();if(a.select&&(a.tagName.toLowerCase()!="input"||!(/^(?:button|reset|submit)$/i.test(a.type)))){a.select()}}catch(b){}return a},disable:function(a){a=$(a);a.disabled=true;return a},enable:function(a){a=$(a);a.disabled=false;return a}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers=(function(){function b(n,o){switch(n.type.toLowerCase()){case"checkbox":case"radio":return g(n,o);default:return f(n,o)}}function g(n,o){if(Object.isUndefined(o)){return n.checked?n.value:null}else{n.checked=!!o}}function f(n,o){if(Object.isUndefined(o)){return n.value}else{n.value=o}}function a(p,s){if(Object.isUndefined(s)){return(p.type==="select-one"?c:d)(p)}var o,q,t=!Object.isArray(s);for(var n=0,r=p.length;n<r;n++){o=p.options[n];q=this.optionValue(o);if(t){if(q==s){o.selected=true;return}}else{o.selected=s.include(q)}}}function c(o){var n=o.selectedIndex;return n>=0?k(o.options[n]):null}function d(q){var n,r=q.length;if(!r){return null}for(var p=0,n=[];p<r;p++){var o=q.options[p];if(o.selected){n.push(k(o))}}return n}function k(n){return Element.hasAttribute(n,"value")?n.value:n.text}return{input:b,inputSelector:g,textarea:f,select:a,selectOne:c,selectMany:d,optionValue:k,button:f}})();Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,a,b,c){$super(c,b);this.element=$(a);this.lastValue=this.getValue()},execute:function(){var a=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(a)?this.lastValue!=a:String(this.lastValue)!=String(a)){this.callback(this.element,a);this.lastValue=a}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=Class.create({initialize:function(a,b){this.element=$(a);this.callback=b;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var a=this.getValue();if(this.lastValue!=a){this.callback(this.element,a);this.lastValue=a}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(a){if(a.type){switch(a.type.toLowerCase()){case"checkbox":case"radio":Event.observe(a,"click",this.onElementEvent.bind(this));break;default:Event.observe(a,"change",this.onElementEvent.bind(this));break}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});(function(){var J={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{}};var g=document.documentElement;var K="onmouseenter" in g&&"onmouseleave" in g;var a=function(L){return false};if(window.attachEvent){if(window.addEventListener){a=function(L){return !(L instanceof window.Event)}}else{a=function(L){return true}}}var y;function H(N,L){return N.which?(N.which===L+1):(N.button===L)}var u={0:1,1:4,2:2};function F(N,L){return N.button===u[L]}function I(N,L){switch(L){case 0:return N.which==1&&!N.metaKey;case 1:return N.which==2||(N.which==1&&N.metaKey);case 2:return N.which==3;default:return false}}if(window.attachEvent){if(!window.addEventListener){y=F}else{y=function(N,L){return a(N)?F(N,L):H(N,L)}}}else{if(Prototype.Browser.WebKit){y=I}else{y=H}}function C(L){return y(L,0)}function A(L){return y(L,1)}function t(L){return y(L,2)}function d(O){O=J.extend(O);var N=O.target,L=O.type,P=O.currentTarget;if(P&&P.tagName){if(L==="load"||L==="error"||(L==="click"&&P.tagName.toLowerCase()==="input"&&P.type==="radio")){N=P}}if(N.nodeType==Node.TEXT_NODE){N=N.parentNode}return Element.extend(N)}function v(N,O){var L=J.element(N);if(!O){return L}while(L){if(Object.isElement(L)&&Prototype.Selector.match(L,O)){return Element.extend(L)}L=L.parentNode}}function z(L){return{x:c(L),y:b(L)}}function c(O){var N=document.documentElement,L=document.body||{scrollLeft:0};return O.pageX||(O.clientX+(N.scrollLeft||L.scrollLeft)-(N.clientLeft||0))}function b(O){var N=document.documentElement,L=document.body||{scrollTop:0};return O.pageY||(O.clientY+(N.scrollTop||L.scrollTop)-(N.clientTop||0))}function w(L){J.extend(L);L.preventDefault();L.stopPropagation();L.stopped=true}J.Methods={isLeftClick:C,isMiddleClick:A,isRightClick:t,element:d,findElement:v,pointer:z,pointerX:c,pointerY:b,stop:w};var E=Object.keys(J.Methods).inject({},function(L,N){L[N]=J.Methods[N].methodize();return L});if(window.attachEvent){function o(N){var L;switch(N.type){case"mouseover":case"mouseenter":L=N.fromElement;break;case"mouseout":case"mouseleave":L=N.toElement;break;default:return null}return Element.extend(L)}var B={stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}};J.extend=function(N,L){if(!N){return false}if(!a(N)){return N}if(N._extendedByPrototype){return N}N._extendedByPrototype=Prototype.emptyFunction;var O=J.pointer(N);Object.extend(N,{target:N.srcElement||L,relatedTarget:o(N),pageX:O.x,pageY:O.y});Object.extend(N,E);Object.extend(N,B);return N}}else{J.extend=Prototype.K}if(window.addEventListener){J.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(J.prototype,E)}function s(Q,P,R){var O=Element.retrieve(Q,"prototype_event_registry");if(Object.isUndefined(O)){f.push(Q);O=Element.retrieve(Q,"prototype_event_registry",$H())}var L=O.get(P);if(Object.isUndefined(L)){L=[];O.set(P,L)}if(L.pluck("handler").include(R)){return false}var N;if(P.include(":")){N=function(S){if(Object.isUndefined(S.eventName)){return false}if(S.eventName!==P){return false}J.extend(S,Q);R.call(Q,S)}}else{if(!K&&(P==="mouseenter"||P==="mouseleave")){if(P==="mouseenter"||P==="mouseleave"){N=function(T){J.extend(T,Q);var S=T.relatedTarget;while(S&&S!==Q){try{S=S.parentNode}catch(U){S=Q}}if(S===Q){return}R.call(Q,T)}}}else{N=function(S){J.extend(S,Q);R.call(Q,S)}}}N.handler=R;L.push(N);return N}function n(){for(var L=0,N=f.length;L<N;L++){J.stopObserving(f[L]);f[L]=null}}var f=[];if(Prototype.Browser.IE){window.attachEvent("onunload",n)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}var r=Prototype.K,k={mouseenter:"mouseover",mouseleave:"mouseout"};if(!K){r=function(L){return(k[L]||L)}}function D(P,O,Q){P=$(P);var N=s(P,O,Q);if(!N){return P}if(O.include(":")){if(P.addEventListener){P.addEventListener("dataavailable",N,false)}else{P.attachEvent("ondataavailable",N);P.attachEvent("onlosecapture",N)}}else{var L=r(O);if(P.addEventListener){P.addEventListener(L,N,false)}else{P.attachEvent("on"+L,N)}}return P}function q(S,P,T){S=$(S);var O=Element.retrieve(S,"prototype_event_registry");if(!O){return S}if(!P){O.each(function(V){var U=V.key;q(S,U)});return S}var Q=O.get(P);if(!Q){return S}if(!T){Q.each(function(U){q(S,P,U.handler)});return S}var R=Q.length,N;while(R--){if(Q[R].handler===T){N=Q[R];break}}if(!N){return S}if(P.include(":")){if(S.removeEventListener){S.removeEventListener("dataavailable",N,false)}else{S.detachEvent("ondataavailable",N);S.detachEvent("onlosecapture",N)}}else{var L=r(P);if(S.removeEventListener){S.removeEventListener(L,N,false)}else{S.detachEvent("on"+L,N)}}O.set(P,Q.without(N));return S}function G(P,O,N,L){P=$(P);if(Object.isUndefined(L)){L=true}if(P==document&&document.createEvent&&!P.dispatchEvent){P=document.documentElement}var Q;if(document.createEvent){Q=document.createEvent("HTMLEvents");Q.initEvent("dataavailable",L,true)}else{Q=document.createEventObject();Q.eventType=L?"ondataavailable":"onlosecapture"}Q.eventName=O;Q.memo=N||{};if(document.createEvent){P.dispatchEvent(Q)}else{P.fireEvent(Q.eventType,Q)}return J.extend(Q)}J.Handler=Class.create({initialize:function(O,N,L,P){this.element=$(O);this.eventName=N;this.selector=L;this.callback=P;this.handler=this.handleEvent.bind(this)},start:function(){J.observe(this.element,this.eventName,this.handler);return this},stop:function(){J.stopObserving(this.element,this.eventName,this.handler);return this},handleEvent:function(N){var L=J.findElement(N,this.selector);if(L){this.callback.call(this.element,N,L)}}});function p(O,N,L,P){O=$(O);if(Object.isFunction(L)&&Object.isUndefined(P)){P=L,L=null}return new J.Handler(O,N,L,P).start()}Object.extend(J,J.Methods);Object.extend(J,{fire:G,observe:D,stopObserving:q,on:p});Element.addMethods({fire:G,observe:D,stopObserving:q,on:p});Object.extend(document,{fire:G.methodize(),observe:D.methodize(),stopObserving:q.methodize(),on:p.methodize(),loaded:false});if(window.Event){Object.extend(window.Event,J)}else{window.Event=J}})();(function(){var d;function a(){if(document.loaded){return}if(d){window.clearTimeout(d)}document.loaded=true;document.fire("dom:loaded")}function c(){if(document.readyState==="complete"){document.stopObserving("readystatechange",c);a()}}function b(){try{document.documentElement.doScroll("left")}catch(f){d=b.defer();return}a()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",a,false)}else{document.observe("readystatechange",c);if(window==top){d=b.defer()}}Event.observe(window,"load",a)})();Element.addMethods();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(a,b){return Element.insert(a,{before:b})},Top:function(a,b){return Element.insert(a,{top:b})},Bottom:function(a,b){return Element.insert(a,{bottom:b})},After:function(a,b){return Element.insert(a,{after:b})}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},within:function(b,a,c){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(b,a,c)}this.xcomp=a;this.ycomp=c;this.offset=Element.cumulativeOffset(b);return(c>=this.offset[1]&&c<this.offset[1]+b.offsetHeight&&a>=this.offset[0]&&a<this.offset[0]+b.offsetWidth)},withinIncludingScrolloffsets:function(b,a,d){var c=Element.cumulativeScrollOffset(b);this.xcomp=a+c[0]-this.deltaX;this.ycomp=d+c[1]-this.deltaY;this.offset=Element.cumulativeOffset(b);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+b.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+b.offsetWidth)},overlap:function(b,a){if(!b){return 0}if(b=="vertical"){return((this.offset[1]+a.offsetHeight)-this.ycomp)/a.offsetHeight}if(b=="horizontal"){return((this.offset[0]+a.offsetWidth)-this.xcomp)/a.offsetWidth}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(a){Position.prepare();return Element.absolutize(a)},relativize:function(a){Position.prepare();return Element.relativize(a)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(b,c,a){a=a||{};return Element.clonePosition(c,b,a)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(b){function a(c){return c.blank()?null:"[contains(concat(' ', @class, ' '), ' "+c+" ')]"}b.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(c,f){f=f.toString().strip();var d=/\s/.test(f)?$w(f).map(a).join(""):a(f);return d?document._getElementsByXPath(".//*"+d,c):[]}:function(f,g){g=g.toString().strip();var k=[],n=(/\s/.test(g)?$w(g):null);if(!n&&!g){return k}var c=$(f).getElementsByTagName("*");g=" "+g+" ";for(var d=0,p,o;p=c[d];d++){if(p.className&&(o=" "+p.className+" ")&&(o.include(g)||(n&&n.all(function(q){return !q.toString().blank()&&o.include(" "+q+" ")})))){k.push(Element.extend(p))}}return k};return function(d,c){return $(c||document.body).getElementsByClassName(d)}}(Element.Methods)}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(a){this.element=$(a)},_each:function(a){this.element.className.split(/\s+/).select(function(b){return b.length>0})._each(a)},set:function(a){this.element.className=a},add:function(a){if(this.include(a)){return}this.set($A(this).concat(a).join(" "))},remove:function(a){if(!this.include(a)){return}this.set($A(this).without(a).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);(function(){window.Selector=Class.create({initialize:function(a){this.expression=a.strip()},findElements:function(a){return Prototype.Selector.select(this.expression,a)},match:function(a){return Prototype.Selector.match(a,this.expression)},toString:function(){return this.expression},inspect:function(){return"#<Selector: "+this.expression+">"}});Object.extend(Selector,{matchElements:function(g,k){var a=Prototype.Selector.match,d=[];for(var c=0,f=g.length;c<f;c++){var b=g[c];if(a(b,k)){d.push(Element.extend(b))}}return d},findElement:function(g,k,b){b=b||0;var a=0,d;for(var c=0,f=g.length;c<f;c++){d=g[c];if(Prototype.Selector.match(d,k)&&b===a++){return Element.extend(d)}}},findChildElements:function(b,c){var a=c.toArray().join(", ");return Prototype.Selector.select(a,b||document)}})})();(function(){if(!$||!Element){return}var g=$([]);var c=10;var k=null;function b(r,q,p){if(!(r=$(r))){return}var n={};$(["top","right","bottom","left"]).each(function(s){var t=parseInt(q[s]);n[s]=isNaN(t)?null:t});var o=r.retrieve("pinned-index",g.length);g[o]={element:r,pinned:false,pinpos:n,cls:p||"pinned",offset:r.cumulativeOffset(),initial:{position:r.getStyle("position"),left:r.getStyle("left"),top:r.getStyle("top")}}}function d(n){n.element.setStyle(n.initial);n.element.removeClassName(n.cls)}function a(o){if(!(o=$(o))){return}var n=o.retrieve("pinned-index",null);if(n!==null){d(g[n]);delete g[n]}}function f(n){if(k){clearTimeout(k)}k=setTimeout(function(){g.each(function(r){var o=document.viewport.getScrollOffsets();var p=false;var q={};if(r.pinpos.left!==null&&o.left>=r.offset.left-r.pinpos.left){q.left=r.pinpos.left+"px";p=true}else{if(r.pinpos.top!==null&&o.top>=r.offset.top-r.pinpos.top){q.top=r.pinpos.top+"px";p=true}}if(p){if(!r.pinned){r.pinned=true;q.position="fixed";r.element.addClassName(r.cls);r.element.setStyle(q)}}else{if(r.pinned){r.pinned=false;d(r)}}})},c)}Element.addMethods({pin:b,unpin:a});Event.observe(window,"scroll",f)}());Array.prototype.remove=function(c,b){var a=this.slice((b||c)+1||this.length);this.length=c<0?this.length+c:c;return this.push.apply(this,a)};(function(){if(!$||!Element){return}function a(c){return"data-"+c}function b(g,d,f){if(!(g=$(g))){return}if(typeof d==="object"){$H(d).each(function(k){g.writeAttribute(a(k.key),k.value)})}else{if(Object.isUndefined(d)){var c={};$A(g.attributes).each(function(k){if(k.name.indexOf("data-")===0){c[k.name.slice(5)]=k.value}});return c}else{if(Object.isUndefined(f)){return g.readAttribute(a(d))}else{g.writeAttribute(a(d),f)}}}return g}Element.addMethods({data:b})}());(function(){function a(d){var c=document.createElement("div");var b="";c.appendChild(d.clone(true));b=c.innerHTML;delete c;return b}Element.addMethods({getOuterHTML:function(b){return b.outerHTML||a(b)}})}());(function(){if(!$||!Element){return}Element.make=function(b){var a=new Element("div").update(b);return a.firstDescendant()||null}}());(function(){if(!$||!Element){return}var c;var b=function(f){f=$(f);if(f.tagName.toLowerCase()!=="form"){throw"Element.enhanceform() method applicable only to HTMLFormElement"}if(f.retrieve("enhanced")){return f}var d=f.select("input[type=submit]");d.each(function(g){if(!g.name){return false}g.on("mousedown",function(k){f.store("submit-as",this.name)})});f.on("submit",function(k){var g=f.retrieve("submit-as");f.store("submit-as",null);if(!g){for(c=0,l=d.length;c<l;c++){if(!d[c].disabled&&d[c].name){g=d[c].name;break}}}f.fire("form:submit",{type:g});f.fire("form:submit:"+g)});f.store("enhanced",true);f.store("submit-as",null);return f};var a=function(d){(d.tagName.toLowerCase()==="form"?[d]:d.select("form")).each(b);return d};Element.addMethods({enhanceform:a})}());(function(){if(Modernizr&&Modernizr.input.placeholder){ns("CD.Polyfills.placeholder",Prototype.emptyFunction);return}var a=function(c){if(!c||c._placeholder_applied){return null}c=$(c);c._placeholder_applied=true;var d=c.readAttribute("placeholder");if(d===null){return}if(c.value.strip().length<1){c.value=d;c.addClassName("edt-placeholder")}c.on("focus",function(f){if(this.value.strip()!==d){this.removeClassName("edt-placeholder")}});c.on("click",function(f){if(this.value.strip()===d){this.value="";this.removeClassName("edt-placeholder")}});c.on("blur",function(f){if(this.value.strip().length<1){this.value=d;this.addClassName("edt-placeholder")}});return c};var b=function(c){(c?$(c).select("[placeholder]"):$$("[placeholder]")).each(a)};Event.observe(document,"dom:loaded",function(){b()});ns("CD.Polyfills.placeholder",b)}());(function(){this.BackboneAdopted={$:$,element:function(a){$$(a).first()},select:function(a,b){return b?$$(b).select(a):$$(a)},attr:function(b,a){b=$(b);$H(a).each(function(c){b.writeAttribute(c.key,c.value)});return b},html:function(b,a){return $(b).update(a)},remove:function(a){$(a).remove()},bind:function(c,a,b){return Event.observe(c,a,b)},delegate:function(d,a,b,f){var c=$(d).select(a);c.each(function(g){this.bind(g,b,f)});return c},unbind:function(b,a){return $(b).stopObserving(a)},iframe:function(){if(navigator.userAgent.toLowerCase().match(/msie 7/)){return null}var a=new Element("iframe",{src:"javascript:0",tabindex:-1});a.hide();$(document.body).insert({bottom:a});return a.contentWindow},ajax:function(a){return new Ajax.Request(a.url,{method:a.type,parameters:(a.data&&typeof a.data.evalToJSON==="function")?a.data.evalJSON():a.data,onSuccess:function(b){a.success.call(b.request,b.responseJSON)},onFailure:function(b){a.error.call(b.request,b.responseJSON)}})}}}).call(this);(function(){var u=this;var t=u.Backbone;var b;if(typeof exports!=="undefined"){b=exports}else{b=u.Backbone={}}b.VERSION="0.5.2";var d=b.$a=u.BackboneAdopted||(function(E){return{$:E,element:function(F){return E(F).get(0)},select:function(F,G){return E(F,G)},attr:function(G,F){return E.attr(G,F)},html:function(G,F){return E(G).html(F)},remove:function(F){E(F).remove()},bind:function(H,F,G){return E(H).bind(F,G)},delegate:function(H,F,G,I){E(H).delegate(F,G,I)},unbind:function(G,F){return E(G).unbind(F)},ajax:function(F){return E.ajax(F)},iframe:function(){return E('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow}}}(u.jQuery||u.Zepto));var D=u._;if(!D&&(typeof require!=="undefined")){D=require("underscore")._}b.noConflict=function(){u.Backbone=t;return this};b.emulateHTTP=false;b.emulateJSON=false;b.Events={bind:function(G,I,F){var E=this._callbacks||(this._callbacks={});var H=E[G]||(E[G]=[]);H.push([I,F||this]);return this},unbind:function(H,J){var G;if(!H){this._callbacks={}}else{if(G=this._callbacks){if(!J){G[H]=[]}else{var I=G[H];if(!I){return this}for(var F=0,E=I.length;F<E;F++){if(I[F]&&J===I[F][0]){I[F]=null;break}}}}}return this},trigger:function(G){var H,N,K,L,I;var J=2;if(!(N=this._callbacks)){return this}while(J--){K=J?G:"all";if(H=N[K]){for(var F=0,E=H.length;F<E;F++){if(!(L=H[F])){H.splice(F,1);F--;E--}else{I=J?Array.prototype.slice.call(arguments,1):arguments;L[0].apply(L[1],I)}}}}return this}};b.Model=function(E,F){var G;E||(E={});if(G=this.defaults){if(D.isFunction(G)){G=G.call(this)}E=D.extend({},G,E)}this.attributes={};this._escapedAttributes={};this.cid=D.uniqueId("c");this.set(E,{silent:true});this._changed=false;this._previousAttributes=D.clone(this.attributes);if(F&&F.collection){this.collection=F.collection}this.initialize(E,F)};D.extend(b.Model.prototype,b.Events,{_previousAttributes:null,_changed:false,idAttribute:"id",initialize:function(){},toJSON:function(){return D.clone(this.attributes)},get:function(E){return this.attributes[E]},escape:function(E){var F;if(F=this._escapedAttributes[E]){return F}var G=this.attributes[E];return this._escapedAttributes[E]=s(G==null?"":""+G)},has:function(E){return this.attributes[E]!=null},set:function(H,G){G||(G={});if(!H){return this}if(H.attributes){H=H.attributes}var F=this.attributes,J=this._escapedAttributes;if(!G.silent&&this.validate&&!this._performValidation(H,G)){return false}if(this.idAttribute in H){this.id=H[this.idAttribute]}var I=this._changing;this._changing=true;for(var E in H){var K=H[E];if(!D.isEqual(F[E],K)){F[E]=K;delete J[E];this._changed=true;if(!G.silent){this.trigger("change:"+E,this,K,G)}}}if(!I&&!G.silent&&this._changed){this.change(G)}this._changing=false;return this},unset:function(E,F){if(!(E in this.attributes)){return this}F||(F={});var H=this.attributes[E];var G={};G[E]=void 0;if(!F.silent&&this.validate&&!this._performValidation(G,F)){return false}delete this.attributes[E];delete this._escapedAttributes[E];if(E==this.idAttribute){delete this.id}this._changed=true;if(!F.silent){this.trigger("change:"+E,this,void 0,F);this.change(F)}return this},clear:function(G){G||(G={});var E;var F=this.attributes;var H={};for(E in F){H[E]=void 0}if(!G.silent&&this.validate&&!this._performValidation(H,G)){return false}this.attributes={};this._escapedAttributes={};this._changed=true;if(!G.silent){for(E in F){this.trigger("change:"+E,this,void 0,G)}this.change(G)}return this},fetch:function(F){F||(F={});var E=this;var G=F.success;F.success=function(J,H,I){if(!E.set(E.parse(J,I),F)){return false}if(G){G(E,J)}};F.error=c(F.error,E,F);return(this.sync||b.sync).call(this,"read",this,F)},save:function(G,F){F||(F={});if(G&&!this.set(G,F)){return false}var E=this;var H=F.success;F.success=function(L,J,K){if(!E.set(E.parse(L,K),F)){return false}if(H){H(E,L,K)}};F.error=c(F.error,E,F);var I=this.isNew()?"create":"update";return(this.sync||b.sync).call(this,I,this,F)},destroy:function(F){F||(F={});if(this.isNew()){return this.trigger("destroy",this,this.collection,F)}var E=this;var G=F.success;F.success=function(H){E.trigger("destroy",E,E.collection,F);if(G){G(E,H)}};F.error=c(F.error,E,F);return(this.sync||b.sync).call(this,"delete",this,F)},url:function(){var E=v(this.collection)||this.urlRoot||y();if(this.isNew()){return E}return E+(E.charAt(E.length-1)=="/"?"":"/")+encodeURIComponent(this.id)},parse:function(F,E){return F},clone:function(){return new this.constructor(this)},isNew:function(){return this.id==null},change:function(E){this.trigger("change",this,E);this._previousAttributes=D.clone(this.attributes);this._changed=false},hasChanged:function(E){if(E){return this._previousAttributes[E]!=this.attributes[E]}return this._changed},changedAttributes:function(G){G||(G=this.attributes);var F=this._previousAttributes;var H=false;for(var E in G){if(!D.isEqual(F[E],G[E])){H=H||{};H[E]=G[E]}}return H},previous:function(E){if(!E||!this._previousAttributes){return null}return this._previousAttributes[E]},previousAttributes:function(){return D.clone(this._previousAttributes)},_performValidation:function(G,F){var E=this.validate(G);if(E){if(F.error){F.error(this,E,F)}else{this.trigger("error",this,E,F)}return false}return true}});b.Collection=function(F,E){E||(E={});if(E.comparator){this.comparator=E.comparator}D.bindAll(this,"_onModelEvent","_removeReference");this._reset();if(F){this.reset(F,{silent:true})}this.initialize.apply(this,arguments)};D.extend(b.Collection.prototype,b.Events,{model:b.Model,initialize:function(){},toJSON:function(){return this.map(function(E){return E.toJSON()})},add:function(H,F){if(D.isArray(H)){for(var G=0,E=H.length;G<E;G++){this._add(H[G],F)}}else{this._add(H,F)}return this},remove:function(H,F){if(D.isArray(H)){for(var G=0,E=H.length;G<E;G++){this._remove(H[G],F)}}else{this._remove(H,F)}return this},get:function(E){if(E==null){return null}return this._byId[E.id!=null?E.id:E]},getByCid:function(E){return E&&this._byCid[E.cid||E]},at:function(E){return this.models[E]},sort:function(E){E||(E={});if(!this.comparator){throw new Error("Cannot sort a set without a comparator")}this.models=this.sortBy(this.comparator);if(!E.silent){this.trigger("reset",this,E)}return this},pluck:function(E){return D.map(this.models,function(F){return F.get(E)})},reset:function(F,E){F||(F=[]);E||(E={});this.each(this._removeReference);this._reset();this.add(F,{silent:true});if(!E.silent){this.trigger("reset",this,E)}return this},fetch:function(E){E||(E={});var G=this;var F=E.success;E.success=function(J,H,I){G[E.add?"add":"reset"](G.parse(J,I),E);if(F){F(G,J)}};E.error=c(E.error,G,E);return(this.sync||b.sync).call(this,"read",this,E)},create:function(F,E){var G=this;E||(E={});F=this._prepareModel(F,E);if(!F){return false}var H=E.success;E.success=function(I,K,J){G.add(I,E);if(H){H(I,K,J)}};F.save(null,E);return F},parse:function(F,E){return F},chain:function(){return D(this.models).chain()},_reset:function(E){this.length=0;this.models=[];this._byId={};this._byCid={}},_prepareModel:function(G,F){if(!(G instanceof b.Model)){var E=G;G=new this.model(E,{collection:this});if(G.validate&&!G._performValidation(E,F)){G=false}}else{if(!G.collection){G.collection=this}}return G},_add:function(G,F){F||(F={});G=this._prepareModel(G,F);if(!G){return false}var H=this.getByCid(G);if(H){throw new Error(["Can't add the same model to a set twice",H.id])}this._byId[G.id]=G;this._byCid[G.cid]=G;var E=F.at!=null?F.at:this.comparator?this.sortedIndex(G,this.comparator):this.length;this.models.splice(E,0,G);G.bind("all",this._onModelEvent);this.length++;if(!F.silent){G.trigger("add",G,this,F)}return G},_remove:function(F,E){E||(E={});F=this.getByCid(F)||this.get(F);if(!F){return null}delete this._byId[F.id];delete this._byCid[F.cid];this.models.splice(this.indexOf(F),1);this.length--;if(!E.silent){F.trigger("remove",F,this,E)}this._removeReference(F);return F},_removeReference:function(E){if(this==E.collection){delete E.collection}E.unbind("all",this._onModelEvent)},_onModelEvent:function(G,F,H,E){if((G=="add"||G=="remove")&&H!=this){return}if(G=="destroy"){this._remove(F,E)}if(F&&G==="change:"+F.idAttribute){delete this._byId[F.previous(F.idAttribute)];this._byId[F.id]=F}this.trigger.apply(this,arguments)}});var B=["forEach","each","map","reduce","reduceRight","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","sortBy","sortedIndex","toArray","size","first","rest","last","without","indexOf","lastIndexOf","isEmpty"];D.each(B,function(E){b.Collection.prototype[E]=function(){return D[E].apply(D,[this.models].concat(D.toArray(arguments)))}});b.Router=function(E){E||(E={});if(E.routes){this.routes=E.routes}this._bindRoutes();this.initialize.apply(this,arguments)};var k=/:([\w\d]+)/g;var C=/\*([\w\d]+)/g;var f=/[-[\]{}()+?.,\\^$|#\s]/g;D.extend(b.Router.prototype,b.Events,{initialize:function(){},route:function(E,F,G){b.history||(b.history=new b.History);if(!D.isRegExp(E)){E=this._routeToRegExp(E)}b.history.route(E,D.bind(function(I){var H=this._extractParameters(E,I);G.apply(this,H);this.trigger.apply(this,["route:"+F].concat(H))},this))},navigate:function(E,F){b.history.navigate(E,F)},_bindRoutes:function(){if(!this.routes){return}var F=[];for(var G in this.routes){F.unshift([G,this.routes[G]])}for(var H=0,E=F.length;H<E;H++){this.route(F[H][0],F[H][1],this[F[H][1]])}},_routeToRegExp:function(E){E=E.replace(f,"\\$&").replace(k,"([^/]*)").replace(C,"(.*?)");return new RegExp("^"+E+"$")},_extractParameters:function(E,F){return E.exec(F).slice(1)}});b.History=function(){this.handlers=[];D.bindAll(this,"checkUrl")};var r=/^#*/;var n=/msie [\w.]+/;var p=false;D.extend(b.History.prototype,{interval:50,getFragment:function(F,E){if(F==null){if(this._hasPushState||E){F=window.location.pathname;var G=window.location.search;if(G){F+=G}if(F.indexOf(this.options.root)==0){F=F.substr(this.options.root.length)}}else{F=window.location.hash}}return F.replace(r,"")},start:function(G){if(p){throw new Error("Backbone.history has already been started")}this.options=D.extend({},{root:"/"},this.options,G);this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&window.history&&window.history.pushState);var F=this.getFragment();var E=document.documentMode;var I=(n.exec(navigator.userAgent.toLowerCase())&&(!E||E<=7));if(I){this.iframe=d.iframe();this.navigate(F)}if(this._hasPushState){d.bind(window,"popstate",this.checkUrl)}else{if("onhashchange" in window&&!I){d.bind(window,"hashchange",this.checkUrl)}else{setInterval(this.checkUrl,this.interval)}}this.fragment=F;p=true;var J=window.location;var H=J.pathname==this.options.root;if(this._wantsPushState&&!this._hasPushState&&!H){this.fragment=this.getFragment(null,true);window.location.replace(this.options.root+"#"+this.fragment);return true}else{if(this._wantsPushState&&this._hasPushState&&H&&J.hash){this.fragment=J.hash.replace(r,"");window.history.replaceState({},document.title,J.protocol+"//"+J.host+this.options.root+this.fragment)}}return this.loadUrl()},route:function(E,F){this.handlers.unshift({route:E,callback:F})},checkUrl:function(F){var E=this.getFragment();if(E==this.fragment&&this.iframe){E=this.getFragment(this.iframe.location.hash)}if(E==this.fragment||E==decodeURIComponent(this.fragment)){return false}if(this.iframe){this.navigate(E)}this.loadUrl()||this.loadUrl(window.location.hash)},loadUrl:function(G){var F=this.fragment=this.getFragment(G);var E=D.any(this.handlers,function(H){if(H.route.test(F)){H.callback(F);return true}});return E},navigate:function(E,F){var H=(E||"").replace(r,"");if(this.fragment==H||this.fragment==decodeURIComponent(H)){return}if(this._hasPushState){var G=window.location;if(H.indexOf(this.options.root)!=0){H=this.options.root+H}this.fragment=H;window.history.pushState({},document.title,G.protocol+"//"+G.host+H)}else{window.location.hash=this.fragment=H;if(this.iframe&&(H!=this.getFragment(this.iframe.location.hash))){this.iframe.document.open().close();this.iframe.location.hash=H}}if(F){this.loadUrl(E)}}});b.View=function(E){this.cid=D.uniqueId("view");this._configure(E||{});this._ensureElement();this.delegateEvents();this.initialize.apply(this,arguments)};var q=function(E){return d.select(E,this.el)};var a=/^(\S+)\s*(.*)$/;var z=["model","collection","el","id","attributes","className","tagName"];D.extend(b.View.prototype,b.Events,{tagName:"div",$:q,initialize:function(){},render:function(){return this},remove:function(){if(this.el.parentNode){d.remove(this.el)}return this},make:function(F,E,H){var G=document.createElement(F);if(E){d.attr(G,E)}if(H){d.html(G,H)}return G},delegateEvents:function(I){if(!(I||(I=this.events))){return}d.unbind(this.el,".delegateEvents"+this.cid);for(var H in I){var J=this[I[H]];if(!J){throw new Error('Event "'+I[H]+'" does not exist')}var G=H.match(a);var F=G[1],E=G[2];J=D.bind(J,this);F+=".delegateEvents"+this.cid;if(E===""){d.bind(this.el,F,J)}else{d.delegate(this.el,E,F,J)}}},_configure:function(G){if(this.options){G=D.extend({},this.options,G)}for(var H=0,F=z.length;H<F;H++){var E=z[H];if(G[E]){this[E]=G[E]}}this.options=G},_ensureElement:function(){if(!this.el){var E=this.attributes||{};if(this.id){E.id=this.id}if(this.className){E["class"]=this.className}this.el=this.make(this.tagName,E)}else{if(D.isString(this.el)){this.el=d.element(this.el)}}}});var A=function(E,F){var G=o(this,E,F);G.extend=this.extend;return G};b.Model.extend=b.Collection.extend=b.Router.extend=b.View.extend=A;var w={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};b.sync=function(I,F,E){var G=w[I];var H=D.extend({type:G,dataType:"json"},E);if(!H.url){H.url=v(F)||y()}if(!H.data&&F&&(I=="create"||I=="update")){H.contentType="application/json";H.data=JSON.stringify(F.toJSON())}if(b.emulateJSON){H.contentType="application/x-www-form-urlencoded";H.data=H.data?{model:H.data}:{}}if(b.emulateHTTP){if(G==="PUT"||G==="DELETE"){if(b.emulateJSON){H.data._method=G}H.type="POST";H.beforeSend=function(J){J.setRequestHeader("X-HTTP-Method-Override",G)}}}if(H.type!=="GET"&&!b.emulateJSON){H.processData=false}return d.ajax(H)};var g=function(){};var o=function(F,E,G){var H;if(E&&E.hasOwnProperty("constructor")){H=E.constructor}else{H=function(){return F.apply(this,arguments)}}D.extend(H,F);g.prototype=F.prototype;H.prototype=new g();if(E){D.extend(H.prototype,E)}if(G){D.extend(H,G)}H.prototype.constructor=H;H.__super__=F.prototype;return H};var v=function(E){if(!(E&&E.url)){return null}return D.isFunction(E.url)?E.url():E.url};var y=function(){throw new Error('A "url" property or function must be specified')};var c=function(G,F,E){return function(H){if(G){G(F,H,E)}else{F.trigger("error",F,H,E)}}};var s=function(E){return E.replace(/&(?!\w+;|#\d+;|#x[\da-f]+;)/gi,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")}}).call(this);(function(){function b(n){}var k={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};var f={contentType:"application/json",accept:"application/json, text/javascript, */*; q=0.01",format:"jsonenv",safenames:["collection","model"],cast_request:null,cast_response:null,data:{},sendmodel:false,success:Prototype.emptyFunction,error:Prototype.emptyFunction,reqsuccess:Prototype.emptyFunction};function d(n){throw new Error(n)}function g(n,o){if(!n||!n[o]){return null}return _.isFunction(n[o])?n[o]():n[o]}function a(n){return Object.isString(n)?n.evalJSON():(n||{})}function c(p,n){var o={};if(typeof p==="object"){_.each(p,function(r,q){o[n.indexOf(q)===-1?q:q+"_attr"]=r})}else{o=p}return o}Backbone.sync=function(r,p,o){p||d("Backbone.sync: No model passed");if(typeof p.request_options==="object"){o=_.extend({},p.request_options[r]||p.request_options,o)}o=_.extend({},f,o);o.type=k[r]||"GET";var n=g(o,"url")||g(p,"url")||d('A "url" property or function must be specified');var q={};if(p instanceof Backbone.Model){q=(r==="read"||r==="delete"||o.sendmodel)?{id:p.id}:p.toJSON()}o.data=_.extend(q,g(o,"data"));if(typeof p.request_options==="object"){o.data=_.extend({},g(p.request_options[r],"data")||p.request_options.data,g(o,"data"))}o.data._method=k[r];o.data.format=o.format;_.each(q,function(s,t){if(typeof s==="object"&&s!==null){o.data[t]=Object.toJSON(s)}});if(_.isFunction(o.cast_request)){o.data=o.cast_request(o.data)}return new CD.Ajax.Request(n,{method:o.type,parameters:o.data,onSuccess:function(t){var w=t.response||t||{};if(!_.isObject(w)){w={}}var v=w;if(_.isFunction(o.cast_response)){v=o.cast_response(v)}var s=function(y){return c(y,o.safenames)};v=_.isArray(v)?_.map(v,s):s(v);try{o.success(v,200,null)}catch(u){console.log(u);throw u}o.reqsuccess(p,v,w);if(r!=="delete"){PageBus.publish(p+".loaded",p,null)}},onFailure:function(s){o.error.call(window,s.responseJSON)}},true,false)};ns("CD.Backbone.sync",Backbone.sync)}());if(!window.OpenAjax){OpenAjax=new function(){this.hub={};h=this.hub;h.implementer="http://openajax.org";h.implVersion="2.0";h.specVersion="2.0";h.implExtraData={};var b={};h.libraries=b;var a="org.openajax.hub.";h.registerLibrary=function(g,f,d,c){b[g]={prefix:g,namespaceURI:f,version:d,extraData:c};this.publish(a+"registerLibrary",b[g])};h.unregisterLibrary=function(c){this.publish(a+"unregisterLibrary",b[c]);delete b[c]}};OpenAjax.hub.Error={BadParameters:"OpenAjax.hub.Error.BadParameters",Disconnected:"OpenAjax.hub.Error.Disconnected",Duplicate:"OpenAjax.hub.Error.Duplicate",NoContainer:"OpenAjax.hub.Error.NoContainer",NoSubscription:"OpenAjax.hub.Error.NoSubscription",NotAllowed:"OpenAjax.hub.Error.NotAllowed",WrongProtocol:"OpenAjax.hub.Error.WrongProtocol"};OpenAjax.hub.SecurityAlert={LoadTimeout:"OpenAjax.hub.SecurityAlert.LoadTimeout",FramePhish:"OpenAjax.hub.SecurityAlert.FramePhish",ForgedMsg:"OpenAjax.hub.SecurityAlert.ForgedMsg"};OpenAjax.hub._debugger=function(){};OpenAjax.hub.ManagedHub=function(c){if(!c||!c.onPublish||!c.onSubscribe){throw new Error(OpenAjax.hub.Error.BadParameters)}this._p=c;this._onUnsubscribe=c.onUnsubscribe?c.onUnsubscribe:null;this._scope=c.scope||window;if(c.log){var a=this._scope;var b=c.log;this._log=function(d){b.call(a,"ManagedHub: "+d)}}else{this._log=function(){}}this._subscriptions={c:{},s:null};this._containers={};this._seq=0;this._active=true;this._isPublishing=false;this._pubQ=[]};OpenAjax.hub.ManagedHub.prototype.subscribeForClient=function(a,b,c){this._assertConn();if(this._invokeOnSubscribe(b,a)){return this._subscribe(b,this._sendToClient,this,{c:a,sid:c})}throw new Error(OpenAjax.hub.Error.NotAllowed)};OpenAjax.hub.ManagedHub.prototype.unsubscribeForClient=function(a,b){this._unsubscribe(b);this._invokeOnUnsubscribe(a,b)};OpenAjax.hub.ManagedHub.prototype.publishForClient=function(a,b,c){this._assertConn();this._publish(b,c,a)};OpenAjax.hub.ManagedHub.prototype.disconnect=function(){this._active=false;for(var a in this._containers){this.removeContainer(this._containers[a])}};OpenAjax.hub.ManagedHub.prototype.getContainer=function(b){var a=this._containers[b];return a?a:null};OpenAjax.hub.ManagedHub.prototype.listContainers=function(){var a=[];for(var b in this._containers){a.push(this._containers[b])}return a};OpenAjax.hub.ManagedHub.prototype.addContainer=function(b){this._assertConn();var a=b.getClientID();if(this._containers[a]){throw new Error(OpenAjax.hub.Error.Duplicate)}this._containers[a]=b};OpenAjax.hub.ManagedHub.prototype.removeContainer=function(b){var a=b.getClientID();if(!this._containers[a]){throw new Error(OpenAjax.hub.Error.NoContainer)}b.remove();delete this._containers[a]};OpenAjax.hub.ManagedHub.prototype.subscribe=function(b,f,d,n,c){this._assertConn();this._assertSubTopic(b);if(!f){throw new Error(OpenAjax.hub.Error.BadParameters)}if(!this._invokeOnSubscribe(b,null)){this._invokeOnComplete(n,d,null,false,OpenAjax.hub.Error.NotAllowed);return null}d=d||window;var g=this;function k(p,q,s,o){if(g._invokeOnPublish(p,q,o,null)){try{f.call(d,p,q,c)}catch(r){OpenAjax.hub._debugger();g._log("caught error from onData callback to Hub.subscribe("+p+"): "+r.message)}}}var a=this._subscribe(b,k,d,c);this._invokeOnComplete(n,d,a,true);return a};OpenAjax.hub.ManagedHub.prototype.publish=function(a,b){this._assertConn();this._assertPubTopic(a);this._publish(a,b,null)};OpenAjax.hub.ManagedHub.prototype.unsubscribe=function(a,c,b){this._assertConn();if(typeof a==="undefined"||a==null){throw new Error(OpenAjax.hub.Error.BadParameters)}this._unsubscribe(a);this._invokeOnUnsubscribe(null,a);this._invokeOnComplete(c,b,a,true)};OpenAjax.hub.ManagedHub.prototype.isConnected=function(){return this._active};OpenAjax.hub.ManagedHub.prototype.getScope=function(){return this._scope};OpenAjax.hub.ManagedHub.prototype.getSubscriberData=function(c){this._assertConn();var d=c.split(".");var a=d.pop();var b=this._getSubscriptionObject(this._subscriptions,d,0,a);if(b){return b.data}throw new Error(OpenAjax.hub.Error.NoSubscription)};OpenAjax.hub.ManagedHub.prototype.getSubscriberScope=function(c){this._assertConn();var d=c.split(".");var a=d.pop();var b=this._getSubscriptionObject(this._subscriptions,d,0,a);if(b){return b.scope}throw new Error(OpenAjax.hub.Error.NoSubscription)};OpenAjax.hub.ManagedHub.prototype.getParameters=function(){return this._p};OpenAjax.hub.ManagedHub.prototype._sendToClient=function(b,c,d,a){if(!this.isConnected()){return}if(this._invokeOnPublish(b,c,a,d.c)){d.c.sendToClient(b,c,d.sid)}};OpenAjax.hub.ManagedHub.prototype._assertConn=function(){if(!this.isConnected()){throw new Error(OpenAjax.hub.Error.Disconnected)}};OpenAjax.hub.ManagedHub.prototype._assertPubTopic=function(a){if((a==null)||(a=="")||(a.indexOf("*")!=-1)||(a.indexOf("..")!=-1)||(a.charAt(0)==".")||(a.charAt(a.length-1)==".")){throw new Error(OpenAjax.hub.Error.BadParameters)}};OpenAjax.hub.ManagedHub.prototype._assertSubTopic=function(b){if(!b){throw new Error(OpenAjax.hub.Error.BadParameters)}var f=b.split(".");var a=f.length;for(var c=0;c<a;c++){var d=f[c];if((d=="")||((d.indexOf("*")!=-1)&&(d!="*")&&(d!="**"))){throw new Error(OpenAjax.hub.Error.BadParameters)}if((d=="**")&&(c<a-1)){throw new Error(OpenAjax.hub.Error.BadParameters)}}};OpenAjax.hub.ManagedHub.prototype._invokeOnComplete=function(c,a,b,g,f){if(c){try{a=a||window;c.call(a,b,g,f)}catch(d){OpenAjax.hub._debugger();this._log("caught error from onComplete callback: "+d.message)}}};OpenAjax.hub.ManagedHub.prototype._invokeOnPublish=function(b,c,a,f){try{return this._p.onPublish.call(this._scope,b,c,a,f)}catch(d){OpenAjax.hub._debugger();this._log("caught error from onPublish callback to constructor: "+d.message)}return false};OpenAjax.hub.ManagedHub.prototype._invokeOnSubscribe=function(b,a){try{return this._p.onSubscribe.call(this._scope,b,a)}catch(c){OpenAjax.hub._debugger();this._log("caught error from onSubscribe callback to constructor: "+c.message)}return false};OpenAjax.hub.ManagedHub.prototype._invokeOnUnsubscribe=function(a,c){if(this._onUnsubscribe){var b=c.slice(0,c.lastIndexOf("."));try{this._onUnsubscribe.call(this._scope,b,a)}catch(d){OpenAjax.hub._debugger();this._log("caught error from onUnsubscribe callback to constructor: "+d.message)}}};OpenAjax.hub.ManagedHub.prototype._subscribe=function(a,f,d,c){var g=a+"."+this._seq;var b={scope:d,cb:f,data:c,sid:this._seq++};var k=a.split(".");this._recursiveSubscribe(this._subscriptions,k,0,b);return g};OpenAjax.hub.ManagedHub.prototype._recursiveSubscribe=function(a,f,b,d){var c=f[b];if(b==f.length){d.next=a.s;a.s=d}else{if(typeof a.c=="undefined"){a.c={}}if(typeof a.c[c]=="undefined"){a.c[c]={c:{},s:null};this._recursiveSubscribe(a.c[c],f,b+1,d)}else{this._recursiveSubscribe(a.c[c],f,b+1,d)}}};OpenAjax.hub.ManagedHub.prototype._publish=function(b,d,a){if(this._isPublishing){this._pubQ.push({t:b,d:d,p:a});return}this._safePublish(b,d,a);while(this._pubQ.length>0){var c=this._pubQ.shift();this._safePublish(c.t,c.d,c.p)}};OpenAjax.hub.ManagedHub.prototype._safePublish=function(b,c,a){this._isPublishing=true;var d=b.split(".");this._recursivePublish(this._subscriptions,d,0,b,c,a);this._isPublishing=false};OpenAjax.hub.ManagedHub.prototype._recursivePublish=function(s,r,o,b,f,k){if(typeof s!="undefined"){var g;if(o==r.length){g=s}else{this._recursivePublish(s.c[r[o]],r,o+1,b,f,k);this._recursivePublish(s.c["*"],r,o+1,b,f,k);g=s.c["**"]}if(typeof g!="undefined"){var a=g.s;while(a){var q=a.scope;var n=a.cb;var p=a.data;var c=a.sid;if(typeof n=="string"){n=q[n]}n.call(q,b,f,p,k);a=a.next}}}};OpenAjax.hub.ManagedHub.prototype._unsubscribe=function(b){var c=b.split(".");var a=c.pop();if(!this._recursiveUnsubscribe(this._subscriptions,c,0,a)){throw new Error(OpenAjax.hub.Error.NoSubscription)}};OpenAjax.hub.ManagedHub.prototype._recursiveUnsubscribe=function(o,n,f,d){if(typeof o=="undefined"){return false}if(f<n.length){var c=o.c[n[f]];if(!c){return false}this._recursiveUnsubscribe(c,n,f+1,d);if(c.s==null){for(var g in c.c){return true}delete o.c[n[f]]}}else{var b=o.s;var a=null;var k=false;while(b){if(d==b.sid){k=true;if(b==o.s){o.s=b.next}else{a.next=b.next}break}a=b;b=b.next}if(!k){return false}}return true};OpenAjax.hub.ManagedHub.prototype._getSubscriptionObject=function(a,g,c,b){if(typeof a!="undefined"){if(c<g.length){var d=a.c[g[c]];return this._getSubscriptionObject(d,g,c+1,b)}var f=a.s;while(f){if(b==f.sid){return f}f=f.next}}return null};OpenAjax.hub._hub=new OpenAjax.hub.ManagedHub({onSubscribe:function(a,b){return true},onPublish:function(b,c,a,d){return true}});OpenAjax.hub.subscribe=function(a,d,c,b){if(typeof d==="string"){c=c||window;d=c[d]||null}return OpenAjax.hub._hub.subscribe(a,d,c,null,b)};OpenAjax.hub.unsubscribe=function(a){return OpenAjax.hub._hub.unsubscribe(a)};OpenAjax.hub.publish=function(a,b){OpenAjax.hub._hub.publish(a,b)};OpenAjax.hub.registerLibrary("OpenAjax","http://openajax.org/hub","2.0",{})}OpenAjax.hub.InlineContainer=function(b,f,d){if(!b||!f||!d||!d.Container||!d.Container.onSecurityAlert){throw new Error(OpenAjax.hub.Error.BadParameters)}this._params=d;this._hub=b;this._id=f;this._onSecurityAlert=d.Container.onSecurityAlert;this._onConnect=d.Container.onConnect?d.Container.onConnect:null;this._onDisconnect=d.Container.onDisconnect?d.Container.onDisconnect:null;this._scope=d.Container.scope||window;if(d.Container.log){var a=this._scope;var c=d.Container.log;this._log=function(g){c.call(a,"InlineContainer::"+f+": "+g)};this._doLog=true}else{this._log=function(){}}this._connected=false;this._subs=[];this._subIndex=1;b.addContainer(this)};OpenAjax.hub.InlineContainer.prototype.getHub=function(){return this._hub};OpenAjax.hub.InlineContainer.prototype.sendToClient=function(b,d,a){if(this.isConnected()){var c=this._subs[a];try{c.cb.call(c.sc,b,d,c.d)}catch(f){OpenAjax.hub._debugger();this._client._log("caught error from onData callback to HubClient.subscribe(): "+f.message)}}};OpenAjax.hub.InlineContainer.prototype.remove=function(){if(this.isConnected()){this._disconnect()}};OpenAjax.hub.InlineContainer.prototype.isConnected=function(){return this._connected};OpenAjax.hub.InlineContainer.prototype.getClientID=function(){return this._id};OpenAjax.hub.InlineContainer.prototype.getPartnerOrigin=function(){if(this._connected){if(!this._cacheOrig){this._cacheOrig=window.location.protocol+"//"+window.location.hostname}return this._cacheOrig}return null};OpenAjax.hub.InlineContainer.prototype.getParameters=function(){return this._params};OpenAjax.hub.InlineContainer.prototype.connect=function(a,d,b){if(this._connected){throw new Error(OpenAjax.hub.Error.Duplicate)}this._connected=true;this._client=a;if(this._onConnect){try{this._onConnect.call(this._scope,this)}catch(c){OpenAjax.hub._debugger();this._log("caught error from onConnect callback to constructor: "+c.message)}}this._invokeOnComplete(d,b,a,true)};OpenAjax.hub.InlineContainer.prototype.disconnect=function(a,d,b){if(!this._connected){throw new Error(OpenAjax.hub.Error.Disconnected)}this._disconnect();if(this._onDisconnect){try{this._onDisconnect.call(this._scope,this)}catch(c){OpenAjax.hub._debugger();this._log("caught error from onDisconnect callback to constructor: "+c.message)}}this._invokeOnComplete(d,b,a,true)};OpenAjax.hub.InlineContainer.prototype.subscribe=function(g,c,p,b,f){this._assertConn();this._assertSubTopic(g);if(!c){throw new Error(OpenAjax.hub.Error.BadParameters)}var d=""+this._subIndex++;var o=false;var a=null;try{var k=this._hub.subscribeForClient(this,g,d);o=true}catch(n){d=null;a=n.message}p=p||window;if(o){this._subs[d]={h:k,cb:c,sc:p,d:f}}this._invokeOnComplete(b,p,d,o,a);return d};OpenAjax.hub.InlineContainer.prototype.publish=function(a,b){this._assertConn();this._assertPubTopic(a);this._hub.publishForClient(this,a,b)};OpenAjax.hub.InlineContainer.prototype.unsubscribe=function(a,d,c){this._assertConn();if(typeof a==="undefined"||a==null){throw new Error(OpenAjax.hub.Error.BadParameters)}var b=this._subs[a];if(!b){throw new Error(OpenAjax.hub.Error.NoSubscription)}this._hub.unsubscribeForClient(this,b.h);delete this._subs[a];this._invokeOnComplete(d,c,a,true)};OpenAjax.hub.InlineContainer.prototype.getSubscriberData=function(a){this._assertConn();return this._getSubscription(a).d};OpenAjax.hub.InlineContainer.prototype.getSubscriberScope=function(a){this._assertConn();return this._getSubscription(a).sc};OpenAjax.hub.InlineContainer.prototype._invokeOnComplete=function(c,a,b,g,f){if(c){try{a=a||window;c.call(a,b,g,f)}catch(d){OpenAjax.hub._debugger();this._client._log("caught error from onComplete callback: "+d.message)}}};OpenAjax.hub.InlineContainer.prototype._disconnect=function(){for(var a in this._subs){this._hub.unsubscribeForClient(this,this._subs[a].h)}this._subs=[];this._subIndex=1;this._connected=false};OpenAjax.hub.InlineContainer.prototype._assertConn=function(){if(!this._connected){throw new Error(OpenAjax.hub.Error.Disconnected)}};OpenAjax.hub.InlineContainer.prototype._assertPubTopic=function(a){if((a==null)||(a=="")||(a.indexOf("*")!=-1)||(a.indexOf("..")!=-1)||(a.charAt(0)==".")||(a.charAt(a.length-1)==".")){throw new Error(OpenAjax.hub.Error.BadParameters)}};OpenAjax.hub.InlineContainer.prototype._assertSubTopic=function(b){if(!b){throw new Error(OpenAjax.hub.Error.BadParameters)}var f=b.split(".");var a=f.length;for(var c=0;c<a;c++){var d=f[c];if((d=="")||((d.indexOf("*")!=-1)&&(d!="*")&&(d!="**"))){throw new Error(OpenAjax.hub.Error.BadParameters)}if((d=="**")&&(c<a-1)){throw new Error(OpenAjax.hub.Error.BadParameters)}}};OpenAjax.hub.InlineContainer.prototype._getSubscription=function(a){var b=this._subs[a];if(b){return b}throw new Error(OpenAjax.hub.Error.NoSubscription)};OpenAjax.hub.InlineHubClient=function(c){if(!c||!c.HubClient||!c.HubClient.onSecurityAlert||!c.InlineHubClient||!c.InlineHubClient.container){throw new Error(OpenAjax.hub.Error.BadParameters)}this._params=c;this._onSecurityAlert=c.HubClient.onSecurityAlert;this._scope=c.HubClient.scope||window;this._container=c.InlineHubClient.container;if(c.HubClient.log){var d=this._container.getClientID();var a=this._scope;var b=c.HubClient.log;this._log=function(f){b.call(a,"InlineHubClient::"+d+": "+f)};this._doLog=true}else{this._log=function(){}}};OpenAjax.hub.InlineHubClient.prototype.connect=function(b,a){this._container.connect(this,b,a)};OpenAjax.hub.InlineHubClient.prototype.disconnect=function(b,a){this._container.disconnect(this,b,a)};OpenAjax.hub.InlineHubClient.prototype.getPartnerOrigin=function(){return this._container.getPartnerOrigin()};OpenAjax.hub.InlineHubClient.prototype.getClientID=function(){return this._container.getClientID()};OpenAjax.hub.InlineHubClient.prototype.subscribe=function(a,d,c,f,b){return this._container.subscribe(a,d,c,f,b)};OpenAjax.hub.InlineHubClient.prototype.publish=function(a,b){this._container.publish(a,b)};OpenAjax.hub.InlineHubClient.prototype.unsubscribe=function(a,c,b){this._container.unsubscribe(a,c,b)};OpenAjax.hub.InlineHubClient.prototype.isConnected=function(){return this._container.isConnected()};OpenAjax.hub.InlineHubClient.prototype.getScope=function(){return this._scope};OpenAjax.hub.InlineHubClient.prototype.getSubscriberData=function(a){return this._container.getSubscriberData(a)};OpenAjax.hub.InlineHubClient.prototype.getSubscriberScope=function(a){return this._container.getSubscriberScope(a)};OpenAjax.hub.InlineHubClient.prototype.getParameters=function(){return this._params};if(typeof OpenAjax==="undefined"){OpenAjax={hub:{}}}OpenAjax.hub.IframeContainer=function(a,c,b){if(!a||!c||!b||!b.Container||!b.Container.onSecurityAlert||!b.IframeContainer||!b.IframeContainer.parent||!b.IframeContainer.uri||!b.IframeContainer.tunnelURI){throw new Error(OpenAjax.hub.Error.BadParameters)}this._params=b;this._id=c;if(window.postMessage){this._delegate=new OpenAjax.hub.IframePMContainer(this,a,c,b)}else{this._delegate=new OpenAjax.hub.IframeFIMContainer(this,a,c,b)}this._iframe=this._createIframe(b.IframeContainer.parent,this._delegate.getURI(),b.IframeContainer.iframeAttrs);a.addContainer(this)};OpenAjax.hub.IframeContainer.prototype.getHub=function(){return this._delegate.getHub()};OpenAjax.hub.IframeContainer.prototype.sendToClient=function(b,c,a){this._delegate.sendToClient(b,c,a)};OpenAjax.hub.IframeContainer.prototype.remove=function(){this._delegate.remove();this._iframe.parentNode.removeChild(this._iframe)};OpenAjax.hub.IframeContainer.prototype.isConnected=function(){return this._delegate.isConnected()};OpenAjax.hub.IframeContainer.prototype.getClientID=function(){return this._id};OpenAjax.hub.IframeContainer.prototype.getPartnerOrigin=function(){return this._delegate.getPartnerOrigin()};OpenAjax.hub.IframeContainer.prototype.getParameters=function(){return this._params};OpenAjax.hub.IframeContainer.prototype.getIframe=function(){return this._iframe};OpenAjax.hub.IframeContainer.bind=function(b,c){var a=c;return function(){return a.apply(b,arguments)}};OpenAjax.hub.IframeContainer.prototype._createIframe=function(f,g,b){var d=document.createElement("iframe");if(b){for(var a in b){if(a=="style"){for(var c in b.style){d.style[c]=b.style[c]}}else{d[a]=b[a]}}}d.style.visibility="hidden";d.src='javascript:"<html></html>"';f.appendChild(d);d.src=g;return d};OpenAjax.hub.IframeHubClient=function(a){if(!a||!a.HubClient||!a.HubClient.onSecurityAlert){throw new Error(OpenAjax.hub.Error.BadParameters)}this._params=a;if(window.postMessage){this._delegate=new OpenAjax.hub.IframePMHubClient(this,a)}else{this._delegate=new OpenAjax.hub.IframeFIMHubClient(this,a)}};OpenAjax.hub.IframeHubClient.prototype.connect=function(b,a){a=a||window;if(this.isConnected()){throw new Error(OpenAjax.hub.Error.Duplicate)}this._delegate.connect(b,a)};OpenAjax.hub.IframeHubClient.prototype.disconnect=function(b,a){a=a||window;if(!this.isConnected()){throw new Error(OpenAjax.hub.Error.Disconnected)}this._delegate.disconnect(b,a)};OpenAjax.hub.IframeHubClient.prototype.getPartnerOrigin=function(){return this._delegate.getPartnerOrigin()};OpenAjax.hub.IframeHubClient.prototype.getClientID=function(){return this._delegate.getClientID()};OpenAjax.hub.IframeHubClient.prototype.subscribe=function(a,d,c,f,b){this._assertConn();this._assertSubTopic(a);if(!d){throw new Error(OpenAjax.hub.Error.BadParameters)}c=c||window;return this._delegate.subscribe(a,d,c,f,b)};OpenAjax.hub.IframeHubClient.prototype.publish=function(a,b){this._assertConn();this._assertPubTopic(a);this._delegate.publish(a,b)};OpenAjax.hub.IframeHubClient.prototype.unsubscribe=function(a,c,b){this._assertConn();if(typeof a==="undefined"||a==null){throw new Error(OpenAjax.hub.Error.BadParameters)}b=b||window;this._delegate.unsubscribe(a,c,b)};OpenAjax.hub.IframeHubClient.prototype.isConnected=function(){return this._delegate.isConnected()};OpenAjax.hub.IframeHubClient.prototype.getScope=function(){return this._delegate.getScope()};OpenAjax.hub.IframeHubClient.prototype.getSubscriberData=function(a){this._assertConn();return this._delegate.getSubscriberData(a)};OpenAjax.hub.IframeHubClient.prototype.getSubscriberScope=function(a){this._assertConn();return this._delegate.getSubscriberScope(a)};OpenAjax.hub.IframeHubClient.prototype.getParameters=function(){return this._params};OpenAjax.hub.IframeHubClient.prototype._assertConn=function(){if(!this.isConnected()){throw new Error(OpenAjax.hub.Error.Disconnected)}};OpenAjax.hub.IframeHubClient.prototype._assertSubTopic=function(b){if(!b){throw new Error(OpenAjax.hub.Error.BadParameters)}var f=b.split(".");var a=f.length;for(var c=0;c<a;c++){var d=f[c];if((d=="")||((d.indexOf("*")!=-1)&&(d!="*")&&(d!="**"))){throw new Error(OpenAjax.hub.Error.BadParameters)}if((d=="**")&&(c<a-1)){throw new Error(OpenAjax.hub.Error.BadParameters)}}};OpenAjax.hub.IframeHubClient.prototype._assertPubTopic=function(a){if((a==null)||(a=="")||(a.indexOf("*")!=-1)||(a.indexOf("..")!=-1)||(a.charAt(0)==".")||(a.charAt(a.length-1)==".")){throw new Error(OpenAjax.hub.Error.BadParameters)}};OpenAjax.hub.IframePMContainer=function(a,c,g,f){this._container=a;this._hub=c;this._id=g;this._onSecurityAlert=f.Container.onSecurityAlert;this._onConnect=f.Container.onConnect?f.Container.onConnect:null;this._onDisconnect=f.Container.onDisconnect?f.Container.onDisconnect:null;this._scope=f.Container.scope||window;this._uri=f.IframeContainer.uri;this._tunnelURI=f.IframeContainer.tunnelURI;this._timeout=f.IframeContainer.timeout||15000;if(f.Container.log){var b=this._scope;var d=f.Container.log;this._log=function(k){d.call(b,"IframeContainer::"+g+": "+k)};this._doLog=true}else{this._log=function(){}}this._securityToken=this._generateSecurityToken(f);this._connected=false;this._subs={};if(typeof OpenAjax.hub.IframePMContainer._pmCapabilities==="undefined"){this._testPostMessage()}if(OpenAjax.hub.IframePMContainer._pmCapabilities.indexOf("s")==-1){this._postMessage=function(n,o,k){n.postMessage(o,k)}}else{this._postMessage=function(n,o,k){setTimeout(function(){n.postMessage(o,k)},0)}}if(!OpenAjax.hub.IframePMContainer._pmListener){OpenAjax.hub.IframePMContainer._pmListener=new OpenAjax.hub.IframePMContainer.PMListener()}this._internalID=OpenAjax.hub.IframePMContainer._pmListener.addContainer(this);this._startLoadTimer()};OpenAjax.hub.IframePMContainer.protocolID="openajax-2.0";OpenAjax.hub.IframePMContainer._pmListener=null;OpenAjax.hub.IframePMContainer.prototype.getHub=function(){return this._hub};OpenAjax.hub.IframePMContainer.prototype.sendToClient=function(b,c,a){this._sendMessage("pub",{t:b,d:c,s:a})};OpenAjax.hub.IframePMContainer.prototype.remove=function(){this._disconnect();OpenAjax.hub.IframePMContainer._pmListener.removeContainer(this._internalID);clearTimeout(this._loadTimer)};OpenAjax.hub.IframePMContainer.prototype.isConnected=function(){return this._connected};OpenAjax.hub.IframePMContainer.prototype.getPartnerOrigin=function(){if(this._connected){return this._partnerOriginNoPort}return null};OpenAjax.hub.IframePMContainer.prototype.receiveMessage=function(b,f){if(f.t!=this._securityToken||(typeof this._partnerOrigin!="undefined"&&!OpenAjax.hub.IframePMContainer.originMatches(this,b))){this._invokeSecurityAlert(OpenAjax.hub.SecurityAlert.ForgedMsg);return}if(this._doLog){this._log("received message: ["+b.data+"]")}switch(f.m){case"sub":var a="";try{this._subs[f.p.s]=this._hub.subscribeForClient(this._container,f.p.t,f.p.s)}catch(d){a=d.message}this._sendMessage("sub_ack",{s:f.p.s,e:a});break;case"pub":this._hub.publishForClient(this._container,f.p.t,f.p.d);break;case"uns":var c=this._subs[f.p.s];this._hub.unsubscribeForClient(this._container,c);delete this._subs[f.p.s];this._sendMessage("uns_ack",f.p.s);break;case"dis":this._startLoadTimer();this._disconnect();this._sendMessage("dis_ack",null);if(this._onDisconnect){try{this._onDisconnect.call(this._scope,this._container)}catch(d){OpenAjax.hub._debugger();this._log("caught error from onDisconnect callback to constructor: "+d.message)}}break}};OpenAjax.hub.IframePMContainer.prototype.connect=function(b,a,f){this._log("client connecting to container "+this._id+" :: origin = "+b+" :: securityToken = "+a);if(a!=this._securityToken){this._invokeSecurityAlert(OpenAjax.hub.SecurityAlert.ForgedMsg);return}var c=this;f.onunload=function(){if(c.isConnected()){setTimeout(function(){c._invokeSecurityAlert(OpenAjax.hub.SecurityAlert.FramePhish)},1)}};clearTimeout(this._loadTimer);this._iframe=this._container.getIframe();this._iframe.style.visibility="visible";this._partnerOrigin=b;this._partnerOriginNoPort=new RegExp("^([a-zA-Z]+://[^:]+).*").exec(this._partnerOrigin)[1];if(OpenAjax.hub.IframePMContainer._pmCapabilities.indexOf("d")!=-1){this._partnerDomain=new RegExp("^.+://([^:]+).*").exec(this._partnerOrigin)[1]}this._sendMessage("con_ack",null);this._connected=true;if(this._onConnect){try{this._onConnect.call(this._scope,this._container)}catch(d){OpenAjax.hub._debugger();this._log("caught error from onConnect callback to constructor: "+d.message)}}};OpenAjax.hub.IframePMContainer.prototype.getURI=function(){var a="oahpv="+encodeURIComponent(OpenAjax.hub.IframePMContainer.protocolID)+"&oahi="+encodeURIComponent(this._internalID)+"&oaht="+this._securityToken+"&oahu="+encodeURIComponent(this._tunnelURI)+"&oahpm="+OpenAjax.hub.IframePMContainer._pmCapabilities;if(this._id!==this._internalID){a+="&oahj="+this._internalID}a+=OpenAjax.hub.enableDebug?"&oahd=true":"";var b=this._uri.split("#");b[0]=b[0]+((b[0].indexOf("?")!=-1)?"&":"?")+a;if(b.length==1){return b[0]}return b[0]+"#"+b[1]};OpenAjax.hub.IframePMContainer.originMatches=function(b,a){if(a.origin){return a.origin==b._partnerOrigin}else{return a.domain==b._partnerDomain}};OpenAjax.hub.IframePMContainer.prototype._generateSecurityToken=function(c){if(!OpenAjax.hub.IframePMContainer._prng){var a=new Date().getTime()+Math.random()+document.cookie;OpenAjax.hub.IframePMContainer._prng=smash.crypto.newPRNG(a)}if(c.IframeContainer.seed){try{var f=c.IframeContainer.seed.call(this._scope);OpenAjax.hub.IframePMContainer._prng.addSeed(f)}catch(b){OpenAjax.hub._debugger();this._log("caught error from 'seed' callback: "+b.message)}}var d=c.IframeContainer.tokenLength||6;return OpenAjax.hub.IframePMContainer._prng.nextRandomB64Str(d)};OpenAjax.hub.IframePMContainer.prototype._testPostMessage=function(){OpenAjax.hub.IframePMContainer._pmCapabilities="";var a=false;function b(c){if(c.data=="postmessage.test"){a=true;if(typeof c.origin==="undefined"){OpenAjax.hub.IframePMContainer._pmCapabilities+="d"}}}if(window.addEventListener){window.addEventListener("message",b,false)}else{if(window.attachEvent){window.attachEvent("onmessage",b)}}window.postMessage("postmessage.test","*");if(a){OpenAjax.hub.IframePMContainer._pmCapabilities+="s"}if(window.removeEventListener){window.removeEventListener("message",b,false)}else{window.detachEvent("onmessage",b)}};OpenAjax.hub.IframePMContainer.prototype._startLoadTimer=function(){var a=this;this._loadTimer=setTimeout(function(){OpenAjax.hub.IframePMContainer._pmListener.removeContainer(a._internalID);a._invokeSecurityAlert(OpenAjax.hub.SecurityAlert.LoadTimeout)},this._timeout)};OpenAjax.hub.IframePMContainer.prototype._sendMessage=function(a,b){var c=JSON.stringify({m:a,i:this._internalID,t:this._securityToken,p:b});this._postMessage(this._iframe.contentWindow,c,this._partnerOrigin)};OpenAjax.hub.IframePMContainer.prototype._disconnect=function(){if(this._connected){this._connected=false;this._iframe.style.visibility="hidden";for(var a in this._subs){this._hub.unsubscribeForClient(this._container,this._subs[a])}this._subs={}}};OpenAjax.hub.IframePMContainer.prototype._invokeSecurityAlert=function(a){try{this._onSecurityAlert.call(this._scope,this._container,a)}catch(b){OpenAjax.hub._debugger();this._log("caught error from onSecurityAlert callback to constructor: "+b.message)}};OpenAjax.hub.IframePMContainer.PMListener=function(){this._containers={};if(window.addEventListener){window.addEventListener("message",OpenAjax.hub.IframeContainer.bind(this,this._receiveMessage),false)}else{if(window.attachEvent){window.attachEvent("onmessage",OpenAjax.hub.IframeContainer.bind(this,this._receiveMessage))}}};OpenAjax.hub.IframePMContainer.PMListener.prototype.addContainer=function(a){var b=a._id;while(this._containers[b]){b=((32767*Math.random())|0).toString(16)+"_"+b}this._containers[b]=a;return b};OpenAjax.hub.IframePMContainer.PMListener.prototype.removeContainer=function(a){delete this._containers[a]};OpenAjax.hub.IframePMContainer.PMListener.prototype.connectFromTunnel=function(b,c,a,d){if(this._containers[b]){this._containers[b].connect(c,a,d)}};OpenAjax.hub.IframePMContainer.PMListener.prototype._receiveMessage=function(b){try{var d=JSON.parse(b.data)}catch(c){return}if(!this._verifyMsg(d)){return}if(this._containers[d.i]){var a=this._containers[d.i].receiveMessage(b,d)}};OpenAjax.hub.IframePMContainer.PMListener.prototype._verifyMsg=function(a){return typeof a.m=="string"&&typeof a.i=="string"&&"t" in a&&"p" in a};OpenAjax.hub.IframePMHubClient=function(a,d){this._checkProtocolID();this._client=a;this._onSecurityAlert=d.HubClient.onSecurityAlert;this._scope=d.HubClient.scope||window;this._id=OpenAjax.hub.IframePMHubClient.queryURLParam("oahi");this._internalID=OpenAjax.hub.IframePMHubClient.queryURLParam("oahj")||this._id;this._securityToken=OpenAjax.hub.IframePMHubClient.queryURLParam("oaht");this._tunnelURI=OpenAjax.hub.IframePMHubClient.queryURLParam("oahu");OpenAjax.hub.IframePMContainer._pmCapabilities=OpenAjax.hub.IframePMHubClient.queryURLParam("oahpm");if(!this._id||!this._securityToken||!this._tunnelURI){throw new Error(OpenAjax.hub.Error.WrongProtocol)}if(OpenAjax.hub.IframePMHubClient.queryURLParam("oahd")){OpenAjax.hub.enableDebug=true}this._partnerOrigin=new RegExp("^([a-zA-Z]+://[^/?#]+).*").exec(this._tunnelURI)[1];this._partnerOriginNoPort=new RegExp("^([a-zA-Z]+://[^:]+).*").exec(this._partnerOrigin)[1];if(OpenAjax.hub.IframePMContainer._pmCapabilities.indexOf("d")!=-1){this._partnerDomain=new RegExp("^.+://([^:]+).*").exec(this._partnerOrigin)[1]}if(d.HubClient.log){var f=this._id;var b=this._scope;var c=d.HubClient.log;this._log=function(g){c.call(b,"IframeHubClient::"+f+": "+g)};this._doLog=true}else{this._log=function(){}}this._connected=false;this._subs={};this._subIndex=1;if(OpenAjax.hub.IframePMContainer._pmCapabilities.indexOf("s")==-1){this._postMessage=function(k,n,g){k.postMessage(n,g)}}else{this._postMessage=function(k,n,g){setTimeout(function(){k.postMessage(n,g)},0)}}};OpenAjax.hub.IframePMHubClient.protocolID="openajax-2.0";OpenAjax.hub.IframePMHubClient.prototype.connect=function(d,c){if(d){this._connectOnComplete={cb:d,sc:c}}this._msgListener=OpenAjax.hub.IframeContainer.bind(this,this._receiveMessage);if(window.addEventListener){window.addEventListener("message",this._msgListener,false)}else{if(window.attachEvent){window.attachEvent("onmessage",this._msgListener)}}var a=window.location.protocol+"//"+window.location.host;var b=document.createElement("iframe");document.body.appendChild(b);b.src=this._tunnelURI+(this._tunnelURI.indexOf("?")==-1?"?":"&")+"oahj="+encodeURIComponent(this._internalID)+"&oaht="+this._securityToken+"&oaho="+encodeURIComponent(a);b.style.position="absolute";b.style.left=b.style.top="-10px";b.style.height=b.style.width="1px";b.style.visibility="hidden";this._tunnelIframe=b};OpenAjax.hub.IframePMHubClient.prototype.disconnect=function(b,a){this._connected=false;if(b){this._disconnectOnComplete={cb:b,sc:a}}this._sendMessage("dis",null)};OpenAjax.hub.IframePMHubClient.prototype.getPartnerOrigin=function(){if(this._connected){return new RegExp("^([a-zA-Z]+://[^:]+).*").exec(this._partnerOrigin)[1]}return null};OpenAjax.hub.IframePMHubClient.prototype.getClientID=function(){return this._id};OpenAjax.hub.IframePMHubClient.prototype.subscribe=function(b,f,d,g,c){var a=""+this._subIndex++;this._subs[a]={cb:f,sc:d,d:c,oc:g};this._sendMessage("sub",{t:b,s:a});return a};OpenAjax.hub.IframePMHubClient.prototype.publish=function(a,b){this._sendMessage("pub",{t:a,d:b})};OpenAjax.hub.IframePMHubClient.prototype.unsubscribe=function(a,c,b){if(!this._subs[a]||this._subs[a].uns){throw new Error(OpenAjax.hub.Error.NoSubscription)}this._subs[a].uns={cb:c,sc:b};this._sendMessage("uns",{s:a})};OpenAjax.hub.IframePMHubClient.prototype.isConnected=function(){return this._connected};OpenAjax.hub.IframePMHubClient.prototype.getScope=function(){return this._scope};OpenAjax.hub.IframePMHubClient.prototype.getSubscriberData=function(a){var b=this._subs[a];if(b){return b.d}throw new Error(OpenAjax.hub.Error.NoSubscription)};OpenAjax.hub.IframePMHubClient.prototype.getSubscriberScope=function(a){var b=this._subs[a];if(b){return b.sc}throw new Error(OpenAjax.hub.Error.NoSubscription)};OpenAjax.hub.IframePMHubClient.queryURLParam=function(b){var a=new RegExp("[\\?&]"+b+"=([^&#]*)").exec(window.location.search);if(a){return decodeURIComponent(a[1].replace(/\+/g,"%20"))}return null};OpenAjax.hub.IframePMHubClient.prototype._checkProtocolID=function(){var a=OpenAjax.hub.IframePMHubClient.queryURLParam("oahpv");if(a!=OpenAjax.hub.IframePMHubClient.protocolID){throw new Error(OpenAjax.hub.Error.WrongProtocol)}};OpenAjax.hub.IframePMHubClient.prototype._receiveMessage=function(f){try{var n=JSON.parse(f.data)}catch(k){return}if(!this._verifyMsg(n)){return}if(n.i!=this._internalID){return}else{if(!OpenAjax.hub.IframePMContainer.originMatches(this,f)||n.t!=this._securityToken){try{this._onSecurityAlert.call(this._scope,this._client,OpenAjax.hub.SecurityAlert.ForgedMsg)}catch(k){OpenAjax.hub._debugger();this._log("caught error from onSecurityAlert callback to constructor: "+k.message)}return}}if(this._doLog){this._log("received message: ["+f.data+"]")}switch(n.m){case"sub_ack":var a=n.p.s;var g=this._subs[a].oc;if(g){try{delete this._subs[a].oc;var d=this._subs[a].sc;g.call(d,n.p.s,n.p.e=="",n.p.e)}catch(k){OpenAjax.hub._debugger();this._log("caught error from onComplete callback to HubClient.subscribe(): "+k.message)}}break;case"pub":var a=n.p.s;if(this._subs[a]&&!this._subs[a].uns){var c=this._subs[a].cb;var d=this._subs[a].sc;var b=this._subs[a].d;try{c.call(d,n.p.t,n.p.d,b)}catch(k){OpenAjax.hub._debugger();this._log("caught error from onData callback to HubClient.subscribe(): "+k.message)}}break;case"uns_ack":var a=n.p;if(this._subs[a]){var g=this._subs[a].uns.cb;if(g){try{var d=this._subs[a].uns.sc;g.call(d,a,true)}catch(k){OpenAjax.hub._debugger();this._log("caught error from onComplete callback to HubClient.unsubscribe(): "+k.message)}}delete this._subs[a]}break;case"con_ack":this._connected=true;if(this._connectOnComplete){var g=this._connectOnComplete.cb;var d=this._connectOnComplete.sc;try{g.call(d,this._client,true)}catch(k){OpenAjax.hub._debugger();this._log("caught error from onComplete callback to HubClient.connect(): "+k.message)}delete this._connectOnComplete}break;case"dis_ack":if(window.removeEventListener){window.removeEventListener("message",this._msgListener,false)}else{window.detachEvent("onmessage",this._msgListener)}delete this._msgListener;this._tunnelIframe.parentNode.removeChild(this._tunnelIframe);delete this._tunnelIframe;if(this._disconnectOnComplete){try{var g=this._disconnectOnComplete.cb;var d=this._disconnectOnComplete.sc;g.call(d,this._client,true)}catch(k){OpenAjax.hub._debugger();this._log("caught error from onComplete callback to HubClient.disconnect(): "+k.message)}delete this._disconnectOnComplete}break}};OpenAjax.hub.IframePMHubClient.prototype._verifyMsg=function(a){return typeof a.m=="string"&&"t" in a&&"p" in a};OpenAjax.hub.IframePMHubClient.prototype._sendMessage=function(a,b){var c=JSON.stringify({m:a,i:this._internalID,t:this._securityToken,p:b});this._postMessage(window.parent,c,this._partnerOrigin)};if(typeof OpenAjax==="undefined"){OpenAjax={hub:{}}}OpenAjax.hub.IframeFIMContainer=function(a,c,g,f){this._container=a;this._hub=c;this._onSecurityAlert=f.Container.onSecurityAlert;this._onConnect=f.Container.onConnect?f.Container.onConnect:null;this._onDisconnect=f.Container.onDisconnect?f.Container.onDisconnect:null;this._scope=f.Container.scope||window;this._clientURI=f.IframeContainer.uri;smash.SEComm.tunnelURI=f.IframeContainer.tunnelURI;smash._loadTimeout=f.IframeContainer.timeout||15000;if(f.Container.log){var b=this._scope;var d=f.Container.log;this._log=function(k){d.call(b,"IframeContainer::"+g+": "+k)};this._doLog=true}else{this._log=function(){}}smash._createPRNG(this,f);smash._ensureSingletonManager();this._internalID=smash._singletonManager.generateUniqueClientName(g)};OpenAjax.hub.IframeFIMContainer.prototype.getHub=function(){return this._hub};OpenAjax.hub.IframeFIMContainer.prototype.sendToClient=function(b,c,a){smash._singletonManager.sendToClient(this._internalID,b,c,[a])};OpenAjax.hub.IframeFIMContainer.prototype.remove=function(){return smash._singletonManager.prepareForUnload(this._internalID)};OpenAjax.hub.IframeFIMContainer.prototype.isConnected=function(){return smash._singletonManager.isConnected(this._internalID)};OpenAjax.hub.IframeFIMContainer.prototype.getPartnerOrigin=function(){return smash._singletonManager.getPartnerOrigin(this._internalID)};OpenAjax.hub.IframeFIMContainer.prototype.getURI=function(){var c=this;function b(k,d){var f=null;switch(d){case smash.SecurityErrors.INVALID_TOKEN:case smash.SecurityErrors.TOKEN_VERIFICATION_FAILED:f=OpenAjax.hub.SecurityAlert.ForgedMsg;break;case smash.SecurityErrors.TUNNEL_UNLOAD:f=OpenAjax.hub.SecurityAlert.FramePhish;break;case smash.SecurityErrors.COMPONENT_LOAD:f=OpenAjax.hub.SecurityAlert.LoadTimeout;break}try{c._onSecurityAlert.call(c._scope,c._container,f)}catch(g){OpenAjax.hub._debugger();c._log("caught error from onSecurityAlert callback to constructor: "+g.message)}}var a=smash._singletonManager.prepareForLoad({clientName:this._internalID,uri:this._clientURI,commErrorCallback:b,oaaContainer:this,log:this._log});if(a&&OpenAjax.hub.enableDebug){a+=":debug"}return a};OpenAjax.hub.IframeFIMHubClient=function(d,f){var k=new RegExp("[\\?&]oahm=([^&#]*)").exec(window.location.search);if(!k){throw new Error(OpenAjax.hub.Error.WrongProtocol)}k=k[1];var n=k.split(":",1);if(n[0]!=smash._protocolID){throw new Error(OpenAjax.hub.Error.WrongProtocol)}k=k.substring(n[0].length+1);var b=window.location.href+"#"+k;window.location.replace(b);this._client=d;this._onSecurityAlert=f.HubClient.onSecurityAlert;this._scope=f.HubClient.scope||window;var q=new RegExp("\\d{3}.{"+smash._securityTokenLength+"}.{"+smash._securityTokenLength+"}\\d{3}(.*)");var o=q.exec(k)[1];var g=o.split(":");var r=decodeURIComponent(g[0]);this._id=r.substring(r.indexOf("_")+1);if(g[2]&&g[2]=="debug"){OpenAjax.hub.enableDebug=true}if(f.HubClient.log){var c=this._id;var p=this._scope;var a=f.HubClient.log;this._log=function(s){a.call(p,"IframeHubClient::"+c+": "+s)};this._doLog=true}else{this._log=function(){}}this._connected=false;this._subs={};this._subIndex=1;smash._createPRNG(this,f)};OpenAjax.hub.IframeFIMHubClient.prototype.connect=function(d,b){if(smash._singletonClientHub==null){smash._singletonClientHub=new smash.SEHubClient(null,this._log);var c=this;smash._singletonClientHub.setSecurityErrorCallback(function(f){if(f!=smash.SecurityErrors.INVALID_TOKEN){c._log("unknown smash security error: "+f)}try{c._onSecurityAlert.call(c._scope,c._client,OpenAjax.hub.SecurityAlert.ForgedMsg)}catch(g){OpenAjax.hub._debugger();c._log("caught error from onSecurityAlert callback to constructor: "+g.message)}})}var c=this;function a(g,k){if(g){c._connected=true}if(d){try{d.call(b,c._client,g)}catch(f){OpenAjax.hub._debugger();c._log("caught error from onComplete callback to HubClient.connect(): "+f.message)}}}smash._singletonClientHub.connect(a)};OpenAjax.hub.IframeFIMHubClient.prototype.disconnect=function(d,b){this._connected=false;var c=this;function a(g,k){if(d){try{d.call(b,c._client,g)}catch(f){OpenAjax.hub._debugger();c._log("caught error from onComplete callback to HubClient.disconnect(): "+f.message)}}}smash._singletonClientHub.disconnect(a)};OpenAjax.hub.IframeFIMHubClient.prototype.getPartnerOrigin=function(){return smash._singletonClientHub?smash._singletonClientHub.getPartnerOrigin():null};OpenAjax.hub.IframeFIMHubClient.prototype.getClientID=function(){return this._id};OpenAjax.hub.IframeFIMHubClient.prototype.subscribe=function(f,b,o,a,d){var c=""+this._subIndex++;var k=this;var n=!a?null:function(s,q,p){try{a.call(o,c,s,p)}catch(r){OpenAjax.hub._debugger();k._log("caught error from onComplete callback to HubClient.subscribe(): "+r.message)}};function g(q,p,r){try{b.call(o,p,r,d)}catch(s){OpenAjax.hub._debugger();k._log("caught error from onData callback to HubClient.subscribe(): "+s.message)}}this._subs[c]=smash._singletonClientHub.subscribe(f,n,g,o,d);return c};OpenAjax.hub.IframeFIMHubClient.prototype.publish=function(a,b){smash._singletonClientHub.publish(a,b)};OpenAjax.hub.IframeFIMHubClient.prototype.unsubscribe=function(b,f,c){if(!this._subs[b]){throw new Error(OpenAjax.hub.Error.NoSubscription)}var d=this;function a(n,g){delete d._subs[b];if(f){try{f.call(c,b,n)}catch(k){OpenAjax.hub._debugger();d._log("caught error from onComplete callback to HubClient.unsubscribe(): "+k.message)}}}this._subs[b].unsubscribe(a)};OpenAjax.hub.IframeFIMHubClient.prototype.isConnected=function(){return this._connected};OpenAjax.hub.IframeFIMHubClient.prototype.getScope=function(){return this._scope};OpenAjax.hub.IframeFIMHubClient.prototype.getSubscriberData=function(a){var b=this._subs[a];if(b){return b.getSubscriberData()}throw new Error(OpenAjax.hub.Error.NoSubscription)};OpenAjax.hub.IframeFIMHubClient.prototype.getSubscriberScope=function(a){var b=this._subs[a];if(b){return b.getSubscriberScope()}throw new Error(OpenAjax.hub.Error.NoSubscription)};if(typeof(smash)=="undefined"){var smash={}}smash._singletonManager=undefined;smash._singletonClientHub=undefined;smash._protocolID="openajax-2.0";smash._prng=undefined;smash._securityTokenLength=6;smash._securityTokenOverhead=null;smash._computeOtherTokenConstants=function(){smash._securityTokenOverhead=2*smash._securityTokenLength;smash._multiplier=Math.pow(10,smash._securityTokenLength-1)};smash._computeOtherTokenConstants();smash._createPRNG=function(b,f){if(!smash._prng){var a=new Date().getTime()+Math.random()+document.cookie;smash._prng=smash.crypto.newPRNG(a)}var d=f.IframeContainer||f.IframeHubClient;if(d&&d.seed){try{var g=d.seed.call(b._scope);smash._prng.addSeed(g)}catch(c){OpenAjax.hub._debugger();b._log("caught error from 'seed' callback: "+c.message)}}};smash._keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";smash._generateSecurityToken=function(){var f;if(smash._prng){f=smash._prng.nextRandomB64Str(smash._securityTokenLength)}else{var b=Math.random();f="";for(var d=0;d<smash._securityTokenLength;d++){var a=b*64;var g=Math.floor(a);b=(a-g);f=f+smash._keyStr.charAt(g)}}return f};smash._ensureSingletonManager=function(){if(smash._singletonManager==null){smash._singletonManager=new smash.SEHub()}};smash.SEHub=function(){var c=this;this.componentInfo=[];this._subs=[];function a(d,f){this.uri=d;this.connected=false;this.errorCallback=f}this.generateUniqueClientName=function(d){do{d=((32767*Math.random())|0).toString(16)+"_"+d}while(c.componentInfo[d]);return d};function b(k,g){var f=c.componentInfo[g];if(f!=null){var d=f.errorCallback;if(d!=null){d(g,k)}}}this.prepareForLoad=function(g){var d=g.clientName;var f=g.uri;if((d==null)||(f==null)){return null}if(c.componentInfo[d]!=null){return null}c.componentInfo[d]=new a(f,g.commErrorCallback);c.componentInfo[d].seComm=new smash.SEComm();c.componentInfo[d].seComm.setSecurityListener(b);c.componentInfo[d].oaaContainer=g.oaaContainer;return c.componentInfo[d].seComm.prepareForLoad(d,f,c,smash._loadTimeout,g.log)};this.prepareForUnload=function(d){if(!c.componentInfo[d]){return true}c._disconnect(d);c.componentInfo[d].seComm.prepareForUnload();delete c.componentInfo[d];return true};this.isConnected=function(d){if(c.componentInfo[d]&&c.componentInfo[d].connected){return true}return false};this.sendToClient=function(k,d,n,g){if(c.isConnected(k)){var f=c.componentInfo[k].seComm;if(f){f.distribute(d,g,n)}}};this.componentLoaded=function(g,f){if(c.componentInfo[g]){c.componentInfo[g].connected=true;c.componentInfo[g].partnerOrigin=new RegExp("^([a-zA-Z]+://[^:/?#]+).*").exec(f)[1];var d=c.componentInfo[g].oaaContainer;d._container.getIframe().style.visibility="visible";if(d._onConnect){try{d._onConnect.call(d._scope,d._container)}catch(k){OpenAjax.hub._debugger();d._log("caught error from onConnect callback to constructor: "+k.message)}}}};this.publishInternal=function(g,f,k){if(c.componentInfo[g]){var d=c.componentInfo[g].oaaContainer;d._hub.publishForClient(d._container,f,k)}};this.subscribeInternal=function(k,g,f){var d=c.componentInfo[k].oaaContainer;c._subs[g]=d._hub.subscribeForClient(d._container,f,g)};this.unsubscribeInternal=function(g,f){try{var k=c._subs[f];var d=c.componentInfo[g].oaaContainer;d._hub.unsubscribeForClient(d._container,k);return true}catch(n){}return false};this.disconnect=function(f){c._disconnect(f);var d=c.componentInfo[f].oaaContainer;if(d._onDisconnect){try{d._onDisconnect.call(d._scope,d._container)}catch(g){OpenAjax.hub._debugger();d._log("caught error from onDisconnect callback to constructor: "+g.message)}}};this._disconnect=function(f){if(c.componentInfo[f].connected){c.componentInfo[f].connected=false;var d=c.componentInfo[f].oaaContainer;d._container.getIframe().style.visibility="hidden";for(var g in c._subs){d._hub.unsubscribeForClient(d._container,c._subs[g])}c._subs=[]}};this.getPartnerOrigin=function(d){if(c.componentInfo[d].connected){return c.componentInfo[d].partnerOrigin}return null}};smash.SEHubClient=function(g,a){this.equals=function(t){return k===t};this.isConnected=function(){return f};this.getClientName=function(){return g};this.connect=function(t){n=function(u){if(u){f=true}t(u,k)};r.connect(n)};this.disconnect=function(t){b=function(u){if(u){f=false;q=[]}t(u,k)};r.disconnect();return};this.subscribe=function(u,z,y,w,v){var t=(d+"");d++;q[t]=new p(t,u,z,y,k,w,v);r.subscribe(t,u);return q[t]};this.publish=function(t,u){r.publish(t,u);return true};function p(t,z,B,E,C,D,y){var w=false;var v=y;var u=D;var A=this;this.getTopic=function(){return z};this.getConnHandle=function(){return C};this.equals=function(F){if((F._getSubId!=null)&&(typeof F._getSubId=="function")&&(F.getConnHandle!=null)&&(typeof F.getConnHandle=="function")){if((t===F._getSubId())&&(C===F.getConnHandle())){return true}}return false};this.isSubscribed=function(){return w};this.unsubscribe=function(F){return C._unsubscribe(A,F)};this.getSubscriberData=function(){return v};this.getSubscriberScope=function(){return u};this._getSubId=function(){return t};this._setIsSubscribed=function(F){w=F};this._getCallback=function(){return B};this._getEventCallback=function(){return E}}this.getPartnerOrigin=function(){if(f&&r!=null){var t=r.getParsedTunnelUrl();if(t!=null){return t.scheme+"://"+t.host}}return null};this.setSecurityErrorCallback=function(t){c=t};this._unsubscribe=function(u,v){var t=u._getSubId();if(!q[t]){throw new Error(OpenAjax.hub.Error.NoSubscription)}q[t]=undefined;r.unsubscribe(t);if(v!=null){v(true,u)}return u};var c=undefined;var d=0;var q=[];var r=new smash.SECommClient(g,a);var f=false;var k=this;var n=null;var b=null;function o(z){if(!f&&z.type!=smash.SECommMessage.CONNECT_ACK){return}switch(z.type){case smash.SECommMessage.DISTRIBUTE:if((z.additionalHeader!=null)&&(z.additionalHeader.s!=null)){var w=z.additionalHeader.s;for(var v=0;v<w.length;v++){var u=w[v];if((u!=null)&&(q[u]!=null)){var A=q[u]._getEventCallback();if(A!=null){A(q[u],z.topic,z.payload)}}}}break;case smash.SECommMessage.SUBSCRIBE_ACK:if(z.additionalHeader!=null){var u=z.additionalHeader.subId;var t=z.additionalHeader.isOk;var y=z.additionalHeader.err;if((u!=null)&&(t!=null)){if(q[u]!=null){var B=q[u]._getCallback();if(t){q[u]._setIsSubscribed(true);if(B!=null){B(true,q[u])}}else{if(B!=null){B(false,q[u],y)}q[u]=undefined}}}}break;case smash.SECommMessage.CONNECT_ACK:n(true);break;case smash.SECommMessage.DISCONNECT_ACK:b(true);break}}function s(t){if(c!=null){c(t)}else{throw new Error(errorString)}}r.handleIncomingMessage=o;r.setSecurityListener(s)};smash.SecurityErrors={INVALID_TOKEN:0,TOKEN_VERIFICATION_FAILED:1,TUNNEL_UNLOAD:2,COMPONENT_LOAD:3};smash.SECommMessage=function(){this.type=null;this.topic=null;this.additionalHeader=null;this.payload=null;var a="y";var c="t";var d="h";var b="p";this.serialize=function(){var o=a+"="+this.type;if(this.topic!=null){var g=encodeURIComponent(this.topic);var p="&"+c+"="+g;o+=p}if(this.additionalHeader!=null){var n=encodeURIComponent(JSON.stringify(this.additionalHeader));var q="&"+d+"="+n;o+=q}if(this.payload!=null){var f=encodeURIComponent(this.payload);var k="&"+b+"="+f;o+=k}return o};this.deserialize=function(o){var g=o.split("&");for(var n=0;n<g.length;n++){var f=g[n].split("=");switch(f[0]){case a:this.type=f[1];break;case c:this.topic=decodeURIComponent(f[1]);break;case d:var k=decodeURIComponent(f[1]);this.additionalHeader=JSON.parse(k);break;case b:this.payload=decodeURIComponent(f[1]);break}}}};smash.SECommMessage.CONNECT="con";smash.SECommMessage.CONNECT_ACK="cac";smash.SECommMessage.DISCONNECT="xcon";smash.SECommMessage.DISCONNECT_ACK="xac";smash.SECommMessage.PUBLISH="pub";smash.SECommMessage.DISTRIBUTE="dis";smash.SECommMessage.SUBSCRIBE="sub";smash.SECommMessage.UNSUBSCRIBE="uns";smash.SECommMessage.SUBSCRIBE_ACK="sac";smash.SECommMessage.ERROR="err";smash.SECommErrors={};smash.SECommErrors.tunnelNotSetError=new Error("The tunnel URI was not set. Please set the tunnel URI.");smash.SEComm=function(){var C=1;var o=null;var w=0;var b=null;var r=null;var z=null;var t=null;var q=null;var a=[];var y=null;var k=null;var p=null;var A=null;var d=null;var n=this;var f=false;var B=null;this.setSecurityListener=function(E){d=E};function u(E,G){var F=E.split("?");if(F.length>1){return F[0]+"?"+G+"&"+F[1]}F=E.split("#");if(F.length>1){return F[0]+"?"+G+F[1]}return E+"?"+G}this.prepareForLoad=function(G,I,F,E,H){B=H;this.log("Parent connecting to : "+G);k=F;q=G;w=E;if(smash.SEComm.tunnelURI==null){throw smash.SECommErrors.tunnelNotSetError}A=smash._generateSecurityToken();r=u(I,"oahm="+smash._protocolID+":100"+A+A+"000"+encodeURIComponent(G)+":"+encodeURIComponent(smash.SEComm.tunnelURI));smash.SEComm.instances[G]=n;o=setInterval(D,w);return r};function D(){clearInterval(o);o=null;if(!z){n.handleSecurityError(smash.SecurityErrors.COMPONENT_LOAD)}}function s(){clearInterval(b);n.handleSecurityError(smash.SecurityErrors.COMPONENT_LOAD)}this.getScope=function(){return this};this.getCallback=function(){return"messageReceived"};this.initializationFinished=function(F,E,H,G,I){this.log("Tunnel commLib initialization finished. Processing outgoing queue. Security token: "+E);if(A!=E){n.handleSecurityError(smash.SecurityErrors.TOKEN_VERIFICATION_FAILED);return false}else{z=F;f=true;this.log("Token verified.");I.onunload=v;k.componentLoaded(q,H);while(a.length>0){z.send(a.shift())}return true}};this.prepareForUnload=function(){if(o!=null){clearInterval(o);o=null}};function c(F,E){return function(){d(F,E)}}this.handleSecurityError=function(E){if(E==smash.SecurityErrors.COMPONENT_LOAD){this.initializationFinished=function(){return false}}if(d==null){throw new Error(E)}else{d(E,q)}return};function v(){if(d==null){setTimeout("throw tunnelUnloadError;",C)}else{setTimeout(c(smash.SecurityErrors.TUNNEL_UNLOAD,q),C)}}this.messageReceived=function(G){var K=new smash.SECommMessage();K.deserialize(G);switch(K.type){case smash.SECommMessage.PUBLISH:if(K.additionalHeader!=null){var I=K.payload;if(K.additionalHeader.f=="J"){I=JSON.parse(K.payload)}k.publishInternal(q,K.topic,I)}break;case smash.SECommMessage.SUBSCRIBE:if(K.additionalHeader!=null){var E=true;var F="";try{k.subscribeInternal(q,K.additionalHeader.subId,K.topic)}catch(H){E=false;F=H.message}var J=new smash.SECommMessage();J.type=smash.SECommMessage.SUBSCRIBE_ACK;J.additionalHeader={subId:K.additionalHeader.subId,isOk:E,err:F};g(J.serialize())}break;case smash.SECommMessage.UNSUBSCRIBE:if(K.additionalHeader!=null){k.unsubscribeInternal(q,K.additionalHeader.subId)}break;case smash.SECommMessage.CONNECT:clearInterval(b);k.componentLoaded(q,K.payload);var K=new smash.SECommMessage();K.type=smash.SECommMessage.CONNECT_ACK;g(K.serialize());break;case smash.SECommMessage.DISCONNECT:k.disconnect(q);b=setInterval(s,w);var K=new smash.SECommMessage();K.type=smash.SECommMessage.DISCONNECT_ACK;g(K.serialize());break}};this.distribute=function(E,F,G){var H=new smash.SECommMessage();H.type=smash.SECommMessage.DISTRIBUTE;H.topic=E;H.additionalHeader={s:F};if((typeof G)=="string"){H.additionalHeader.f="S";H.payload=G}else{H.additionalHeader.f="J";H.payload=JSON.stringify(G)}g(H.serialize())};function g(E){if(f==false){a.push(E)}else{z.send(E)}}this.log=function(E){B(E)}};smash.SEComm.instances=[];smash.SECommClient=function(k,a){var d=[];d.child=this;var p=new smash.CommLib(true,d,k);var n=this;var c=[];var f=false;var o=null;var t={f:"J"};var b={f:"S"};var r=null;this.publish=function(u,v){var w=new smash.SECommMessage();w.type=smash.SECommMessage.PUBLISH;w.topic=u;if((typeof v)=="string"){w.additionalHeader=b;w.payload=v}else{w.additionalHeader=t;w.payload=JSON.stringify(v)}g(w.serialize())};this.subscribe=function(v,u){var w=new smash.SECommMessage();w.type=smash.SECommMessage.SUBSCRIBE;w.topic=u;w.additionalHeader={subId:v};g(w.serialize())};this.connect=function(v){if(f){var u=new smash.SECommMessage();u.type=smash.SECommMessage.CONNECT;u.payload=window.location.href.split("#")[0];g(u.serialize());return}connectCallback=v};this.disconnect=function(){var u=new smash.SECommMessage();u.type=smash.SECommMessage.DISCONNECT;g(u.serialize())};this.initializationFinished=function(u){this.log("Initialization finished. Processing outgoing queue.");r=new q(u);f=true;connectCallback(true);while(c.length>0){p.send(c.shift())}};this.getParsedTunnelUrl=function(){return r};var s=new RegExp("^((http|https):)?(//([^/?#:]*))?(:([0-9]*))?([^?#]*)(\\?([^#]*))?");function q(v){var u=v.match(s);this.scheme=(u[2]=="")?null:u[2];this.host=(u[4]=="")?null:u[4];this.port=(u[6]=="")?null:u[6];this.path=(u[7]=="")?null:u[7];this.query=(u[8]=="")?null:u[8]}this.unsubscribe=function(u){var v=new smash.SECommMessage();v.type=smash.SECommMessage.UNSUBSCRIBE;v.additionalHeader={subId:u};g(v.serialize())};function g(u){if(f==false){c.push(u)}else{p.send(u)}}this.messageReceived=function(u){var v=new smash.SECommMessage();v.deserialize(u);if(v.type==smash.SECommMessage.DISTRIBUTE){var w=v.additionalHeader;if((w!=null)&&(w.f=="J")){v.payload=JSON.parse(v.payload)}}n.handleIncomingMessage(v)};this.handleSecurityError=function(u){if(o==null){throw new Error(u)}else{o(u,k)}return};this.setSecurityListener=function(u){o=u};this.handleIncomingMessage=function(u){alert("SECommClient\n\nTopic: "+u.topic+"\n\nPayload: "+u.payload)};this.log=function(u){a(u)}};smash.CommLib=function(q,C,t){var u="1";var P="2";var H="3";var Q="4";var K=this;var o=100;var y=4000;var z=6;var w=0;var a=null;var n=null;var F=null;var L=null;var k=null;var v=null;var W=null;var r=[];var J=0;var D="";var g=null;var p=null;var O=null;var R=null;var c=[];this.send=function(ab){if(v==null){s("Trying to send without proper initialization. Message will be discarded. "+ab);return}s("Sending: "+ab);var ac=ab;var Z=y-z-smash._securityTokenOverhead-v.length;var aa=ac;while(aa.length>0){var Y=aa.substr(0,Z);aa=aa.substr(Z);if(aa==0){r.push({type:Q,payload:Y})}else{r.push({type:H,payload:Y})}}};function d(){if(A()){if(B()){if(b()){N()}}}if(X()){f()}}function X(){if(k.type==P){return true}if((k.msn==n.ackMsn)&&(n.ack==1)){return true}s("Waiting for ACK : "+k.msn);return false}function T(){J++;if(J==100){J=0}if(J<10){return"0"+J}return""+J}function A(){var Z=window.location.href.split("#");if(Z.length==2){var Y=Z[1];if(Y!=""&&Y!=a){a=Y;return true}}return false}function B(){var aa=a.substr(0,1);var Z=a.substr(1,2);var ab=3;var ae=a.substr(ab,smash._securityTokenLength);ab+=smash._securityTokenLength;var ad=a.substr(ab,smash._securityTokenLength);ab+=smash._securityTokenLength;var af=a.substr(ab,1);ab+=1;var Y=a.substr(ab,2);ab+=2;var ac=a.substr(ab);s("In : Type: "+aa+" msn: "+Z+" tokenParent: "+ae+" tokenChild: "+ad+" ack: "+af+" msn: "+Y+" payload: "+ac);n={type:aa,msn:Z,tokenParent:ae,tokenChild:ad,ack:af,ackMsn:Y,payload:ac};return true}function b(){if(n.type!=u&&(n.tokenParent!=p||n.tokenChild!=O)){s("Security token error: Invalid security token received. The message will be discarded.");V(smash.SecurityErrors.INVALID_TOKEN);return false}return true}function N(){w=1;if(n.type!=u&&q&&k.type==u&&n.ack=="1"&&k.msn==n.ackMsn){R.initializationFinished(v)}switch(n.type){case u:E();break;case P:G();break;case H:U();break;case Q:I();break}F=n}function E(){var ae=n.payload.split(":");var Z=decodeURIComponent(ae[0]);v=decodeURIComponent(ae[1]);p=n.tokenParent;O=n.tokenChild;if(q){if(t!=null){Z=t}O=smash._generateSecurityToken();var ab="3827816c-f3b1-11db-8314-0800200c9a66";var aa=document.createElement("iframe");var ad=encodeURIComponent(window.location.href.split("#")[0]);var ac=ad;var Y=encodeURIComponent(Z)+":"+ad+":"+ac;v+=(v.indexOf("?")!=-1?"&":"?")+"oahm=100"+p+O+"100"+Y;aa.src=v;aa.name=ab;aa.id=ab;document.body.appendChild(aa);aa.style.position="absolute";aa.style.left=aa.style.top="-10px";aa.style.height=aa.style.width="1px";aa.style.visibility="hidden";w=0;W=window.frames[ab];k={type:u,msn:"00",tokenParent:p,tokenChild:O,ack:"0",ackMsn:"00",payload:Y};R=C.child}else{var ac=decodeURIComponent(ae[2]);W=window.parent;R=C[Z];var af=R.initializationFinished(K,p,v,ac,window);if(!af){w=0}k={type:u,msn:"00",tokenParent:p,tokenChild:O,ack:"0",ackMsn:"00",payload:(encodeURIComponent(Z)+":"+encodeURIComponent(window.location.href.split("#")[0]))}}if(W==null){s("Init failed.")}}function G(){w=0}function U(){D+=n.payload}function I(){D+=n.payload;s("Received: "+D);R.messageReceived(D);D=""}function f(){if(r.length==0&&w==1){r.push({type:P,payload:""})}if(r.length!=0){L=r.shift();L.tokenParent=p;L.tokenChild=O;L.msn=T();L.ack="1";L.ackMsn=F.msn;w=0;S()}}function S(){var Y=v+"#"+L.type+L.msn+L.tokenParent+L.tokenChild+L.ack+L.ackMsn+L.payload;W.location.replace(Y);k=L;s("Out: Type: "+L.type+" msn: "+L.msn+" tokenParent: "+L.tokenParent+" tokenChild: "+L.tokenChild+" ack: "+L.ack+" msn: "+L.ackMsn+" payload: "+L.payload)}function V(Y){clearInterval(g);R.handleSecurityError(Y)}function s(Y){if(R){while(c.length>0){R.log(c.shift())}R.log(Y)}else{c.push(Y)}}g=setInterval(d,o)};if(typeof(smash)=="undefined"){var smash={}}smash.crypto={strToWA:function(d,f){var c=Array();var a=(1<<f)-1;for(var b=0;b<d.length*f;b+=f){c[b>>5]|=(d.charCodeAt(b/f)&a)<<(32-f-b%32)}return c},hmac_sha1:function(d,k,g){var a=Array(16),c=Array(16);for(var b=0;b<16;b++){a[b]=d[b]^909522486;c[b]=d[b]^1549556828}var f=this.sha1(a.concat(this.strToWA(k,g)),512+k.length*g);return this.sha1(c.concat(f),512+160)},newPRNG:function(a){that=this;if((typeof a!="string")||(a.length<12)){alert("WARNING: Seed length too short ...")}var c=[43417,15926,18182,33130,9585,30800,49772,40144,47678,55453,4659,38181,65340,6787,54417,65301];var b=[];var f=0;function g(k){return that.hmac_sha1(c,k,8)}function d(k){var o=g(k);for(var n=0;n<5;n++){b[n]^=o[n]}}d(a);return{addSeed:function(k){d(k)},nextRandomOctets:function(k){var n=[];while(k>0){f+=1;var o=that.hmac_sha1(b,(f).toString(16),8);for(i=0;(i<20)&(k>0);i++,k--){n.push((o[i>>2]>>(i%4))%256)}}return n},nextRandomB64Str:function(k){var q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";var p=this.nextRandomOctets(k);var n="";for(var o=0;o<k;o++){n+=q.charAt(p[o]&63)}return n}}},sha1:function(){var d=function(f,n){var k=(f&65535)+(n&65535);var g=(f>>16)+(n>>16)+(k>>16);return(g<<16)|(k&65535)};var c=function(f,g){return(f<<g)|(f>>>(32-g))};function b(g,f,n,k){if(g<20){return(f&n)|((~f)&k)}if(g<40){return f^n^k}if(g<60){return(f&n)|(f&k)|(n&k)}return f^n^k}function a(f){return(f<20)?1518500249:(f<40)?1859775393:(f<60)?-1894007588:-899497514}return function(A,g){A[g>>5]|=128<<(24-g%32);A[((g+64>>9)<<4)+15]=g;var f=Array(80);var z=1732584193;var y=-271733879;var w=-1732584194;var u=271733878;var s=-1009589776;for(var o=0;o<A.length;o+=16){var v=z;var t=y;var r=w;var q=u;var p=s;for(var n=0;n<80;n++){f[n]=((n<16)?A[o+n]:c(f[n-3]^f[n-8]^f[n-14]^f[n-16],1));var k=d(d(c(v,5),b(n,t,r,q)),d(d(p,f[n]),a(n)));p=q;q=r;r=c(t,30);t=v;v=k}z=d(v,z);y=d(t,y);w=d(r,w);u=d(q,u);s=d(p,s)}return Array(z,y,w,u,s)}}()};if(!this.JSON){JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){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=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}})();if(!window.PageBus){window.PageBus={}}PageBus._debug=function(){};PageBus._esc=function(a){return a.replace(/\./g,"!")};PageBus._assertPubTopic=function(a){if((a==null)||(a=="")||(a.indexOf("*")!=-1)||(a.indexOf("..")!=-1)||(a.charAt(0)==".")||(a.charAt(a.length-1)==".")){throw new Error(OpenAjax.hub.Error.BadParameters)}};PageBus._assertSubTopic=function(b){if((b==null)||(b=="")){throw new Error(OpenAjax.hub.Error.BadParameters)}var f=b.split(".");var a=f.length;for(var c=0;c<a;c++){var d=f[c];if((d=="")||((d.indexOf("*")!=-1)&&(d!="*")&&(d!="**"))){throw new Error(OpenAjax.hub.Error.BadParameters)}if((d=="**")&&(c<a-1)){throw new Error(OpenAjax.hub.Error.BadParameters)}}};PageBus._copy=function(d){var f;if(typeof(d)=="object"){if(d==null){return null}else{if(d.constructor==Array){f=[];for(var a=0;a<d.length;a++){f[a]=PageBus._copy(d[a])}return f}else{if(d.constructor==Date){f=new Date();f.setDate(d.getDate());return f}}}f={};for(var b in d){f[b]=PageBus._copy(d[b])}return f}else{return d}};PageBus._TopicMatcher=function(){this._items={}};PageBus._TopicMatcher.prototype.store=function(b,d){var c=b.split(".");var a=c.length;_recurse=function(f,g){if(g==a){f["."]={topic:b,value:d}}else{var k=c[g];if(!f[k]){f[k]={}}_recurse(f[k],g+1)}};_recurse(this._items,0)};PageBus._TopicMatcher.prototype.match=function(b,d){var f=b.split(".");var a=f.length;var c=[];_recurse=function(g,k){if(!g){return}var n;if(k==a){n=g}else{_recurse(g[f[k]],k+1);if(d){return}if(f[k]!="**"){_recurse(g["*"],k+1)}n=g["**"]}if((!n)||(!n["."])){return}c.push(n["."])};_recurse(this._items,0);return c};PageBus._TopicMatcher.prototype.exists=function(b,d){var f=b.split(".");var a=f.length;var c=false;_recurse=function(g,k){if(!g){return}var n;if(k==a){n=g}else{_recurse(g[f[k]],k+1);if(c||d){return}if(f[k]!="**"){_recurse(g["*"],k+1);if(c){return}}n=g["**"]}if((!n)||(!n["."])){return}c=true};_recurse(this._items,0);return c};PageBus._TopicMatcher.prototype.clear=function(b){var c=b.split(".");var a=c.length;_recurse=function(f,g){if(!f){return}if(g==a){if(f["."]){delete f["."]}}else{_recurse(f[c[g]],g+1);for(var d in f[c[g]]){return}delete f[c[g]]}};_recurse(this._items,0)};PageBus._TopicMatcher.prototype.wildcardClear=function(b){var c=b.split(".");var a=c.length;_clean=function(f,d){for(m in f[d]){return}delete f[d]};_recurse=function(d,g){if(!d){return}if(g==a){if(d["."]){delete d["."]}return}else{var f=c[g];var k;if(d[f]){_recurse(d[f],g+1);_clean(d,f)}if(f=="*"){for(k in d){if((k!="**")&&(k!=".")){_recurse(d[k],g+1);_clean(d,k)}}}else{if(f=="**"){for(k in d){delete d[k]}}}}return};_recurse(this._items,0)};PageBus._TopicMatcher.prototype.wildcardMatch=function(b){var d=b.split(".");var a=d.length;var c=[];_recurse=function(f,k){var g=d[k];var o;if((!f)||(k==a)){return}if(g=="**"){for(var p in f){if(p!="."){o=f[p];if(o["."]){c.push(o["."])}_recurse(o,k)}}}else{if(g=="*"){for(var p in f){if((p!=".")&&(p!="**")){o=f[p];if(k==a-1){if(o["."]){c.push(o["."])}}else{_recurse(o,k+1)}}}}else{o=f[g];if(!o){return}if(k==a-1){if(o["."]){c.push(o["."])}}else{_recurse(o,k+1)}}}};_recurse(this._items,0);return c};PageBus.policy={Ops:{Publish:"p",Subscribe:"s"},Error:{BadParameters:"PageBus.policy.Error.BadParameters"},_assertName:function(b){if((b==null)||(b=="")){throw new Error(OpenAjax.hub.Error.BadParameters)}if(PageBus.policy._tops[b]){return}var f=b.split(".");var a=f.length;for(var c=0;c<a;c++){var d=f[c];if((d=="")||((d.indexOf("*")!=-1)&&(d!="*")&&(d!="**"))){throw new Error(PageBus.policy.Error.BadParameters)}if((d=="**")&&(c<a-1)){throw new Error(PageBus.policy.Error.BadParameters)}}PageBus.policy._tops[b]=true},_tops:{}};PageBus.policy.HubPolicy=function(a){if(!a){a={}}this._cfg=a;this._log=a.log;this._topicMgr=new PageBus._TopicMatcher()};PageBus.policy.HubPolicy.prototype.onPublish=function(f,k,d,n){var g=true;var c;if(n!=null){c=n.getPartnerOrigin();if(!c){return false}g=this.isAllowed.call(this,c,PageBus.policy.Ops.Subscribe,f)}if(g&&(d!=null)){c=d.getPartnerOrigin();if(!c){return false}g=this.isAllowed.call(this,c,PageBus.policy.Ops.Publish,f)}if(this._log){var a=n?n.getClientID():"(Mgr)";var b=d?d.getClientID():"(Mgr)";this._log("(PageBus.policy) ["+b+", "+a+"] onPublish: "+(g?"ALLOWED ":"DENIED  ")+f)}return g};PageBus.policy.HubPolicy.prototype.onSubscribe=function(b,d){var c=true;var a;if(d!=null){a=d.getPartnerOrigin();if(!a){return false}c=this.isAllowed.call(this,a,PageBus.policy.Ops.Subscribe,b)}if(this._log){var f=d?d.getClientID():"(Mgr)";this._log("(PageBus.policy) ["+f+"] onSubscribe: "+(c?"ALLOWED ":"DENIED  ")+b)}return c};PageBus.policy.HubPolicy.prototype.onUnsubscribe=function(a,b){};PageBus.policy.HubPolicy.prototype.onSend=function(b,d,a){var c=this.isAllowed(a,PageBus.policy.Ops.Subscribe,b);if(this._log){this._log("(PageBus.policy) ["+a+"] onSend: "+(c?"ALLOWED ":"DENIED  ")+b)}return c};PageBus.policy.HubPolicy.prototype.onReceive=function(b,d,a){var c=this.isAllowed(a,PageBus.policy.Ops.Publish,b);if(this._log){this._log("(PageBus.policy) ["+a+"] onReceive: "+(c?"ALLOWED ":"DENIED  ")+b)}return c};PageBus.policy.HubPolicy.prototype._getMyOrigin=function(){var a=window.location.href.match(/[^:]*:\/\/[^:\/\?#]*/);return a[0]};PageBus.policy.HubPolicy.prototype.grant=function(a,f,b){if((!a)||(!f)||(!b)){throw new Error(PageBus.policy.Error.BadParameters)}var c=PageBus._esc(a)+"."+f+"."+b;PageBus.policy._assertName(c);this._topicMgr.store(c,{dm:a,op:f,tp:b});if(this._log){this._log("(PageBus.policy) ["+a+"] grant: "+f+" on "+b)}var d="_pagebus.cache.s."+b;this._topicMgr.store(PageBus._esc(a)+"."+f+"."+d,{dm:a,op:f,tp:d});if(this._log){this._log("(PageBus.policy) ["+a+"] implicit grant: "+f+" on "+d)}};PageBus.policy.HubPolicy.prototype.revoke=function(a,f,b){if((!a)||(!f)||(!b)){throw new Error(PageBus.policy.Error.BadParameters)}var c=PageBus._esc(a)+"."+f+"."+b;PageBus.policy._assertName(c);this._topicMgr.clear(c);if(this._log){this._log("(PageBus.policy) ["+a+"] revoke: "+f+" on "+b)}var d="_pagebus.cache.s."+b;this._topicMgr.clear(PageBus._esc(a)+"."+f+"."+d);if(this._log){this._log("(PageBus.policy) ["+a+"] implicit revoke: "+f+" on "+d)}};PageBus.policy.HubPolicy.prototype.revokeAll=function(a){if((!a)){throw new Error(PageBus.policy.Error.BadParameters)}this._topicMgr.wildcardClear(PageBus._esc(a)+".**");if(this._log){this._log("(PageBus.policy) ["+a+"] revokeAll")}};PageBus.policy.HubPolicy.prototype.isAllowed=function(a,d,b){if((!a)||(a=="")||(!d)||(d=="")||(!b)||(b=="")){throw new Error(PageBus.policy.Error.BadParameters)}var c=PageBus._esc(a)+"."+d+"."+b;return this._topicMgr.exists(c,false)};PageBus.policy.HubPolicy.prototype.listAllowed=function(b,f){if((!b)||(!f)){throw new Error(PageBus.policy.Error.BadParameters)}var a=this._topicMgr.wildcardMatch(PageBus._esc(b)+"."+f+".**");var c=[];for(var d in a){if(a[d].value.tp.substring(0,9)!="_pagebus."){c.push(a[d].value.tp)}}return c};PageBus.cache={};PageBus.cache.Error={NoCache:"PageBus.cache.Error.NoCache"};PageBus._cache={};PageBus._cache.isCacheable=function(a){return((a)&&(typeof a=="object")&&(a.PageBus)&&(a.PageBus.cache))};PageBus._cache.Cache=function(){this._refs={};this._doCache=new PageBus._TopicMatcher();this._caches=new PageBus._TopicMatcher()};PageBus._cache.Cache.prototype.add=function(c,b){var a;var d=this._doCache.match(c,true);if(d.length>0){a=d[0].value}else{a={rc:0};this._doCache.store(c,a)}a.rc++;this._refs[b]=c};PageBus._cache.Cache.prototype.remove=function(b){var c=this._refs[b];if(!c){return}delete this._refs[b];var f=this._doCache.match(c,true);if(f.length==0){return}f[0].value.rc--;if(f[0].value.rc==0){this._doCache.clear(c);var a=this._caches.wildcardMatch(c);for(var d=0;d<a.length;d++){if(!(this._doCache.exists(a[d].topic,false))){this._caches.clear(a[d].topic)}}}};PageBus._cache.Cache.prototype.storeCopy=function(a,b){PageBus._assertPubTopic(a);var c=PageBus._copy(b);this._caches.store(a,c)};PageBus._cache.Cache.prototype.clear=function(a,b){PageBus._assertPubTopic(a);this._caches.clear(a)};PageBus._cache.Cache.prototype.query=function(a){PageBus._assertSubTopic(a);return this._caches.wildcardMatch(a)};PageBus._cache.Cache.prototype.isCaching=function(a){for(var b in this._refs){false}return this._doCache.exists(a,false)};PageBus._enableMH=function(){var d=OpenAjax.hub.ManagedHub;OpenAjax.hub.ManagedHub=function(u){if(!u){throw new Error(OpenAjax.hub.Error.BadParameters)}if((!u.onPublish)||(!u.onSubscribe)){throw new Error(OpenAjax.hub.Error.BadParameters)}var t={};var s=null;if(!u.PageBus){u.PageBus={}}if(!u.PageBus.policy){u.PageBus.policy=s}if(!u.scope){u.scope=window}this._pagebus={_params:{},_getActualParameters:function(){return this._pagebus._params},_policy:u.PageBus.policy,_hub:this};this.pagebus={_hub:this};var p=this._pagebus;p._cache=new PageBus._cache.Cache();this.pagebus.query=function(v){return this._hub._pagebus._cache.query(v)};this.pagebus.store=function(v,w){if(this._hub._pagebus._cache.isCaching(v)){this._hub.publish(v,w)}};this.pagebus.clear=function(v){if(this._hub._pagebus._cache.isCaching(v)){this._hub.publish(v,null)}};var r=u.scope?u.scope:window;var q=this._pagebus._params;for(var o in u){q[o]=u[o]}q.scope=u.scope?u.scope:window;q.onPublish=function(w,A,v,C){try{var z=q.PageBus.policy;if(z){var y=z.onPublish.call(z,w,A,v,C);if(!y){return false}}return u.onPublish.call(r,w,A,v,C)}catch(B){return false}};q.onSubscribe=function(v,A){try{var y=q.PageBus.policy;if(y){var w=y.onSubscribe.call(y,v,A);if(!w){return false}}w=u.onSubscribe.call(r,v,A);return w}catch(z){return false}};q.onUnsubscribe=function(v,z){try{var w=q.PageBus.policy;if(w){w.onUnsubscribe.call(w,u.scope,v,z)}u.onUnsubscribe.call(r,v,z)}catch(y){return}};if(!p._policy){p._policy=null}d.call(this,q);this.getParameters=function(){return u}};OpenAjax.hub.ManagedHub.prototype=d.prototype;var k=OpenAjax.hub.ManagedHub.prototype.publish;var c=OpenAjax.hub.ManagedHub.prototype.subscribe;var b=OpenAjax.hub.ManagedHub.prototype.unsubscribe;var g=OpenAjax.hub.ManagedHub.prototype.publishForClient;var f=OpenAjax.hub.ManagedHub.prototype.subscribeForClient;var n=OpenAjax.hub.ManagedHub.prototype.unsubscribeForClient;var a=OpenAjax.hub.ManagedHub.prototype.getScope;OpenAjax.hub.ManagedHub.prototype.publish=function(o,p){PageBus._assertPubTopic(o);if(this._pagebus._cache.isCaching(o)){if(p==null){this._pagebus._cache.clear(o)}else{this._pagebus._cache.storeCopy(o,p)}}k.call(this,o,p)};OpenAjax.hub.ManagedHub.prototype.subscribe=function(u,r,y,q,t){PageBus._assertSubTopic(u);var p=c.call(this,u,r,y,q,t);if(PageBus._cache.isCacheable(t)){var o=this._pagebus._cache;o.add(u,p);var w=o.query(u);for(var s=0;s<w.length;s++){try{r.call(y?y:window,w[s].topic,w[s].value,t)}catch(v){PageBus._debug()}}}return p};OpenAjax.hub.ManagedHub.prototype.unsubscribe=function(p,r,q){var o=this._pagebus._cache;o.remove(p);b.call(this,p,r,q)};OpenAjax.hub.ManagedHub.prototype.getScope=function(){return a.call(this)};OpenAjax.hub.ManagedHub.prototype.publishForClient=function(o,p,q){PageBus._assertPubTopic(p);if((!this._pagebus._policy)||(this._pagebus._policy.isAllowed(o.getPartnerOrigin(),PageBus.policy.Ops.Publish,p))){if(this._pagebus._cache.isCaching(p)){if(q==null){this._pagebus._cache.clear(p)}else{this._pagebus._cache.storeCopy(p,q)}}}g.call(this,o,p,q)};OpenAjax.hub.ManagedHub.prototype.subscribeForClient=function(o,q,s){PageBus._assertSubTopic(q);var p=f.call(this,o,q,s);if(q.substring(0,17)=="_pagebus.cache.s."){var r=q.substring(17);this._pagebus._cache.add(r,p);var u=this._pagebus._cache.query(r);function v(){for(var t=0;t<u.length;t++){o.sendToClient(u[t].topic,u[t].value,s)}}setTimeout(v,0)}return p};OpenAjax.hub.ManagedHub.prototype.unsubscribeForClient=function(o,p){this._pagebus._cache.remove(p);try{var q=this.getSubscriberData(p);if(PageBus._cache.isCacheable(q)){if(this._pagebus._cacheSids[p]){this.unsubscribe(this._pagebus._cacheSids[p],null,null);delete this._pagebus._cacheSids[p];this._pagebus._cache.remove(p)}}n.call(this,o,p)}catch(r){PageBus._debug()}}};PageBus._enableMH();PageBus.HubClientExtender=function(a,c){var b=this;this._hub=a;this._params=c;if(!c.PageBus){this._params.PageBus={log:c.log}}if(!c.PageBus.policy){c.PageBus.policy=null}this._policy=c.PageBus.policy;this._cache=new PageBus._cache.Cache();this._cacheSids={};this._wrappedSubscribe=a.subscribe;this._wrappedUnsubscribe=a.unsubscribe;this._wrappedPublish=a.publish;this._wrappedDisconnect=a.disconnect;a.publish=function(d,f){b._publishWrapper(d,f)};a.subscribe=function(f,k,g,n,d){return b._subscribeWrapper(f,k,g,n,d)};a.unsubscribe=function(d,g,f){b._unsubscribeWrapper(d,g,f)};a.disconnect=function(f,d){b._disconnectWrapper(f,d)}};PageBus.HubClientExtender.prototype._publishWrapper=function(b,c){if(!this._hub.isConnected()){throw new Error(OpenAjax.hub.Error.Disconnected)}PageBus._assertPubTopic(b);if(this._cache.isCaching(b)){if(c==null){this._cache.clear(b)}else{this._cache.storeCopy(b,c)}}var a=this._hub.getPartnerOrigin();if(!a){throw new Error(OpenAjax.hub.Error.Disconnected)}if(this._policy&&(!this._policy.onSend(b,c,a))){return}this._wrappedPublish.call(this._hub,b,c)};PageBus.HubClientExtender.prototype._subscribeWrapper=function(d,c,p,b,n){var f=this;if(!this._hub.isConnected()){throw new Error(OpenAjax.hub.Error.Disconnected)}PageBus._assertSubTopic(d);if(!c){throw new Error(OpenAjax.hub.Error.BadParameters)}var k=this._policy;var o=this._hub.getPartnerOrigin();if(!o){throw new Error(OpenAjax.hub.Error.Disconnected)}if(k&&(!k.onReceive.call(k,d,null,o))){throw new Error(OpenAjax.hub.Error.NotAllowed)}dataHook=function(r,z,w){var y=f._policy;var q=f._hub.getPartnerOrigin();if(y&&(!y.onReceive.call(y,r,z,q))){return}if(PageBus._cache.isCacheable(w)){if(f._cache.isCaching(r)){if(z==null){f._cache.clear(r)}else{f._cache.storeCopy(r,z)}}}try{var u=p?p:window;c.call(u,r,z,w)}catch(v){PageBus._debug()}};completeHook=function(u,q,t){if(!q){if(f._cacheSids[u]){f._hub.unsubscribe(f._cacheSids[u],null,null);delete f._cacheSids[u];f._cache.remove(u)}}try{var r=p?p:window;b.call(r,u,q,t)}catch(v){PageBus._debug()}};var a=this._wrappedSubscribe.call(this._hub,d,dataHook,p,completeHook,n);try{this._hub.getSubscriberData(a)}catch(g){if(g.message==OpenAjax.hub.Error.NoSubscription){return a}}if(PageBus._cache.isCacheable(n)){this._cache.add(d,a);this._cacheSids[a]=this._hub.subscribe("_pagebus.cache.s."+d,function(r,z,w){var y=this._policy;var q=this._hub.getPartnerOrigin();if(y&&(!this._policy.onReceive(r,z,q))){return}if(PageBus._cache.isCacheable(n)){if(this._cache.isCaching(r)){if(z==null){this._cache.clear(r)}else{this._cache.storeCopy(r,z)}}}try{var u=p?p:window;c.call(u,r,z,n)}catch(v){PageBus._debug()}},this,function(s,q,r){},null)}return a};PageBus.HubClientExtender.prototype._unsubscribeWrapper=function(a,d,c){if(!this._hub.isConnected()){throw new Error(OpenAjax.hub.Error.Disconnected)}if((a==null)||(a=="")){throw new Error(OpenAjax.hub.Error.BadParameters)}var b=this._hub.getSubscriberData(a);if(PageBus._cache.isCacheable(b)){if(this._cacheSids[a]){this._hub.unsubscribe(this._cacheSids[a],null,null);delete this._cacheSids[a];this._cache.remove(a)}}this._wrappedUnsubscribe.call(this._hub,a,d,c)};PageBus.HubClientExtender.prototype._disconnectWrapper=function(b,a){this._cache._caches.wildcardClear("**");this._cacheSids={};this._wrappedDisconnect.call(this._hub,b,a)};PageBus.HubClientExtender.prototype.query=function(a){return this._cache.query(a)};PageBus.HubClientExtender.prototype.store=function(a,b){if(this._cache.isCaching(a)){this._hub.publish(a,b)}else{throw new Error(PageBus.cache.Error.NoCache)}};PageBus.HubClientExtender.prototype.clear=function(a){if(this._cache.isCaching(a)){this._hub.publish(a,null)}else{throw new Error(PageBus.cache.Error.NoCache)}};PageBus.enableHubClientClass=function(a){a.prototype._pagebusWrappedConnect=a.prototype.connect;a.prototype.connect=function(d,c){var b=this;if(!b.pagebus){b.pagebus=new PageBus.HubClientExtender(b,b.getParameters())}b._pagebusWrappedConnect.call(b,d,c)}};if(!OpenAjax.hub){}if(OpenAjax.hub.InlineHubClient){PageBus.enableHubClientClass(OpenAjax.hub.InlineHubClient)}if(OpenAjax.hub.IframeHubClient){PageBus.enableHubClientClass(OpenAjax.hub.IframeHubClient)}OpenAjax.hub._hub=new OpenAjax.hub.ManagedHub({onSubscribe:function(a,b){return true},onPublish:function(b,c,a,d){return true},log:(function(){if(typeof console=="undefined"){return null}else{if(typeof console.log!=="undefined"){return function(a){console.log(a)}}}}())});OpenAjax.hub.subscribe=function(a,d,c,b){if(typeof d==="string"){c=c||window;d=c[d]||null}return OpenAjax.hub._hub.subscribe(a,d,c,null,b)};OpenAjax.hub.unsubscribe=function(a){return OpenAjax.hub._hub.unsubscribe(a)};OpenAjax.hub.publish=function(a,b){OpenAjax.hub._hub.publish(a,b)};PageBus.publish=function(a,b){OpenAjax.hub.publish(a,b)};PageBus.subscribe=function(a,d,c,b){return OpenAjax.hub.subscribe(a,c,d,b)};PageBus.unsubscribe=function(a){OpenAjax.hub.unsubscribe(a)};PageBus.store=function(a,b){OpenAjax.hub._hub.pagebus.store(a,b)};PageBus.query=function(a){return OpenAjax.hub._hub.pagebus.query(a)};OpenAjax.hub.registerLibrary("PageBus","http://pagebus.org/pagebus","2.0",{});(function(){function a(){if(!_.isArray(this.subscriptions)){this.subscriptions=[]}}ns("CD.PageBus",{subscriptions:null,subscribe:function(c,f,k,g,d){a.call(this);var b=PageBus.subscribe(c,f,k,g,d);this.subscriptions.push(b);return b},unsubscribe:function(c){var b;a.call(this);for(b=0;b<this.subscriptions.length;b++){if(this.subscriptions[b]===c){delete this.subscriptions[b];break}}return PageBus.unsubscribe(c)},publish:function(b,c){return PageBus.publish(b,c)},query:function(b,d,g,f,c){return PageBus.query(b,d,g,f,c)},destroy:function(){var b;a.call(this);for(b=0;b<this.subscriptions.length;b++){if(typeof this.subscriptions[b]!=="undefined"){this.unsubscribe(this.subscriptions[b])}}try{if(typeof this.view!=="undefined"){this.view.destroy()}}catch(f){console.log(f)}try{if(typeof this.children!=="undefined"){for(b=0;b<this.children.length;b++){this.children[b].destroy()}}}catch(d){console.log(d)}try{if(typeof this.widgets!=="undefined"){for(b=0;b<this.widgets.length;b++){this.widgets[b].destroy()}}}catch(c){console.log(c)}}})}());(function(){var a=["placeholder","automount"];ns("CD.Widget",function(c){c=_.extend({},this.options,c||{});_.each(a,function(d){if(!_.isUndefined(c[d])){this[d]=c[d]}},this);this.options=c;this.cid=_.uniqueId("w");this.el=this.mkel();this._baseCls=(["wdg",this.cls,c.cls]).compact().join(" ");this.el.className=this._baseCls;this.el.msgclose.observe("click",(function(d){this.msg(false);d.stop()}).bind(this));this.is_locked=false;this.is_processing=true;this.is_msg=false;if(this.automount&&this.placeholder){this.mount(this.placeholder)}if(CD.LocalStorage.compatible){define.call(this,"storage",CD.LocalStorage.getInstance(this.ns()+(this.options.persistent_id?"."+this.options.persistent_id:"")))}else{define.call(this,"storage",null)}this.initialize(c)});_.extend(CD.Widget.prototype,Backbone.Events,CD.PageBus,{cls:"",options:{},placeholder:null,automount:true,storage:null,mkel:(function(){var c=new Element("div");c.update('<div class="wdg wdg-w-proc"><div class="wdg-cnt"></div><div class="wdg-lck"><span>Processing&hellip;</span></div><div class="wdg-msg"><span></span><a href="#close">&times;</a></div></div>');c=c.firstDescendant();return function(){var d=$(c.clone(true));d.content=d.select(".wdg-cnt").first();d.message=d.select(".wdg-msg span").first();d.msgclose=d.select(".wdg-msg a").first();return d}}()),initialize:function(c){},mount:function(c){c=$((c&&(this.placeholder=c))||this.placeholder);if(c){c.replace(this.el)}return this},msg:function(c,d){if(c===false){this.el.removeClassName("wdg-w-msg");this.is_msg=false}else{this.el.addClassName("wdg-w-msg");this.el.message.up().className="wdg-msg wdg-msg-"+c;this.el.message.update(d);this.is_msg=true}return this},locked:function(c){if(c){this.el.addClassName("wdg-w-lck");this.is_locked=true}else{this.el.removeClassName("wdg-w-lck");this.is_locked=false}return this},processing:function(c){if(c){this.el.addClassName("wdg-w-proc");this.is_processing=true}else{this.el.removeClassName("wdg-w-proc");this.is_processing=false}return this},html:function(c){if(_.isUndefined(c)){return this.el.content.innerHTML}else{this.el.content.update(c)}return this},state:function(d){if(!this.storage){console.warn("Browser does not allow to persist widget state")}try{if(_.isUndefined(d)){return this.storage.get("state")||{}}else{if(d===null){this.storage.unset("state")}else{this.storage.set("state",_.extend(this.storage.get("state")||{},d))}}}catch(c){console.warn(this+" failed to persist state",c)}},toString:function(){try{return this.ns()+"."+this.id}catch(c){return"[object Widget]"}}});CD.Widget.extend=clsextend;CD.Widget.init=function(f,d){try{var k=[];var n=$$("[data-init-widget="+f+"]").first();var c=resolve(f);if(c){d=_.extend({placeholder:n,automount:true},d||{});return new c(d)}else{console.warn("No widget "+f)}}catch(g){console.log(f+" failed to initialize. ",g);if(!CD.Environment.islive){throw g}}};CD.Widget.initall=function(c){c=c||{};var d=[];$$("[data-init-widget], .x-widget").each(function(o){var k=o.data("init-widget");var f=resolve(k);if(f){var g=_.extend({},c[k]||{},{placeholder:o,automount:true});try{d.push(new f(g))}catch(n){console.warn("Failed to instantiate",k,":",n);if(!CD.Environment.islive){throw n}}}else{console.warn("No widget "+k)}});return d};var b=1;CD.Widget.getNextId=function(){return b++}}());CD=typeof CD!=="undefined"?CD:{};CD.ACTIVITY_TYPE_SYSTEM=1;CD.ACTIVITY_TYPE_ITEM=2;CD.ACTIVITY_TYPE_DATABASE=6;CD.ACTIVITY_TYPE_DATABASE_RECORD=22;CD.ACTIVITY_TYPE_EVENT=7;CD.ACTIVITY_TYPE_MILESTONE=8;CD.ACTIVITY_TYPE_TASK=9;CD.ACTIVITY_TYPE_CATEGORY=20;CD.ACTIVITY_TYPE_WORKSPACE=21;CD.ACTIVITY_TYPE_DB_RECORD=22;CD.ACTIVITY_TYPE_USER=23;CD.ACTIVITY_TYPE_STATUS_UPDATE=24;CD.ACTIVITY_TYPE_COMPANY_USER=25;CD.ACTIVITY_TYPE_COMPANY=26;CD.ACTIVITY_TYPE_TASKLIST=32;CD.ACTIVITY_TYPE_ASSET=33;CD.ACTIVITY_TYPE_AUDITLOG=34;CD.ITEM_TYPE_WIKI=0;CD.ITEM_TYPE_ONLINE_DOC=1;CD.ITEM_TYPE_SPREADSHEET=2;CD.ITEM_TYPE_LOCAL_FILE=3;CD.ITEM_TYPE_BOOKMARK=4;CD.ITEM_TYPE_DISCUSSION=5;CD.ITEM_TYPE_DB=6;CD.ITEM_TYPE_EVENTS=7;CD.ITEM_TYPE_MILESTONE=8;CD.ITEM_TYPE_TASK=9;CD.ITEM_TYPE_BLOGENTRY=10;CD.ITEM_TYPE_FORUMPOST=11;CD.ITEM_TYPE_DIAGRAM=12;CD.ITEM_TYPE_FOLDER=20;CD.ITEM_TYPE_WORKSPACE=21;CD.ITEM_TYPE_DB_RECORD=22;CD.ITEM_TYPE_USER=23;CD.ITEM_TYPE_STATUS_UPDATE=24;CD.ITEM_TYPE_COMPANY_USER=25;CD.ITEM_TYPE_COMPANY=26;CD.ITEM_TYPE_TASKLIST=32;CD.ITEM_TYPE_ASSET=33;CD.ITEM_TYPE_AUDITLOG=34;function BrowserDetect(){var a=navigator.userAgent.toLowerCase();this.isGecko=(a.indexOf("gecko")!=-1&&a.indexOf("safari")==-1);this.isAppleWebKit=(a.indexOf("applewebkit")!=-1);this.isChrome=(a.indexOf("chrome")!=-1);this.isIPhone=(a.indexOf("iphone")!=-1);this.isIPad=(a.indexOf("ipad")!=-1);this.isIPod=(a.indexOf("ipod")!=-1);this.isAndroid=(a.indexOf("android")!=-1);this.isKonqueror=(a.indexOf("konqueror")!=-1);this.isSafari=(a.indexOf("safari")!=-1);this.isOmniweb=(a.indexOf("omniweb")!=-1);this.isOpera=(a.indexOf("opera")!=-1);this.isIcab=(a.indexOf("icab")!=-1);this.isAol=(a.indexOf("aol")!=-1);this.isIE=(a.indexOf("msie")!=-1&&!this.isOpera&&(a.indexOf("webtv")==-1));this.isMozilla=(this.isGecko&&a.indexOf("gecko/")+14==a.length);this.isFirefox=(a.indexOf("firefox/")!=-1||a.indexOf("firebird/")!=-1);this.isNS=((this.isGecko)?(a.indexOf("netscape")!=-1):((a.indexOf("mozilla")!=-1)&&!this.isOpera&&!this.isSafari&&(a.indexOf("spoofer")==-1)&&(a.indexOf("compatible")==-1)&&(a.indexOf("webtv")==-1)&&(a.indexOf("hotjava")==-1)));this.isIECompatible=((a.indexOf("msie")!=-1)&&!this.isIE);this.isNSCompatible=((a.indexOf("mozilla")!=-1)&&!this.isNS&&!this.isMozilla);this.isIPhoneCompatible=(this.isIPhone||this.isIPad||this.isIPod);this.isMobile=(this.isIPhone||this.isIPad||this.isIPod||this.isAndroid);this.geckoVersion=((this.isGecko)?a.substring((a.lastIndexOf("gecko/")+6),(a.lastIndexOf("gecko/")+14)):-1);this.equivalentMozilla=((this.isGecko)?parseFloat(a.substring(a.indexOf("rv:")+3)):-1);this.appleWebKitVersion=((this.isAppleWebKit)?parseFloat(a.substring(a.indexOf("applewebkit/")+12)):-1);this.versionMinor=parseFloat(navigator.appVersion);if(this.isGecko&&!this.isMozilla){this.versionMinor=parseFloat(a.substring(a.indexOf("/",a.indexOf("gecko/")+6)+1))}else{if(this.isMozilla){this.versionMinor=parseFloat(a.substring(a.indexOf("rv:")+3))}else{if(this.isIE&&this.versionMinor>=4){this.versionMinor=parseFloat(a.substring(a.indexOf("msie ")+5))}else{if(this.isKonqueror){this.versionMinor=parseFloat(a.substring(a.indexOf("konqueror/")+10))}else{if(this.isSafari){this.versionMinor=parseFloat(a.substring(a.lastIndexOf("safari/")+7))}else{if(this.isOmniweb){this.versionMinor=parseFloat(a.substring(a.lastIndexOf("omniweb/")+8))}else{if(this.isOpera){this.versionMinor=parseFloat(a.substring(a.indexOf("opera")+6))}else{if(this.isIcab){this.versionMinor=parseFloat(a.substring(a.indexOf("icab")+5))}}}}}}}}this.versionMajor=parseInt(this.versionMinor);this.isDOM1=(document.getElementById);this.isDOM2Event=(document.addEventListener&&document.removeEventListener);this.mode=document.compatMode?document.compatMode:"BackCompat";this.isWin=(a.indexOf("win")!=-1);this.isWin32=(this.isWin&&(a.indexOf("95")!=-1||a.indexOf("98")!=-1||a.indexOf("nt")!=-1||a.indexOf("win32")!=-1||a.indexOf("32bit")!=-1||a.indexOf("xp")!=-1));this.isMac=(a.indexOf("mac")!=-1);this.isUnix=(a.indexOf("unix")!=-1||a.indexOf("sunos")!=-1||a.indexOf("bsd")!=-1||a.indexOf("x11")!=-1);this.isLinux=(a.indexOf("linux")!=-1);this.isNS4x=(this.isNS&&this.versionMajor==4);this.isNS40x=(this.isNS4x&&this.versionMinor<4.5);this.isNS47x=(this.isNS4x&&this.versionMinor>=4.7);this.isNS4up=(this.isNS&&this.versionMinor>=4);this.isNS6x=(this.isNS&&this.versionMajor==6);this.isNS6up=(this.isNS&&this.versionMajor>=6);this.isNS7x=(this.isNS&&this.versionMajor==7);this.isNS7up=(this.isNS&&this.versionMajor>=7);this.isIE4x=(this.isIE&&this.versionMajor==4);this.isIE4up=(this.isIE&&this.versionMajor>=4);this.isIE5x=(this.isIE&&this.versionMajor==5);this.isIE55=(this.isIE&&this.versionMinor==5.5);this.isIE5up=(this.isIE&&this.versionMajor>=5);this.isIE6x=(this.isIE&&this.versionMajor==6);this.isIE6up=(this.isIE&&this.versionMajor>=6);this.isIE4xMac=(this.isIE4x&&this.isMac)}var browser=new BrowserDetect();function chk_compatibility(b,d,a){if((browser.isGecko&&!browser.isMozilla)||(browser.isNS&&(browser.versionMinor>=7.1))||(browser.isIE&&(browser.versionMinor>=5.5))||(browser.isMozilla&&(browser.versionMinor>1.3))){}else{var c='<div align="center"><br />';c+="<h1>Central Desktop does not currently support your browser.</h1>";c+='<h2>See our <a href="/no?browser">browser requirements</a> for more information about browser compatibility.</h2>';c+='<br /><h1>or <a href="'+d+"?c=1&rurl="+a+'">Click Here to Sign in Anyway</a></h1>';c+="<br /><br /><br />Some features of the application may not be available.<br /><br /><br /><br /><br />";c+="</div>";document.getElementById(b).innerHTML=c}}var detectableWithVB=false;var pluginFound=false;function canDetectPlugins(){if(detectableWithVB||(navigator.plugins&&navigator.plugins.length>0)){return true}else{return false}}function detectFlash(){pluginFound=detectPlugin("Shockwave","Flash");if(!pluginFound&&detectableWithVB){pluginFound=detectActiveXControl("ShockwaveFlash.ShockwaveFlash.1")}return pluginFound}function detectDirector(){pluginFound=detectPlugin("Shockwave","Director");if(!pluginFound&&detectableWithVB){pluginFound=detectActiveXControl("SWCtl.SWCtl.1")}return pluginFound}function detectQuickTime(){pluginFound=detectPlugin("QuickTime");if(!pluginFound&&detectableWithVB){pluginFound=detectQuickTimeActiveXControl()}return pluginFound}function detectReal(){pluginFound=detectPlugin("RealPlayer");if(!pluginFound&&detectableWithVB){pluginFound=(detectActiveXControl("rmocx.RealPlayer G2 Control")||detectActiveXControl("RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)")||detectActiveXControl("RealVideo.RealVideo(tm) ActiveX Control (32-bit)"))}return pluginFound}function detectWindowsMedia(){pluginFound=detectPlugin("Windows Media");if(!pluginFound&&detectableWithVB){pluginFound=detectActiveXControl("MediaPlayer.MediaPlayer.1")}return pluginFound}function detectPlugin(){var c=detectPlugin.arguments;var b=false;if(navigator.plugins&&navigator.plugins.length>0){var a=navigator.plugins.length;for(pluginsArrayCounter=0;pluginsArrayCounter<a;pluginsArrayCounter++){var d=0;for(namesCounter=0;namesCounter<c.length;namesCounter++){if((navigator.plugins[pluginsArrayCounter].name.indexOf(c[namesCounter])>=0)||(navigator.plugins[pluginsArrayCounter].description.indexOf(c[namesCounter])>=0)){d++}}if(d==c.length){b=true;break}}}return b}if((navigator.userAgent.indexOf("MSIE")!=-1)&&(navigator.userAgent.indexOf("Win")!=-1)){document.writeln('<script language="VBscript">');document.writeln("'do a one-time test for a version of VBScript that can handle this code");document.writeln("detectableWithVB = False");document.writeln("If ScriptEngineMajorVersion >= 2 then");document.writeln("  detectableWithVB = True");document.writeln("End If");document.writeln("'this next function will detect most plugins");document.writeln("Function detectActiveXControl(activeXControlName)");document.writeln("  on error resume next");document.writeln("  detectActiveXControl = False");document.writeln("  If detectableWithVB Then");document.writeln("     detectActiveXControl = IsObject(CreateObject(activeXControlName))");document.writeln("  End If");document.writeln("End Function");document.writeln("'and the following function handles QuickTime");document.writeln("Function detectQuickTimeActiveXControl()");document.writeln("  on error resume next");document.writeln("  detectQuickTimeActiveXControl = False");document.writeln("  If detectableWithVB Then");document.writeln("    detectQuickTimeActiveXControl = False");document.writeln("    hasQuickTimeChecker = false");document.writeln('    Set hasQuickTimeChecker = CreateObject("QuickTimeCheckObject.QuickTimeCheck.1")');document.writeln("    If IsObject(hasQuickTimeChecker) Then");document.writeln("      If hasQuickTimeChecker.IsQuickTimeAvailable(0) Then ");document.writeln("        detectQuickTimeActiveXControl = True");document.writeln("      End If");document.writeln("    End If");document.writeln("  End If");document.writeln("End Function");document.writeln("<\/script>")}function Starter(){if("_instance" in Starter){return Starter._instance}var b={domReady:[],contentReady:[]};var a={domReady:42,contentReady:42};function c(d){var f=[];b[d].each(function(g){if(g){for(var k in g){try{g[k]()}catch(n){f.push('Function "'+d+":"+k+'" failed: '+n)}}}});if(f.length){throw"Starter failures: \n\t"+f.join("\n\t")}}this.regFunc=function(d,f,k,g){var g=g||a[d];if(!b[d][g]){b[d][g]={}}b[d][g][f]=k;if(Starter["_starter_"+d]){k()}};this.getFuncs=function(){return b};Event.observe(document,"dom:loaded",function(){Starter._starter_domReady=true;c("domReady")});Event.observe(window,"load",function(){Starter._starter_contentReady=true;c("contentReady")});Starter._instance=this}Starter._starter_domReady=false;Starter._starter_contentReady=false;Starter.regInitFunc=function(a,c,b){(new Starter()).regFunc("domReady",a,c)};Starter.regStartFunc=function(a,c,b){(new Starter()).regFunc("contentReady",a,c)};function $C(b,a){$C.checkClass(b);if(!b._extendedClass){var d=["statics","classMethod","classProperty","makeSubclass"];for(var c=0;c<d.length;c++){(function(g,k){var f=function(){return k.apply(null,$C.argsArray(arguments).prepend(b))};f._name=$C.fname(k);f.staticMethod=k;b[g]=f})(d[c],$C[d[c]])}b._self=b;b._parent=Object;b._super=Object;b._statics=[];b._extendedClass=true;b.prototype._self=b}if(a){$C(a).makeSubclass(b)}return b}$C.statics=function(a){$C.checkClass(a);if(arguments.length==0){return}else{if(arguments.length==1){return a._statics}else{if(arguments.length>1){function d(f,k){for(var g=0;g<f.length;g++){if(f[g]==k){return true}}return false}var c=a._statics.slice(0);for(var b=1;b<arguments.length;b++){if(!d(c,arguments[b])){c.push(arguments[b])}}a._statics=c}}}};$C.classProperty=function(a,b,c){$C.checkClass(a);if(c){a[b]=c;a.statics(b)}return a[b]};$C.classMethod=function(a,c,f){f._name=c;$C.checkClass(a);$C.checkFunc(f);if(!$C[f._name]){var d=f.staticMethod||f;var b=function(){return d.apply(null,$C.argsArray(arguments).prepend(a))};b._name=f._name;b.staticMethod=d;a[f._name]=b;$C.statics(a,f._name)}return b};$C.makeSubclass=function(a,c){$C.checkClass(a);$C(c);c.prototype=new a();c.prototype.constructor=a;c.prototype._self=c;c._self=c;c._statics=$C.statics(a);c._super=a._super||a;c._parent=a;if(a._statics&&a._statics.length){for(var d=0;d<a._statics.length;d++){var b=a._statics[d];(function(f,g){if(a[f].apply){c[f,f]=$C.classMethod(c,a[f]._name,a[f])}else{c[f]=a[f]}})(b)}}};$C.fname=function(a){if(typeof(a._name)=="undefined"){if(typeof(a.name)=="undefined"){a.toString().match(/function\s+([^\(]+)\s*/i);a._name=RegExp.$1}else{a._name=a.name||"@"}}if(!a._name){console.warn("Unnamed function:",a.toString())}return a._name};$C.checkClass=function(a){message="$C: (name = "+$C.fname(a)+") attempt to apply method to non-class object or anonimous class";if(!a||!a.call||!$C.fname(a)){console.log(message);throw message}};$C.checkFunc=function(a){if(!a||!a.call||!$C.fname(a)){throw"$C: attempt to use non-callable object or anonimous callable"}};$C.argsArray=function(b){var a=[];for(var c=0;c<b.length;c++){a.push(b[c])}a.prepend=function(d){this.unshift(d);return this};return a};ClassTpl=(function(){return{render:function(n){var c=null;if(arguments.length>1){c=arguments[1]}var f=$$(".tpl-"+n)[0];var k=f.cloneNode(true);$(k).removeClassName("tpl-"+n);if(c){for(var g in c){try{var d="."+n+"-"+g;var a=k.select(d)[0];if(a){a.innerHTML=c[g]}}catch(b){console.log(b)}}}return k}}})();function DOMTemplator(f,b,d){var d=d||DOMTemplator.CSSMapper();var b=b||function(o,q,p){return o};var k=console&&console.group&&console.info;var a=(document.location.host.match(/centraldesktop-dev.com$/))?DOMTemplator.LOG_WARN:0;function n(q){var o=document.createElement("div");o.innerHTML=q;var p;if(navigator.userAgent.match(/msie 7/i)){p=$(o.firstChild)}else{p=o.firstDescendant()}return p}function c(p){var o=new Element("div");o.update(p);return o.innerHTML}var g=f.tagName?f:n(f);this.logMode=function(o){if(!isNaN(parseInt(o))){a=parseInt(o)}return a};this.render=function(t){var p=g.clone(true);var r={};for(var u in t){var o=(t[u] instanceof Array)?t[u]:[t[u]];try{var s=r[u]=d(p,u)}catch(q){var s=[];if(k&&a>=DOMTemplator.LOG_WARN){console.warn('Failed to map "%s"',u)}}o.each(function(v){if(k&&a>=DOMTemplator.LOG_INFO){console.info('Field "%s":',u,s)}try{if(v.call){v(s)}else{DOMTemplator.genericHandlers.setval(v)(s)}}catch(w){if(k&&a>=DOMTemplator.LOG_WARN){console.group("Template field render failed");console.warn("Field:  ",u);console.warn("Error:  ",w);console.warn("Handler:",v);console.groupEnd()}}})}p=b(p,t,r);p.toHTML=function(){return c(this)};return p}}DOMTemplator.CSSMapper=function(){return function(a,b){return(b=="self")?[a]:$(a).select(b)}};DOMTemplator.ObjMapper=function(a){return function(b,c){return $(b).select(a+c)}};DOMTemplator.genericHandlers=(function(){function p(){}function u(f){return function(y){y.each(function(A){for(var z in f){A[z]=f[z]}})}}function a(f){return function(y){y.each(function(z){z.insert({bottom:f})})}}function n(){return function(f){f.each(Element.hide)}}function k(){return function(f){f.each(Element.remove)}}function b(f){return f?k():p}function q(f){return f?n():p}function v(f){return f?true:null}function d(f){return function(y){y.each(function(z){z.id=f+z.id})}}function r(f){return function(y){y.each(function(z){z.id=z.id+f})}}function c(f,z,y){var y=!!y;return function(A){A.each(function(B){B.observe(f,function(C){z.call(this,C);if(!y){C.stop()}})})}}function w(y,f){return c("click",y,f)}function t(f){return function(y){y.each(f)}}function s(f){return function(y){y.each(function(z){z.addClassName(f)})}}function o(f){return function(y){y.each(function(z){z.removeClassName(f)})}}function g(A){function C(E,F){for(var D=0;D<E[0].options.length;D++){E[0].options[D].selected=(E[0].options[D].value==F)}}function y(D,E){D[0].checked=!!E}function f(D,E){D.each(function(F){F.checked=(F.value==E)})}function B(D,E){D[0].value=E}function z(D,E){D[0].innerHTML=E}return function(D){var E;switch(D[0].tagName.toLowerCase()){case"select":C(D,A);break;case"input":switch(D[0].type){case"checkbox":y(D,A);break;case"radio":f(D,A);break;default:B(D,A)}break;default:z(D,A)}}}return{attrs:u,prefid:d,suffid:r,apply:t,addclass:s,rmclass:o,append:a,remove:k,removeif:b,hide:n,hideif:q,nullif:v,observe:c,click:w,setval:g}})();DOMTemplator.LOG_WARN=1;DOMTemplator.LOG_INFO=2;var $t=DOMTemplator.genericHandlers;function StrTemplator(c){var a=/@\{([\w\-]+)\}(.*)\{\1\}/;function b(f){var d=new Element("div");d.update(f);return d.innerHTML}if(c.tagName){c=b(c)}this.render=function(d){c=c.gsub(a,function(f){if(f[1] in d){if(Object.isFunction(d[f[1]])){return d[f[1]](f[2])}else{if(!d[f[1]]){return""}else{return f[2]}}}else{return f[2]}});return(new Template(c)).evaluate(d)}}function SysEventsController(b){if(SysEventsController._instance){return SysEvents._instance}var b=!!b;var c={};function a(d,f){if(!b){throw (f?f+": ":"")+d}}this.regEvents=function(f,d){var d=!!d;f.each(function(g){if((g in c)){if(!d){a("Event "+g+" has been already registered.","SysEvents.regEvents")}}else{c[g]={}}})};this.unregEvents=function(d){d.each(function(f){if(f in c){c[f]={}}else{a('Invalid event "'+f+'"',"SysEvents.unregEvents")}})};this.regListener=function(k,f,g){var d=!!d;if(k in c){if(g.call){c[k][f]=g}else{a("Invalid listener. Not collable","SysEvents.regListener")}}else{a('Invalid event "'+k+'"',"SysEvents.regListener")}};this.unregListener=function(g,d){if(c[g]){if(c[g][d]){try{delete c[g][d]}catch(f){c[g][d]=null}}else{a('Invalid event "'+g+"."+d+'"',"SysEvents.unregListener")}}else{a('Invalid event "'+g+'"',"SysEvents.unregListener")}};this.fire=function(n,f,d){var f=f||[];var d=d||window;if(c[n]){for(var g in c[n]){try{c[n][g].apply(d,f)}catch(k){}}}else{a('Invalid event "'+n+'"',"SysEvents.fireEvent")}};SysEventsController._instance=this}var SysEvents=new SysEventsController(false);var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(c){var a="";var p,n,g,o,k,f,d;var b=0;c=Base64._utf8_encode(c);while(b<c.length){p=c.charCodeAt(b++);n=c.charCodeAt(b++);g=c.charCodeAt(b++);o=p>>2;k=((p&3)<<4)|(n>>4);f=((n&15)<<2)|(g>>6);d=g&63;if(isNaN(n)){f=d=64}else{if(isNaN(g)){d=64}}a=a+this._keyStr.charAt(o)+this._keyStr.charAt(k)+this._keyStr.charAt(f)+this._keyStr.charAt(d)}return a},decode:function(c){var a="";var p,n,g;var o,k,f,d;var b=0;c=c.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(b<c.length){o=this._keyStr.indexOf(c.charAt(b++));k=this._keyStr.indexOf(c.charAt(b++));f=this._keyStr.indexOf(c.charAt(b++));d=this._keyStr.indexOf(c.charAt(b++));p=(o<<2)|(k>>4);n=((k&15)<<4)|(f>>2);g=((f&3)<<6)|d;a=a+String.fromCharCode(p);if(f!=64){a=a+String.fromCharCode(n)}if(d!=64){a=a+String.fromCharCode(g)}}a=Base64._utf8_decode(a);return a},_utf8_encode:function(b){b=b.replace(/\r\n/g,"\n");var a="";for(var f=0;f<b.length;f++){var d=b.charCodeAt(f);if(d<128){a+=String.fromCharCode(d)}else{if((d>127)&&(d<2048)){a+=String.fromCharCode((d>>6)|192);a+=String.fromCharCode((d&63)|128)}else{a+=String.fromCharCode((d>>12)|224);a+=String.fromCharCode(((d>>6)&63)|128);a+=String.fromCharCode((d&63)|128)}}}return a},_utf8_decode:function(a){var b="";var d=0;var f=c1=c2=0;while(d<a.length){f=a.charCodeAt(d);if(f<128){b+=String.fromCharCode(f);d++}else{if((f>191)&&(f<224)){c2=a.charCodeAt(d+1);b+=String.fromCharCode(((f&31)<<6)|(c2&63));d+=2}else{c2=a.charCodeAt(d+1);c3=a.charCodeAt(d+2);b+=String.fromCharCode(((f&15)<<12)|((c2&63)<<6)|(c3&63));d+=3}}}return b}};var Scriptaculous={Version:"1.9.0",require:function(b){try{document.write('<script type="text/javascript" src="'+b+'"><\/script>')}catch(c){var a=document.createElement("script");a.type="text/javascript";a.src=b;document.getElementsByTagName("head")[0].appendChild(a)}},REQUIRED_PROTOTYPE:"1.6.0.3",load:function(){function a(c){var d=c.replace(/_.*|\./g,"");d=parseInt(d+"0".times(4-d.length));return c.indexOf("_")>-1?d-1:d}if((typeof Prototype=="undefined")||(typeof Element=="undefined")||(typeof Element.Methods=="undefined")||(a(Prototype.Version)<a(Scriptaculous.REQUIRED_PROTOTYPE))){throw ("script.aculo.us requires the Prototype JavaScript framework >= "+Scriptaculous.REQUIRED_PROTOTYPE)}var b=/scriptaculous\.js(\?.*)?$/;$$("script[src]").findAll(function(c){return c.src.match(b)}).each(function(d){var f=d.src.replace(b,""),c=d.src.match(/\?.*load=([a-z,]*)/);(c?c[1]:"builder,effects,dragdrop,controls,slider,sound").split(",").each(function(g){Scriptaculous.require(f+g+".js")})})}};Scriptaculous.load();String.prototype.parseColor=function(){var a="#";if(this.slice(0,4)=="rgb("){var c=this.slice(4,this.length-1).split(",");var b=0;do{a+=parseInt(c[b]).toColorPart()}while(++b<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var b=1;b<4;b++){a+=(this.charAt(b)+this.charAt(b)).toLowerCase()}}if(this.length==7){a=this.toLowerCase()}}}return(a.length==7?a:(arguments[0]||this))};Element.collectTextNodes=function(a){return $A($(a).childNodes).collect(function(b){return(b.nodeType==3?b.nodeValue:(b.hasChildNodes()?Element.collectTextNodes(b):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(a,b){return $A($(a).childNodes).collect(function(c){return(c.nodeType==3?c.nodeValue:((c.hasChildNodes()&&!Element.hasClassName(c,b))?Element.collectTextNodesIgnoreClass(c,b):""))}).flatten().join("")};Element.setContentZoom=function(a,b){a=$(a);a.setStyle({fontSize:(b/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return a};Element.getInlineOpacity=function(a){return $(a).style.opacity||""};Element.forceRerendering=function(a){try{a=$(a);var c=document.createTextNode(" ");a.appendChild(c);a.removeChild(c)}catch(b){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(a){return(-Math.cos(a*Math.PI)/2)+0.5},reverse:function(a){return 1-a},flicker:function(a){var a=((-Math.cos(a*Math.PI)/4)+0.75)+Math.random()/4;return a>1?1:a},wobble:function(a){return(-Math.cos(a*Math.PI*(9*a))/2)+0.5},pulse:function(b,a){return(-Math.cos((b*((a||5)-0.5)*2)*Math.PI)/2)+0.5},spring:function(a){return 1-(Math.cos(a*4.5*Math.PI)*Math.exp(-a*6))},none:function(a){return 0},full:function(a){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(a){var b="position:relative";if(Prototype.Browser.IE){b+=";zoom:1"}a=$(a);$A(a.childNodes).each(function(c){if(c.nodeType==3){c.nodeValue.toArray().each(function(d){a.insertBefore(new Element("span",{style:b}).update(d==" "?String.fromCharCode(160):d),c)});Element.remove(c)}})},multiple:function(b,c){var f;if(((typeof b=="object")||Object.isFunction(b))&&(b.length)){f=b}else{f=$(b).childNodes}var a=Object.extend({speed:0.1,delay:0},arguments[2]||{});var d=a.delay;$A(f).each(function(k,g){new c(k,Object.extend(a,{delay:g*a.speed+d}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(b,c,a){b=$(b);c=(c||"appear").toLowerCase();return Effect[Effect.PAIRS[c][b.visible()?1:0]](b,Object.extend({queue:{position:"end",scope:(b.id||"global"),limit:1}},a||{}))}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(a){this.effects._each(a)},add:function(b){var c=new Date().getTime();var a=Object.isString(b.options.queue)?b.options.queue:b.options.queue.position;switch(a){case"front":this.effects.findAll(function(d){return d.state=="idle"}).each(function(d){d.startOn+=b.finishOn;d.finishOn+=b.finishOn});break;case"with-last":c=this.effects.pluck("startOn").max()||c;break;case"end":c=this.effects.pluck("finishOn").max()||c;break}b.startOn+=c;b.finishOn+=c;if(!b.options.queue.limit||(this.effects.length<b.options.queue.limit)){this.effects.push(b)}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)}},remove:function(a){this.effects=this.effects.reject(function(b){return b==a});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var c=new Date().getTime();for(var b=0,a=this.effects.length;b<a;b++){this.effects[b]&&this.effects[b].loop(c)}}});Effect.Queues={instances:$H(),get:function(a){if(!Object.isString(a)){return a}return this.instances.get(a)||this.instances.set(a,new Effect.ScopedQueue())}};Effect.Queue=Effect.Queues.get("global");Effect.Base=Class.create({position:null,start:function(a){if(a&&a.transition===false){a.transition=Effect.Transitions.linear}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),a||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;this.render=(function(){function b(d,c){if(d.options[c+"Internal"]){d.options[c+"Internal"](d)}if(d.options[c]){d.options[c](d)}}return function(c){if(this.state==="idle"){this.state="running";b(this,"beforeSetup");if(this.setup){this.setup()}b(this,"afterSetup")}if(this.state==="running"){c=(this.options.transition(c)*this.fromToDelta)+this.options.from;this.position=c;b(this,"beforeUpdate");if(this.update){this.update(c)}b(this,"afterUpdate")}}})();this.event("beforeStart");if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this)}},loop:function(c){if(c>=this.startOn){if(c>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return}var b=(c-this.startOn)/this.totalTime,a=(b*this.totalFrames).round();if(a>this.currentFrame){this.render(b);this.currentFrame=a}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(a){if(this.options[a+"Internal"]){this.options[a+"Internal"](this)}if(this.options[a]){this.options[a](this)}},inspect:function(){var a=$H();for(property in this){if(!Object.isFunction(this[property])){a.set(property,this[property])}}return"#<Effect:"+a.inspect()+",options:"+$H(this.options).inspect()+">"}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(a){this.effects=a||[];this.start(arguments[1])},update:function(a){this.effects.invoke("render",a)},finish:function(a){this.effects.each(function(b){b.render(1);b.cancel();b.event("beforeFinish");if(b.finish){b.finish(a)}b.event("afterFinish")})}});Effect.Tween=Class.create(Effect.Base,{initialize:function(c,g,f){c=Object.isString(c)?$(c):c;var b=$A(arguments),d=b.last(),a=b.length==5?b[3]:null;this.method=Object.isFunction(d)?d.bind(c):Object.isFunction(c[d])?c[d].bind(c):function(k){c[d]=k};this.start(Object.extend({from:g,to:f},a||{}))},update:function(a){this.method(a)}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var a=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(a)},update:function(a){this.element.setOpacity(a)}});Effect.Move=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(a)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(a){this.element.setStyle({left:(this.options.x*a+this.originalLeft).round()+"px",top:(this.options.y*a+this.originalTop).round()+"px"})}});Effect.MoveBy=function(b,a,c){return new Effect.Move(b,Object.extend({x:c,y:a},arguments[3]||{}))};Effect.Scale=Class.create(Effect.Base,{initialize:function(b,c){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:c},arguments[2]||{});this.start(a)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(b){this.originalStyle[b]=this.element.style[b]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var a=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(b){if(a.indexOf(b)>0){this.fontSize=parseFloat(a);this.fontSizeType=b}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(a){var b=(this.options.scaleFrom/100)+(this.factor*a);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*b+this.fontSizeType})}this.setDimensions(this.dims[0]*b,this.dims[1]*b)},finish:function(a){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(a,f){var g={};if(this.options.scaleX){g.width=f.round()+"px"}if(this.options.scaleY){g.height=a.round()+"px"}if(this.options.scaleFromCenter){var c=(a-this.dims[0])/2;var b=(f-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){g.top=this.originalTop-c+"px"}if(this.options.scaleX){g.left=this.originalLeft-b+"px"}}else{if(this.options.scaleY){g.top=-c+"px"}if(this.options.scaleX){g.left=-b+"px"}}}this.element.setStyle(g)}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(a)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(a){return parseInt(this.options.startcolor.slice(a*2+1,a*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(a){return parseInt(this.options.endcolor.slice(a*2+1,a*2+3),16)-this._base[a]}.bind(this))},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(b,c,d){return b+((this._base[d]+(this._delta[d]*a)).round().toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(c){var b=arguments[1]||{},a=document.viewport.getScrollOffsets(),d=$(c).cumulativeOffset();if(b.offset){d[1]+=b.offset}return new Effect.Tween(null,a.top,d[1],b,function(f){scrollTo(a.left,f.round())})};Effect.Fade=function(c){c=$(c);var a=c.getInlineOpacity();var b=Object.extend({from:c.getOpacity()||1,to:0,afterFinishInternal:function(d){if(d.options.to!=0){return}d.element.hide().setStyle({opacity:a})}},arguments[1]||{});return new Effect.Opacity(c,b)};Effect.Appear=function(b){b=$(b);var a=Object.extend({from:(b.getStyle("display")=="none"?0:b.getOpacity()||0),to:1,afterFinishInternal:function(c){c.element.forceRerendering()},beforeSetup:function(c){c.element.setOpacity(c.options.from).show()}},arguments[1]||{});return new Effect.Opacity(b,a)};Effect.Puff=function(b){b=$(b);var a={opacity:b.getInlineOpacity(),position:b.getStyle("position"),top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};return new Effect.Parallel([new Effect.Scale(b,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(c){Position.absolutize(c.effects[0].element)},afterFinishInternal:function(c){c.effects[0].element.hide().setStyle(a)}},arguments[1]||{}))};Effect.BlindUp=function(a){a=$(a);a.makeClipping();return new Effect.Scale(a,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(b){b.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(b){b=$(b);var a=b.getDimensions();return new Effect.Scale(b,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:a.height,originalWidth:a.width},restoreAfterFinish:true,afterSetup:function(c){c.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(c){c.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(b){b=$(b);var a=b.getInlineOpacity();return new Effect.Appear(b,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(c){new Effect.Scale(c.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(d){d.element.makePositioned().makeClipping()},afterFinishInternal:function(d){d.element.hide().undoClipping().undoPositioned().setStyle({opacity:a})}})}},arguments[1]||{}))};Effect.DropOut=function(b){b=$(b);var a={top:b.getStyle("top"),left:b.getStyle("left"),opacity:b.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(b,{x:0,y:100,sync:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(c){c.effects[0].element.makePositioned()},afterFinishInternal:function(c){c.effects[0].element.hide().undoPositioned().setStyle(a)}},arguments[1]||{}))};Effect.Shake=function(d){d=$(d);var b=Object.extend({distance:20,duration:0.5},arguments[1]||{});var f=parseFloat(b.distance);var c=parseFloat(b.duration)/10;var a={top:d.getStyle("top"),left:d.getStyle("left")};return new Effect.Move(d,{x:f,y:0,duration:c,afterFinishInternal:function(g){new Effect.Move(g.element,{x:-f*2,y:0,duration:c*2,afterFinishInternal:function(k){new Effect.Move(k.element,{x:f*2,y:0,duration:c*2,afterFinishInternal:function(n){new Effect.Move(n.element,{x:-f*2,y:0,duration:c*2,afterFinishInternal:function(o){new Effect.Move(o.element,{x:f*2,y:0,duration:c*2,afterFinishInternal:function(p){new Effect.Move(p.element,{x:-f,y:0,duration:c,afterFinishInternal:function(q){q.element.undoPositioned().setStyle(a)}})}})}})}})}})}})};Effect.SlideDown=function(c){c=$(c).cleanWhitespace();var a=c.down().getStyle("bottom");var b=c.getDimensions();return new Effect.Scale(c,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();d.element.down().makePositioned();if(window.opera){d.element.setStyle({top:""})}d.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"})},afterFinishInternal:function(d){d.element.undoClipping().undoPositioned();d.element.down().undoPositioned().setStyle({bottom:a})}},arguments[1]||{}))};Effect.SlideUp=function(c){c=$(c).cleanWhitespace();var a=c.down().getStyle("bottom");var b=c.getDimensions();return new Effect.Scale(c,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();d.element.down().makePositioned();if(window.opera){d.element.setStyle({top:""})}d.element.makeClipping().show()},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"})},afterFinishInternal:function(d){d.element.hide().undoClipping().undoPositioned();d.element.down().undoPositioned().setStyle({bottom:a})}},arguments[1]||{}))};Effect.Squish=function(a){return new Effect.Scale(a,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(b){b.element.makeClipping()},afterFinishInternal:function(b){b.element.hide().undoClipping()}})};Effect.Grow=function(c){c=$(c);var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var a={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};var k=c.getDimensions();var n,g;var f,d;switch(b.direction){case"top-left":n=g=f=d=0;break;case"top-right":n=k.width;g=d=0;f=-k.width;break;case"bottom-left":n=f=0;g=k.height;d=-k.height;break;case"bottom-right":n=k.width;g=k.height;f=-k.width;d=-k.height;break;case"center":n=k.width/2;g=k.height/2;f=-k.width/2;d=-k.height/2;break}return new Effect.Move(c,{x:n,y:g,duration:0.01,beforeSetup:function(o){o.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(o){new Effect.Parallel([new Effect.Opacity(o.element,{sync:true,to:1,from:0,transition:b.opacityTransition}),new Effect.Move(o.element,{x:f,y:d,sync:true,transition:b.moveTransition}),new Effect.Scale(o.element,100,{scaleMode:{originalHeight:k.height,originalWidth:k.width},sync:true,scaleFrom:window.opera?1:0,transition:b.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(p){p.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(p){p.effects[0].element.undoClipping().undoPositioned().setStyle(a)}},b))}})};Effect.Shrink=function(c){c=$(c);var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var a={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};var g=c.getDimensions();var f,d;switch(b.direction){case"top-left":f=d=0;break;case"top-right":f=g.width;d=0;break;case"bottom-left":f=0;d=g.height;break;case"bottom-right":f=g.width;d=g.height;break;case"center":f=g.width/2;d=g.height/2;break}return new Effect.Parallel([new Effect.Opacity(c,{sync:true,to:0,from:1,transition:b.opacityTransition}),new Effect.Scale(c,window.opera?1:0,{sync:true,transition:b.scaleTransition,restoreAfterFinish:true}),new Effect.Move(c,{x:f,y:d,sync:true,transition:b.moveTransition})],Object.extend({beforeStartInternal:function(k){k.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(k){k.effects[0].element.hide().undoClipping().undoPositioned().setStyle(a)}},b))};Effect.Pulsate=function(c){c=$(c);var b=arguments[1]||{},a=c.getInlineOpacity(),f=b.transition||Effect.Transitions.linear,d=function(g){return 1-f((-Math.cos((g*(b.pulses||5)*2)*Math.PI)/2)+0.5)};return new Effect.Opacity(c,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(g){g.element.setStyle({opacity:a})}},b),{transition:d}))};Effect.Fold=function(b){b=$(b);var a={top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};b.makeClipping();return new Effect.Scale(b,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(c){new Effect.Scale(b,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(d){d.element.hide().undoClipping().setStyle(a)}})}},arguments[1]||{}))};Effect.Morph=Class.create(Effect.Base,{initialize:function(c){this.element=$(c);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(a.style)){this.style=$H(a.style)}else{if(a.style.include(":")){this.style=a.style.parseStyle()}else{this.element.addClassName(a.style);this.style=$H(this.element.getStyles());this.element.removeClassName(a.style);var b=this.element.getStyles();this.style=this.style.reject(function(d){return d.value==b[d.key]});a.afterFinishInternal=function(d){d.element.addClassName(d.options.style);d.transforms.each(function(f){d.element.style[f.style]=""})}}}this.start(a)},setup:function(){function a(b){if(!b||["rgba(0, 0, 0, 0)","transparent"].include(b)){b="#ffffff"}b=b.parseColor();return $R(0,2).map(function(c){return parseInt(b.slice(c*2+1,c*2+3),16)})}this.transforms=this.style.map(function(k){var g=k[0],f=k[1],d=null;if(f.parseColor("#zzzzzz")!="#zzzzzz"){f=f.parseColor();d="color"}else{if(g=="opacity"){f=parseFloat(f);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(f)){var c=f.match(/^([\+\-]?[0-9\.]+)(.*)$/);f=parseFloat(c[1]);d=(c.length==3)?c[2]:null}}}var b=this.element.getStyle(g);return{style:g.camelize(),originalValue:d=="color"?a(b):parseFloat(b||0),targetValue:d=="color"?a(f):f,unit:d}}.bind(this)).reject(function(b){return((b.originalValue==b.targetValue)||(b.unit!="color"&&(isNaN(b.originalValue)||isNaN(b.targetValue))))})},update:function(a){var d={},b,c=this.transforms.length;while(c--){d[(b=this.transforms[c]).style]=b.unit=="color"?"#"+(Math.round(b.originalValue[0]+(b.targetValue[0]-b.originalValue[0])*a)).toColorPart()+(Math.round(b.originalValue[1]+(b.targetValue[1]-b.originalValue[1])*a)).toColorPart()+(Math.round(b.originalValue[2]+(b.targetValue[2]-b.originalValue[2])*a)).toColorPart():(b.originalValue+(b.targetValue-b.originalValue)*a).toFixed(3)+(b.unit===null?"":b.unit)}this.element.setStyle(d,true)}});Effect.Transform=Class.create({initialize:function(a){this.tracks=[];this.options=arguments[1]||{};this.addTracks(a)},addTracks:function(a){a.each(function(b){b=$H(b);var c=b.values().first();this.tracks.push($H({ids:b.keys().first(),effect:Effect.Morph,options:{style:c}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(a){var d=a.get("ids"),c=a.get("effect"),b=a.get("options");var f=[$(d)||$$(d)].flatten();return f.map(function(g){return new c(g,Object.extend({sync:true},b))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");String.prototype.parseStyle=function(){var b,a=$H();if(Prototype.Browser.WebKit){b=new Element("div",{style:this}).style}else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';b=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(c){if(b[c]){a.set(c,b[c])}});if(Prototype.Browser.IE&&this.include("opacity")){a.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])}return a};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(b){var a=document.defaultView.getComputedStyle($(b),null);return Element.CSS_PROPERTIES.inject({},function(c,d){c[d]=a[d];return c})}}else{Element.getStyles=function(b){b=$(b);var a=b.currentStyle,c;c=Element.CSS_PROPERTIES.inject({},function(d,f){d[f]=a[f];return d});if(!c.opacity){c.opacity=b.getOpacity()}return c}}Effect.Methods={morph:function(a,b){a=$(a);new Effect.Morph(a,Object.extend({style:b},arguments[2]||{}));return a},visualEffect:function(c,f,b){c=$(c);var d=f.dasherize().camelize(),a=d.charAt(0).toUpperCase()+d.substring(1);new Effect[a](c,b);return c},highlight:function(b,a){b=$(b);new Effect.Highlight(b,a);return b}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(a){Effect.Methods[a]=function(c,b){c=$(c);Effect[a.charAt(0).toUpperCase()+a.substring(1)](c,b);return c}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(a){Effect.Methods[a]=Element[a]});Element.addMethods(Effect.Methods);var Builder={NODEMAP:{AREA:"map",CAPTION:"table",COL:"table",COLGROUP:"table",LEGEND:"fieldset",OPTGROUP:"select",OPTION:"select",PARAM:"object",TBODY:"table",TD:"table",TFOOT:"table",TH:"table",THEAD:"table",TR:"table"},node:function(a){a=a.toUpperCase();var g=this.NODEMAP[a]||"div";var b=document.createElement(g);try{b.innerHTML="<"+a+"></"+a+">"}catch(f){}var d=b.firstChild||null;if(d&&(d.tagName.toUpperCase()!=a)){d=d.getElementsByTagName(a)[0]}if(!d){d=document.createElement(a)}if(!d){return}if(arguments[1]){if(this._isStringOrNumber(arguments[1])||(arguments[1] instanceof Array)||arguments[1].tagName){this._children(d,arguments[1])}else{var c=this._attributes(arguments[1]);if(c.length){try{b.innerHTML="<"+a+" "+c+"></"+a+">"}catch(f){}d=b.firstChild||null;if(!d){d=document.createElement(a);for(attr in arguments[1]){d[attr=="class"?"className":attr]=arguments[1][attr]}}if(d.tagName.toUpperCase()!=a){d=b.getElementsByTagName(a)[0]}}}}if(arguments[2]){this._children(d,arguments[2])}return $(d)},_text:function(a){return document.createTextNode(a)},ATTR_MAP:{className:"class",htmlFor:"for"},_attributes:function(a){var b=[];for(attribute in a){b.push((attribute in this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+'="'+a[attribute].toString().escapeHTML().gsub(/"/,"&quot;")+'"')}return b.join(" ")},_children:function(b,a){if(a.tagName){b.appendChild(a);return}if(typeof a=="object"){a.flatten().each(function(c){if(typeof c=="object"){b.appendChild(c)}else{if(Builder._isStringOrNumber(c)){b.appendChild(Builder._text(c))}}})}else{if(Builder._isStringOrNumber(a)){b.appendChild(Builder._text(a))}}},_isStringOrNumber:function(a){return(typeof a=="string"||typeof a=="number")},build:function(b){var a=this.node("div");$(a).update(b.strip());return a.down()},dump:function(b){if(typeof b!="object"&&typeof b!="function"){b=window}var a=("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);a.each(function(c){b[c]=function(){return Builder.node.apply(Builder,[c].concat($A(arguments)))}})}};if(typeof Effect=="undefined"){throw ("controls.js requires including script.aculo.us' effects.js library")}var Autocompleter={};Autocompleter.Base=Class.create({baseInitialize:function(b,c,a){b=$(b);this.element=b;this.update=$(c);this.hasFocus=false;this.changed=false;this.active=false;this.index=0;this.entryCount=0;this.oldElementValue=this.element.value;if(this.setOptions){this.setOptions(a)}else{this.options=a||{}}this.options.paramName=this.options.paramName||this.element.name;this.options.tokens=this.options.tokens||[];this.options.frequency=this.options.frequency||0.4;this.options.minChars=this.options.minChars||1;this.options.onShow=this.options.onShow||function(d,f){if(!f.style.position||f.style.position=="absolute"){f.style.position="absolute";Position.clone(d,f,{setHeight:false,offsetTop:d.offsetHeight})}Effect.Appear(f,{duration:0.15})};this.options.onHide=this.options.onHide||function(d,f){new Effect.Fade(f,{duration:0.15})};if(typeof(this.options.tokens)=="string"){this.options.tokens=new Array(this.options.tokens)}if(!this.options.tokens.include("\n")){this.options.tokens.push("\n")}this.observer=null;this.element.setAttribute("autocomplete","off");Element.hide(this.update);Event.observe(this.element,"blur",this.onBlur.bindAsEventListener(this));Event.observe(this.element,"keydown",this.onKeyPress.bindAsEventListener(this))},show:function(){if(Element.getStyle(this.update,"display")=="none"){this.options.onShow(this.element,this.update)}if(!this.iefix&&(Prototype.Browser.IE)&&(Element.getStyle(this.update,"position")=="absolute")){new Insertion.After(this.update,'<iframe id="'+this.update.id+'_iefix" style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" src="javascript:false;" frameborder="0" scrolling="no"></iframe>');this.iefix=$(this.update.id+"_iefix")}if(this.iefix){setTimeout(this.fixIEOverlapping.bind(this),50)}},fixIEOverlapping:function(){Position.clone(this.update,this.iefix,{setTop:(!this.update.style.height)});this.iefix.style.zIndex=1;this.update.style.zIndex=2;Element.show(this.iefix)},hide:function(){this.stopIndicator();if(Element.getStyle(this.update,"display")!="none"){this.options.onHide(this.element,this.update)}if(this.iefix){Element.hide(this.iefix)}},startIndicator:function(){if(this.options.indicator){Element.show(this.options.indicator)}},stopIndicator:function(){if(this.options.indicator){Element.hide(this.options.indicator)}},onKeyPress:function(a){if(this.active){switch(a.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:this.selectEntry();Event.stop(a);case Event.KEY_ESC:this.hide();this.active=false;Event.stop(a);return;case Event.KEY_LEFT:case Event.KEY_RIGHT:return;case Event.KEY_UP:this.markPrevious();this.render();Event.stop(a);return;case Event.KEY_DOWN:this.markNext();this.render();Event.stop(a);return}}else{if(a.keyCode==Event.KEY_TAB||a.keyCode==Event.KEY_RETURN||(Prototype.Browser.WebKit>0&&a.keyCode==0)){return}}this.changed=true;this.hasFocus=true;if(this.observer){clearTimeout(this.observer)}this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000)},activate:function(){this.changed=false;this.hasFocus=true;this.getUpdatedChoices()},onHover:function(b){var a=Event.findElement(b,"LI");if(this.index!=a.autocompleteIndex){this.index=a.autocompleteIndex;this.render()}Event.stop(b)},onClick:function(b){var a=Event.findElement(b,"LI");this.index=a.autocompleteIndex;this.selectEntry();this.hide()},onBlur:function(a){setTimeout(this.hide.bind(this),250);this.hasFocus=false;this.active=false},render:function(){if(this.entryCount>0){for(var a=0;a<this.entryCount;a++){this.index==a?Element.addClassName(this.getEntry(a),"selected"):Element.removeClassName(this.getEntry(a),"selected")}if(this.hasFocus){this.show();this.active=true}}else{this.active=false;this.hide()}},markPrevious:function(){if(this.index>0){this.index--}else{this.index=this.entryCount-1}this.getEntry(this.index).scrollIntoView(true)},markNext:function(){if(this.index<this.entryCount-1){this.index++}else{this.index=0}this.getEntry(this.index).scrollIntoView(false)},getEntry:function(a){return this.update.firstChild.childNodes[a]},getCurrentEntry:function(){return this.getEntry(this.index)},selectEntry:function(){this.active=false;this.updateElement(this.getCurrentEntry())},updateElement:function(g){if(this.options.updateElement){this.options.updateElement(g);return}var d="";if(this.options.select){var a=$(g).select("."+this.options.select)||[];if(a.length>0){d=Element.collectTextNodes(a[0],this.options.select)}}else{d=Element.collectTextNodesIgnoreClass(g,"informal")}var c=this.getTokenBounds();if(c[0]!=-1){var f=this.element.value.substr(0,c[0]);var b=this.element.value.substr(c[0]).match(/^\s+/);if(b){f+=b[0]}this.element.value=f+d+this.element.value.substr(c[1])}else{this.element.value=d}this.oldElementValue=this.element.value;this.element.focus();if(this.options.afterUpdateElement){this.options.afterUpdateElement(this.element,g)}},updateChoices:function(c){if(!this.changed&&this.hasFocus){this.update.innerHTML=c;Element.cleanWhitespace(this.update);Element.cleanWhitespace(this.update.down());if(this.update.firstChild&&this.update.down().childNodes){this.entryCount=this.update.down().childNodes.length;for(var a=0;a<this.entryCount;a++){var b=this.getEntry(a);b.autocompleteIndex=a;this.addObservers(b)}}else{this.entryCount=0}this.stopIndicator();this.index=0;if(this.entryCount==1&&this.options.autoSelect){this.selectEntry();this.hide()}else{this.render()}}},addObservers:function(a){Event.observe(a,"mouseover",this.onHover.bindAsEventListener(this));Event.observe(a,"click",this.onClick.bindAsEventListener(this))},onObserverEvent:function(){this.changed=false;this.tokenBounds=null;if(this.getToken().length>=this.options.minChars){this.getUpdatedChoices()}else{this.active=false;this.hide()}this.oldElementValue=this.element.value},getToken:function(){var a=this.getTokenBounds();return this.element.value.substring(a[0],a[1]).strip()},getTokenBounds:function(){if(null!=this.tokenBounds){return this.tokenBounds}var f=this.element.value;if(f.strip().empty()){return[-1,0]}var g=arguments.callee.getFirstDifferencePos(f,this.oldElementValue);var n=(g==this.oldElementValue.length?1:0);var d=-1,c=f.length;var k;for(var b=0,a=this.options.tokens.length;b<a;++b){k=f.lastIndexOf(this.options.tokens[b],g+n-1);if(k>d){d=k}k=f.indexOf(this.options.tokens[b],g+n);if(-1!=k&&k<c){c=k}}return(this.tokenBounds=[d+1,c])}});Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos=function(c,a){var d=Math.min(c.length,a.length);for(var b=0;b<d;++b){if(c[b]!=a[b]){return b}}return d};Ajax.Autocompleter=Class.create(Autocompleter.Base,{initialize:function(c,d,b,a){this.baseInitialize(c,d,a);this.options.asynchronous=true;this.options.onComplete=this.onComplete.bind(this);this.options.defaultParams=this.options.parameters||null;this.url=b},getUpdatedChoices:function(){this.startIndicator();var a=encodeURIComponent(this.options.paramName)+"="+encodeURIComponent(this.getToken());this.options.parameters=this.options.callback?this.options.callback(this.element,a):a;if(this.options.defaultParams){this.options.parameters+="&"+this.options.defaultParams}new Ajax.Request(this.url,this.options)},onComplete:function(a){this.updateChoices(a.responseText)}});Autocompleter.Local=Class.create(Autocompleter.Base,{initialize:function(b,d,c,a){this.baseInitialize(b,d,a);this.options.array=c},getUpdatedChoices:function(){this.updateChoices(this.options.selector(this))},setOptions:function(a){this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(b){var d=[];var c=[];var n=b.getToken();var k=0;for(var f=0;f<b.options.array.length&&d.length<b.options.choices;f++){var g=b.options.array[f];var o=b.options.ignoreCase?g.toLowerCase().indexOf(n.toLowerCase()):g.indexOf(n);while(o!=-1){if(o==0&&g.length!=n.length){d.push("<li><strong>"+g.substr(0,n.length)+"</strong>"+g.substr(n.length)+"</li>");break}else{if(n.length>=b.options.partialChars&&b.options.partialSearch&&o!=-1){if(b.options.fullSearch||/\s/.test(g.substr(o-1,1))){c.push("<li>"+g.substr(0,o)+"<strong>"+g.substr(o,n.length)+"</strong>"+g.substr(o+n.length)+"</li>");break}}}o=b.options.ignoreCase?g.toLowerCase().indexOf(n.toLowerCase(),o+1):g.indexOf(n,o+1)}}if(c.length){d=d.concat(c.slice(0,b.options.choices-d.length))}return"<ul>"+d.join("")+"</ul>"}},a||{})}});Field.scrollFreeActivate=function(a){setTimeout(function(){Field.activate(a)},1)};Ajax.InPlaceEditor=Class.create({initialize:function(c,b,a){this.url=b;this.element=c=$(c);this.prepareOptions();this._controls={};arguments.callee.dealWithDeprecatedOptions(a);Object.extend(this.options,a||{});if(!this.options.formId&&this.element.id){this.options.formId=this.element.id+"-inplaceeditor";if($(this.options.formId)){this.options.formId=""}}if(this.options.externalControl){this.options.externalControl=$(this.options.externalControl)}if(!this.options.externalControl){this.options.externalControlOnly=false}this._originalBackground=this.element.getStyle("background-color")||"transparent";this.element.title=this.options.clickToEditText;this._boundCancelHandler=this.handleFormCancellation.bind(this);this._boundComplete=(this.options.onComplete||Prototype.emptyFunction).bind(this);this._boundFailureHandler=this.handleAJAXFailure.bind(this);this._boundSubmitHandler=this.handleFormSubmission.bind(this);this._boundWrapperHandler=this.wrapUp.bind(this);this.registerListeners()},checkForEscapeOrReturn:function(a){if(!this._editing||a.ctrlKey||a.altKey||a.shiftKey){return}if(Event.KEY_ESC==a.keyCode){this.handleFormCancellation(a)}else{if(Event.KEY_RETURN==a.keyCode){this.handleFormSubmission(a)}}},createControl:function(k,c,b){var f=this.options[k+"Control"];var g=this.options[k+"Text"];if("button"==f){var a=document.createElement("input");a.type="submit";a.value=g;a.className="editor_"+k+"_button";if("cancel"==k){a.onclick=this._boundCancelHandler}this._form.appendChild(a);this._controls[k]=a}else{if("link"==f){var d=document.createElement("a");d.href="#";d.appendChild(document.createTextNode(g));d.onclick="cancel"==k?this._boundCancelHandler:this._boundSubmitHandler;d.className="editor_"+k+"_link";if(b){d.className+=" "+b}this._form.appendChild(d);this._controls[k]=d}}},createEditField:function(){var c=(this.options.loadTextURL?this.options.loadingText:this.getText());var b;if(1>=this.options.rows&&!/\r|\n/.test(this.getText())){b=document.createElement("input");b.type="text";var a=this.options.size||this.options.cols||0;if(0<a){b.size=a}}else{b=document.createElement("textarea");b.rows=(1>=this.options.rows?this.options.autoRows:this.options.rows);b.cols=this.options.cols||40}b.name=this.options.paramName;b.value=c;b.className="editor_field";if(this.options.submitOnBlur){b.onblur=this._boundSubmitHandler}this._controls.editor=b;if(this.options.loadTextURL){this.loadExternalText()}this._form.appendChild(this._controls.editor)},createForm:function(){var b=this;function a(d,f){var c=b.options["text"+d+"Controls"];if(!c||f===false){return}b._form.appendChild(document.createTextNode(c))}this._form=$(document.createElement("form"));this._form.id=this.options.formId;this._form.addClassName(this.options.formClassName);this._form.onsubmit=this._boundSubmitHandler;this.createEditField();if("textarea"==this._controls.editor.tagName.toLowerCase()){this._form.appendChild(document.createElement("br"))}if(this.options.onFormCustomization){this.options.onFormCustomization(this,this._form)}a("Before",this.options.okControl||this.options.cancelControl);this.createControl("ok",this._boundSubmitHandler);a("Between",this.options.okControl&&this.options.cancelControl);this.createControl("cancel",this._boundCancelHandler,"editor_cancel");a("After",this.options.okControl||this.options.cancelControl)},destroy:function(){if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML}this.leaveEditMode();this.unregisterListeners()},enterEditMode:function(a){if(this._saving||this._editing){return}this._editing=true;this.triggerCallback("onEnterEditMode");if(this.options.externalControl){this.options.externalControl.hide()}this.element.hide();this.createForm();this.element.parentNode.insertBefore(this._form,this.element);if(!this.options.loadTextURL){this.postProcessEditField()}if(a){Event.stop(a)}},enterHover:function(a){if(this.options.hoverClassName){this.element.addClassName(this.options.hoverClassName)}if(this._saving){return}this.triggerCallback("onEnterHover")},getText:function(){return this.element.innerHTML.unescapeHTML()},handleAJAXFailure:function(a){this.triggerCallback("onFailure",a);if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML;this._oldInnerHTML=null}},handleFormCancellation:function(a){this.wrapUp();if(a){Event.stop(a)}},handleFormSubmission:function(d){var b=this._form;var c=$F(this._controls.editor);this.prepareSubmission();var f=this.options.callback(b,c)||"";if(Object.isString(f)){f=f.toQueryParams()}f.editorId=this.element.id;if(this.options.htmlResponse){var a=Object.extend({evalScripts:true},this.options.ajaxOptions);Object.extend(a,{parameters:f,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Updater({success:this.element},this.url,a)}else{var a=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(a,{parameters:f,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Request(this.url,a)}if(d){Event.stop(d)}},leaveEditMode:function(){this.element.removeClassName(this.options.savingClassName);this.removeForm();this.leaveHover();this.element.style.backgroundColor=this._originalBackground;this.element.show();if(this.options.externalControl){this.options.externalControl.show()}this._saving=false;this._editing=false;this._oldInnerHTML=null;this.triggerCallback("onLeaveEditMode")},leaveHover:function(a){if(this.options.hoverClassName){this.element.removeClassName(this.options.hoverClassName)}if(this._saving){return}this.triggerCallback("onLeaveHover")},loadExternalText:function(){this._form.addClassName(this.options.loadingClassName);this._controls.editor.disabled=true;var a=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(a,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(c){this._form.removeClassName(this.options.loadingClassName);var b=c.responseText;if(this.options.stripLoadedTextTags){b=b.stripTags()}this._controls.editor.value=b;this._controls.editor.disabled=false;this.postProcessEditField()}.bind(this),onFailure:this._boundFailureHandler});new Ajax.Request(this.options.loadTextURL,a)},postProcessEditField:function(){var a=this.options.fieldPostCreation;if(a){$(this._controls.editor)["focus"==a?"focus":"activate"]()}},prepareOptions:function(){this.options=Object.clone(Ajax.InPlaceEditor.DefaultOptions);Object.extend(this.options,Ajax.InPlaceEditor.DefaultCallbacks);[this._extraDefaultOptions].flatten().compact().each(function(a){Object.extend(this.options,a)}.bind(this))},prepareSubmission:function(){this._saving=true;this.removeForm();this.leaveHover();this.showSaving()},registerListeners:function(){this._listeners={};var a;$H(Ajax.InPlaceEditor.Listeners).each(function(b){a=this[b.value].bind(this);this._listeners[b.key]=a;if(!this.options.externalControlOnly){this.element.observe(b.key,a)}if(this.options.externalControl){this.options.externalControl.observe(b.key,a)}}.bind(this))},removeForm:function(){if(!this._form){return}this._form.remove();this._form=null;this._controls={}},showSaving:function(){this._oldInnerHTML=this.element.innerHTML;this.element.innerHTML=this.options.savingText;this.element.addClassName(this.options.savingClassName);this.element.style.backgroundColor=this._originalBackground;this.element.show()},triggerCallback:function(b,a){if("function"==typeof this.options[b]){this.options[b](this,a)}},unregisterListeners:function(){$H(this._listeners).each(function(a){if(!this.options.externalControlOnly){this.element.stopObserving(a.key,a.value)}if(this.options.externalControl){this.options.externalControl.stopObserving(a.key,a.value)}}.bind(this))},wrapUp:function(a){this.leaveEditMode();this._boundComplete(a,this.element)}});Object.extend(Ajax.InPlaceEditor.prototype,{dispose:Ajax.InPlaceEditor.prototype.destroy});Ajax.InPlaceCollectionEditor=Class.create(Ajax.InPlaceEditor,{initialize:function($super,c,b,a){this._extraDefaultOptions=Ajax.InPlaceCollectionEditor.DefaultOptions;$super(c,b,a)},createEditField:function(){var a=document.createElement("select");a.name=this.options.paramName;a.size=1;this._controls.editor=a;this._collection=this.options.collection||[];if(this.options.loadCollectionURL){this.loadCollection()}else{this.checkForExternalText()}this._form.appendChild(this._controls.editor)},loadCollection:function(){this._form.addClassName(this.options.loadingClassName);this.showLoadingText(this.options.loadingCollectionText);var options=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(options,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(transport){var js=transport.responseText.strip();if(!/^\[.*\]$/.test(js)){throw ("Server returned an invalid collection representation.")}this._collection=eval(js);this.checkForExternalText()}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadCollectionURL,options)},showLoadingText:function(b){this._controls.editor.disabled=true;var a=this._controls.editor.firstChild;if(!a){a=document.createElement("option");a.value="";this._controls.editor.appendChild(a);a.selected=true}a.update((b||"").stripScripts().stripTags())},checkForExternalText:function(){this._text=this.getText();if(this.options.loadTextURL){this.loadExternalText()}else{this.buildOptionList()}},loadExternalText:function(){this.showLoadingText(this.options.loadingText);var a=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(a,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(b){this._text=b.responseText.strip();this.buildOptionList()}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadTextURL,a)},buildOptionList:function(){this._form.removeClassName(this.options.loadingClassName);this._collection=this._collection.map(function(d){return 2===d.length?d:[d,d].flatten()});var b=("value" in this.options)?this.options.value:this._text;var a=this._collection.any(function(d){return d[0]==b}.bind(this));this._controls.editor.update("");var c;this._collection.each(function(f,d){c=document.createElement("option");c.value=f[0];c.selected=a?f[0]==b:0==d;c.appendChild(document.createTextNode(f[1]));this._controls.editor.appendChild(c)}.bind(this));this._controls.editor.disabled=false;Field.scrollFreeActivate(this._controls.editor)}});Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions=function(a){if(!a){return}function b(c,d){if(c in a||d===undefined){return}a[c]=d}b("cancelControl",(a.cancelLink?"link":(a.cancelButton?"button":a.cancelLink==a.cancelButton==false?false:undefined)));b("okControl",(a.okLink?"link":(a.okButton?"button":a.okLink==a.okButton==false?false:undefined)));b("highlightColor",a.highlightcolor);b("highlightEndColor",a.highlightendcolor)};Object.extend(Ajax.InPlaceEditor,{DefaultOptions:{ajaxOptions:{},autoRows:3,cancelControl:"link",cancelText:"cancel",clickToEditText:"Click to edit",externalControl:null,externalControlOnly:false,fieldPostCreation:"activate",formClassName:"inplaceeditor-form",formId:null,highlightColor:"#ffff99",highlightEndColor:"#ffffff",hoverClassName:"",htmlResponse:true,loadingClassName:"inplaceeditor-loading",loadingText:"Loading...",okControl:"button",okText:"ok",paramName:"value",rows:1,savingClassName:"inplaceeditor-saving",savingText:"Saving...",size:0,stripLoadedTextTags:false,submitOnBlur:false,textAfterControls:"",textBeforeControls:"",textBetweenControls:""},DefaultCallbacks:{callback:function(a){return Form.serialize(a)},onComplete:function(b,a){new Effect.Highlight(a,{startcolor:this.options.highlightColor,keepBackgroundImage:true})},onEnterEditMode:null,onEnterHover:function(a){a.element.style.backgroundColor=a.options.highlightColor;if(a._effect){a._effect.cancel()}},onFailure:function(b,a){alert("Error communication with the server: "+b.responseText.stripTags())},onFormCustomization:null,onLeaveEditMode:null,onLeaveHover:function(a){a._effect=new Effect.Highlight(a.element,{startcolor:a.options.highlightColor,endcolor:a.options.highlightEndColor,restorecolor:a._originalBackground,keepBackgroundImage:true})}},Listeners:{click:"enterEditMode",keydown:"checkForEscapeOrReturn",mouseover:"enterHover",mouseout:"leaveHover"}});Ajax.InPlaceCollectionEditor.DefaultOptions={loadingCollectionText:"Loading options..."};Form.Element.DelayedObserver=Class.create({initialize:function(b,a,c){this.delay=a||0.5;this.element=$(b);this.callback=c;this.timer=null;this.lastValue=$F(this.element);Event.observe(this.element,"keyup",this.delayedListener.bindAsEventListener(this))},delayedListener:function(a){if(this.lastValue==$F(this.element)){return}if(this.timer){clearTimeout(this.timer)}this.timer=setTimeout(this.onTimerEvent.bind(this),this.delay*1000);this.lastValue=$F(this.element)},onTimerEvent:function(){this.timer=null;this.callback(this.element,$F(this.element))}});if(Object.isUndefined(Effect)){throw ("dragdrop.js requires including script.aculo.us' effects.js library")}var Droppables={drops:[],remove:function(a){this.drops=this.drops.reject(function(b){return b.element==$(a)})},add:function(b){b=$(b);var a=Object.extend({greedy:true,hoverclass:null,tree:false},arguments[1]||{});if(a.containment){a._containers=[];var c=a.containment;if(Object.isArray(c)){c.each(function(d){a._containers.push($(d))})}else{a._containers.push($(c))}}if(a.accept){a.accept=[a.accept].flatten()}Element.makePositioned(b);a.element=b;this.drops.push(a)},findDeepestChild:function(a){deepest=a[0];for(i=1;i<a.length;++i){if(Element.isParent(a[i].element,deepest.element)){deepest=a[i]}}return deepest},isContained:function(b,a){var c;if(a.tree){c=b.treeNode}else{c=b.parentNode}return a._containers.detect(function(d){return c==d})},isAffected:function(a,c,b){return((b.element!=c)&&((!b._containers)||this.isContained(c,b))&&((!b.accept)||(Element.classNames(c).detect(function(d){return b.accept.include(d)})))&&Position.within(b.element,a[0],a[1]))},deactivate:function(a){if(a.hoverclass){Element.removeClassName(a.element,a.hoverclass)}this.last_active=null},activate:function(a){if(a.hoverclass){Element.addClassName(a.element,a.hoverclass)}this.last_active=a},show:function(a,c){if(!this.drops.length){return}var b,d=[];this.drops.each(function(f){if(Droppables.isAffected(a,c,f)){d.push(f)}});if(d.length>0){b=Droppables.findDeepestChild(d)}if(this.last_active&&this.last_active!=b){this.deactivate(this.last_active)}if(b){Position.within(b.element,a[0],a[1]);if(b.onHover){b.onHover(c,b.element,Position.overlap(b.overlap,b.element))}if(b!=this.last_active){Droppables.activate(b)}}},fire:function(b,a){if(!this.last_active){return}Position.prepare();if(this.isAffected([Event.pointerX(b),Event.pointerY(b)],a,this.last_active)){if(this.last_active.onDrop){this.last_active.onDrop(a,this.last_active.element,b);return true}}},reset:function(){if(this.last_active){this.deactivate(this.last_active)}}};var Draggables={drags:[],observers:[],register:function(a){if(this.drags.length==0){this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.updateDrag.bindAsEventListener(this);this.eventKeypress=this.keyPress.bindAsEventListener(this);Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);Event.observe(document,"keypress",this.eventKeypress)}this.drags.push(a)},unregister:function(a){this.drags=this.drags.reject(function(b){return b==a});if(this.drags.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);Event.stopObserving(document,"keypress",this.eventKeypress)}},activate:function(a){if(a.options.delay){this._timeout=setTimeout(function(){Draggables._timeout=null;window.focus();Draggables.activeDraggable=a}.bind(this),a.options.delay)}else{window.focus();this.activeDraggable=a}},deactivate:function(){this.activeDraggable=null},updateDrag:function(a){if(!this.activeDraggable){return}var b=[Event.pointerX(a),Event.pointerY(a)];if(this._lastPointer&&(this._lastPointer.inspect()==b.inspect())){return}this._lastPointer=b;this.activeDraggable.updateDrag(a,b)},endDrag:function(a){if(this._timeout){clearTimeout(this._timeout);this._timeout=null}if(!this.activeDraggable){return}this._lastPointer=null;this.activeDraggable.endDrag(a);this.activeDraggable=null},keyPress:function(a){if(this.activeDraggable){this.activeDraggable.keyPress(a)}},addObserver:function(a){this.observers.push(a);this._cacheObserverCallbacks()},removeObserver:function(a){this.observers=this.observers.reject(function(b){return b.element==a});this._cacheObserverCallbacks()},notify:function(b,a,c){if(this[b+"Count"]>0){this.observers.each(function(d){if(d[b]){d[b](b,a,c)}})}if(a.options[b]){a.options[b](a,c)}},_cacheObserverCallbacks:function(){["onStart","onEnd","onDrag"].each(function(a){Draggables[a+"Count"]=Draggables.observers.select(function(b){return b[a]}).length})}};var Draggable=Class.create({initialize:function(b){var c={handle:false,reverteffect:function(g,f,d){var k=Math.sqrt(Math.abs(f^2)+Math.abs(d^2))*0.02;new Effect.Move(g,{x:-d,y:-f,duration:k,queue:{scope:"_draggable",position:"end"}})},endeffect:function(f){var d=Object.isNumber(f._opacity)?f._opacity:1;new Effect.Opacity(f,{duration:0.2,from:0.7,to:d,queue:{scope:"_draggable",position:"end"},afterFinish:function(){Draggable._dragging[f]=false}})},zindex:1000,revert:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false,delay:0};if(!arguments[1]||Object.isUndefined(arguments[1].endeffect)){Object.extend(c,{starteffect:function(d){d._opacity=Element.getOpacity(d);Draggable._dragging[d]=true;new Effect.Opacity(d,{duration:0.2,from:d._opacity,to:0.7})}})}var a=Object.extend(c,arguments[1]||{});this.element=$(b);if(a.handle&&Object.isString(a.handle)){this.handle=this.element.down("."+a.handle,0)}if(!this.handle){this.handle=$(a.handle)}if(!this.handle){this.handle=this.element}if(a.scroll&&!a.scroll.scrollTo&&!a.scroll.outerHTML){a.scroll=$(a.scroll);this._isScrollChild=Element.childOf(this.element,a.scroll)}Element.makePositioned(this.element);this.options=a;this.dragging=false;this.eventMouseDown=this.initDrag.bindAsEventListener(this);Event.observe(this.handle,"mousedown",this.eventMouseDown);Draggables.register(this)},destroy:function(){Event.stopObserving(this.handle,"mousedown",this.eventMouseDown);Draggables.unregister(this)},currentDelta:function(){return([parseInt(Element.getStyle(this.element,"left")||"0"),parseInt(Element.getStyle(this.element,"top")||"0")])},initDrag:function(a){if(!Object.isUndefined(Draggable._dragging[this.element])&&Draggable._dragging[this.element]){return}if(Event.isLeftClick(a)){var c=Event.element(a);if((tag_name=c.tagName.toUpperCase())&&(tag_name=="INPUT"||tag_name=="SELECT"||tag_name=="OPTION"||tag_name=="BUTTON"||tag_name=="TEXTAREA")){return}var b=[Event.pointerX(a),Event.pointerY(a)];var d=this.element.cumulativeOffset();this.offset=[0,1].map(function(f){return(b[f]-d[f])});Draggables.activate(this);Event.stop(a)}},startDrag:function(b){this.dragging=true;if(!this.delta){this.delta=this.currentDelta()}if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,"z-index")||0);this.element.style.zIndex=this.options.zindex}if(this.options.ghosting){this._clone=this.element.cloneNode(true);this._originallyAbsolute=(this.element.getStyle("position")=="absolute");if(!this._originallyAbsolute){Position.absolutize(this.element)}this.element.parentNode.insertBefore(this._clone,this.element)}if(this.options.scroll){if(this.options.scroll==window){var a=this._getWindowScroll(this.options.scroll);this.originalScrollLeft=a.left;this.originalScrollTop=a.top}else{this.originalScrollLeft=this.options.scroll.scrollLeft;this.originalScrollTop=this.options.scroll.scrollTop}}Draggables.notify("onStart",this,b);if(this.options.starteffect){this.options.starteffect(this.element)}},updateDrag:function(event,pointer){if(!this.dragging){this.startDrag(event)}if(!this.options.quiet){Position.prepare();Droppables.show(pointer,this.element)}Draggables.notify("onDrag",this,event);this.draw(pointer);if(this.options.change){this.options.change(this)}if(this.options.scroll){this.stopScrolling();var p;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){p=[left,top,left+width,top+height]}}else{p=Position.page(this.options.scroll).toArray();p[0]+=this.options.scroll.scrollLeft+Position.deltaX;p[1]+=this.options.scroll.scrollTop+Position.deltaY;p.push(p[0]+this.options.scroll.offsetWidth);p.push(p[1]+this.options.scroll.offsetHeight)}var speed=[0,0];if(pointer[0]<(p[0]+this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[0]+this.options.scrollSensitivity)}if(pointer[1]<(p[1]+this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[1]+this.options.scrollSensitivity)}if(pointer[0]>(p[2]-this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[2]-this.options.scrollSensitivity)}if(pointer[1]>(p[3]-this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[3]-this.options.scrollSensitivity)}this.startScrolling(speed)}if(Prototype.Browser.WebKit){window.scrollBy(0,0)}Event.stop(event)},finishDrag:function(b,g){this.dragging=false;if(this.options.quiet){Position.prepare();var f=[Event.pointerX(b),Event.pointerY(b)];Droppables.show(f,this.element)}if(this.options.ghosting){if(!this._originallyAbsolute){Position.relativize(this.element)}delete this._originallyAbsolute;Element.remove(this._clone);this._clone=null}var k=false;if(g){k=Droppables.fire(b,this.element);if(!k){k=false}}if(k&&this.options.onDropped){this.options.onDropped(this.element)}Draggables.notify("onEnd",this,b);var a=this.options.revert;if(a&&Object.isFunction(a)){a=a(this.element)}var c=this.currentDelta();if(a&&this.options.reverteffect){if(k==0||a!="failure"){this.options.reverteffect(this.element,c[1]-this.delta[1],c[0]-this.delta[0])}}else{this.delta=c}if(this.options.zindex){this.element.style.zIndex=this.originalZ}if(this.options.endeffect){this.options.endeffect(this.element)}Draggables.deactivate(this);Droppables.reset()},keyPress:function(a){if(a.keyCode!=Event.KEY_ESC){return}this.finishDrag(a,false);Event.stop(a)},endDrag:function(a){if(!this.dragging){return}this.stopScrolling();this.finishDrag(a,true);Event.stop(a)},draw:function(a){var k=this.element.cumulativeOffset();if(this.options.ghosting){var c=Position.realOffset(this.element);k[0]+=c[0]-Position.deltaX;k[1]+=c[1]-Position.deltaY}var g=this.currentDelta();k[0]-=g[0];k[1]-=g[1];if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){k[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;k[1]-=this.options.scroll.scrollTop-this.originalScrollTop}var f=[0,1].map(function(d){return(a[d]-k[d]-this.offset[d])}.bind(this));if(this.options.snap){if(Object.isFunction(this.options.snap)){f=this.options.snap(f[0],f[1],this)}else{if(Object.isArray(this.options.snap)){f=f.map(function(d,n){return(d/this.options.snap[n]).round()*this.options.snap[n]}.bind(this))}else{f=f.map(function(d){return(d/this.options.snap).round()*this.options.snap}.bind(this))}}}var b=this.element.style;if((!this.options.constraint)||(this.options.constraint=="horizontal")){b.left=f[0]+"px"}if((!this.options.constraint)||(this.options.constraint=="vertical")){b.top=f[1]+"px"}if(b.visibility=="hidden"){b.visibility=""}},stopScrolling:function(){if(this.scrollInterval){clearInterval(this.scrollInterval);this.scrollInterval=null;Draggables._lastScrollPointer=null}},startScrolling:function(a){if(!(a[0]||a[1])){return}this.scrollSpeed=[a[0]*this.options.scrollSpeed,a[1]*this.options.scrollSpeed];this.lastScrolled=new Date();this.scrollInterval=setInterval(this.scroll.bind(this),10)},scroll:function(){var current=new Date();var delta=current-this.lastScrolled;this.lastScrolled=current;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){if(this.scrollSpeed[0]||this.scrollSpeed[1]){var d=delta/1000;this.options.scroll.scrollTo(left+d*this.scrollSpeed[0],top+d*this.scrollSpeed[1])}}}else{this.options.scroll.scrollLeft+=this.scrollSpeed[0]*delta/1000;this.options.scroll.scrollTop+=this.scrollSpeed[1]*delta/1000}Position.prepare();Droppables.show(Draggables._lastPointer,this.element);Draggables.notify("onDrag",this);if(this._isScrollChild){Draggables._lastScrollPointer=Draggables._lastScrollPointer||$A(Draggables._lastPointer);Draggables._lastScrollPointer[0]+=this.scrollSpeed[0]*delta/1000;Draggables._lastScrollPointer[1]+=this.scrollSpeed[1]*delta/1000;if(Draggables._lastScrollPointer[0]<0){Draggables._lastScrollPointer[0]=0}if(Draggables._lastScrollPointer[1]<0){Draggables._lastScrollPointer[1]=0}this.draw(Draggables._lastScrollPointer)}if(this.options.change){this.options.change(this)}},_getWindowScroll:function(w){var T,L,W,H;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft}else{if(w.document.body){T=body.scrollTop;L=body.scrollLeft}}if(w.innerWidth){W=w.innerWidth;H=w.innerHeight}else{if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight}else{W=body.offsetWidth;H=body.offsetHeight}}}return{top:T,left:L,width:W,height:H}}});Draggable._dragging={};var SortableObserver=Class.create({initialize:function(b,a){this.element=$(b);this.observer=a;this.lastValue=Sortable.serialize(this.element)},onStart:function(){this.lastValue=Sortable.serialize(this.element)},onEnd:function(){Sortable.unmark();if(this.lastValue!=Sortable.serialize(this.element)){this.observer(this.element)}}});var Sortable={SERIALIZE_RULE:/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,sortables:{},_findRootElement:function(a){while(a.tagName.toUpperCase()!="BODY"){if(a.id&&Sortable.sortables[a.id]){return a}a=a.parentNode}},options:function(a){a=Sortable._findRootElement($(a));if(!a){return}return Sortable.sortables[a.id]},destroy:function(a){a=$(a);var b=Sortable.sortables[a.id];if(b){Draggables.removeObserver(b.element);b.droppables.each(function(c){Droppables.remove(c)});b.draggables.invoke("destroy");delete Sortable.sortables[b.element.id]}},create:function(c){c=$(c);var b=Object.extend({element:c,tag:"li",dropOnEmpty:false,tree:false,treeTag:"ul",overlap:"vertical",constraint:"vertical",containment:c,handle:false,only:false,delay:0,hoverclass:null,ghosting:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:this.SERIALIZE_RULE,elements:false,handles:false,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},arguments[1]||{});this.destroy(c);var a={revert:true,quiet:b.quiet,scroll:b.scroll,scrollSpeed:b.scrollSpeed,scrollSensitivity:b.scrollSensitivity,delay:b.delay,ghosting:b.ghosting,constraint:b.constraint,handle:b.handle};if(b.starteffect){a.starteffect=b.starteffect}if(b.reverteffect){a.reverteffect=b.reverteffect}else{if(b.ghosting){a.reverteffect=function(g){g.style.top=0;g.style.left=0}}}if(b.endeffect){a.endeffect=b.endeffect}if(b.zindex){a.zindex=b.zindex}var d={overlap:b.overlap,containment:b.containment,tree:b.tree,hoverclass:b.hoverclass,onHover:Sortable.onHover};var f={onHover:Sortable.onEmptyHover,overlap:b.overlap,containment:b.containment,hoverclass:b.hoverclass};Element.cleanWhitespace(c);b.draggables=[];b.droppables=[];if(b.dropOnEmpty||b.tree){Droppables.add(c,f);b.droppables.push(c)}(b.elements||this.findElements(c,b)||[]).each(function(n,g){var k=b.handles?$(b.handles[g]):(b.handle?$(n).select("."+b.handle)[0]:n);b.draggables.push(new Draggable(n,Object.extend(a,{handle:k})));Droppables.add(n,d);if(b.tree){n.treeNode=c}b.droppables.push(n)});if(b.tree){(Sortable.findTreeElements(c,b)||[]).each(function(g){Droppables.add(g,f);g.treeNode=c;b.droppables.push(g)})}this.sortables[c.identify()]=b;Draggables.addObserver(new SortableObserver(c,b.onUpdate))},findElements:function(b,a){return Element.findChildren(b,a.only,a.tree?true:false,a.tag)},findTreeElements:function(b,a){return Element.findChildren(b,a.only,a.tree?true:false,a.treeTag)},onHover:function(f,d,a){if(Element.isParent(d,f)){return}if(a>0.33&&a<0.66&&Sortable.options(d).tree){return}else{if(a>0.5){Sortable.mark(d,"before");if(d.previousSibling!=f){var b=f.parentNode;f.style.visibility="hidden";d.parentNode.insertBefore(f,d);if(d.parentNode!=b){Sortable.options(b).onChange(f)}Sortable.options(d.parentNode).onChange(f)}}else{Sortable.mark(d,"after");var c=d.nextSibling||null;if(c!=f){var b=f.parentNode;f.style.visibility="hidden";d.parentNode.insertBefore(f,c);if(d.parentNode!=b){Sortable.options(b).onChange(f)}Sortable.options(d.parentNode).onChange(f)}}}},onEmptyHover:function(f,k,n){var o=f.parentNode;var a=Sortable.options(k);if(!Element.isParent(k,f)){var g;var c=Sortable.findElements(k,{tag:a.tag,only:a.only});var b=null;if(c){var d=Element.offsetSize(k,a.overlap)*(1-n);for(g=0;g<c.length;g+=1){if(d-Element.offsetSize(c[g],a.overlap)>=0){d-=Element.offsetSize(c[g],a.overlap)}else{if(d-(Element.offsetSize(c[g],a.overlap)/2)>=0){b=g+1<c.length?c[g+1]:null;break}else{b=c[g];break}}}}k.insertBefore(f,b);Sortable.options(o).onChange(f);a.onChange(f)}},unmark:function(){if(Sortable._marker){Sortable._marker.hide()}},mark:function(b,a){var d=Sortable.options(b.parentNode);if(d&&!d.ghosting){return}if(!Sortable._marker){Sortable._marker=($("dropmarker")||Element.extend(document.createElement("DIV"))).hide().addClassName("dropmarker").setStyle({position:"absolute"});document.getElementsByTagName("body").item(0).appendChild(Sortable._marker)}var c=b.cumulativeOffset();Sortable._marker.setStyle({left:c[0]+"px",top:c[1]+"px"});if(a=="after"){if(d.overlap=="horizontal"){Sortable._marker.setStyle({left:(c[0]+b.clientWidth)+"px"})}else{Sortable._marker.setStyle({top:(c[1]+b.clientHeight)+"px"})}}Sortable._marker.show()},_tree:function(f,b,g){var d=Sortable.findElements(f,b)||[];for(var c=0;c<d.length;++c){var a=d[c].id.match(b.format);if(!a){continue}var k={id:encodeURIComponent(a?a[1]:null),element:f,parent:g,children:[],position:g.children.length,container:$(d[c]).down(b.treeTag)};if(k.container){this._tree(k.container,b,k)}g.children.push(k)}return g},tree:function(d){d=$(d);var c=this.options(d);var b=Object.extend({tag:c.tag,treeTag:c.treeTag,only:c.only,name:d.id,format:c.format},arguments[1]||{});var a={id:null,parent:null,children:[],container:d,position:0};return Sortable._tree(d,b,a)},_constructIndex:function(b){var a="";do{if(b.id){a="["+b.position+"]"+a}}while((b=b.parent)!=null);return a},sequence:function(b){b=$(b);var a=Object.extend(this.options(b),arguments[1]||{});return $(this.findElements(b,a)||[]).map(function(c){return c.id.match(a.format)?c.id.match(a.format)[1]:""})},setSequence:function(b,c){b=$(b);var a=Object.extend(this.options(b),arguments[2]||{});var d={};this.findElements(b,a).each(function(f){if(f.id.match(a.format)){d[f.id.match(a.format)[1]]=[f,f.parentNode]}f.parentNode.removeChild(f)});c.each(function(f){var g=d[f];if(g){g[1].appendChild(g[0]);delete d[f]}})},serialize:function(c){c=$(c);var b=Object.extend(Sortable.options(c),arguments[1]||{});var a=encodeURIComponent((arguments[1]&&arguments[1].name)?arguments[1].name:c.id);if(b.tree){return Sortable.tree(c,arguments[1]).children.map(function(d){return[a+Sortable._constructIndex(d)+"[id]="+encodeURIComponent(d.id)].concat(d.children.map(arguments.callee))}).flatten().join("&")}else{return Sortable.sequence(c,arguments[1]).map(function(d){return a+"[]="+encodeURIComponent(d)}).join("&")}}};Element.isParent=function(b,a){if(!b.parentNode||b==a){return false}if(b.parentNode==a){return true}return Element.isParent(b.parentNode,a)};Element.findChildren=function(d,b,a,c){if(!d.hasChildNodes()){return null}c=c.toUpperCase();if(b){b=[b].flatten()}var f=[];$A(d.childNodes).each(function(k){if(k.tagName&&k.tagName.toUpperCase()==c&&(!b||(Element.classNames(k).detect(function(n){return b.include(n)})))){f.push(k)}if(a){var g=Element.findChildren(k,b,a,c);if(g){f.push(g)}}});return(f.length>0?f.flatten():[])};Element.offsetSize=function(a,b){return a["offset"+((b=="vertical"||b=="height")?"Height":"Width")]};if(!Control){var Control={}}Control.Slider=Class.create({initialize:function(d,a,b){var c=this;if(Object.isArray(d)){this.handles=d.collect(function(f){return $(f)})}else{this.handles=[$(d)]}this.track=$(a);this.options=b||{};this.axis=this.options.axis||"horizontal";this.increment=this.options.increment||1;this.step=parseInt(this.options.step||"1");this.range=this.options.range||$R(0,1);this.value=0;this.values=this.handles.map(function(){return 0});this.spans=this.options.spans?this.options.spans.map(function(f){return $(f)}):false;this.options.startSpan=$(this.options.startSpan||null);this.options.endSpan=$(this.options.endSpan||null);this.restricted=this.options.restricted||false;this.maximum=this.options.maximum||this.range.end;this.minimum=this.options.minimum||this.range.start;this.alignX=parseInt(this.options.alignX||"0");this.alignY=parseInt(this.options.alignY||"0");this.trackLength=this.maximumOffset()-this.minimumOffset();this.handleLength=this.isVertical()?(this.handles[0].offsetHeight!=0?this.handles[0].offsetHeight:this.handles[0].style.height.replace(/px$/,"")):(this.handles[0].offsetWidth!=0?this.handles[0].offsetWidth:this.handles[0].style.width.replace(/px$/,""));this.active=false;this.dragging=false;this.disabled=false;if(this.options.disabled){this.setDisabled()}this.allowedValues=this.options.values?this.options.values.sortBy(Prototype.K):false;if(this.allowedValues){this.minimum=this.allowedValues.min();this.maximum=this.allowedValues.max()}this.eventMouseDown=this.startDrag.bindAsEventListener(this);this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.update.bindAsEventListener(this);this.handles.each(function(g,f){f=c.handles.length-1-f;c.setValue(parseFloat((Object.isArray(c.options.sliderValue)?c.options.sliderValue[f]:c.options.sliderValue)||c.range.start),f);g.makePositioned().observe("mousedown",c.eventMouseDown)});this.track.observe("mousedown",this.eventMouseDown);document.observe("mouseup",this.eventMouseUp);document.observe("mousemove",this.eventMouseMove);this.initialized=true},dispose:function(){var a=this;Event.stopObserving(this.track,"mousedown",this.eventMouseDown);Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);this.handles.each(function(b){Event.stopObserving(b,"mousedown",a.eventMouseDown)})},setDisabled:function(){this.disabled=true},setEnabled:function(){this.disabled=false},getNearestValue:function(a){if(this.allowedValues){if(a>=this.allowedValues.max()){return(this.allowedValues.max())}if(a<=this.allowedValues.min()){return(this.allowedValues.min())}var c=Math.abs(this.allowedValues[0]-a);var b=this.allowedValues[0];this.allowedValues.each(function(d){var f=Math.abs(d-a);if(f<=c){b=d;c=f}});return b}if(a>this.range.end){return this.range.end}if(a<this.range.start){return this.range.start}return a},setValue:function(b,a){if(!this.active){this.activeHandleIdx=a||0;this.activeHandle=this.handles[this.activeHandleIdx];this.updateStyles()}a=a||this.activeHandleIdx||0;if(this.initialized&&this.restricted){if((a>0)&&(b<this.values[a-1])){b=this.values[a-1]}if((a<(this.handles.length-1))&&(b>this.values[a+1])){b=this.values[a+1]}}b=this.getNearestValue(b);this.values[a]=b;this.value=this.values[0];this.handles[a].style[this.isVertical()?"top":"left"]=this.translateToPx(b);this.drawSpans();if(!this.dragging||!this.event){this.updateFinished()}},setValueBy:function(b,a){this.setValue(this.values[a||this.activeHandleIdx||0]+b,a||this.activeHandleIdx||0)},translateToPx:function(a){return Math.round(((this.trackLength-this.handleLength)/(this.range.end-this.range.start))*(a-this.range.start))+"px"},translateToValue:function(a){return((a/(this.trackLength-this.handleLength)*(this.range.end-this.range.start))+this.range.start)},getRange:function(b){var a=this.values.sortBy(Prototype.K);b=b||0;return $R(a[b],a[b+1])},minimumOffset:function(){return(this.isVertical()?this.alignY:this.alignX)},maximumOffset:function(){return(this.isVertical()?(this.track.offsetHeight!=0?this.track.offsetHeight:this.track.style.height.replace(/px$/,""))-this.alignY:(this.track.offsetWidth!=0?this.track.offsetWidth:this.track.style.width.replace(/px$/,""))-this.alignX)},isVertical:function(){return(this.axis=="vertical")},drawSpans:function(){var a=this;if(this.spans){$R(0,this.spans.length-1).each(function(b){a.setSpan(a.spans[b],a.getRange(b))})}if(this.options.startSpan){this.setSpan(this.options.startSpan,$R(0,this.values.length>1?this.getRange(0).min():this.value))}if(this.options.endSpan){this.setSpan(this.options.endSpan,$R(this.values.length>1?this.getRange(this.spans.length-1).max():this.value,this.maximum))}},setSpan:function(b,a){if(this.isVertical()){b.style.top=this.translateToPx(a.start);b.style.height=this.translateToPx(a.end-a.start+this.range.start)}else{b.style.left=this.translateToPx(a.start);b.style.width=this.translateToPx(a.end-a.start+this.range.start)}},updateStyles:function(){this.handles.each(function(a){Element.removeClassName(a,"selected")});Element.addClassName(this.activeHandle,"selected")},startDrag:function(c){if(Event.isLeftClick(c)){if(!this.disabled){this.active=true;var d=Event.element(c);var f=[Event.pointerX(c),Event.pointerY(c)];var a=d;if(a==this.track){var b=this.track.cumulativeOffset();this.event=c;this.setValue(this.translateToValue((this.isVertical()?f[1]-b[1]:f[0]-b[0])-(this.handleLength/2)));var b=this.activeHandle.cumulativeOffset();this.offsetX=(f[0]-b[0]);this.offsetY=(f[1]-b[1])}else{while((this.handles.indexOf(d)==-1)&&d.parentNode){d=d.parentNode}if(this.handles.indexOf(d)!=-1){this.activeHandle=d;this.activeHandleIdx=this.handles.indexOf(this.activeHandle);this.updateStyles();var b=this.activeHandle.cumulativeOffset();this.offsetX=(f[0]-b[0]);this.offsetY=(f[1]-b[1])}}}Event.stop(c)}},update:function(a){if(this.active){if(!this.dragging){this.dragging=true}this.draw(a);if(Prototype.Browser.WebKit){window.scrollBy(0,0)}Event.stop(a)}},draw:function(b){var c=[Event.pointerX(b),Event.pointerY(b)];var a=this.track.cumulativeOffset();c[0]-=this.offsetX+a[0];c[1]-=this.offsetY+a[1];this.event=b;this.setValue(this.translateToValue(this.isVertical()?c[1]:c[0]));if(this.initialized&&this.options.onSlide){this.options.onSlide(this.values.length>1?this.values:this.value,this)}},endDrag:function(a){if(this.active&&this.dragging){this.finishDrag(a,true);Event.stop(a)}this.active=false;this.dragging=false},finishDrag:function(a,b){this.active=false;this.dragging=false;this.updateFinished()},updateFinished:function(){if(this.initialized&&this.options.onChange){this.options.onChange(this.values.length>1?this.values:this.value,this)}this.event=null}});Sound={tracks:{},_enabled:true,template:new Template('<embed style="height:0" id="sound_#{track}_#{id}" src="#{url}" loop="false" autostart="true" hidden="true"/>'),enable:function(){Sound._enabled=true},disable:function(){Sound._enabled=false},play:function(b){if(!Sound._enabled){return}var a=Object.extend({track:"global",url:b,replace:false},arguments[1]||{});if(a.replace&&this.tracks[a.track]){$R(0,this.tracks[a.track].id).each(function(d){var c=$("sound_"+a.track+"_"+d);c.Stop&&c.Stop();c.remove()});this.tracks[a.track]=null}if(!this.tracks[a.track]){this.tracks[a.track]={id:0}}else{this.tracks[a.track].id++}a.id=this.tracks[a.track].id;$$("body")[0].insert(Prototype.Browser.IE?new Element("bgsound",{id:"sound_"+a.track+"_"+a.id,src:a.url,loop:1,autostart:true}):Sound.template.evaluate(a))}};if(Prototype.Browser.Gecko&&navigator.userAgent.indexOf("Win")>0){if(navigator.plugins&&$A(navigator.plugins).detect(function(a){return a.name.indexOf("QuickTime")!=-1})){Sound.template=new Template('<object id="sound_#{track}_#{id}" width="0" height="0" type="audio/mpeg" data="#{url}"/>')}else{if(navigator.plugins&&$A(navigator.plugins).detect(function(a){return a.name.indexOf("Windows Media")!=-1})){Sound.template=new Template('<object id="sound_#{track}_#{id}" type="application/x-mplayer2" data="#{url}"></object>')}else{if(navigator.plugins&&$A(navigator.plugins).detect(function(a){return a.name.indexOf("RealPlayer")!=-1})){Sound.template=new Template('<embed type="audio/x-pn-realaudio-plugin" style="height:0" id="sound_#{track}_#{id}" src="#{url}" loop="false" autostart="true" hidden="true"/>')}else{Sound.play=function(){}}}}}if(!this.JSON){this.JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());function xml_http_request_object(){var a=false;try{a=new XMLHttpRequest()}catch(b){try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){a=false}}}return a}function xml_request(b,a,c){a+="&rand="+rand();req=xml_http_request_object();req.open(b,a,c);req.setRequestHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");req.send(null);return req.responseText}function xml_request_x(b,a,c){a+="?rand="+rand();req=xml_http_request_object();req.open(b,a,c);req.setRequestHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");req.send(null);return req.responseXML}Ajax.activeRequests={};var ajaxGlobalHandlers={onCreate:function(b,c){Ajax.activeRequests[b.url]="RUNNING";var a=$("ajax_loading");if(a){a.show()}},onComplete:function(b,c){Ajax.activeRequests[b.url]="done";if(Ajax.activeRequestCount==0){var a=$("ajax_loading");if(a){a.hide()}}},on404:function(a){alert('Error 404: location "'+a.statusText+'" was not found.')},onFailure:function(a){alert("error communicating with server.  Error: "+a.responseText)}};Ajax.Responders.register(ajaxGlobalHandlers);try{if(parent&&!(typeof parent.cdwm=="undefined"||typeof parent.cdwm=="unknown")){cdwm=parent.cdwm}}catch(e){}var images_fldr="/i/";var icon_fldr=images_fldr+"icons/";var expand_icon=new Image(16,16);expand_icon.src=icon_fldr+"expand_icon.gif";var collapse_icon=new Image(16,16);collapse_icon.src=icon_fldr+"collapse_icon.gif";var wiki_page_load_complete=false;function group_whois_popup(URL){day=new Date();id=day.getTime();eval("page"+id+" = window.open(URL, '"+id+"', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=250,height=300');")}function validatespacename(a){return/[^a-zA-Z0-9-]+/.test(a)}function validatenumlett(f){var d="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";var c="yes";var a;for(var b=0;b<f.value.length;b++){a=""+f.value.substring(b,b+1);if(d.indexOf(a)=="-1"){c="no"}}return c}function validatenumlettstr(f){var d="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";var c="yes";var a;for(var b=0;b<f.length;b++){a=""+f.substring(b,b+1);if(d.indexOf(a)=="-1"){c="no"}}return c}function strtrim(a){return a.replace(/^\s+/,"").replace(/\s+$/,"")}function findPos(a){var b=curtop=0;if(a.offsetParent){b=a.offsetLeft;curtop=a.offsetTop;while(a=a.offsetParent){b+=a.offsetLeft;curtop+=a.offsetTop}}return curtop}function makeRemote(c,b,d,a){remote=window.open(c,b,"height="+d+",width="+a+",toolbar=yes,location=no,scrollbars=yes,menubar=n");remote.location.href=c;if(remote.opener==null){remote.opener=window}}function notify(c,b){var a;if("success"==b){a=notify.getSuccessMsg(c)}else{if("notice"==b){a=notify.getNoticeMsg(c)}else{a=notify.getErrorMsg(c)}}document.body.appendChild(a);if("error"!==b){setTimeout(function(){a.fade();setTimeout(function(){document.body.removeChild(a)},3000)},7000)}}notify.getErrorMsg=function(c){var f=$(document.createElement("div"));f.addClassName("sysmessage sysmessage-screentop sysmessage-statuserror");f.insert('<img src="/i/ui2.0/statuserror.gif" class="sysmessage-icon">');var b=document.createElement("ul"),a=document.createElement("li");a.innerHTML=c;b.appendChild(a);f.appendChild(b);var d=$(document.createElement("a"));d.href="#close";d.addClassName("sysmessage-close icon icon_favorites_remove");f.appendChild(d);Event.observe(d,"click",function(g){f.fade();g.stop()});return f};notify.getSuccessMsg=function(c){var d=$(document.createElement("div"));d.addClassName("sysmessage sysmessage-screentop sysmessage-statusok");d.insert('<img src="/i/ui2.0/statusok.gif" class="sysmessage-icon">');var b=document.createElement("ul"),a=document.createElement("li");a.innerHTML=c;b.appendChild(a);d.appendChild(b);return d};notify.getNoticeMsg=function(c){var d=$(document.createElement("div"));d.addClassName("sysmessage sysmessage-screentop sysmessage-statusnotice");d.insert('<img src="/i/ui2.0/statusnotice.gif" class="sysmessage-icon">');var b=document.createElement("ul"),a=document.createElement("li");a.innerHTML=c;b.appendChild(a);d.appendChild(b);return d};function displaystatus(g,b,c,a,f){b=("e"==b)?"error":"success";return notify(g,b);if(!c){c="ffffff"}if(!a){a=6000}if(!f){f="stmsg"}var d=document.getElementById(f);if(d){d.innerHTML=statusmsg(g,b,c);d.style.display="block";window.setTimeout("document.getElementById('"+f+"').style.display = 'none';",a)}}function statusmsg(d,b,c){if(b=="e"){var a="#FF6666"}else{var a="#FFCC33"}return'<span class="p5 bl-noticeline"><ins class="icon icon_edit"></ins>'+d+"</span>"}function doSearch(a){var b="/home/search?q="+escape(searchTerm);if(a!="sort"&&$("sort")){b+="&q_sc="+escape($("sort")?$("sort").value:"")}if(a!="tag"&&$("tag")){b+="&tags="+escape($("tag").value)}if(a!="type"&&$("type")){b+="&q_at="+escape($("type").value)}if(!(a=="space"||a=="spaces")&&$("space")){b+="&st="+escape($("space").value)}if(a!="mlt"&&$("mlt")){b+="&mlt="+escape($("mlt").value)}document.location=b}function cdsrch(d){var c=encodeURIComponent(d.q.value);var a=d.alttype_id.value;var b=d.select_search_type.value;if(b=="web"){top.location="http://www.google.com/search?q="+c}else{if(b=="forum"){top.location="http://forum.centraldesktop.com/search.php?action=search&keywords="+c}else{if(b=="tags"){top.location="/home/search?q=&tags="+c+"&q_at="+a+"&st="}else{if(b=="cd"){top.location="/home/search?q="+c+"&q_at=8&st="}else{if(b=="help"){cd_launch_help_search(c)}else{top.location="/home/search?q="+c+"&q_at="+a+"&st="+b}}}}}return false}function cdsrch_public(a,c){var b=encodeURIComponent(document.getElementById(c).value);disablesubmit(a,"Searching...");window.location=cd_spaceurl+"search&q="+b;return false}function checkEntersrch_public(d,b,c){var a;if(d&&d.which){d=d;a=d.which}else{d=event;a=d.keyCode}if(a==13){cdsrch_public(b,c);return false}return true}function validateField(a,b){if(document.getElementById(a).value==""){alert(b);document.getElementById(a).focus();return false}else{return true}}function IsNumeric(b){var d="0123456789";var c=true;var a;for(i=0;i<b.length&&c==true;i++){a=b.charAt(i);if(d.indexOf(a)==-1){c=false}}return c}function showMessage(a){var c=document.getElementById("message");var b=document.getElementById("messages");if(c&&b){if(c.firstChild){c.removeChild(c.firstChild)}c.appendChild(document.createTextNode(a));b.style.display="block";if(typeof(window.cd_page)!="undefined"){if(cd_page=="filemanager"){if(browser.isIE){fixed_layout()}}}}}function hideMessage(b){var a=document.getElementById(b);if(a){a.style.display="none"}wiki_page_load_complete=true}function disablesubmit(a,b){if(document.getElementById(a)){document.getElementById(a).disabled=true;if(b){document.getElementById(a).value=b}}}function enablesubmit(a,b){if(document.getElementById(a)){document.getElementById(a).disabled=false;if(b){document.getElementById(a).value=b}}}function bigmsg(){if(document.getElementById("bigmsg")){window.setTimeout("document.getElementById('bigmsg').style.display = 'none';",10000)}}function switchFlags(b,a){$$(b).each(function(d,c){d.checked=a})}function check_all_boxes_in_form(a,c,b){(a.checked)?CheckAll(c,b):ClearAll(c,b)}function CheckAll(b,d){var f=document.forms[b];for(var a=0;a<f.elements.length;a++){var c=f.elements[a];if(c.id==d){c.checked=true;if(d=="itemids"){check_exec(c,c.parentNode.parentNode)}}}}function ClearAll(b,d){var f=document.forms[b];for(var a=0;a<f.elements.length;a++){var c=f.elements[a];if(c.id==d){c.checked=false;if(d=="itemids"){check_exec(c,c.parentNode.parentNode)}}}}function check_exec(b,a){}function clean_prompt_input_box(d){var b="";var a=d.length;for(i=0;i<a;i++){var c=d.charCodeAt(i);if(c==43){b+="%2b"}else{if(c>128){b+=d.charAt(i)}else{b+=escape(d.charAt(i))}}}return b}function rand(){return Math.random()}function randomString(){var d="0123456789abcdefghiklmnopqrstuvwxyz";var f=35;var c="";for(var b=0;b<f;b++){var a=Math.floor(Math.random()*d.length);c+=d.substring(a,a+1)}return"N"+c}function autolink(b){var a=/\s(ht|f)tp:\/\/([^ \,\;\:\!\)\(\"\'\<\>\f\n\r\t\v])+/g;return(b.replace(a,function(d,c,f){b=d.substring(1,d.length);while(b.length>0&&b.charAt(b.length-1)=="."){b=b.substring(0,b.length-1)}return" "+b.link(b)}))}function display_show(b,a){(a)?document.getElementById(b).style.display="block":document.getElementById(b).style.display="none"}function remove_table_rows(a,c,b){for(i=0;i<=c.length-1;i++){var d=document.getElementById(b+c[i]);if(d.tagName.toLowerCase()=="td"){d=d.parentNode}if(d){a.deleteRow(d.rowIndex)}}}var WikiCookies={all:[],readAll:function(){var a=document.cookie.split(";");for(var b=0;b<a.length;b++){var f=a[b];var d=f.split("=");if(d.length==2){this.all[d[0].replace(/(^\s*)|(\s*$)/g,"")]=unescape(d[1].replace(/(^\s*)|(\s*$)/g,""))}}},readcookie:function(b){var f=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var g=a[d];while(g.charAt(0)==" "){g=g.substring(1,g.length)}if(g.indexOf(f)==0){return g.substring(f.length,g.length)}}return null},save:function(c,d,f){f=f||365;var b=new Date();b.setTime(b.getTime()+(f*24*60*60*1000));var a="; expires="+b.toGMTString();document.cookie=c+"="+escape(d)+a+"; path=/"},remove:function(a){WikiCookies.save(a,"",-1)}};function str_rot13(g){var k=new String("");var c=g.length;var a;var d=new String("");if(c>0){for(var f=0;f<c;f++){a=g.charCodeAt(f);if(((a>64)&&(a<78))||((a>96)&&(a<110))){a=a+13}else{if(((a>77)&&(a<91))||((a>109)&&(a<123))){a=a-13}}d=String.fromCharCode(a);k=k.concat(d)}}return k}function install_ff_search_plugin(a){if(window.sidebar&&window.sidebar.addSearchEngine){window.sidebar.addSearchEngine(a.href,"http://www.centraldesktop.com/i/cd.png","Central Desktop Search Plugin","Search");return false}return true}function escramble_email(q,o,k){var g,f,r,p,n;g='<a href="mai';f=q;r='">';g+="lto:";f+="@";n="</a>";f+=o;f+=".";f+=k;p=f;document.write(g+f+r+p+n)}function escramble_email_only(k,g,f){var d,c;d="mai";c=k;d+="lto:";c+="@";c+=g;c+=".";c+=f;return d+c}function escramble_email_only_2(g,f){var d,c;d="mai";c=g;d+="lto:";c+="@";c+=f;return d+c}function msg_checkall(g,b){chkall=$("checkall_"+b).checked;var a=g.elements.length;for(var c=0;c<a;c++){var f=g.elements[c];if(f.id=="nu"){(chkall)?f.checked=true:f.checked=false}}}function check_firstchild(a){a.parentNode.firstChild.checked=(a.parentNode.firstChild.checked)?false:true}function open_notifier_sidebar(){var c="/spaces/recent_activity/";var d=250;var f=screen.availHeight-30;var b=screen.availWidth-d;var a=window.open(c,"navWin","width="+d+",height="+f+",top=0,left="+b+",resizable=0,status=0,menubar=0,titlebar=0,location=0");a.focus()}function insertTab(c,g){var f=9;if(c.which){var a=c.which}else{var a=c.keyCode}if(a==f){if(c.type=="keydown"){if(g.setSelectionRange){var b=g.selectionStart;var d=g.selectionEnd;g.value=g.value.substring(0,b)+"\t"+g.value.substr(d);g.setSelectionRange(b+1,b+1);g.focus()}else{if(g.createTextRange){document.selection.createRange().text="\t";g.onblur=function(){this.focus();this.onblur=null}}else{}}}if(c.returnValue){c.returnValue=false}if(c.preventDefault){c.preventDefault()}return false}return true}function strip_non_alpha_numerics(f){var b="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";var a;var d="";for(a=0;a<f.length;a++){var g=f.charAt(a);if(b.indexOf(g)>-1){d+=g}}return d}function switch_domains(){var b=$("cd_switch_domains");if(b){var a=b.style.display;b.style.display=(a=="none")?"block":"none"}}function validate_username(b){var a=xml_request("GET","/spaces/ns_doaction?do=check_valid_username&username="+b,false);return a}function validate_company(b){var a=xml_request("GET","/spaces/ns_doaction?do=check_valid_company&company="+b,false);return a}function validate_email(b){var a=xml_request("GET","/spaces/ns_doaction?do=check_valid_email&email="+b,false);return a}var already_sent_clt=false;function cd_done_loading(a){if(already_sent_clt||a<=0){return}var c=(((new Date()).getTime()-cd_began_loading)/1000);var b="/spaces/ns_doaction";var d={"do":"clt",id:a,lt:c,rand:Math.random()};new Ajax.Request(b,{method:"get",parameters:d,onSuccess:function(){var f=$("execution_time_client_side");if(f){f.innerHTML="Client Execution Time: "+c+" sec"}already_sent_clt=true}})}function getAnchorPosition(b){var f=false;var q=new Object();var p=0,k=0;var d=false,g=false,n=false;if(document.getElementById){d=true}else{if(document.all){g=true}else{if(document.layers){n=true}}}if(d&&document.all){p=AnchorPosition_getPageOffsetLeft(document.all[b]);k=AnchorPosition_getPageOffsetTop(document.all[b])}else{if(d){var a=document.getElementById(b);p=AnchorPosition_getPageOffsetLeft(a);k=AnchorPosition_getPageOffsetTop(a)}else{if(g){p=AnchorPosition_getPageOffsetLeft(document.all[b]);k=AnchorPosition_getPageOffsetTop(document.all[b])}else{if(n){var r=0;for(var c=0;c<document.anchors.length;c++){if(document.anchors[c].name==b){r=1;break}}if(r==0){q.x=0;q.y=0;return q}p=document.anchors[c].x;k=document.anchors[c].y}else{q.x=0;q.y=0;return q}}}}q.x=p;q.y=k;return q}function getAnchorWindowPosition(b){var c=getAnchorPosition(b);var a=0;var d=0;if(document.getElementById){if(isNaN(window.screenX)){a=c.x-document.body.scrollLeft+window.screenLeft;d=c.y-document.body.scrollTop+window.screenTop}else{a=c.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;d=c.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset}}else{if(document.all){a=c.x-document.body.scrollLeft+window.screenLeft;d=c.y-document.body.scrollTop+window.screenTop}else{if(document.layers){a=c.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;d=c.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset}}}c.x=a;c.y=d;return c}function AnchorPosition_getPageOffsetLeft(b){var a=b.offsetLeft;while((b=b.offsetParent)!=null){a+=b.offsetLeft}return a}function AnchorPosition_getWindowOffsetLeft(a){return AnchorPosition_getPageOffsetLeft(a)-document.body.scrollLeft}function AnchorPosition_getPageOffsetTop(a){var b=a.offsetTop;while((a=a.offsetParent)!=null){b+=a.offsetTop}return b}function AnchorPosition_getWindowOffsetTop(a){return AnchorPosition_getPageOffsetTop(a)-document.body.scrollTop}function PopupWindow_getXYPosition(a){var b;if(this.type=="WINDOW"){b=getAnchorWindowPosition(a)}else{b=getAnchorPosition(a)}this.x=b.x;this.y=b.y}function PopupWindow_setSize(b,a){this.width=b;this.height=a}function PopupWindow_populate(a){this.contents=a;this.populated=false}function PopupWindow_setUrl(a){this.url=a}function PopupWindow_setWindowProperties(a){this.windowProperties=a}function PopupWindow_refresh(){if(this.divName!=null){if(this.use_gebi){document.getElementById(this.divName).innerHTML=this.contents}else{if(this.use_css){document.all[this.divName].innerHTML=this.contents}else{if(this.use_layers){var a=document.layers[this.divName];a.document.open();a.document.writeln(this.contents);a.document.close()}}}}else{if(this.popupWindow!=null&&!this.popupWindow.closed){if(this.url!=""){this.popupWindow.location.href=this.url}else{this.popupWindow.document.open();this.popupWindow.document.writeln(this.contents);this.popupWindow.document.close()}this.popupWindow.focus()}}}function PopupWindow_showPopup(b){if(browser.isIE){overlay.toggleSelects(true)}if(this.divName.indexOf("cd_item_subscribers_")==0){var a=this.divName.substring(19,this.divName.length);$("cd_item_subscribers_list"+a).style.display="block"}this.getXYPosition(b);this.x+=this.offsetX;this.y+=this.offsetY;var d=dom.utils.getElementLeft(this);var c=dom.utils.getElementTop(this);if(!this.populated&&(this.contents!="")){this.populated=true;this.refresh()}if(this.divName!=null){dom.utils.getBody().appendChild($(this.divName));$(this.divName).style.top=c+"px";$(this.divName).style.left=d+"px";$(this.divName).style.position="absolute";$(this.divName).style.visibility="visible"}else{if(this.popupWindow==null||this.popupWindow.closed){if(this.x<0){this.x=0}if(this.y<0){this.y=0}if(screen&&screen.availHeight){if((this.y+this.height)>screen.availHeight){this.y=screen.availHeight-this.height}}if(screen&&screen.availWidth){if((this.x+this.width)>screen.availWidth){this.x=screen.availWidth-this.width}}var f=window.opera||(document.layers&&!navigator.mimeTypes["*"])||navigator.vendor=="KDE"||(document.childNodes&&!document.all&&!navigator.taintEnabled);this.popupWindow=window.open(f?"":"about:blank","window_"+b,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+"")}this.refresh()}}function PopupWindow_hidePopup(){if(browser.isIE){overlay.toggleSelects(false)}if(this.divName.indexOf("cd_item_subscribers_")==0){var a=this.divName.substring(19,this.divName.length);$("cd_item_subscribers_list"+a).style.display="none"}if(this.divName!=null){var b;if(this.use_gebi){b=document.getElementById(this.divName);if(b){b.style.visibility="hidden"}}else{if(this.use_css){b=document.all[this.divName];if(b){b.style.visibility="hidden"}}else{if(this.use_layers){b=document.layers[this.divName];if(b){b.visibility="hidden"}}}}}else{if(this.popupWindow&&!this.popupWindow.closed){this.popupWindow.close();this.popupWindow=null}}}function PopupWindow_isClicked(c){if(this.divName!=null){if(this.use_layers){var d=c.pageX;var b=c.pageY;var a=document.layers[this.divName];if((d>a.left)&&(d<a.left+a.clip.width)&&(b>a.top)&&(b<a.top+a.clip.height)){return true}else{return false}}else{if(document.all){var a=window.event.srcElement;while(a.parentElement!=null){if(a.id==this.divName){return true}a=a.parentElement}return false}else{if(this.use_gebi&&c){var a=c.target;while(a.parentNode!=null){if(a.id==this.divName){return true}a=a.parentNode}return false}}}return false}return false}function PopupWindow_hideIfNotClicked(a){if(this.autoHideEnabled&&!this.isClicked(a)){this.hidePopup()}}function PopupWindow_autoHide(){this.autoHideEnabled=true}function PopupWindow_hidePopupWindows(c){for(var a=0;a<popupWindowObjects.length;a++){if(popupWindowObjects[a]!=null){var b=popupWindowObjects[a];b.hideIfNotClicked(c)}}}function PopupWindow_attachListener(){Event.observe(document,"mouseup",PopupWindow_hidePopupWindows)}function PopupWindow(){if(!window.popupWindowIndex){window.popupWindowIndex=0}if(!window.popupWindowObjects){window.popupWindowObjects=new Array()}if(!window.listenerAttached){window.listenerAttached=true;PopupWindow_attachListener()}this.index=popupWindowIndex++;popupWindowObjects[this.index]=this;this.divName=null;this.popupWindow=null;this.width=0;this.height=0;this.populated=false;this.visible=false;this.autoHideEnabled=false;this.contents="";this.url="";this.windowProperties="toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable,alwaysRaised,dependent,titlebar=no";if(arguments.length>0){this.type="DIV";this.divName=arguments[0]}else{this.type="WINDOW"}this.use_gebi=false;this.use_css=false;this.use_layers=false;if(document.getElementById){this.use_gebi=true}else{if(document.all){this.use_css=true}else{if(document.layers){this.use_layers=true}else{this.type="WINDOW"}}}this.offsetX=0;this.offsetY=0;this.getXYPosition=PopupWindow_getXYPosition;this.populate=PopupWindow_populate;this.setUrl=PopupWindow_setUrl;this.setWindowProperties=PopupWindow_setWindowProperties;this.refresh=PopupWindow_refresh;this.showPopup=PopupWindow_showPopup;this.hidePopup=PopupWindow_hidePopup;this.setSize=PopupWindow_setSize;this.isClicked=PopupWindow_isClicked;this.autoHide=PopupWindow_autoHide;this.hideIfNotClicked=PopupWindow_hideIfNotClicked}function showTabDropDown(c,g){var g=$(g);if(!g){return}var b=function(n){var k=Event.findElement(n,"div");if(!k||!k.hasClassName("cd_tabs_dropdown")){$(document).stopObserving("click",b);g.hide()}};setTimeout(function(){Event.observe(document,"click",b)},50);g.show();g.style.top=g.up().getDimensions().height;var f=g.up().positionedOffset();var d=g.getDimensions();var a=document.viewport.getDimensions();if(f.left+d.width>a.width){g.style.right=0;g.style.left=""}else{g.style.left=0;g.style.right=""}}function showDropDown(f,b,d){var o=$(b);if(!o){return}if(o.parentNode.tagName.toLowerCase()!="body"){document.body.appendChild(o)}var n=function(q){var p=Event.findElement(q,".cd_dropdown_control");if(!p){$(document).stopObserving("click",n);o.hide()}};setTimeout(function(){Event.observe(document,"click",n)},50);o.style.position="absolute";o.show();var g=$(f).getDimensions();var a=$(f).cumulativeOffset();var c=o.getDimensions();var k=document.viewport.getDimensions();o.style.top=a[1]+g.height+"px";if((a[0]+c.width>k.width&&!d)||d=="left"){o.style.left=a[0]-(c.width-g.width)+"px"}else{o.style.left=a[0]+"px"}}function JSGetSwfVer(b){if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var c=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var a=navigator.plugins["Shockwave Flash"+c].description;descArray=a.split(" ");tempArrayMajor=descArray[2].split(".");versionMajor=tempArrayMajor[0];versionMinor=tempArrayMajor[1];if(descArray[3]!=""){tempArrayMinor=descArray[3].split("r")}else{tempArrayMinor=descArray[4].split("r")}versionRevision=tempArrayMinor[1]>0?tempArrayMinor[1]:0;flashVer=versionMajor+"."+versionMinor+"."+versionRevision}else{flashVer=-1}}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1){flashVer=4}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1){flashVer=3}else{if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1){flashVer=2}else{flashVer=-1}}}}return flashVer}function DetectFlashVer(c,b,a){reqVer=parseFloat(c+"."+a);for(i=25;i>0;i--){versionStr=JSGetSwfVer(i);if(versionStr==-1){return false}else{if(versionStr!=0){versionArray=versionStr.split(".");versionMajor=versionArray[0];versionMinor=versionArray[1];versionRevision=versionArray[2];versionString=versionMajor+"."+versionRevision;versionNum=parseFloat(versionString);if((versionMajor>c)&&(versionNum>=reqVer)){return true}else{return((versionNum>=reqVer&&versionMinor>=b)?true:false)}}}}return(reqVer?false:0)}var menu_small={on_hover:function(b,a){var c=(a=="b")?"bottom":"top";b.className="cd_"+c+"_menu_hover_on"},off_hover:function(b,a){var c=(a=="b")?"bottom":"top";b.className="cd_"+c+"_menu_hover_off"},ahref:function(b,a){if(a=="new"){window.open(b)}else{window.location=b}}};function update_custom_color_scheme(b,a){if($("color_palette_custom")){$("color_palette_custom").checked=true}}function submit_form(){}function addslashes(a){a=a.replace(/\'/g,"\\'");a=a.replace(/\"/g,'\\"');a=a.replace(/\\/g,"\\\\");a=a.replace(/\0/g,"\\0");return a}function stripslashes(a){a=a.replace(/\\'/g,"'");a=a.replace(/\\"/g,'"');a=a.replace(/\\\\/g,"\\");a=a.replace(/\\0/g,"\0");return a}function check_password_complexity(a){if(a.match(/^.*(?=.{6,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=\-!]).*$/)){return true}else{return false}}function open_lightbox_url(c,d,a,k,f){var g={title:d,file:c,width:a,height:k,type:"dynamic",inline:1};if((f!=null)&&(f.beforeRender!=null)){g.beforeOpen=f.beforeRender}if((f!=null)&&(f.afterRender!=null)){g.afterLoad=f.afterRender}else{if(f!=null){g.afterLoad=f}}var b=overlay.show(g,true);return(b)}function open_lightbox(g,b,d,o,k,c,n){if(c.match(/\&do\=$/)){c+=b;b=""}var f=(typeof(ajax_params)!="undefined"?ajax_params:"")+(b?b:"")+"&"+(c?c:"");var a=g+"?"+f;return(open_lightbox_url(a,d,o,k,n))}function is_array(a){return(a instanceof Array)}function str_replace(p,c,k){var g=p,a=c,o=k;var b=is_array(a),n=is_array(o),g=[].concat(g),a=[].concat(a),d=(o=[].concat(o)).length;while(j=0,d--){while(o[d]=o[d].split(g[j]).join(b?a[j]||"":a[0]),++j in g){}}return n?o:o[0]}var corp_roster={displayUserAutocomplete:function(b,a){$("member_search_autocompleted").value="true"},removeUserFilter:function(a){$("member_search").value="";$("member_search_autocompleted").value="false";if(a){document.member_search_form.submit()}},removeLetterFilter:function(a){$("first_name_search_char").value="";if(a){document.member_search_form.submit()}},removeAllFilters:function(a){this.removeUserFilter(false);this.removeLetterFilter(a)}};if(typeof dom=="undefined"){var dom=new Object}if(typeof dom.utils=="undefined"){dom.utils=new Object}dom.getNext=function(c,d){for(var a=0;a<c.childNodes.length;a++){var b=c.childNodes[a];if(b.nodeType==1&&b.nodeName.toLowerCase()==d.toLowerCase()){return b}}return false};dom.utils.stripIds=function(d){var a=new Array;a[a.length]=d;while(a.length>0){var f=a.shift();if(d.nodeType==Node.ELEMENT_NODE){if(f.id){f.removeAttribute("id")}if(f.hasChildNodes()){var c=f.childNodes;for(var b=0;b<c.length;b++){a.push(c[b])}}}}return d};dom.utils.getMouseCoords=function(a){if(a.pageX||a.pageY){return{x:a.pageX,y:a.pageY}}return{x:a.clientX+document.body.scrollLeft-document.body.clientLeft,y:a.clientY+document.body.scrollTop-document.body.clientTop}};dom.utils.getMouseOffset=function(d,c){c=c||window.event;var b=dom.utils.getPosition(d);var a=dom.utils.mouseCoords(c);return{x:a.x-b.x,y:a.y-b.y}};dom.utils.scrollTo=function(b){var a=dom.utils.getElementTop(b);window.scrollTo(0,a)};dom.utils.browser=new Object;dom.utils.browser.regexes={overflowX:new Array(/Firefox\/1\.0/),overflowY:new Array(/Firefox\/1\.0/)};dom.utils.browser.supportsOverflowX=function(){for(var a=0;a<dom.utils.browser.regexes.overflowX.length;a++){var b=dom.utils.browser.regexes.overflowX[a];if(navigator.userAgent.match(b)){return false}}return true};dom.utils.browser.supportsOverflowY=function(){for(var a=0;a<dom.utils.browser.regexes.overflowY.length;a++){var b=dom.utils.browser.regexes.overflowY[a];if(navigator.userAgent.match(b)){return false}}return true};dom.utils.browser.supportsDom=function(){return(document.getElementById)?true:false};dom.utils.browser.isIE=function(){return(document.all&&navigator.appName.indexOf("Microsoft Internet Explorer")>-1)?true:false};dom.utils.browser.isSafari=function(){return(navigator.userAgent.toLowerCase().indexOf("safari")>-1)?true:false};dom.utils.removeElement=function(a){if(dom.utils.browser.isIE()){var b=document.getElementById("IELeakGarbageBin");if(!b){b=document.createElement("DIV");b.id="IELeakGarbageBin";b.style.display="none";document.body.appendChild(b)}b.appendChild(a);b.innerHTML=""}else{a.parentNode.removeChild(a)}};dom.utils.getPageWidth=function(){var a=0;if(window.innerWidth&&window.scrollMaxX){a=window.innerWidth+window.scrollMaxX}else{if(document.body.scrollWidth>document.body.offsetWidth){a=document.body.scrollWidth}else{a=document.body.offsetWidth}}return a};dom.utils.getPageHeight=function(){var a=0;if(window.innerHeight&&window.scrollMaxY){a=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){a=document.body.scrollHeight}else{a=document.body.offsetHeight}}return a};dom.utils.getWindowWidth=function(a){a=(a)?a:window;if(a.document.compatMode=="CSS1Compat"){return parseInt(a.document.body.parentNode.clientWidth)}else{if(dom.utils.browser.isIE()){return parseInt(a.document.body.clientWidth)}else{return parseInt(a.innerWidth)}}};dom.utils.getWindowHeight=function(a){a=(a)?a:window;if(a.document.compatMode=="CSS1Compat"){return parseInt(a.document.body.parentNode.clientHeight)}else{if(dom.utils.browser.isIE()){return parseInt(a.document.body.clientHeight)}else{return parseInt(a.innerHeight)}}};dom.utils.getWindowScrollX=function(a){a=(a)?a:window;if(document.compatMode=="CSS1Compat"&&a.document.body.parentNode.scrollLeft){return parseInt(a.document.body.parentNode.scrollLeft)}else{if(dom.utils.browser.isIE()){return parseInt(a.document.body.scrollLeft)}else{return parseInt(a.scrollX)}}};dom.utils.getWindowScrollY=function(a){a=(a)?a:window;if(document.compatMode=="CSS1Compat"&&a.document.body.parentNode.scrollTop){return parseInt(a.document.body.parentNode.scrollTop)}else{if(dom.utils.browser.isIE()){return parseInt(a.document.body.scrollTop)}else{return parseInt(a.scrollY)}}};dom.utils.getElementWidth=function(d){var n,a,c;var g=0;if(d.tagName=="IMG"){g=parseInt(d.width)}else{if(document.compatMode=="CSS1Compat"){g=parseInt(d.offsetWidth)}else{if(document.compatMode=="BackCompat"){n=dom.utils.getCurrentStyle(d);if(d.offsetWidth){g=parseInt(d.offsetWidth)}else{g=parseInt(n.width)}var b=parseInt(n.borderLeft);var f=parseInt(n.borderRight);var k=parseInt(n.paddingLeft);var o=parseInt(n.paddingRight);g+=!isNaN(b)?parseInt(b):0;g+=!isNaN(f)?parseInt(f):0;g+=!isNaN(k)?parseInt(k):0;g+=!isNaN(o)?parseInt(o):0}else{if(dom.utils.browser.isSafari()){g=parseInt(d.offsetWidth)}}}}return g};dom.utils.getElementHeight=function(f){var d=0;var b,a;if(f.tagName&&f.tagName=="IMG"){d=parseInt(f.height)}else{if(document.compatMode=="CSS1Compat"){d=parseInt(f.offsetHeight)}else{if(document.compatMode=="BackCompat"){b=dom.utils.getCurrentStyle(f);if(f.offsetHeight){d=parseInt(f.offsetHeight)}else{d=parseInt(b.height)}var g=parseInt(b.borderTop);var c=parseInt(b.borderBottom);var n=parseInt(b.paddingTop);var k=parseInt(b.paddingBottom);if(!dom.utils.browser.isIE()){d+=!isNaN(g)?parseInt(g):0;d+=!isNaN(c)?parseInt(c):0;d+=!isNaN(n)?parseInt(n):0;d+=!isNaN(k)?parseInt(k):0}else{d-=!isNaN(g)?parseInt(g):0;d-=!isNaN(c)?parseInt(c):0}}else{if(dom.utils.browser.isSafari()){d=parseInt(f.offsetHeight)}}}}return d};dom.utils.getElementLeft=function(a){var c=0;try{if(a.offsetParent){while(a.offsetParent){c+=parseInt(a.offsetLeft);a=a.offsetParent}}else{if(a.x){c+=parseInt(a.x)}}return c}catch(b){return 0}};dom.utils.getElementTop=function(a){try{var c=0;if(a.offsetParent){while(a.offsetParent){c+=parseInt(a.offsetTop);a=a.offsetParent}}else{if(a.y){c+=parseInt(a.y)}}return c}catch(b){return 0}};dom.utils.center=function(b){var c=parseInt(dom.utils.getWindowWidth());var d=parseInt(dom.utils.getWindowHeight());var n=parseInt(dom.utils.getElementWidth(b));var k=parseInt(dom.utils.getElementHeight(b));var o=parseInt(dom.utils.getWindowScrollX());var f=parseInt(dom.utils.getWindowScrollY());var a=parseInt(c/2)-parseInt(n/2)+o;var g=parseInt(d/2)-parseInt(k/2)+f;b.style.left=a+"px";b.style.top=g+"px"};dom.utils.getCurrentStyle=function(a){if(a&&a.currentStyle){return a.currentStyle}else{if(document.defaultView&&document.defaultView.getComputedStyle){return document.defaultView.getComputedStyle(a,"")}}};dom.utils.duplicateStyle=function(elem1,elem2){var style1=dom.utils.getCurrentStyle(elem1);for(prop in style1){try{eval("elem2.style."+prop+" = style1."+prop)}catch(e){}}};dom.utils.getZIndex=function(c){var a=dom.utils.getCurrentStyle(c);var b=0;if(a.zIndex&&isNaN(a.zIndex)){if(c.offsetParent){while(c.offsetParent){b=(parseInt(a.zIndex)>b)?parseInt(a.zIndex):b;a=dom.utils.getCurrentStyle(c);c=c.offsetParent}}}else{b=parseInt(a.zIndex)}return b};dom.utils.getBody=function(){return document.getElementsByTagName("body")[0]};var overlay={shouldReload:false,show:function(b,a){if(dom.utils.browser.isIE()){this.toggleSelects(true)}if(b.height=="auto"){b.height=null}if(b.width=="auto"){b.width=null}if(b.file!=null){if(b.file.indexOf("?")>-1||b.file.indexOf("&")>-1){b.file+="&rand="+Math.random()}else{b.file+="?rand="+Math.random()}}if(b.url!=null){if(b.url.indexOf("?")>-1||b.url.indexOf("&")>-1){b.url+="&rand="+Math.random()}else{b.url+="?rand="+Math.random()}}return cdwm.open(a,b)},showFullScreen:function(k,b,c,a,g,o){a=a||false;g=g||{};o=o===false?false:true;if(c=="lb"||c=="vr"){if(dom.utils.browser.isIE()){this.toggleSelects(true)}var f=dom.utils.getWindowHeight();var n=dom.utils.getWindowWidth();if(c=="lb"){b=b+"&lbref="+c+"&pgref=vr"}else{b=b+"&pgref="+c}if(g.height==undefined){g.height="100%"}if(g.width==undefined){g.width="100%"}if(g.left==undefined){g.left=dom.utils.getWindowScrollX()}if(g.top==undefined){g.top=dom.utils.getWindowScrollY()}var d={title:k,file:b,height:g.height,width:g.width,top:g.top,left:g.left,inline:1,type:"iframe",scrollbars:true,closable:o};if(c=="lb"){if(typeof a!="function"&&a){d.afterClose=overlay.reload}else{if(typeof a=="function"){d.afterClose=a}}}cdwm.open(true,d)}else{window.location.href=b}},reload:function(){window.location.reload()},hide:function(){cdwm.close();if(dom.utils.browser.isIE()){this.toggleSelects(false)}},toggleSelects:function(c){var b=dom.utils.getBody().getElementsByTagName("select");for(var a=0;a<b.length;a++){b[a].style.visibility=(c)?"hidden":"visible"}},reloadParent:function(){if(overlay.shouldReload){overlay.reload()}}};activateMenu=function(b){if(browser.isIE){var a=function(f){var c=document.getElementById(b);if(!c){return false}var k=c.getElementsByTagName(f);for(var d=0;d<k.length;d++){var g=$(k[d]);k[d].onmouseover=function(){var n=$(this);if(!n.hasClassName("hover")){n.addClassName("hover");if(this.lastChild&&this.lastChild.nodeName.toLowerCase()=="ul"){this.lastChild.style.display="block"}}return false};k[d].onmouseout=function(){var n=$(this);if(n.hasClassName("hover")){n.removeClassName("hover");if(this.lastChild&&this.lastChild.nodeName.toLowerCase()=="ul"){this.lastChild.style.display="none"}}return false}}};a("li");if(browser.majorVersion>6){a("b");a("span")}}};function urlparam(a){var d=window.location.search.substring(1,window.location.search.length);var c=false;var b=d.split("&");for(i=0;i<b.length;i++){param_name=b[i].substring(0,b[i].indexOf("="));if(param_name==a){c=b[i].substring(b[i].indexOf("=")+1)}}if(c){return c}else{return false}}function toggleVisibility(b,a){a.each(function(c){$$("body ."+c).each(function(d){d.setStyle({display:"none"})})});$$("body ."+b).each(function(c){c.setStyle({display:""})})}function expandFieldset(a){$(a).toggleClassName("cd_expandable_expanded")}function check_members_in_group(a,f){var c=a.value.split(" ... ");var b=$(f).select(".nu");b.each(function(d){if(c.indexOf(d.value)!=-1){d.checked=a.checked}})}Array.prototype.in_array=function(c){var b=this.length;for(var a=0;a<=b;a++){if(this[a]==c){return true}}return false};function validateProfile(c){var a={firstname:[/^[^$]+$/,"First name is required"],primary_email:[/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,"Primary Email is required"]};var b="Please check these fields:";var f=true;for(var d in a){if(c[d]&&!a[d][0].test(c[d].value.trim())){b+="\n - "+a[d][1];f=false}}if(!f){alert(b)}return f}var cd_tab_popup_dashboard={showPopup:function(){PlainDropdown.show($("cd_tab_popup_dashboard_link"),"dd_ui1_dashboard")}};var cd_tab_popup_account={showPopup:function(){PlainDropdown.show($("cd_tab_popup_account_link"),"dd_ui1_account")}};var cd_tab_popup_help={showPopup:function(){PlainDropdown.show($("cd_tab_popup_help_link"),"dd_ui1_help")}};var cd_menu_workspace_list={showPopup:function(){PlainDropdown.show($("cd_menu_workspace_list_link"),"dd_ui1_workspaces")}};Event.observe(window,"load",function(){activateMenu("dd_workspaces")});function deployUserPicker(k,a){if(typeof(a)=="undefined"){a=true}var g="/spaces/rpc.php?action=userpicker";var d={stype:null,catId:null,spaceId:null,itemId:null,internalOnly:null,wrapperId:"add_msg_dist_list_box",holderId:"add_msg_dist_list",forceDeploy:false};if(!k){return}var b=d;for(var n in k){b[n]=k[n]}k=b;if(k.spaceId==null&&window.spid){k.spaceId=window.spid}var f=["stype","catId","spaceId","itemId","internalOnly"];if(k.spaceId>0){if(k.catId!=deployUserPicker.lastCid||k.spaceId!=deployUserPicker.lastSpid||k.forceDeploy){if(window.upicker){$(window.upicker).remove()}for(var c=0;c<f.length;c++){if(k[f[c]]!=null){g+="&"+f[c]+"="+k[f[c]]}}window.upicker=new UserPicker({sourceURL:g,maxHeight:150,ownUserId:uid,internalOnly:k.internalOnly});window.upicker.init();$(k.holderId).appendChild(window.upicker);window.upicker.adjustSize();deployUserPicker.lastCid=k.catId;deployUserPicker.lastSpid=k.spaceId}if($(k.wrapperId)){a?$(k.wrapperId).show():$(k.wrapperId).hide()}}else{if(window.upicker){$(window.upicker).remove();window.upicker=null}if($(k.wrapperId)){$(k.wrapperId).hide()}deployUserPicker.lastCid=k.catId;deployUserPicker.lastSpid=k.spaceId}}deployUserPicker.lastCid=null;deployUserPicker.lastSpid=null;function cd_sleep(a){var b=new Date().getTime();while(new Date().getTime()<b+a){}}function setupFieldHint(d,c,b){var b=!!b;var d=$(d);if((d.type.toLowerCase()=="text")||(d.type.toLowerCase()=="textarea")){var a=function(f){if(f.value.strip()==""||f.value.strip().toLowerCase()==c.toLowerCase()){f.value=c;f.addClassName("fieldhint")}};d.observe("focus",function(){if(b&&d.value.strip().toLowerCase()==c.toLowerCase()){d.value=""}d.removeClassName("fieldhint")});d.observe("blur",function(){a(d)});a(d)}}function copySelectDescriptionToInput(f,d,k){if(typeof k==undefined){k=false}var a=$(f);var b=$(d);var g=$("sdd_"+f+"_control");var c=g.select("span")[0].innerHTML;if(c=="None - Select Field"){b.value=""}else{if(k||b.value==""){b.value=c}else{b.focus()}}}function toggleOverflowHidden(b,a,c){if(b.style.overflow=="hidden"){b.style.overflow="auto";a.innerHTML="Less";if(typeof c!="undefined"){b.style.height="auto"}}else{b.style.overflow="hidden";a.innerHTML="More";if(typeof c!="undefined"){b.style.height=c}}return(false)}function toggleTableSection(a){a=$(a);if(a._isrolling==true){return}function c(g){a._isrolling=g}c(true);var f=a.up("tr");var b=a.rel;var d=a.select(".icon").first();if(!f.hasClassName("prc-expanded")){a.up("tr").addClassName("prc-expanded");Effect.SlideDown(b,{afterFinish:c.bind(window,false)});d.className="icon icon_rollup"}else{a.up("tr").removeClassName("prc-expanded");Effect.SlideUp(b,{afterFinish:c.bind(window,false)});d.className="icon icon_rolldown"}}function roundNumber(b,c){var a=Math.round(b*Math.pow(10,c))/Math.pow(10,c);return a}function update_domain(b,c){b=""+b;var a=b.replace(/[^a-z0-9-]/ig,"").toLowerCase();$(c).setValue(a);return}function html_entity_decode(b){var a=new Element("textarea");a.update(b);return(a.value.trim())}function cmp(d,c){return(d!=c)?(d-c)/Math.abs(d-c):0}function upd(a,b){var c=$(a);if(!c){return false}if(c.tagName.toLowerCase="input"){c.value=b}else{if(c.tagName.toLowerCase="select"){c.options.each(function(d){d.selected=(d.value==b)})}else{c.update(b)}}return true}function break_out_of_frame(){if(top.location!=document.location){top.location.href=document.location.href}}function ResetableTimer(d,a){if(!("_timers" in ResetableTimer)){ResetableTimer._timers={}}var c=d.toString();function b(f){if(ResetableTimer._timers[f]){clearTimeout(ResetableTimer._timers[f])}ResetableTimer._timers[f]=null}b(c);ResetableTimer._timers[c]=setTimeout(function(){d();b(c)})}function fixIESelectWidth(){if(Prototype.Browser.IE){$$("select.fix-iewidth").each(function(a){if(!a._iewidthfixed){a.observe("click",function(b){this.addClassName("fix-iewidth-fixed")});a.observe("blur",function(b){this.removeClassName("fix-iewidth-fixed")});a._iewidthfixed=true}})}}Starter.regInitFunc("fixIESelectWidth",fixIESelectWidth);function TabbedDialog(d){if(d._tabbedDialogInitialized){return d}var d=$(d);var b=d.select(".dlg-tab");var n=d.select(".dlg-tab-cnt");var k=b[0].getHeight();var a={};var c=null;function o(){}function g(){b.each(function(p){p.removeClassName("dlg-tab-selected")});n.each(function(p){p.removeClassName("dlg-tab-cnt-selected")})}function f(q){g();b[q].addClassName("dlg-tab-selected");n[q].addClassName("dlg-tab-cnt-selected");c=n[q];o();try{var p=CD.TinyMCE.getWindowId(b[q]);var s=cdwm.getWindow(p);cdwm.resizeByContent(s)}catch(r){}}b.each(function(q,p){a[q.select("span")[0].innerHTML.strip()]=p;q.observe("click",function(r){Event.stop(r);f(p)})});d.selectTab=function(p){f(a[p])};d.autosize=o;d._tabbedDialogInitialized=true;return d}Starter.regInitFunc("initTabbedDialogs",function(){$$(".dlg-tabs").each(TabbedDialog)});function call_when_visible(a,b){return function(){var f=arguments;var g=["resize","scroll"];var n=false;function c(){var o=Math.min(document.body.clientHeight,document.documentElement.clientHeight);var p=$(b).cumulativeOffset().top-document.viewport.getScrollOffsets()[1];return 0<p&&p<o}function k(){if(c()&&!n){n=true;d();return a.apply(null,f)}return null}function d(){g.each(function(o){Event.stopObserving(window,o,k)})}g.each(function(o){Event.observe(window,o,k)});return k()}}function str2dom(c){var a=document.createElement("div");a.innerHTML=c;var b;if(navigator.userAgent.match(/msie 7/i)){b=$(a.firstChild)}else{b=a.firstDescendant()}return b}function dom2str(b){var a=new Element("div");a.update(b);return a.innerHTML}function calc_lb_pos(a,b){a=a/100;b=b/100;var d=document.viewport.getScrollOffsets();var c={width:document.viewport.getWidth(),height:Math.min(document.body.clientHeight,document.documentElement.clientHeight)};return{height:parseInt(c.height*b),width:parseInt(c.width*a),left:parseInt(c.width*(1-a)/2)+d.left,top:parseInt(c.height*(1-b)/2)+d.top}}function pluralize(a,c,b){return(c!=1)?(b?b:a+"s"):a}function escapeHTML(a){return a.replace(/&(?!\w+;|#\d+;|#x[\da-f]+;)/gi,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")}Calendar=function(d,c,g,a){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=g||null;this.onClose=a||null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT.DEF_DATE_FORMAT;this.ttDateFormat=Calendar._TT.TT_DATE_FORMAT;this.isPopup=true;this.weekNumbers=true;this.firstDayOfWeek=typeof d=="number"?d:Calendar._FD;this.showsOtherMonths=false;this.dateStr=c;this.ar_days=null;this.showsTime=false;this.time24=true;this.yearStep=2;this.hiliteToday=true;this.multiple=null;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined"){Calendar._SDN_len=3}var b=new Array();for(var f=8;f>0;){b[--f]=Calendar._DN[f].substr(0,Calendar._SDN_len)}Calendar._SDN=b;if(typeof Calendar._SMN_len=="undefined"){Calendar._SMN_len=3}b=new Array();for(var f=12;f>0;){b[--f]=Calendar._MN[f].substr(0,Calendar._SMN_len)}Calendar._SMN=b}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie7=(Calendar.is_ie&&/msie 7\.0/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(f){var a=0,d=0;var c=/^div$/i.test(f.tagName);if(c&&f.scrollLeft){a=f.scrollLeft}if(c&&f.scrollTop){d=f.scrollTop}var g={x:f.offsetLeft-a,y:f.offsetTop-d};if(f.offsetParent){var b=this.getAbsolutePos(f.offsetParent);g.x+=b.x;g.y+=b.y}return g};Calendar.isRelated=function(c,a){var d=a.relatedTarget;if(!d){var b=a.type;if(b=="mouseover"){d=a.fromElement}else{if(b=="mouseout"){d=a.toElement}}}while(d){if(d==c){return true}d=d.parentNode}return false};Calendar.removeClass=function(f,d){if(!(f&&f.className)){return}var a=f.className.split(" ");var b=new Array();for(var c=a.length;c>0;){if(a[--c]!=d){b[b.length]=a[c]}}f.className=b.join(" ")};Calendar.addClass=function(b,a){Calendar.removeClass(b,a);b.className+=" "+a};Calendar.getElement=function(a){var b=Calendar.is_ie?window.event.srcElement:a.currentTarget;while(b.nodeType!=1||/^div$/i.test(b.tagName)){b=b.parentNode}return b};Calendar.getTargetElement=function(a){var b=Calendar.is_ie?window.event.srcElement:a.target;while(b.nodeType!=1){b=b.parentNode}return b};Calendar.stopEvent=function(a){a||(a=window.event);if(Calendar.is_ie){a.cancelBubble=true;a.returnValue=false}else{a.preventDefault();a.stopPropagation()}return false};Calendar.addEvent=function(a,c,b){if(a.attachEvent){a.attachEvent("on"+c,b)}else{if(a.addEventListener){a.addEventListener(c,b,true)}else{a["on"+c]=b}}};Calendar.removeEvent=function(a,c,b){if(a.detachEvent){a.detachEvent("on"+c,b)}else{if(a.removeEventListener){a.removeEventListener(c,b,true)}else{a["on"+c]=null}}};Calendar.createElement=function(c,b){var a=null;if(document.createElementNS){a=document.createElementNS("http://www.w3.org/1999/xhtml",c)}else{a=document.createElement(c)}if(typeof b!="undefined"){b.appendChild(a)}return a};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true)}}};Calendar.findMonth=function(a){if(typeof a.month!="undefined"){return a}else{if(typeof a.parentNode.month!="undefined"){return a.parentNode}}return null};Calendar.findYear=function(a){if(typeof a.year!="undefined"){return a}else{if(typeof a.parentNode.year!="undefined"){return a.parentNode}}return null};Calendar.showMonthsCombo=function(){var f=Calendar._C;if(!f){return false}var f=f;var g=f.activeDiv;var d=f.monthsCombo;if(f.hilitedMonth){Calendar.removeClass(f.hilitedMonth,"hilite")}if(f.activeMonth){Calendar.removeClass(f.activeMonth,"active")}var c=f.monthsCombo.getElementsByTagName("div")[f.date.getMonth()];Calendar.addClass(c,"active");f.activeMonth=c;var b=d.style;b.display="block";if(g.navtype<0){b.left=g.offsetLeft+"px"}else{var a=d.offsetWidth;if(typeof a=="undefined"){a=50}b.left=(g.offsetLeft+g.offsetWidth-a)+"px"}b.top=(g.offsetTop+g.offsetHeight)+"px"};Calendar.showYearsCombo=function(d){var a=Calendar._C;if(!a){return false}var a=a;var c=a.activeDiv;var g=a.yearsCombo;if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}if(a.activeYear){Calendar.removeClass(a.activeYear,"active")}a.activeYear=null;var b=a.date.getFullYear()+(d?1:-1);var o=g.firstChild;var n=false;for(var f=12;f>0;--f){if(b>=a.minYear&&b<=a.maxYear){o.innerHTML=b;o.year=b;o.style.display="block";n=true}else{o.style.display="none"}o=o.nextSibling;b+=d?a.yearStep:-a.yearStep}if(n){var p=g.style;p.display="block";if(c.navtype<0){p.left=c.offsetLeft+"px"}else{var k=g.offsetWidth;if(typeof k=="undefined"){k=50}p.left=(c.offsetLeft+c.offsetWidth-k)+"px"}p.top=(c.offsetTop+c.offsetHeight)+"px"}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false}if(cal.timeout){clearTimeout(cal.timeout)}var el=cal.activeDiv;if(!el){return false}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev)}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler()}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler()}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev)}};Calendar.tableMouseOver=function(s){var a=Calendar._C;if(!a){return}var c=a.activeDiv;var o=Calendar.getTargetElement(s);if(o==c||o.parentNode==c){Calendar.addClass(c,"hilite active");Calendar.addClass(c.parentNode,"rowhilite")}else{if(typeof c.navtype=="undefined"||(c.navtype!=50&&(c.navtype==0||Math.abs(c.navtype)>2))){Calendar.removeClass(c,"active")}Calendar.removeClass(c,"hilite");Calendar.removeClass(c.parentNode,"rowhilite")}s||(s=window.event);if(c.navtype==50&&o!=c){var r=Calendar.getAbsolutePos(c);var u=c.offsetWidth;var t=s.clientX;var v;var q=true;if(t>r.x+u){v=t-r.x-u;q=false}else{v=r.x-t}if(v<0){v=0}var g=c._range;var n=c._current;var k=Math.floor(v/10)%g.length;for(var f=g.length;--f>=0;){if(g[f]==n){break}}while(k-->0){if(q){if(--f<0){f=g.length-1}}else{if(++f>=g.length){f=0}}}var b=g[f];c.innerHTML=b;a.onUpdateTime()}var d=Calendar.findMonth(o);if(d){if(d.month!=a.date.getMonth()){if(a.hilitedMonth){Calendar.removeClass(a.hilitedMonth,"hilite")}Calendar.addClass(d,"hilite");a.hilitedMonth=d}else{if(a.hilitedMonth){Calendar.removeClass(a.hilitedMonth,"hilite")}}}else{if(a.hilitedMonth){Calendar.removeClass(a.hilitedMonth,"hilite")}var p=Calendar.findYear(o);if(p){if(p.year!=a.date.getFullYear()){if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}Calendar.addClass(p,"hilite");a.hilitedYear=p}else{if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}}}else{if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}}}return Calendar.stopEvent(s)};Calendar.tableMouseDown=function(a){if(Calendar.getTargetElement(a)==Calendar.getElement(a)){return Calendar.stopEvent(a)}};Calendar.calDragIt=function(b){var c=Calendar._C;if(!(c&&c.dragging)){return false}var f;var d;if(Calendar.is_ie){d=window.event.clientY+document.body.scrollTop;f=window.event.clientX+document.body.scrollLeft}else{f=b.pageX;d=b.pageY}c.hideShowCovered();var a=c.element.style;a.left=(f-c.xOffs)+"px";a.top=(d-c.yOffs)+"px";return Calendar.stopEvent(b)};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev)}cal.hideShowCovered()};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300){with(Calendar){if(el.navtype==50){el._current=el.innerHTML;addEvent(document,"mousemove",tableMouseOver)}else{addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver)}addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp)}}else{if(cal.isPopup){cal._dragStart(ev)}}if(el.navtype==-1||el.navtype==1){if(cal.timeout){clearTimeout(cal.timeout)}cal.timeout=setTimeout("Calendar.showMonthsCombo()",250)}else{if(el.navtype==-2||el.navtype==2){if(cal.timeout){clearTimeout(cal.timeout)}cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250)}else{cal.timeout=null}}return Calendar.stopEvent(ev)};Calendar.dayMouseDblClick=function(a){Calendar.cellClick(Calendar.getElement(a),a||window.event);if(Calendar.is_ie){document.selection.empty()}};Calendar.dayMouseOver=function(b){var a=Calendar.getElement(b);if(Calendar.isRelated(a,b)||Calendar._C||a.disabled){return false}if(a.ttip){if(a.ttip.substr(0,1)=="_"){a.ttip=a.caldate.print(a.calendar.ttDateFormat)+a.ttip.substr(1)}a.calendar.tooltips.innerHTML=a.ttip}if(a.navtype!=300){Calendar.addClass(a,"hilite");if(a.caldate){Calendar.addClass(a.parentNode,"rowhilite")}}return Calendar.stopEvent(b)};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled){return false}removeClass(el,"hilite");if(el.caldate){removeClass(el.parentNode,"rowhilite")}if(el.calendar){el.calendar.tooltips.innerHTML=_TT.SEL_DATE}return stopEvent(ev)}};Calendar.cellClick=function(f,t){var c=f.calendar;var n=false;var q=false;var g=null;if(typeof f.navtype=="undefined"){if(c.currentDateEl){Calendar.removeClass(c.currentDateEl,"selected");Calendar.addClass(f,"selected");n=(c.currentDateEl==f);if(!n){c.currentDateEl=f}}c.date.setDateOnly(f.caldate);g=c.date;var b=!(c.dateClicked=!f.otherMonth);if(!b&&!c.currentDateEl){c._toggleMultipleDate(new Date(g))}else{q=!f.disabled}if(b){c._init(c.firstDayOfWeek,g)}}else{if(f.navtype==200){Calendar.removeClass(f,"hilite");c.callCloseHandler();return}g=new Date(c.date);if(f.navtype==0){g.setDateOnly(new Date())}c.dateClicked=false;var s=g.getFullYear();var k=g.getMonth();function a(w){var y=g.getDate();var v=g.getMonthDays(w);if(y>v){g.setDate(v)}g.setMonth(w)}switch(f.navtype){case 400:Calendar.removeClass(f,"hilite");var u=Calendar._TT.ABOUT;if(typeof u!="undefined"){u+=c.showsTime?Calendar._TT.ABOUT_TIME:""}else{u='Help and about box text is not translated into this language.\nIf you know this language and you feel generous please update\nthe corresponding file in "lang" subdir to match calendar-en.js\nand send it back to <mihai_bazon@yahoo.com> to get it into the distribution  ;-)\n\nThank you!\nhttp://dynarch.com/mishoo/calendar.epl\n'}alert(u);return;case -2:if(s>c.minYear){g.setFullYear(s-1)}break;case -1:if(k>0){a(k-1)}else{if(s-->c.minYear){g.setFullYear(s);a(11)}}break;case 1:if(k<11){a(k+1)}else{if(s<c.maxYear){g.setFullYear(s+1);a(0)}}break;case 2:if(s<c.maxYear){g.setFullYear(s+1)}break;case 100:c.setFirstDayOfWeek(f.fdow);return;case 50:var p=f._range;var r=f.innerHTML;for(var o=p.length;--o>=0;){if(p[o]==r){break}}if(t&&t.shiftKey){if(--o<0){o=p.length-1}}else{if(++o>=p.length){o=0}}var d=p[o];f.innerHTML=d;c.onUpdateTime();return;case 0:if((typeof c.getDateStatus=="function")&&c.getDateStatus(g,g.getFullYear(),g.getMonth(),g.getDate())){return false}break}if(!g.equalsTo(c.date)){c.setDate(g);q=true}else{if(f.navtype==0){q=n=true}}}if(q){t&&c.callHandler()}if(n){Calendar.removeClass(f,"hilite");t&&c.callCloseHandler()}};Calendar.prototype.create=function(r){var q=null;if(!r){q=document.getElementsByTagName("body")[0];this.isPopup=true}else{q=r;this.isPopup=false}this.date=this.dateStr?new Date(this.dateStr):new Date();var u=Calendar.createElement("table");this.table=u;u.cellSpacing=0;u.cellPadding=0;u.calendar=this;Calendar.addEvent(u,"mousedown",Calendar.tableMouseDown);var a=Calendar.createElement("div");this.element=a;a.className="calendar";if(this.isPopup){a.style.position="absolute";a.style.display="none"}a.style.zIndex=9005;a.appendChild(u);var o=Calendar.createElement("thead",u);var s=null;var v=null;var b=this;var f=function(z,y,w){s=Calendar.createElement("td",v);s.colSpan=y;s.className="button";if(w!=0&&Math.abs(w)<=2){s.className+=" nav"}Calendar._add_evs(s);s.calendar=b;s.navtype=w;s.innerHTML="<div unselectable='on'>"+z+"</div>";return s};v=Calendar.createElement("tr",o);var c=6;(this.isPopup)&&--c;(this.weekNumbers)&&++c;f("?",1,400).ttip=Calendar._TT.INFO;this.title=f("",c,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT.DRAG_TO_MOVE;this.title.style.cursor="move";f("&#x00d7;",1,200).ttip=Calendar._TT.CLOSE}v=Calendar.createElement("tr",o);v.className="headrow";this._nav_py=f("&#x00ab;",1,-2);this._nav_py.ttip=Calendar._TT.PREV_YEAR;this._nav_pm=f("&#x2039;",1,-1);this._nav_pm.ttip=Calendar._TT.PREV_MONTH;this._nav_now=f(Calendar._TT.TODAY,this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT.GO_TODAY;this._nav_nm=f("&#x203a;",1,1);this._nav_nm.ttip=Calendar._TT.NEXT_MONTH;this._nav_ny=f("&#x00bb;",1,2);this._nav_ny.ttip=Calendar._TT.NEXT_YEAR;v=Calendar.createElement("tr",o);v.className="daynames";if(this.weekNumbers){s=Calendar.createElement("td",v);s.className="name wn";s.innerHTML=Calendar._TT.WK}for(var n=7;n>0;--n){s=Calendar.createElement("td",v);if(!n){s.navtype=100;s.calendar=this;Calendar._add_evs(s)}}this.firstdayname=(this.weekNumbers)?v.firstChild.nextSibling:v.firstChild;this._displayWeekdays();var k=Calendar.createElement("tbody",u);this.tbody=k;for(n=6;n>0;--n){v=Calendar.createElement("tr",k);if(this.weekNumbers){s=Calendar.createElement("td",v)}for(var g=7;g>0;--g){s=Calendar.createElement("td",v);s.calendar=this;Calendar._add_evs(s)}}if(this.showsTime){v=Calendar.createElement("tr",k);v.className="time";s=Calendar.createElement("td",v);s.className="time";s.colSpan=2;s.innerHTML=Calendar._TT.TIME||"&nbsp;";s=Calendar.createElement("td",v);s.className="time";s.colSpan=this.weekNumbers?4:3;(function(){function A(J,L,K,N){var H=Calendar.createElement("span",s);H.className=J;H.innerHTML=L;H.calendar=b;H.ttip=Calendar._TT.TIME_PART;H.navtype=50;H._range=[];if(typeof K!="number"){H._range=K}else{for(var I=K;I<=N;++I){var G;if(I<10&&N>=10){G="0"+I}else{G=""+I}H._range[H._range.length]=G}}Calendar._add_evs(H);return H}var E=b.date.getHours();var w=b.date.getMinutes();var F=!b.time24;var y=(E>12);if(F&&y){E-=12}var C=A("hour",E,F?1:0,F?12:23);var B=Calendar.createElement("span",s);B.innerHTML=":";B.className="colon";var z=A("minute",w,0,59);var D=null;s=Calendar.createElement("td",v);s.className="time";s.colSpan=2;if(F){D=A("ampm",y?"pm":"am",["am","pm"])}else{s.innerHTML="&nbsp;"}b.onSetTime=function(){var H,G=this.date.getHours(),I=this.date.getMinutes();if(F){H=(G>=12);if(H){G-=12}if(G==0){G=12}D.innerHTML=H?"pm":"am"}C.innerHTML=(G<10)?("0"+G):G;z.innerHTML=(I<10)?("0"+I):I};b.onUpdateTime=function(){var H=this.date;var I=parseInt(C.innerHTML,10);if(F){if(/pm/i.test(D.innerHTML)&&I<12){I+=12}else{if(/am/i.test(D.innerHTML)&&I==12){I=0}}}var J=H.getDate();var G=H.getMonth();var K=H.getFullYear();H.setHours(I);H.setMinutes(parseInt(z.innerHTML,10));H.setFullYear(K);H.setMonth(G);H.setDate(J);this.dateClicked=false;this.callHandler()}})()}else{this.onSetTime=this.onUpdateTime=function(){}}var p=Calendar.createElement("tfoot",u);v=Calendar.createElement("tr",p);v.className="footrow";s=f(Calendar._TT.SEL_DATE,this.weekNumbers?8:7,300);s.className="ttip";if(this.isPopup){s.ttip=Calendar._TT.DRAG_TO_MOVE;s.style.cursor="move"}this.tooltips=s;a=Calendar.createElement("div",this.element);this.monthsCombo=a;a.className="combo";for(n=0;n<Calendar._MN.length;++n){var d=Calendar.createElement("div");d.className=Calendar.is_ie?"label-IEfix":"label";d.month=n;d.innerHTML=Calendar._SMN[n];a.appendChild(d)}a=Calendar.createElement("div",this.element);this.yearsCombo=a;a.className="combo";for(n=12;n>0;--n){var t=Calendar.createElement("div");t.className=Calendar.is_ie?"label-IEfix":"label";a.appendChild(t)}this._init(this.firstDayOfWeek,this.date);q.appendChild(this.element)};Calendar._keyEvent=function(q){var a=window._dynarch_popupCalendar;if(!a||a.multiple){return false}(Calendar.is_ie)&&(q=window.event);var o=(Calendar.is_ie||q.type=="keypress"),r=q.keyCode;if(q.ctrlKey){switch(r){case 37:o&&Calendar.cellClick(a._nav_pm);break;case 38:o&&Calendar.cellClick(a._nav_py);break;case 39:o&&Calendar.cellClick(a._nav_nm);break;case 40:o&&Calendar.cellClick(a._nav_ny);break;default:return false}}else{switch(r){case 32:Calendar.cellClick(a._nav_now);break;case 27:o&&a.callCloseHandler();break;case 37:case 38:case 39:case 40:if(o){var f,s,p,k,c,d;f=r==37||r==38;d=(r==37||r==39)?1:7;function b(){c=a.currentDateEl;var t=c.pos;s=t&15;p=t>>4;k=a.ar_days[p][s]}b();function g(){var t=new Date(a.date);t.setDate(t.getDate()-d);a.setDate(t)}function n(){var t=new Date(a.date);t.setDate(t.getDate()+d);a.setDate(t)}while(1){switch(r){case 37:if(--s>=0){k=a.ar_days[p][s]}else{s=6;r=38;continue}break;case 38:if(--p>=0){k=a.ar_days[p][s]}else{g();b()}break;case 39:if(++s<7){k=a.ar_days[p][s]}else{s=0;r=40;continue}break;case 40:if(++p<a.ar_days.length){k=a.ar_days[p][s]}else{n();b()}break}break}if(k){if(!k.disabled){Calendar.cellClick(k)}else{if(f){g()}else{n()}}}}break;case 13:if(o){Calendar.cellClick(a.currentDateEl,q)}break;default:return false}}return Calendar.stopEvent(q)};Calendar.prototype._init=function(r,C){var B=new Date(),v=B.getFullYear(),E=B.getMonth(),b=B.getDate();this.table.style.visibility="hidden";var n=C.getFullYear();if(n<this.minYear){n=this.minYear;C.setFullYear(n)}else{if(n>this.maxYear){n=this.maxYear;C.setFullYear(n)}}this.firstDayOfWeek=r;this.date=new Date(C);var D=C.getMonth();var G=C.getDate();var F=C.getMonthDays();C.setDate(1);var w=(C.getDay()-this.firstDayOfWeek)%7;if(w<0){w+=7}C.setDate(w?-w:0);C.setDate(C.getDate()+1);var f=this.tbody.firstChild;var p=Calendar._SMN[D];var t=this.ar_days=new Array();var s=Calendar._TT.WEEKEND;var d=this.multiple?(this.datesCells={}):null;for(var z=0;z<6;++z,f=f.nextSibling){var a=f.firstChild;if(this.weekNumbers){a.className="day wn";a.innerHTML=C.getWeekNumber();a=a.nextSibling}f.className="daysrow";var A=false,g,c=t[z]=[];for(var y=0;y<7;++y,a=a.nextSibling,C.setDate(g+1)){g=C.getDate();var k=C.getDay();a.className="day";a.pos=z<<4|y;c[y]=a;var q=(C.getMonth()==D);if(!q){if(this.showsOtherMonths){a.className+=" othermonth";a.otherMonth=true}else{a.className="emptycell";a.innerHTML="&nbsp;";a.disabled=true;continue}}else{a.otherMonth=false;A=true}a.disabled=false;a.innerHTML=this.getDateText?this.getDateText(C,g):g;if(d){d[C.print("%Y%m%d")]=a}if(this.getDateStatus){var u=this.getDateStatus(C,n,D,g);if(this.getDateToolTip){var o=this.getDateToolTip(C,n,D,g);if(o){a.title=o}}if(u===true){a.className+=" disabled";a.disabled=true}else{if(/disabled/i.test(u)){a.disabled=true}a.className+=" "+u}}if(!a.disabled){a.caldate=new Date(C);a.ttip="_";if(!this.multiple&&q&&g==G&&this.hiliteToday){a.className+=" selected";this.currentDateEl=a}if(C.getFullYear()==v&&C.getMonth()==E&&g==b){a.className+=" today";a.ttip+=Calendar._TT.PART_TODAY}if(s.indexOf(k.toString())!=-1){a.className+=a.otherMonth?" oweekend":" weekend"}}}if(!(A||this.showsOtherMonths)){f.className="emptyrow"}}this.title.innerHTML=Calendar._MN[D]+", "+n;this.onSetTime();this.table.style.visibility="visible";this._initMultipleDates()};Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var b in this.multiple){var a=this.datesCells[b];var c=this.multiple[b];if(!c){continue}if(a){a.className+=" selected"}}}};Calendar.prototype._toggleMultipleDate=function(b){if(this.multiple){var c=b.print("%Y%m%d");var a=this.datesCells[c];if(a){var f=this.multiple[c];if(!f){Calendar.addClass(a,"selected");this.multiple[c]=b}else{Calendar.removeClass(a,"selected");delete this.multiple[c]}}}};Calendar.prototype.setDateToolTipHandler=function(a){this.getDateToolTip=a};Calendar.prototype.setDate=function(a){if(!a.equalsTo(this.date)){this._init(this.firstDayOfWeek,a)}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date)};Calendar.prototype.setFirstDayOfWeek=function(a){this._init(a,this.date);this._displayWeekdays()};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(a){this.getDateStatus=a};Calendar.prototype.setRange=function(b,c){this.minYear=b;this.maxYear=c};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat))}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this)}this.hideShowCovered()};Calendar.prototype.destroy=function(){var a=this.element.parentNode;a.removeChild(this.element);Calendar._C=null;window._dynarch_popupCalendar=null};Calendar.prototype.reparent=function(b){var a=this.element;a.parentNode.removeChild(a);b.appendChild(a)};Calendar._checkCalendar=function(b){var c=window._dynarch_popupCalendar;if(!c){return false}var a=Calendar.is_ie?Calendar.getElement(b):Calendar.getTargetElement(b);for(;a!=null&&a!=c.element;a=a.parentNode){}if(a==null){window._dynarch_popupCalendar.callCloseHandler();return Calendar.stopEvent(b)}};Calendar.prototype.show=function(){var f=this.table.getElementsByTagName("tr");for(var d=f.length;d>0;){var g=f[--d];Calendar.removeClass(g,"rowhilite");var c=g.getElementsByTagName("td");for(var b=c.length;b>0;){var a=c[--b];Calendar.removeClass(a,"hilite");Calendar.removeClass(a,"active")}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window._dynarch_popupCalendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar)}this.hideShowCovered()};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar)}this.element.style.display="none";this.hidden=true;this.hideShowCovered()};Calendar.prototype.showAt=function(a,c){var b=this.element.style;b.left=a+"px";b.top=c+"px";this.show()};Calendar.prototype.showAtElement=function(b,a){var p=this;var c=navigator.userAgent.match(/msie/i);var d={x:0,y:0,width:0,height:0,top:0,left:0};var n=$(b).cumulativeOffset();var o=$(b).cumulativeScrollOffset();var f={left:c?document.documentElement.scrollLeft:window.scrollX,top:c?document.documentElement.scrollTop:window.scrollY};var g=$(b).getDimensions();d.left=n.left-o.left+f.left;d.top=n.top-o.top+f.top;d.width=g.width;d.height=g.height;p.element.style.display="block";var k={x:0,y:0,width:0,height:0,top:0,left:0};k.left=dom.utils.getElementLeft(p.element);k.top=dom.utils.getElementTop(p.element);k.width=dom.utils.getElementWidth(p.element);k.height=dom.utils.getElementHeight(p.element);switch(a){case"L":d.x=d.left-k.width;d.y=d.top;break;case"R":d.x=d.left+d.width;d.y=d.top;break;case"T":case"TR":case"Tr":d.x=d.left;d.y=d.top-k.height;break;case"TL":case"Tl":d.x=d.left+d.width-k.width;d.y=d.top-k.height;break;case"B":case"BR":case"Br":d.x=d.left;d.y=d.top+d.height;break;case"BL":case"Bl":d.x=d.left+d.width-k.width;d.y=d.top+d.height;break}if(d.x<0){d.x=0}if(d.y<0){d.y=0}p.showAt(d.x,d.y)};Calendar.prototype.setDateFormat=function(a){this.dateFormat=a};Calendar.prototype.setTtDateFormat=function(a){this.ttDateFormat=a};Calendar.prototype.parseDate=function(b,a){if(!a){a=this.dateFormat}this.setDate(Date.parseDate(b,a))};Calendar.prototype.hideShowCovered=function(){if(!Calendar.is_ie&&!Calendar.is_opera){return}function b(p){var k=p.style.visibility;if(!k){if(document.defaultView&&typeof(document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml){k=document.defaultView.getComputedStyle(p,"").getPropertyValue("visibility")}else{k=""}}else{if(p.currentStyle){k=p.currentStyle.visibility}else{k=""}}}return k}var y=new Array("applet","iframe","select");var c=this.element;var a=Calendar.getAbsolutePos(c);var g=a.x;var d=c.offsetWidth+g;var w=a.y;var v=c.offsetHeight+w;for(var o=y.length;o>0;){var n=document.getElementsByTagName(y[--o]);var f=null;for(var r=n.length;r>0;){f=n[--r];a=Calendar.getAbsolutePos(f);var u=a.x;var t=f.offsetWidth+u;var s=a.y;var q=f.offsetHeight+s;if(this.hidden||(u>d)||(t<g)||(s>v)||(q<w)){if(!f.__msh_save_visibility){f.__msh_save_visibility=b(f)}f.style.visibility=f.__msh_save_visibility}else{if(!f.__msh_save_visibility){f.__msh_save_visibility=b(f)}f.style.visibility="hidden"}}}};Calendar.prototype._displayWeekdays=function(){var b=this.firstDayOfWeek;var a=this.firstdayname;var d=Calendar._TT.WEEKEND;for(var c=0;c<7;++c){a.className="day name";var f=(c+b)%7;if(c){a.ttip=Calendar._TT.DAY_FIRST.replace("%s",Calendar._DN[f]);a.navtype=100;a.calendar=this;a.fdow=f;Calendar._add_evs(a)}if(d.indexOf(f.toString())!=-1){Calendar.addClass(a,"weekend")}a.innerHTML=Calendar._SDN[(c+b)%7];a=a.nextSibling}};Calendar.prototype._hideCombos=function(){this.monthsCombo.style.display="none";this.yearsCombo.style.display="none"};Calendar.prototype._dragStart=function(ev){if(this.dragging){return}this.dragging=true;var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft}else{posY=ev.clientY+window.scrollY;posX=ev.clientX+window.scrollX}var st=this.element.style;this.xOffs=posX-parseInt(st.left);this.yOffs=posY-parseInt(st.top);with(Calendar){addEvent(document,"mousemove",calDragIt);addEvent(document,"mouseup",calDragEnd)}};if(!Date._hasBeenExtended){Date._hasBeenExtended=true;Date._MD=new Array(31,28,31,30,31,30,31,31,30,31,30,31);Date.SECOND=1000;Date.MINUTE=60*Date.SECOND;Date.HOUR=60*Date.MINUTE;Date.DAY=24*Date.HOUR;Date.WEEK=7*Date.DAY;Date.parseDate=function(p,c){var q=new Date();var r=0;var f=-1;var o=0;var u=p.split(/\W+/);var s=c.match(/%./g);var n=0,k=0;var v=0;var g=0;for(n=0;n<u.length;++n){if(!u[n]){continue}switch(s[n]){case"%d":case"%e":o=parseInt(u[n],10);break;case"%m":f=parseInt(u[n],10)-1;break;case"%Y":case"%y":r=parseInt(u[n],10);(r<100)&&(r+=(r>29)?1900:2000);break;case"%b":case"%B":for(k=0;k<12;++k){if(Calendar._MN[k].substr(0,u[n].length).toLowerCase()==u[n].toLowerCase()){f=k;break}}break;case"%H":case"%I":case"%k":case"%l":v=parseInt(u[n],10);break;case"%P":case"%p":if(/pm/i.test(u[n])&&v<12){v+=12}else{if(/am/i.test(u[n])&&v>=12){v-=12}}break;case"%M":g=parseInt(u[n],10);break}}if(isNaN(r)){r=q.getFullYear()}if(isNaN(f)){f=q.getMonth()}if(isNaN(o)){o=q.getDate()}if(isNaN(v)){v=q.getHours()}if(isNaN(g)){g=q.getMinutes()}if(r!=0&&f!=-1&&o!=0){return new Date(r,f,o,v,g,0)}r=0;f=-1;o=0;for(n=0;n<u.length;++n){if(u[n].search(/[a-zA-Z]+/)!=-1){var w=-1;for(k=0;k<12;++k){if(Calendar._MN[k].substr(0,u[n].length).toLowerCase()==u[n].toLowerCase()){w=k;break}}if(w!=-1){if(f!=-1){o=f+1}f=w}}else{if(parseInt(u[n],10)<=12&&f==-1){f=u[n]-1}else{if(parseInt(u[n],10)>31&&r==0){r=parseInt(u[n],10);(r<100)&&(r+=(r>29)?1900:2000)}else{if(o==0){o=u[n]}}}}}if(r==0){r=q.getFullYear()}if(f!=-1&&o!=0){return new Date(r,f,o,v,g,0)}return q};Date.prototype.getMonthDays=function(b){var a=this.getFullYear();if(typeof b=="undefined"){b=this.getMonth()}if(((0==(a%4))&&((0!=(a%100))||(0==(a%400))))&&b==1){return 29}else{return Date._MD[b]}};Date.prototype.getDayOfYear=function(){var a=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var c=new Date(this.getFullYear(),0,0,0,0,0);var b=a-c;return Math.floor(b/Date.DAY)};Date.prototype.getWeekNumber=function(){var c=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var b=c.getDay();c.setDate(c.getDate()-(b+6)%7+3);var a=c.valueOf();c.setMonth(0);c.setDate(4);return Math.round((a-c.valueOf())/(7*86400000))+1};Date.prototype.equalsTo=function(a){return((this.getFullYear()==a.getFullYear())&&(this.getMonth()==a.getMonth())&&(this.getDate()==a.getDate())&&(this.getHours()==a.getHours())&&(this.getMinutes()==a.getMinutes()))};Date.prototype.setDateOnly=function(a){var b=new Date(a);this.setDate(1);this.setFullYear(b.getFullYear());this.setMonth(b.getMonth());this.setDate(b.getDate())};Date.prototype.print=function(q){var b=this.getMonth();var p=this.getDate();var r=this.getFullYear();var u=this.getWeekNumber();var v=this.getDay();var C={};var z=this.getHours();var c=(z>=12);var n=(c)?(z-12):z;var B=this.getDayOfYear();if(n==0){n=12}var f=this.getMinutes();var o=this.getSeconds();C["%a"]=Calendar._SDN[v];C["%A"]=Calendar._DN[v];C["%b"]=Calendar._SMN[b];C["%B"]=Calendar._MN[b];C["%C"]=1+Math.floor(r/100);C["%d"]=(p<10)?("0"+p):p;C["%e"]=p;C["%H"]=(z<10)?("0"+z):z;C["%I"]=(n<10)?("0"+n):n;C["%j"]=(B<100)?((B<10)?("00"+B):("0"+B)):B;C["%k"]=z;C["%l"]=n;C["%m"]=(b<9)?("0"+(1+b)):(1+b);C["%M"]=(f<10)?("0"+f):f;C["%n"]="\n";C["%p"]=c?"PM":"AM";C["%P"]=c?"pm":"am";C["%s"]=Math.floor(this.getTime()/1000);C["%S"]=(o<10)?("0"+o):o;C["%t"]="\t";C["%U"]=C["%W"]=C["%V"]=(u<10)?("0"+u):u;C["%u"]=v+1;C["%w"]=v;C["%y"]=(""+r).substr(2,2);C["%Y"]=r;C["%%"]="%";var A=/%./g;if(!Calendar.is_ie5&&!Calendar.is_khtml){return q.replace(A,function(a){return C[a]||a})}var t=q.match(A);for(var k=0;k<t.length;k++){var g=C[t[k]];if(g){A=new RegExp(t[k],"g");q=q.replace(A,g)}}return q};Date.prototype.__msh_oldSetFullYear=Date.prototype.setFullYear;Date.prototype.setFullYear=function(b){var a=new Date(this);a.__msh_oldSetFullYear(b);if(a.getMonth()!=this.getMonth()){this.setDate(28)}this.__msh_oldSetFullYear(b)}}window._dynarch_popupCalendar=null;Calendar._DN=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");Calendar._SDN=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun");Calendar._FD=0;Calendar._MN=new Array("January","February","March","April","May","June","July","August","September","October","November","December");Calendar._SMN=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");Calendar._TT={};Calendar._TT.INFO="About the calendar";Calendar._TT.ABOUT="DHTML Date/Time Selector\n(c) dynarch.com 2002-2005 / Author: Mihai Bazon\nFor latest version visit: http://www.dynarch.com/projects/calendar/\nDistributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details.\n\nDate selection:\n- Use the \xab, \xbb buttons to select year\n- Use the "+String.fromCharCode(8249)+", "+String.fromCharCode(8250)+" buttons to select month\n- Hold mouse button on any of the above buttons for faster selection.";Calendar._TT.ABOUT_TIME="\n\nTime selection:\n- Click on any of the time parts to increase it\n- or Shift-click to decrease it\n- or click and drag for faster selection.";Calendar._TT.PREV_YEAR="Prev. year (hold for menu)";Calendar._TT.PREV_MONTH="Prev. month (hold for menu)";Calendar._TT.GO_TODAY="Go Today";Calendar._TT.NEXT_MONTH="Next month (hold for menu)";Calendar._TT.NEXT_YEAR="Next year (hold for menu)";Calendar._TT.SEL_DATE="Select date";Calendar._TT.DRAG_TO_MOVE="Drag to move";Calendar._TT.PART_TODAY=" (today)";Calendar._TT.DAY_FIRST="Display %s first";Calendar._TT.WEEKEND="0,6";Calendar._TT.CLOSE="Close";Calendar._TT.TODAY="Today";Calendar._TT.TIME_PART="(Shift-)Click or drag to change value";Calendar._TT.DEF_DATE_FORMAT="%Y-%m-%d";Calendar._TT.TT_DATE_FORMAT="%a, %b %e";Calendar._TT.WK="wk";Calendar._TT.TIME="Time:";Calendar.setup=function(n){function k(o,p){if(typeof n[o]=="undefined"){n[o]=p}}k("inputField",null);k("displayArea",null);k("button",null);k("eventName","click");k("ifFormat","%Y/%m/%d");k("daFormat","%Y/%m/%d");k("singleClick",true);k("disableFunc",null);k("dateStatusFunc",n.disableFunc);k("dateText",null);k("firstDay",null);k("align","Br");k("range",[1900,2999]);k("weekNumbers",true);k("flat",null);k("flatCallback",null);k("onSelect",null);k("onClose",null);k("onUpdate",null);k("date",null);k("showsTime",false);k("timeFormat","24");k("electric",true);k("step",1);k("position",null);k("cache",true);k("showOthers",false);k("multiple",null);var d=["inputField","displayArea","button"];for(var c in d){if(typeof n[d[c]]=="string"){n[d[c]]=document.getElementById(n[d[c]])}}if(!(n.flat||n.multiple||n.inputField||n.displayArea||n.button)){}function b(q){var o=q.params;var r=(q.dateClicked||o.electric);if(r&&o.inputField){o.inputField.value=q.date.print(o.ifFormat);if(typeof o.inputField.onchange=="function"){o.inputField.onchange()}}if(r&&o.displayArea){o.displayArea.innerHTML=q.date.print(o.daFormat)}if(r&&typeof o.onUpdate=="function"){o.onUpdate(q)}if(r&&o.flat){if(typeof o.flatCallback=="function"){o.flatCallback(q)}}if(r&&o.singleClick&&q.dateClicked){q.callCloseHandler()}}if(n.flat!=null){if(typeof n.flat=="string"){n.flat=document.getElementById(n.flat)}if(!n.flat){alert("Calendar.setup:\n  Flat specified but can't find parent.");return false}var g=new Calendar(n.firstDay,n.date,n.onSelect||b);g.showsOtherMonths=n.showOthers;g.showsTime=n.showsTime;g.time24=(n.timeFormat=="24");g.params=n;g.weekNumbers=n.weekNumbers;g.setRange(n.range[0],n.range[1]);g.setDateStatusHandler(n.dateStatusFunc);g.getDateText=n.dateText;if(n.ifFormat){g.setDateFormat(n.ifFormat)}if(n.inputField&&typeof n.inputField.value=="string"){g.parseDate(n.inputField.value)}g.create(n.flat);g.show();return false}var f=n.button||n.displayArea||n.inputField;function a(){var o=n.inputField||n.displayArea;var q=n.inputField?n.ifFormat:n.daFormat;var u=false;var s=window.calendar;if(o){n.date=Date.parseDate(o.value||o.innerHTML,q)}if(!(s&&n.cache)){window.calendar=s=new Calendar(n.firstDay,n.date,n.onSelect||b,n.onClose||function(v){v.hide()});s.showsTime=n.showsTime;s.time24=(n.timeFormat=="24");s.weekNumbers=n.weekNumbers;u=true}else{if(n.date){s.setDate(n.date)}s.hide()}if(n.multiple){s.multiple={};for(var p=n.multiple.length;--p>=0;){var t=n.multiple[p];var r=t.print("%Y%m%d");s.multiple[r]=t}}s.showsOtherMonths=n.showOthers;s.yearStep=n.step;s.setRange(n.range[0],n.range[1]);s.params=n;s.setDateStatusHandler(n.dateStatusFunc);s.getDateText=n.dateText;s.setDateFormat(q);if(u){s.create()}s.refresh();if(!n.position){s.showAtElement(n.button||n.displayArea||n.inputField,n.align)}else{s.showAt(n.position[0],n.position[1])}return false}f["on"+n.eventName]=a;f.showCalendar=a;return g};function addCal(c,a){a||(a={});var b={ifFormat:"%b %d, %Y",weekNumbers:false,align:"Br",inputField:c,button:c+"_trigger"};var d;for(d in a){if(a.hasOwnProperty(d)){b[d]=a[d]}}Calendar.setup.call(Calendar.setup,b)}if(!JSControlsTags){var JSControlsTags={}}JSControlsTags.Autocomplete=Class.create();JSControlsTags.Autocomplete.prototype=Object.extend(new Autocompleter.Base(),{initialize:function(c,a,b){this.source=c;this.list="JSControlsTagsAuto_"+this.source;$(this.source).setAttribute("autocomplete","off");new Insertion.After(this.source,'<div id="'+this.list+'" ></div>');$(this.list).style.maxHeight=100+"px";$(this.list).style.overflowY="auto";this.baseInitialize(this.source,this.list,b);this.options.items=a;Element.addClassName($(this.list),this.options.className);this.forceActivation=false},setOptions:function(a){this.options=Object.extend({maxItems:10,partialSearch:true,minChars:1,partialChars:1,ignoreCase:true,fullSearch:true,frequency:0.1,tokens:a.tokens||new Array("+","/","*","-"),className:a.className||"autocomplete",fade:a.fade,onSelectedItem:a.onSelectedItem?a.onSelectedItem:null,selector:function(p){var g=[];var k=[];var n=p.getToken();var f=0;var b=p.options.items.length;if(p.forceActivation==true){for(var d=0;d<b;d++){var q=p.options.items[d];var o=q.description;var c=q.keyword.toString();g.push("<li id=' "+d+"'>"+c+p.getHtmlDescription(o)+"</li>")}}else{for(var d=0;d<b;d++){if(p.options.choices){if(!(g.length<p.options.choices)){break}}var q=p.options.items[d];var o=q.description;var c=q.keyword.toString();var r=p.options.ignoreCase?c.toLowerCase().indexOf(n.toLowerCase()):c.indexOf(n);while(r!=-1){if(r==0&&c.length!=n.length){g.push("<li id=' "+d+"'><strong>"+c.substr(0,n.length)+"</strong>"+c.substr(n.length)+p.getHtmlDescription(o)+"</li>");break}else{if(n.length>=p.options.partialChars&&p.options.partialSearch&&r!=-1){if(p.options.fullSearch||/\s/.test(c.substr(r-1,1))){k.push("<li id=' "+d+"'>"+c.substr(0,r)+"<strong>"+c.substr(r,n.length)+"</strong>"+c.substr(r+n.length)+p.getHtmlDescription(o)+"</li>");break}}}r=p.options.ignoreCase?c.toLowerCase().indexOf(n.toLowerCase(),r+1):c.indexOf(n,r+1)}}if(k.length){if(p.options.choices){g=g.concat(k.slice(0,p.options.choices-g.length))}else{if(g.length==0){g=k}else{g=g.concat(k.slice(0,g.length))}}}}return"<ul>"+g.join("")+"</ul>"},onShow:function(b,c){if(!c.style.position||c.style.position=="absolute"){c.style.position="absolute";Position.clone(b,c,{setHeight:false,offsetTop:b.offsetHeight})}if(a.fade){Effect.Appear(c,{duration:0.2})}else{Element.show(c)}},onHide:function(b,c){if(a.fade){new Effect.Fade(c,{duration:0.2})}else{Element.hide(c)}}},a||{})},getHtmlDescription:function(a){if(a!=null){return" : <code>"+a+"</code>"}return""},getUpdatedChoices:function(){this.updateChoices(this.options.selector(this));if(this.entryCount>0){var b=this.getEntry(0);var a=b.offsetHeight*this.options.maxItems;this.update.style.maxHeight=a+"px";if(this.entryCount>this.options.maxItems){this.update.style.height=a+"px"}else{this.update.style.height=""}}},onKeyPress:function(a){if(this.active){switch(a.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:this.selectEntry();Event.stop(a);case Event.KEY_ESC:this.hide();this.active=false;Event.stop(a);return;case Event.KEY_LEFT:case Event.KEY_RIGHT:return;case Event.KEY_UP:if(this.index>0){this.markPrevious();this.render();this.updateScrollbar()}if(navigator.appVersion.indexOf("AppleWebKit")>0){Event.stop(a)}Event.stop(a);return;case Event.KEY_DOWN:if(this.index<this.entryCount-1){this.markNext();this.render();this.updateScrollbar()}if(navigator.appVersion.indexOf("AppleWebKit")>0){Event.stop(a)}Event.stop(a);return;case 33:if(this.index>0){this.markPreviousPage();this.render();this.updateScrollbar()}if(navigator.appVersion.indexOf("AppleWebKit")>0){Event.stop(a)}Event.stop(a);return;case 34:if(this.index<this.entryCount-1){this.markNextPage();this.render();this.updateScrollbar()}if(navigator.appVersion.indexOf("AppleWebKit")>0){Event.stop(a)}Event.stop(a);return;case 36:this.markFirst();this.render();this.updateScrollbar();if(navigator.appVersion.indexOf("AppleWebKit")>0){Event.stop(a)}Event.stop(a);return;case 35:this.markEnd();this.render();this.updateScrollbar();if(navigator.appVersion.indexOf("AppleWebKit")>0){Event.stop(a)}Event.stop(a);return}}else{if(a.keyCode==Event.KEY_TAB||a.keyCode==Event.KEY_RETURN){return}}this.changed=true;this.hasFocus=true;if(this.observer){clearTimeout(this.observer)}this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000)},updateScrollbar:function(){var a=this.getCurrentEntry();this.update.scrollTop=a.offsetTop},getToken:function(){var b=this.getTokenBounds();if(b!=-1){var a=this.element.value.substr(b+1).replace(/^\s+/,"")}else{var a=this.element.value}return/\n/.test(a)?"":a},selectEntry:function(){this.active=false;var f=this.getCurrentEntry();if(f!=null){var b=parseInt(f.id);var c=this.options.items[b];var a=c.keyword;f.innerHTML=a;if(this.options.onSelectedItem){var d=this.options.onSelectedItem(c,this);if(d==false){return false}}}this.updateElement(f)},markPreviousPage:function(){var a=this.options.maxItems;if(this.index-a>0){this.index-=a}else{this.index=0}},markNextPage:function(){var a=this.options.maxItems;if(this.index+a<this.entryCount-1){this.index+=a}else{this.index=this.entryCount-1}},markFirst:function(){this.index=0},markEnd:function(){this.index=this.entryCount-1},openWithAllItems:function(){this.forceActivation=true;$(this.source).focus();this.activate();setTimeout(this.unForceActivation.bind(this),250)},unForceActivation:function(){this.forceActivation=false},hide:function(){if(this.forceActivation!=true){this.stopIndicator();if(Element.getStyle(this.update,"display")!="none"){this.options.onHide(this.element,this.update)}if(this.iefix){Element.hide(this.iefix)}}}});if(!JSControlsTags){var JSControlsTags={}}JSControlsTags.AutocompleteUser=Class.create();JSControlsTags.AutocompleteUser.prototype=Object.extend(new Autocompleter.Base(),{initialize:function(c,a,b){this.source=c;this.list="JSControlsTagsAuto_"+this.source;this.form=null;$(this.source).setAttribute("autocomplete","off");new Insertion.After(this.source,'<div id="'+this.list+'" ></div>');$(this.list).style.maxHeight=100+"px";$(this.list).style.overflowY="auto";this.baseInitialize(this.source,this.list,b);this.options.items=a;Element.addClassName($(this.list),this.options.className);this.forceActivation=false},setOptions:function(a){this.options=Object.extend({maxItems:10,partialSearch:true,minChars:1,partialChars:1,ignoreCase:true,fullSearch:true,frequency:0.1,tokens:a.tokens||new Array("+","/","*","-"),className:a.className||"autocomplete",fade:a.fade,onSelectedItem:a.onSelectedItem?a.onSelectedItem:null,selector:function(p){var g=[];var k=[];var n=p.getToken();var f=0;var b=p.options.items.length;if(p.forceActivation==true){for(var d=0;d<b;d++){var q=p.options.items[d];var o=q.description;var c=q.keyword.toString()+", "+q.email.toString();g.push("<li id=' "+d+"'>"+c+p.getHtmlDescription(o)+"</li>")}}else{for(var d=0;d<b;d++){if(p.options.choices){if(!(g.length<p.options.choices)){break}}var q=p.options.items[d];var o=q.description;var c=q.keyword.toString()+", "+q.email.toString();var r=p.options.ignoreCase?c.toLowerCase().indexOf(n.toLowerCase()):c.indexOf(n);while(r!=-1){if(r==0&&c.length!=n.length){g.push("<li id=' "+d+"'><strong>"+c.substr(0,n.length)+"</strong>"+c.substr(n.length)+p.getHtmlDescription(o)+"</li>");break}else{if(n.length>=p.options.partialChars&&p.options.partialSearch&&r!=-1){if(p.options.fullSearch||/\s/.test(c.substr(r-1,1))){k.push("<li id=' "+d+"'>"+c.substr(0,r)+"<strong>"+c.substr(r,n.length)+"</strong>"+c.substr(r+n.length)+p.getHtmlDescription(o)+"</li>");break}}}r=p.options.ignoreCase?c.toLowerCase().indexOf(n.toLowerCase(),r+1):c.indexOf(n,r+1)}}if(k.length){if(p.options.choices){g=g.concat(k.slice(0,p.options.choices-g.length))}else{if(g.length==0){g=k}else{g=g.concat(k.slice(0,g.length))}}}}return"<ul>"+g.join("")+"</ul>"},onShow:function(b,c){if(!c.style.position||c.style.position=="absolute"){c.style.position="absolute";Position.clone(b,c,{setHeight:false,offsetTop:b.offsetHeight})}if(a.fade){Effect.Appear(c,{duration:0.2})}else{Element.show(c)}},onHide:function(b,c){if(a.fade){new Effect.Fade(c,{duration:0.2})}else{Element.hide(c)}}},a||{})},getHtmlDescription:function(a){if(a!=null){return" : <code>"+a+"</code>"}return""},getUpdatedChoices:function(){this.updateChoices(this.options.selector(this));if(this.entryCount>0){var b=this.getEntry(0);var a=b.offsetHeight*this.options.maxItems;this.update.style.maxHeight=a+"px";if(this.entryCount>this.options.maxItems){this.update.style.height=a+"px"}else{this.update.style.height=""}}},onKeyPress:function(a){if(this.active){switch(a.keyCode){case Event.KEY_TAB:this.hide();this.active=false;this.selectEntry();Event.stop(a);return;case Event.KEY_RETURN:this.hide();this.active=false;Event.stop(a);if(this.form!=null){this.form.submit()}return;case Event.KEY_ESC:this.hide();this.active=false;Event.stop(a);return;case Event.KEY_LEFT:case Event.KEY_RIGHT:return;case Event.KEY_UP:if(this.index>0){this.markPrevious();this.render();this.updateScrollbar();$(this.source).value=this.options.items[parseInt(this.getCurrentEntry().id)].keyword}if(navigator.appVersion.indexOf("AppleWebKit")>0){Event.stop(a)}Event.stop(a);return;case Event.KEY_DOWN:if(this.index<this.entryCount-1){this.markNext();this.render();this.updateScrollbar();$(this.source).value=this.options.items[parseInt(this.getCurrentEntry().id)].keyword}if(navigator.appVersion.indexOf("AppleWebKit")>0){Event.stop(a)}Event.stop(a);return;case 33:if(this.index>0){this.markPreviousPage();this.render();this.updateScrollbar();$(this.source).value=this.options.items[parseInt(this.getCurrentEntry().id)].keyword}if(navigator.appVersion.indexOf("AppleWebKit")>0){Event.stop(a)}Event.stop(a);return;case 34:if(this.index<this.entryCount-1){this.markNextPage();this.render();this.updateScrollbar();$(this.source).value=this.options.items[parseInt(this.getCurrentEntry().id)].keyword}if(navigator.appVersion.indexOf("AppleWebKit")>0){Event.stop(a)}Event.stop(a);return;case 36:this.markFirst();this.render();this.updateScrollbar();$(this.source).value=this.options.items[parseInt(this.getCurrentEntry().id)].keyword;if(navigator.appVersion.indexOf("AppleWebKit")>0){Event.stop(a)}Event.stop(a);return;case 35:this.markEnd();this.render();this.updateScrollbar();$(this.source).value=this.options.items[parseInt(this.getCurrentEntry().id)].keyword;if(navigator.appVersion.indexOf("AppleWebKit")>0){Event.stop(a)}Event.stop(a);return}}else{if(a.keyCode==Event.KEY_TAB||a.keyCode==Event.KEY_RETURN){return}}this.changed=true;this.hasFocus=true;if(this.observer){clearTimeout(this.observer)}this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000)},updateScrollbar:function(){var a=this.getCurrentEntry();this.update.scrollTop=a.offsetTop},getToken:function(){var b=this.getTokenBounds();if(b!=-1){var a=this.element.value.substr(b+1).replace(/^\s+/,"")}else{var a=this.element.value}return/\n/.test(a)?"":a},selectEntry:function(){this.active=false;var f=this.getCurrentEntry();if(f!=null){var b=parseInt(f.id);var c=this.options.items[b];var a=c.keyword;f.innerHTML=a;if(this.options.onSelectedItem){var d=this.options.onSelectedItem(c,this);if(d==false){return false}}}this.updateElement(f)},markPreviousPage:function(){var a=this.options.maxItems;if(this.index-a>0){this.index-=a}else{this.index=0}},markNextPage:function(){var a=this.options.maxItems;if(this.index+a<this.entryCount-1){this.index+=a}else{this.index=this.entryCount-1}},markFirst:function(){this.index=0},markEnd:function(){this.index=this.entryCount-1},openWithAllItems:function(){this.forceActivation=true;$(this.source).focus();this.activate();setTimeout(this.unForceActivation.bind(this),250)},unForceActivation:function(){this.forceActivation=false},hide:function(){if(this.forceActivation!=true){this.stopIndicator();if(Element.getStyle(this.update,"display")!="none"){this.options.onHide(this.element,this.update)}if(this.iefix){Element.hide(this.iefix)}}}});var CD=CD||{};CD.Login={showLogin:function(c){var a=document.getElementById("openIdLogin");var b=document.getElementById("legacyLogin");if(c=="openid"){a.style.display="";b.style.display="none"}else{if(c=="legacy"){a.style.display="none";b.style.display=""}}},validateForm:function(d){var c=true,a="";if(d.useCrowd&&!!d.useCrowd[0].checked){if(""==d.username){c=false;a=a+"You must enter a valid username.\n"}}else{try{if(!d.username.value.match(/^[A-Za-z0-9]+$/)||d.username.value==""){c=false;a=a+"You must enter a valid username.\n"}}catch(b){if(!d.openid_name.value.match(/^[A-Za-z0-9]+$/)||d.openid_name.value==""){c=false;a=a+"You must enter a valid username.\n"}}}try{if(d.password.value.length<4){c=false;a=a+"You must enter a valid password."}}catch(b){if(d.openid_password.value.length<4){c=false;a=a+"You must enter a valid password."}}if(!c){alert(a)}return c},submitForm:function(f){if(this.validateForm(f)){var b=document.getElementById("signin");if(b){b.value="Signing In...";b.style.disabled=true}if(typeof f.elements.username=="object"){var d=f.elements.username;var c=f.elements.password;d.name="openid_name";c.name="openid_password";var a=document.createElement("input");a.type="hidden";a.name="openid_action";a.value="login";f.appendChild(a)}return true}else{f.password.focus();return false}return false}};var hexcase=0;var b64pad="";var chrsz=8;function hex_md5(a){return binl2hex(core_md5(str2binl(a),a.length*chrsz))}function b64_md5(a){return binl2b64(core_md5(str2binl(a),a.length*chrsz))}function str_md5(a){return binl2str(core_md5(str2binl(a),a.length*chrsz))}function hex_hmac_md5(a,b){return binl2hex(core_hmac_md5(a,b))}function b64_hmac_md5(a,b){return binl2b64(core_hmac_md5(a,b))}function str_hmac_md5(a,b){return binl2str(core_hmac_md5(a,b))}function md5_vm_test(){return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72"}function core_md5(u,p){u[p>>5]|=128<<((p)%32);u[(((p+64)>>>9)<<4)+14]=p;var t=1732584193;var s=-271733879;var r=-1732584194;var q=271733878;for(var k=0;k<u.length;k+=16){var o=t;var n=s;var g=r;var f=q;t=md5_ff(t,s,r,q,u[k+0],7,-680876936);q=md5_ff(q,t,s,r,u[k+1],12,-389564586);r=md5_ff(r,q,t,s,u[k+2],17,606105819);s=md5_ff(s,r,q,t,u[k+3],22,-1044525330);t=md5_ff(t,s,r,q,u[k+4],7,-176418897);q=md5_ff(q,t,s,r,u[k+5],12,1200080426);r=md5_ff(r,q,t,s,u[k+6],17,-1473231341);s=md5_ff(s,r,q,t,u[k+7],22,-45705983);t=md5_ff(t,s,r,q,u[k+8],7,1770035416);q=md5_ff(q,t,s,r,u[k+9],12,-1958414417);r=md5_ff(r,q,t,s,u[k+10],17,-42063);s=md5_ff(s,r,q,t,u[k+11],22,-1990404162);t=md5_ff(t,s,r,q,u[k+12],7,1804603682);q=md5_ff(q,t,s,r,u[k+13],12,-40341101);r=md5_ff(r,q,t,s,u[k+14],17,-1502002290);s=md5_ff(s,r,q,t,u[k+15],22,1236535329);t=md5_gg(t,s,r,q,u[k+1],5,-165796510);q=md5_gg(q,t,s,r,u[k+6],9,-1069501632);r=md5_gg(r,q,t,s,u[k+11],14,643717713);s=md5_gg(s,r,q,t,u[k+0],20,-373897302);t=md5_gg(t,s,r,q,u[k+5],5,-701558691);q=md5_gg(q,t,s,r,u[k+10],9,38016083);r=md5_gg(r,q,t,s,u[k+15],14,-660478335);s=md5_gg(s,r,q,t,u[k+4],20,-405537848);t=md5_gg(t,s,r,q,u[k+9],5,568446438);q=md5_gg(q,t,s,r,u[k+14],9,-1019803690);r=md5_gg(r,q,t,s,u[k+3],14,-187363961);s=md5_gg(s,r,q,t,u[k+8],20,1163531501);t=md5_gg(t,s,r,q,u[k+13],5,-1444681467);q=md5_gg(q,t,s,r,u[k+2],9,-51403784);r=md5_gg(r,q,t,s,u[k+7],14,1735328473);s=md5_gg(s,r,q,t,u[k+12],20,-1926607734);t=md5_hh(t,s,r,q,u[k+5],4,-378558);q=md5_hh(q,t,s,r,u[k+8],11,-2022574463);r=md5_hh(r,q,t,s,u[k+11],16,1839030562);s=md5_hh(s,r,q,t,u[k+14],23,-35309556);t=md5_hh(t,s,r,q,u[k+1],4,-1530992060);q=md5_hh(q,t,s,r,u[k+4],11,1272893353);r=md5_hh(r,q,t,s,u[k+7],16,-155497632);s=md5_hh(s,r,q,t,u[k+10],23,-1094730640);t=md5_hh(t,s,r,q,u[k+13],4,681279174);q=md5_hh(q,t,s,r,u[k+0],11,-358537222);r=md5_hh(r,q,t,s,u[k+3],16,-722521979);s=md5_hh(s,r,q,t,u[k+6],23,76029189);t=md5_hh(t,s,r,q,u[k+9],4,-640364487);q=md5_hh(q,t,s,r,u[k+12],11,-421815835);r=md5_hh(r,q,t,s,u[k+15],16,530742520);s=md5_hh(s,r,q,t,u[k+2],23,-995338651);t=md5_ii(t,s,r,q,u[k+0],6,-198630844);q=md5_ii(q,t,s,r,u[k+7],10,1126891415);r=md5_ii(r,q,t,s,u[k+14],15,-1416354905);s=md5_ii(s,r,q,t,u[k+5],21,-57434055);t=md5_ii(t,s,r,q,u[k+12],6,1700485571);q=md5_ii(q,t,s,r,u[k+3],10,-1894986606);r=md5_ii(r,q,t,s,u[k+10],15,-1051523);s=md5_ii(s,r,q,t,u[k+1],21,-2054922799);t=md5_ii(t,s,r,q,u[k+8],6,1873313359);q=md5_ii(q,t,s,r,u[k+15],10,-30611744);r=md5_ii(r,q,t,s,u[k+6],15,-1560198380);s=md5_ii(s,r,q,t,u[k+13],21,1309151649);t=md5_ii(t,s,r,q,u[k+4],6,-145523070);q=md5_ii(q,t,s,r,u[k+11],10,-1120210379);r=md5_ii(r,q,t,s,u[k+2],15,718787259);s=md5_ii(s,r,q,t,u[k+9],21,-343485551);t=safe_add(t,o);s=safe_add(s,n);r=safe_add(r,g);q=safe_add(q,f)}return Array(t,s,r,q)}function md5_cmn(n,f,d,c,k,g){return safe_add(bit_rol(safe_add(safe_add(f,n),safe_add(c,g)),k),d)}function md5_ff(k,g,q,p,f,o,n){return md5_cmn((g&q)|((~g)&p),k,g,f,o,n)}function md5_gg(k,g,q,p,f,o,n){return md5_cmn((g&p)|(q&(~p)),k,g,f,o,n)}function md5_hh(k,g,q,p,f,o,n){return md5_cmn(g^q^p,k,g,f,o,n)}function md5_ii(k,g,q,p,f,o,n){return md5_cmn(q^(g|(~p)),k,g,f,o,n)}function core_hmac_md5(c,g){var f=str2binl(c);if(f.length>16){f=core_md5(f,c.length*chrsz)}var a=Array(16),d=Array(16);for(var b=0;b<16;b++){a[b]=f[b]^909522486;d[b]=f[b]^1549556828}var k=core_md5(a.concat(str2binl(g)),512+g.length*chrsz);return core_md5(d.concat(k),512+128)}function safe_add(a,d){var c=(a&65535)+(d&65535);var b=(a>>16)+(d>>16)+(c>>16);return(b<<16)|(c&65535)}function bit_rol(a,b){return(a<<b)|(a>>>(32-b))}function str2binl(d){var c=Array();var a=(1<<chrsz)-1;for(var b=0;b<d.length*chrsz;b+=chrsz){c[b>>5]|=(d.charCodeAt(b/chrsz)&a)<<(b%32)}return c}function binl2str(c){var d="";var a=(1<<chrsz)-1;for(var b=0;b<c.length*32;b+=chrsz){d+=String.fromCharCode((c[b>>5]>>>(b%32))&a)}return d}function binl2hex(c){var b=hexcase?"0123456789ABCDEF":"0123456789abcdef";var d="";for(var a=0;a<c.length*4;a++){d+=b.charAt((c[a>>2]>>((a%4)*8+4))&15)+b.charAt((c[a>>2]>>((a%4)*8))&15)}return d}function binl2b64(d){var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var g="";for(var b=0;b<d.length*4;b+=3){var f=(((d[b>>2]>>8*(b%4))&255)<<16)|(((d[b+1>>2]>>8*((b+1)%4))&255)<<8)|((d[b+2>>2]>>8*((b+2)%4))&255);for(var a=0;a<4;a++){if(b*8+a*6>d.length*32){g+=b64pad}else{g+=c.charAt((f>>6*(3-a))&63)}}}return g}var helpcenter=null;function help_center_search(f,b){if(f.search_type.value=="user_forum"){var c=CD.www_forum+"/search.php?action=search&keywords="+f.q.value;if(b=="app"){cd_popup_helpcenter(c)}else{window.location=c}}else{if(b=="app"){var a=CD.www_helpcenter+"/search/"+f.q.value;help_center_window=cd_popup_helpcenter(a)}else{window.location=CD.www_helpcenter+"/search/"+f.q.value}}return false}function postto(b,f,c){var a=document.body.appendChild(new Element("form",{method:"post",action:CD.www_helpcenter+b,target:c,style:"display:none"}));for(var d in f){a.appendChild(new Element("input",{type:"hidden",name:d,value:f[d]}))}a.submit();a.remove()}function load_tools_iframe(b){var a=document.getElementById("cd_tools_frame");a.src=CD.wwwurl+"/utils/helpcenter/tools?section="+b}var remote_helpcenter;function cd_popup_helpcenter(a){if(remote_helpcenter){remote_helpcenter.close()}remote_helpcenter=window.open(a,"cd_win_helpcenter","height=600,width=950,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,resizable=yes");if(remote_helpcenter.opener==null){remote_helpcenter.opener=window}return remote_helpcenter}function cd_popup_helpvideo(a){makeRemote(CD.wwwurl+"/viewvideos?vid="+a,"cd_win_video",700,850)}var Validator=Class.create();Validator.prototype={initialize:function(c,b,d,a){if(typeof d=="function"){this.options=$H(a);this._test=d}else{this.options=$H(d);this._test=function(){return true}}this.error=b||"Validation failed.";this.className=c},test:function(a,b){return(this._test(a,b)&&this.options.all(function(c){return Validator.methods[c.key]?Validator.methods[c.key](a,b,c.value):true}))}};Validator.methods={pattern:function(a,c,b){return Validation.get("IsEmpty").test(a)||b.test(a)},minLength:function(a,c,b){return a.length>=b},maxLength:function(a,c,b){return a.length<=b},min:function(a,c,b){return a>=parseFloat(b)},max:function(a,c,b){return a<=parseFloat(b)},notOneOf:function(a,c,b){return $A(b).all(function(d){return a!=d})},oneOf:function(a,c,b){return $A(b).any(function(d){return a==d})},is:function(a,c,b){return a==b},isNot:function(a,c,b){return a!=b},equalToField:function(a,c,b){return a==$F(b)},notEqualToField:function(a,c,b){return a!=$F(b)},include:function(a,c,b){return $A(b).all(function(d){return Validation.get(d).test(a,c)})}};var Validation=Class.create();Validation.prototype={initialize:function(c,a){this.form=$(c);if(!this.form){return}this.options=Object.extend({onSubmit:true,stopOnFirst:false,immediate:false,focusOnError:true,useTitles:false,onFormValidate:function(f,g){return f},onElementValidate:function(f,g){return f}},a||{});if(this.options.onSubmit){Event.observe(this.form,"submit",this.onSubmit.bind(this),false)}if(this.options.immediate){var b=this.options.useTitles;var d=this.options.onElementValidate;Form.getElements(this.form).each(function(f){Event.observe(f,"blur",function(g){Validation.validate(Event.element(g),{useTitle:b,onElementValidate:d})})})}},onSubmit:function(a){if(!this.validate()){Event.stop(a)}},validate:function(){var a=false;var b=this.options.useTitles;var d=this.options.onElementValidate;if(this.options.stopOnFirst){a=Form.getElements(this.form).all(function(f){return Validation.validate(f,{useTitle:b,onElementValidate:d})})}else{a=Form.getElements(this.form).collect(function(f){return Validation.validate(f,{useTitle:b,onElementValidate:d})}).all()}if(!a&&this.options.focusOnError){Form.getElements(this.form).findAll(function(f){return $(f).hasClassName("validation-failed")}).first().focus()}var c=this.options.onFormValidate(a,this.form);if(typeof(c)==="boolean"){a=a&&c}return a},reset:function(){Form.getElements(this.form).each(Validation.reset)}};Object.extend(Validation,{validate:function(c,a){a=Object.extend({useTitle:false,onElementValidate:function(d,f){return d}},a||{});c=$(c);var b=c.classNames();return result=b.all(function(d){var f=Validation.test(d,c,a.useTitle);return a.onElementValidate(f,c)})},test:function(b,n,o){var q=Validation.get(b);var a="__advice"+b.camelize();try{if(Validation.isVisible(n)&&!q.test($F(n),n)){if(!n[a]){var d=Validation.getAdvice(b,n);var f="";if(d==null){f=o?((n&&n.title)?n.title:q.error):q.error;d='<div class="validation-advice" id="advice-'+b+"-"+Validation.getElmID(n)+'" style="display:none">'+f+"</div>";var g=n;if(n.hasAttribute("data-ui-advice")){g=$(n.readAttribute("data-ui-advice"));new Insertion.After(g,d)}else{if(g=n.up(".edt-input")){g.insert({after:d})}else{switch(n.type.toLowerCase()){case"checkbox":case"radio":var c=n.parentNode;if(c){new Insertion.Bottom(c,d)}else{new Insertion.After(n,d)}break;default:new Insertion.After(n,d)}}}d=Validation.getAdvice(b,n)}if(d.innerHTML.strip()===""){d.update(f)}if(typeof Effect=="undefined"){d.style.display="block"}else{new Effect.Appear(d,{duration:1})}}n[a]=true;n.removeClassName("validation-passed");n.addClassName("validation-failed");return false}else{var d=Validation.getAdvice(b,n);if(d!=null){d.hide()}n[a]="";n.removeClassName("validation-failed");n.addClassName("validation-passed");return true}}catch(k){throw (k)}},isVisible:function(a){while(a.tagName!="BODY"&&typeof a.style!=="undefined"){if(a.style.visibility!=="visible"&&a.style.visibility!==""||a.style.display==="none"){return false}a=a.parentNode}return true},getAdvice:function(a,b){return $("advice-"+a+"-"+Validation.getElmID(b))||$("advice-"+Validation.getElmID(b))},getElmID:function(a){return a.id?a.id:a.name},reset:function(b){b=$(b);var a=b.classNames();a.each(function(d){var f="__advice"+d.camelize();if(b[f]){var c=Validation.getAdvice(d,b);c.hide();b[f]=""}b.removeClassName("validation-failed");b.removeClassName("validation-passed")})},add:function(d,c,f,b){var a={};a[d]=new Validator(d,c,f,b);Object.extend(Validation.methods,a)},addAllThese:function(a){var b={};$A(a).each(function(c){b[c[0]]=new Validator(c[0],c[1],c[2],(c.length>3?c[3]:{}))});Object.extend(Validation.methods,b)},get:function(a){return Validation.methods[a]?Validation.methods[a]:Validation.methods._LikeNoIDIEverSaw_},methods:{_LikeNoIDIEverSaw_:new Validator("_LikeNoIDIEverSaw_","",{})}});Validation.add("IsEmpty","",function(a){return((a==null)||(a.length==0))});Validation.addAllThese([["required","This is a required field.",function(a){return !Validation.get("IsEmpty").test(a)}],["required-file","This is a required field.",function(a,b){a=b.value;return !Validation.get("IsEmpty").test(a)}],["required-boolean-radio-yes","This field must be Yes.",function(c,d){var b=Validation.getElmID(d);var a=Validation.getElmID(d).replace("_on","_off");Validation.reset(a);return !Validation.get("IsEmpty").test($F(b))&&Validation.get("IsEmpty").test($F(a))}],["required-boolean-radio-no","This field must be Yes.",function(c,d){var b=Validation.getElmID(d).replace("_off","_on");var a=Validation.getElmID(d);Validation.reset(b);return !Validation.get("IsEmpty").test($F(b))&&Validation.get("IsEmpty").test($F(a))}],["view-name-not-standard",'The name "Standard View" is reserved.',function(a,b){return !Validation.get("IsEmpty").test(a)&&(a!="Standard View")}],["validate-number","Please enter a valid number in this field.",function(a,b){return Validation.get("IsEmpty").test(a)||(!isNaN(a)&&!/^\s+$/.test(a))}],["validate-number-nodecimal","Please enter a valid number with no decimals into this field.",function(a,b){return Validation.get("IsEmpty").test(a)||(!isNaN(a)&&!/^\s+$/.test(a)&&!/(\.[0-9]*)$/.test(a))}],["validate-uom","Please enter a valid number in this field.",function(a,c){var b=a.replace($F(Validation.getElmID(c)+"_uom"),"");var b=a.replace(",","");return Validation.get("validate-number").test(b)}],["validate-number-more-than-zero","Please enter a number greater than zero.",function(a){return Validation.get("IsEmpty").test(a)||(!isNaN(a)&&!/^\s+$/.test(a)&&a>0)}],["validate-number-zero-or-greater","Please enter a number zero or greater.",function(a){return Validation.get("IsEmpty").test(a)||(!isNaN(a)&&!/^\s+$/.test(a)&&a>=0)}],["validate-digits","Please use numbers only in this field. please avoid spaces or other characters such as dots or commas.",function(a){return Validation.get("IsEmpty").test(a)||!/[^\d]/.test(a)}],["validate-alpha","Please use letters only (a-z) in this field.",function(a){return Validation.get("IsEmpty").test(a)||/^[a-zA-Z]+$/.test(a)}],["validate-alpha-num","Please use only letters (a-z) or numbers (0-9) only in this field.",function(a){return Validation.get("IsEmpty").test(a)||/^[a-zA-Z0-9]+$/.test(a)}],["validate-alphanum","Please use only letters (a-z) or numbers (0-9) only in this field. No spaces or other characters are allowed.",function(a){return Validation.get("IsEmpty").test(a)||/^[a-zA-Z0-9]+$/.test(a)}],["validate-shortdomain","Please use only letters (a-z), numbers (0-9), or (-) in this field. No spaces or other characters are allowed.",function(a){return Validation.get("IsEmpty").test(a)||/^[a-z0-9-]+$/.test(a)}],["validate-date","Please enter a valid date.",function(a){var b=new Date(a);return Validation.get("IsEmpty").test(a)||!isNaN(b)}],["validate-email","Please enter a valid email address. For example fred@domain.com .",function(a){return Validation.get("IsEmpty").test(a)||/[\w\.\-]+@[\w\-]+(\.([\w\-]+))+$/.test(a)}],["validate-emails","Please enter valid email addresses. For example fred@domain.com .",function(a){var c=Validation.get("IsEmpty").test(a);if(!c){c=true;var d=a.split(",");for(var b=0;b<d.length;b++){if(/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+[\w\-]{0,}\.[A-Za-z]{2,4}\b/.test(d[b].trim())===false){c=false;break}}}return c}],["validate-email-aliases","Please enter valid email addresses. For example fred@domain.com .",function(a){var c=Validation.get("IsEmpty").test(a);if(!c){c=true;var d=a.split("\n");for(var b=0;b<d.length;b++){if(/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+[\w\-]{0,}\.[A-Za-z]{2,4}\b/.test(d[b].trim())===false){c=false;break}}}return c}],["validate-url","Please enter a valid URL. For example: www.centraldesktop.com",function(a){return Validation.get("IsEmpty").test(a)||/^((http|https|ftp):\/\/)?(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i.test(a)}],["validate-url-internal","Please enter a valid URL. For example: www.centraldesktop.com",function(a){return Validation.get("IsEmpty").test(a)||/^((http|https|ftp):\/\/)?(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)*)(:(\d+))?\/?/i.test(a)}],["validate-date-au","Please use this date format: dd/mm/yyyy. For example 17/03/2006 for the 17th of March, 2006.",function(a){if(Validation.get("IsEmpty").test(a)){return true}var b=/^(\d{2})\/(\d{2})\/(\d{4})$/;if(!b.test(a)){return false}var c=new Date(a.replace(b,"$2/$1/$3"));return(parseInt(RegExp.$2,10)==(1+c.getMonth()))&&(parseInt(RegExp.$1,10)==c.getDate())&&(parseInt(RegExp.$3,10)==c.getFullYear())}],["validate-currency-dollar","Please enter a valid $ amount. For example $100.00 .",function(a){return Validation.get("IsEmpty").test(a)||/^\$?\-?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}\d*(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$/.test(a)}],["validate-selection","Please make a selection",function(a,b){return b.options?b.options[b.selectedIndex].value>-1:!Validation.get("IsEmpty").test(a)}],["validate-selection-orig","Please make a selection",function(a,b){return b.options?b.selectedIndex>0&&!Validation.get("IsEmpty").test(a):!Validation.get("IsEmpty").test(a)}],["validate-is-not-addon","Please enter a new choice (click on the drop down to activate input)",function(a,b){return Validation.get("IsEmpty").test(a)||!/^~new~$/.test(a)}],["validate-one-required","Please select one of the above options.",function(a,d){var c=d.up(".db-record-field-value");if(!c){c=d.up(".validation-group")}if(!c){c=d.up("body")}var b=false;c.select(".validate-one-required").each(function(f){if(f.checked){b=true}});return b}],["validate-phone","Please enter only numbers and dashes, optionally including area / country code. For example: 1-555-555-5555.",function(a){if(Validation.get("IsEmpty").test(a)){return true}else{if(a.indexOf("-")!==-1){return/^[0-9\-]{12,}$/.test(a)}else{return/^[0-9]{7,}$/.test(a)}}}],["validate-min-length","Please enter the minimum number of characters or more.",function(b,c){var a=c.getAttribute("minlength");if(a){return parseInt(c.getAttribute("minlength"))<=b.length}else{return true}}],["validate-password-complex","Your password must contain at least ONE lower case character, ONE UPPER CASE character, ONE digit AND ONE special character such as @#$%^&+=-!.",function(a,c){var b=[];if(password_complexity_req&&!check_password_complexity(c.value)){b.push(password_complexity_description)}return b.length==0}],["validate-password-match","Your password and password verification fields do not match!",function(a,c){var b=c.getAttribute("match");if(b&&c.form.elements[b]){return c.form.elements[b].value==c.value}else{return true}}],["validate-subdomain-available","That subdomain is already taken. Please choose a different one.",function(b){var a=CD.Signup.checkDomainAvailability(b);return a}],["validate-username-available","That username is already taken. Please choose a different one.",function(b){var a=CD.Signup.checkUsernameAvailability(b);return a}],["validate-email-available","That email address is already registered as a Central Desktop user.",function(b){var a=CD.Signup.checkEmailAvailability(b);return a}],["validate-start-date","Start date date can not be after due date",function(c,a){var b;if($(a).hasClassName("csvimport")){b=$(a).up(".column").select(".validate-due-date").first()}else{b=$(a).up("form").select(".validate-due-date").first()}b=b?b.getValue():"";return c===""||b===""||(new Date(c))<=(new Date(b))}],["validate-due-date","Due date can not be before start date",function(c,a){var b;if($(a).hasClassName("csvimport")){b=$(a).up(".column").select(".validate-start-date").first()}else{b=$(a).up("form").select(".validate-start-date").first()}b=b?b.getValue():"";return c===""||b===""||(new Date(c))>=(new Date(b))}],["validate-not-past-date","Please enter a date in the future.",function(b,a){if(b.toLowerCase()==="none"||b.toLowerCase()==="+1 day"||b.toLowerCase()==="+1 month"){b=""}return !b||(new Date(b))>=(new Date())}],["validate-future-date","Please enter a date in the future.",function(b,a){if(b.toLowerCase()==="none"||b.toLowerCase()==="+1 day"||b.toLowerCase()==="+1 month"){b=""}return !b||(new Date(b))>(new Date())}],["validate-unique-milestone-move","This milestone name is already used on the selected Workspace.",function(b){var d=false;var f=window.location.hash.replace(/#milestone-/,"");var c;if(f){CD.Milestone.Model.find(f,{success:function(g){c=g.get("title")},error:function(){}});var a="/zf-front.php/"+CD.Environment.space.name+"/project/milestone/check.json";new CD.Ajax.Request(a,{method:"post",asynchronous:false,parameters:{title:c,space:b},onSuccess:function(g){var k=g.responseText.evalJSON();if(k.status=="taken"){d=false}else{d=true}}},true)}return d}],["validate-unique-milestone","That milestone name is already used on this Workspace.",function(b){var c=false;var d=window.location.hash.replace(/#milestoneedit-/,"");if(window.location.hash.startsWith("#milestoneedit-")&&d!="new"){CD.Milestone.Model.find(d,{success:function(f){if(f.get("title")==b){c=true}},error:function(){}})}if(!c){var a="/zf-front.php/"+CD.Environment.space.name+"/project/milestone/check.json";new CD.Ajax.Request(a,{method:"post",asynchronous:false,parameters:{title:b},onSuccess:function(f){var g=f.responseText.evalJSON();if(g.status=="taken"){c=false}else{c=true}}},false)}return c}]]);var Slider={_hashValues:function(a){var b=a;a={};b.each(function(d,c){a[String((1/(b.length-1))*c)]=d});return new Hash(a)},initHorizontal:function(a){var b=$("slider-"+a);var d=b.select(".hslider-track").first();var n=b.select(".hslider-handle").first();var o=b.select("input").first();var p=b.readAttribute("data-values");var k=b.readAttribute("data-selected");if(p){p=p.split(",");var c=this._hashValues(p);sliderSelected=c.keys()[c.values().indexOf(k)];sliderValues=c.keys();var f=function(q){return c.get(String(q))}}else{sliderValues=null;k=parseFloat(k)||0;sliderSelected=k;var f=function(q){return Math.round(q*100)/100}}o.value=k;var g={values:sliderValues,sliderValue:sliderSelected,onChange:function(r,q){var r=f(r);o.value=r}};new Control.Slider(n,d,g)}};function HFrameSlider(a){var b=$(a);if(!b){throw"Wrong container id"}if(b._HFrameSlider){return b}b.prevFrame=function(){var c=b.select("li").last();c.setStyle({width:0});c.up().insert({top:c});new Effect.Morph(c,{style:"width:"+b.getWidth()+"px"})};b.nextFrame=function(){var c=b.select("li").first();function d(){c.up().insert({bottom:c});c.setStyle({width:b.getWidth()+"px"})}new Effect.Morph(c,{style:"width:0",afterFinish:d})};console.log(b);return b}function AbstractInfoBox(){this.pClassName="";this.boxId=null;this.box=null;this.controlElm=null;this.contentIsSet=false;this.isVisible=false;this.hasLoader=false;this.setup=function(a,d,c){this.params=c||{};this.setupGeometry(a,d,c);for(var b in this.params){if(typeof(this[b])!="undefined"){this[b]=this.params[b]}}this.buildBox();this.box=$(this.box);this.boxId=this.box.boxId=this.box.id=d;this.box.addClassName("dd-control");this.box.addClassName(this.pClassName);this.box.addClassName(c.cls||"");$$("body")[0].appendChild(this.box);this.box._manager=this};this.setupGeometry=function(a,c,b){this.controlElm=$(a);this.controlElm.boxId=c;this.controlElmDim=this.controlElm.getDimensions();this.controlElmPos=this.controlElm.cumulativeOffset()};this.buildBox=function(){this.box=new Element("div",{style:"position: absolute; display: none;"})};this.setContent=function(a){this.box.update($(a.contentId));$(a.contentId).show()};this.updateContent=function(a){this.box.getContentNode().update(a)};this.showBox=function(){var a=this;if(!this.contentIsSet){setTimeout(function(){a.setContent(a.params);a.contentIsSet=true;a.alignBox();setTimeout(a.params.onAfterShow.bind(a),10)},1)}else{setTimeout(a.params.onAfterShow.bind(a),10)}$(this.box).show();this.alignBox();this.isVisible=true};this.hideBox=function(){$(this.box).hide();this.isVisible=false};this.alignBox=function(){this.controlElmDim=this.controlElm.getDimensions();this.controlElmPos=this.controlElm.cumulativeOffset();this.boxDim=this.box.getDimensions();this.screenDim=document.viewport.getDimensions();var a=this.controlElm.up(".lb-ui2");if(a){this.box.setStyle({zIndex:a.getStyle("zIndex")+1})}}}$C(AbstractInfoBox);AbstractInfoBox.classProperty("_instances",{});AbstractInfoBox.classProperty("currentInstance",null);AbstractInfoBox.classMethod("createInstance",function(b,a,f,d){var d=d||{};d.contentId=d.contentId||f+"_content";d.onAfterShow=d.onAfterShow||function(){};for(var c in AbstractInfoBox._instances){if(AbstractInfoBox._instances[c].isVisible&&c!=f){AbstractInfoBox._instances[c].hideBox()}}if(!AbstractInfoBox._instances[f]){AbstractInfoBox._instances[f]=new b;AbstractInfoBox._instances[f]._callerClass=b;AbstractInfoBox._instances[f].setup(a,f,d)}else{AbstractInfoBox._instances[f].setupGeometry(a,f,d)}AbstractInfoBox.currentInstance=AbstractInfoBox._instances[f];return AbstractInfoBox._instances[f]});AbstractInfoBox.classMethod("getInstance",function(a,b){return a._instances[b]?a._instances[b]:null});AbstractInfoBox.classMethod("show",function(b,a,d,c){AbstractInfoBox.createInstance.staticMethod(b,a,d,c).showBox()});AbstractInfoBox.classMethod("hide",function(b,a,g){var f=null;if(g){f=AbstractInfoBox._instances[g]}else{if(a){var d=Event.element(a);var c=d.up(".dd-control");f=AbstractInfoBox._instances[c.id]}else{f=AbstractInfoBox.currentInstance}}if(f&&(f instanceof b)){f.hideBox();AbstractInfoBox.currentInstance=null}});AbstractInfoBox.classMethod("destruct",function(a,c){$(AbstractInfoBox._instances[c].box).remove();AbstractInfoBox._instances[c]=null;try{delete AbstractInfoBox._instances[c]}catch(b){}});function AbstractDropdown(){this.pClassName="dd";this._eventsAreSet=false;this.alignedLeft=true;this.pMargins={top:0,bottom:0,left:0,right:0},this._setupEvents=function(){if(!this._eventsAreSet){var a=this;setTimeout(function(){$(document).observe("click",a._closeHandler,false);Event.observe(window,"resize",a._reposHandler)},10);this._eventsAreSet=true}};this._removeEvents=function(){$(document).stopObserving("click",this._closeHandler);$(document).stopObserving("click",this._reposHandler);this._eventsAreSet=false};this.setup=function(){AbstractDropdown.prototype.setup.apply(this,arguments);var a=this;this._closeHandler=function(b){var c=Event.element(b);if(!c){a.hideBox()}if(c.hasClassName("dd-choice")||c.up(".dd-choice")){a.hideBox()}if(!(c.hasClassName("dd-control")||c.up(".dd-control"))){a.hideBox()}};this._reposHandler=function(b){a.alignBox()}};this.showBox=function(){AbstractDropdown.prototype.showBox.apply(this,arguments);this._setupEvents()};this.hideBox=function(){AbstractDropdown.prototype.hideBox.apply(this,arguments);this._removeEvents()};this.alignBox=function(){AbstractDropdown.prototype.alignBox.call(this);var c=this.controlElmPos.top+this.controlElmDim.height+this.pMargins.top;var a=document.viewport.getScrollOffsets();if(this.controlElmPos.left+this.boxDim.width+this.pMargins.right-a.left>=this.screenDim.width){var b=this.controlElmPos.left-(this.boxDim.width+this.pMargins.right-this.controlElmDim.width);this.alignedLeft=false}else{this.alignedLeft=true;var b=this.controlElmPos.left+this.pMargins.left}this.box.style.left=b+"px";this.box.style.top=c+"px"}}AbstractInfoBox.makeSubclass(AbstractDropdown);function BalloonBox(a){var a=!!a;var b=new Element("div",{"class":"bbl"});var c=b.appendChild(new Element("div",{"class":"bbl-wrapper"}));b.shadow=c.appendChild(new Element("div",{"class":"bbl-shadow"}));b.content=c.appendChild(new Element("div",{"class":"bbl-contents"}));b.content.box=b;if(a){b.btnClose=c.appendChild(new Element("a",{"class":"bbl-controls icon icon_lightbox_close",href:"#close"}));b.btnClose.box=b}else{b.btnClose=null}arr=c.appendChild(new Element("ins",{"class":"bbl-arr"}));arr.appendChild(new Element("ins",{"class":"bbl-arrbg"}));arr.appendChild(new Element("ins",{"class":"bbl-arrfg"}));b.getContentNode=function(){return this.content};if(this.hasCloseButton){b.getBtnCloseNode=function(){return this.btnClose}}b.switchArrowPosition=function(d){this.classNames().grep(/^bbl-arrpos-/).each(function(f){b.removeClassName(f)});this.addClassName("bbl-arrpos-"+d)};return b}function AbstractBalloon(){this.pClassName="balloon";this.pHasCloseBtn=false;this.pos=null;this.priorities=[4,3,5,10,11,9,1,0,2,7,8,6];this.posLT=11;this.posT=1;this.posRT=3;this.posR=4;this.posRB=5;this.posB=7;this.posLB=8;this.posL=10;this._eventsAreSet=false;this._setupEvents=function(){if(!this._eventsAreSet){$(this.controlElm).observe("mouseout",this._closeHandler);$(this.box).observe("mouseout",this._closeHandler);$(this.box).observe("mouseover",function(){AbstractBalloon.cancelDisappearing(AbstractBalloon.currentTimerId)});this._eventsAreSet=true}};this.setup=function(){AbstractBalloon.prototype.setup.apply(this,arguments);var a=this;this._closeHandler=function(b){AbstractBalloon.cancelDisappearing(a.boxId);AbstractBalloon.cancelAppearing(a.boxId);AbstractBalloon.disappearTimers[a.boxId]=setTimeout(function(){clearTimeout(AbstractBalloon.disappearTimers[a.boxId]);AbstractBalloon.disappearTimers[a.boxId]=null;AbstractBalloon.hide(b,a.boxId)},a._self.disappearDelay)};this._setupEvents()};this.buildBox=function(){this.box=new BalloonBox(this.pHasCloseBtn);if(this.hasLoader){this.box.getContentNode().update('<span class="bbl-loader"><ins class="ajax-loader"></ins> Loading details&hellip;</span>')}if(this.pHasCloseBtn){Event.observe(this.box.getBtnCloseNode(),"click",function(a){AbstractBalloon.hide(a)})}};this.setContent=function(a){this.box.getContentNode().update($(a.contentId));contentElm.style.display="block"};this.alignBox=function(){AbstractBalloon.prototype.alignBox.call(this);var q={0:6,1:7,2:8,3:9,4:10,5:11,6:0,7:1,8:2,9:3,10:4,11:5};var b={0:[-1,0,-1,0],1:[0,0.5,-1,0],2:[1,0,-1,0],3:[1,0,-1,0],4:[1,0,0,0.5],5:[1,0,1,0],6:[1,0,1,0],7:[0,0.5,1,0],8:[-1,0,1,0],9:[-1,0,1,0],10:[-1,0,0,0.5],11:[-1,0,-1,0]};var c={};var g=Math.ceil((this.boxDim.width-this.controlElmDim.width)/2);var o=Math.ceil((this.boxDim.height-this.controlElmDim.height)/2);var k=document.viewport.getScrollOffsets();var d=this.controlElmPos.top-k.top;c.top=d<=this.boxDim.height;c.mtop=d<=o;var p=this.screenDim.width-(this.controlElmPos.left+this.controlElmDim.width)+k.left;c.right=p<=this.boxDim.width;c.mright=p<=g;var r=this.screenDim.height-(this.controlElmPos.top+this.controlElmDim.height)+k.top;c.bottom=r<=this.boxDim.height;c.mbottom=r<=o;var s=this.controlElmPos.left-k.left;c.left=s<=this.boxDim.width;c.mleft=s<=g;var a={0:!c.top&&!c.left,1:!c.top&&!c.mleft&&!c.mright,2:!c.top&&!c.mright,3:!c.right&&!c.top,4:!c.right&&!c.mtop&&!c.mbottom,5:!c.right&&!c.bottom,6:!c.bottom&&!c.right,7:!c.bottom&&!c.mleft&&!c.mright,8:!c.bottom&&!c.left,9:!c.left&&!c.bottom,10:!c.left&&!c.mtop&&!c.mbottom,11:!c.left&&!c.top};for(var f=0;f<this.priorities.length;f++){this.pos=this.priorities[f];if(a[this.pos]){break}}this.box.switchArrowPosition(q[this.pos]);var n=b[this.pos];this.box.setStyle({left:this.controlElmPos.left+Math.round(n[0]>0?this.controlElmDim.width*n[0]:this.boxDim.width*n[0])+Math.round((this.controlElmDim.width-this.boxDim.width)*n[1])+"px",top:this.controlElmPos.top+Math.round(n[2]>0?this.controlElmDim.height*n[2]:this.boxDim.height*n[2])+Math.round((this.controlElmDim.height-this.boxDim.height)*n[3])+"px"})}}AbstractInfoBox.makeSubclass(AbstractBalloon);AbstractBalloon.classProperty("currentTimerId",[]);AbstractBalloon.classProperty("appearTimers",[]);AbstractBalloon.classProperty("disappearTimers",[]);AbstractBalloon.classProperty("appearDelay",200);AbstractBalloon.classProperty("disappearDelay",500);AbstractBalloon.classMethod("cancelAppearing",function(a,b){if(AbstractBalloon.appearTimers[b]){clearTimeout(AbstractBalloon.appearTimers[b]);AbstractBalloon.appearTimers[b]=null}});AbstractBalloon.classMethod("cancelDisappearing",function(a,b){if(AbstractBalloon.disappearTimers[b]){clearTimeout(AbstractBalloon.disappearTimers[b]);AbstractBalloon.disappearTimers[b]=null}});AbstractBalloon.classMethod("show",function(b,a,f,d){if(AbstractBalloon.disappearTimers[f]){AbstractBalloon.cancelDisappearing(f)}var c=b.createInstance(a,f,d);AbstractBalloon.cancelAppearing(AbstractBalloon.currentTimerId);AbstractBalloon.appearTimers[f]=setTimeout(function(){c.showBox()},b.appearDelay);AbstractBalloon.currentTimerId=f});function MegaDropdown(){this.pClassName="mdd";this.pMargins={top:3,bottom:0,left:-5,right:-5};this.sensitivity=100;this.buildBox=function(){var a=new Element("div",{style:"position: absolute; display: none;"});a.appendChild(new Element("div",{"class":"mdd-shadow dd-control"}));a.content=a.appendChild(new Element("div",{"class":"mdd-contents"}));a.appendChild(new Element("div",{"class":"clear"}));a.cap=a.appendChild(new Element("div",{"class":"mdd-cap dd-control"}));a.cap.innerHTML=this.controlElm.innerHTML;this.box=a};this.setContent=function(b){var a=$(b.contentId);this.box.content.update(a);a.style.display="block"};this.alignBox=function(){MegaDropdown.prototype.alignBox.call(this);this.box.cap.style[this.alignedLeft?"left":"right"]=0}}AbstractDropdown.makeSubclass(MegaDropdown);function CapDropdown(){this.pClassName="dd";this.buildBox=function(){if(this.controlElm.hasClassName("rbutton")||(this.controlElm.tagName.toLowerCase()=="input"&&this.controlElm.type.toLowerCase()=="button")||this.controlElm.tagName.toLowerCase()=="button"){this.pClassName+=" dd-btn"}var a=new Element("div",{style:"position: absolute; display: none;"});a.shadow=a.appendChild(new Element("div",{"class":"dd-shadow"}));a.content=a.appendChild(new Element("div",{"class":"dd-contents"}));a.cap=a.appendChild(new Element("div",{"class":"dd-cap"}));a.cap.appendChild(new Element("div",{"class":"dd-cap-shadow"}));a.cap.content=a.cap.appendChild(new Element("div",{"class":"dd-cap-title"})).appendChild(new Element("span",{"class":"dd-cap-title-content"}));this.box=a;this.updateCap(this.controlElm.innerHTML)};this.updateCap=function(a){this.box.cap.content.innerHTML=a;var c=this.controlElm.getDimensions();this.box.cap.content.setStyle({width:c.width+"px",height:c.height+"px",lineHeight:c.height+"px"});var b=this.controlElm.getStyle("fontSize");if(b){this.box.cap.content.setStyle({fontSize:b})}};this.setContent=function(b){var a=$(b.contentId);this.box.content.innerHTML="";this.box.content.appendChild(a);a.style.display="block"};this.alignBox=function(){CapDropdown.prototype.alignBox.call(this);if(this.alignedLeft){this.box.removeClassName("dd-right");this.box.addClassName("dd-left")}else{this.box.removeClassName("dd-left");this.box.addClassName("dd-right")}var a=this.box.cap.getWidth();var b=this.box.getWidth();if(a>b&&this.contentIsSet){this.box.setStyle({width:a+15+"px"})}}}AbstractDropdown.makeSubclass(CapDropdown);function PlainDropdown(){this.pClassName="pdd";this.pMargins={top:1,bottom:0,left:0,right:-2};var a=null;this.buildBox=function(){this.box=new Element("div",{style:"position: absolute; display: none;"})};this.setContent=function(c){var b=$(c.contentId);this.box.update(b);b.style.display="block";b.select(".pdd-groupli").each(function(f){var g=$(f).down("a");var d=$(f).down("ul");if(g){g.onclick=function(){if(a&&a!=d){a.toggle()}d.toggle();a=d.visible()?d:null;return false}}})};this.hideBox=function(){if(a){a.hide();a=null}PlainDropdown.prototype.hideBox.call(this)}}AbstractDropdown.makeSubclass(PlainDropdown);function SelectDropdown(){this.pClassName="sdd";this.pMargins={top:-29,bottom:0,left:-4,right:-4};this.buildBox=function(){var a=new Element("div",{style:"position: absolute; display: none;"});a.shadow=a.appendChild(new Element("div",{"class":"sdd-shadow"}));a.content=a.appendChild(new Element("div",{"class":"sdd-contents"}));this.box=a};this.setContent=function(b){var a=$(b.contentId);this.box.content.innerHTML="";this.box.content.appendChild(a);a.style.display="block"}}AbstractDropdown.makeSubclass(SelectDropdown);SelectDropdown.classProperty("onChangeHandlers",{});(SelectDropdown.classMethod("select",function(b,a,f,k){var g=$(AbstractDropdown._instances["sdd_"+f]);$("sdd_"+f+"_control").select("span")[0].innerHTML=$(a).select("span")[0].innerHTML;g.box.select("li").each(function(n){n.removeClassName("sdd-option-selected")});a.addClassName("sdd-option-selected");g.hideBox();var c=$(f);var d=c.value;c.value=k;if(k!=d&&SelectDropdown.onChangeHandlers[f]&&SelectDropdown.onChangeHandlers[f].call){SelectDropdown.onChangeHandlers[f].call($(f))}}));SelectDropdown.classMethod("onChange",function(a,b,c){SelectDropdown.onChangeHandlers[b]=c});function UserWidgetBubble(){this.pClassName="";this.hasLoader=true;this.pMargins={top:0,bottom:0,left:0,right:0};this.contentCache="uwConentContainer";this.setContent=function(d){var a,c=this,f=$(this.contentCache);if(!f){f=new Element("div",{"class":"bl-dynamic",id:this.contentCache});document.body.appendChild(f)}if(!$(d.contentId)){a={format:"json",doaction:"getUserWidgetContent",uid:d.id,guid:d.guid};new CD.Ajax.Request("/home/myaccount/",{parameters:a,method:"post",onSuccess:function(g){f.insert(g);var k=$(d.contentId);c.box.getContentNode().update(k);k.style.display="block";c.alignBox()},onError:function(){console.log("error handler triggered for getUserWidgetContent",arguments)}})}else{var b=$(d.contentId);this.box.getContentNode().update(b);b.style.display="block"}}}AbstractBalloon.makeSubclass(UserWidgetBubble);function CalendarBalloon(){this.pClassName="cal-dd";this.hasLoader=true;this.priorities=[7,8,6,0,1,2];this.setContent=function(params){var reqParams={recid:params.recid,spid:params.spid,type:params.type};reqParams.r=Math.random();reqParams.evalJSON=true;reqParams.action="get_event";var inst=this;new Ajax.Request("/spaces/rpc.php",{method:"POST",parameters:reqParams,onComplete:function(responseObj){try{eval(responseObj.responseText);var eventId=reqParams.recid;if(response!="INVALID ID"&&response!="BAD REQUEST"){data=response}else{data=false}function _columns(hash){var ret="";for(var label in hash){if(hash[label]){ret+='<div class="bbl-cols bm10"><span class="bbl-cols-label">'+label.stripTags()+":</span>"+hash[label].stripTags()+"</div>"}}return ret}function _wrap(tpl,value,force){return(value||!!force)?tpl.replace("%s%",value):""}var controls='<span class="bbl-controls">'+_wrap("%s%",data.edit)+'<a href="#" class="icon icon_lightbox_close" onclick="CalendarBalloon.hide(event); return false;"></a></span>';if(data){switch(data.type){case"event":if(data.restricted){var str="<h3>Busy</h3>";str+=_wrap('<div class="bm10">%s%</div>',data.startdate)}else{var str='<h3><ins class="icon '+(data.icon_class||"icon_calendar")+'"></ins><a href="'+data.url+'">'+data.title+'</a></h3><div class="bm5">'+data.workspace+"</div>";str+=_columns({Organizer:data.organizer,Location:data.eventlocation,"Start Date":data.startdate,Recurring:data.recur,Description:data.description});str+=_wrap('<div class="bm10">%s%</div>',data.conferencing_phone_html);str+=_wrap('<div class="bm10">%s%</div>',data.webmeeting_html)}break;case"milestone":var str='<h3><ins class="icon '+(data.icon_class||"icon_milestone")+'"></ins><a href="'+data.url+'" title="'+data.description+'">'+data.title+'</a></h3><div class="bm5">'+data.workspace+"</div>";str+=_columns({"Start Date":data.startdate,"Due Date":data.duedate,Status:data.completed,"Assigned To":data.assignedto});break;case"task":var str='<h3><ins class="icon '+(data.icon_class||"icon_task")+'"></ins><a href="'+data.url+'" title="'+data.description+'">'+data.title+'</a></h3><div class="bm5">'+data.workspace+"</div>";str+=_columns({"Start Date":data.startdate,"Due Date":data.duedate,Status:data.completed,Priority:data.priority,"Assigned To":data.assignedto});str+=_wrap('<a href="'+data.comments_url+'"><ins class="icon icon_comment"></ins>%s% Comment(s)</div>',data.num_replies);break}inst.box.getContentNode().update('<div class="w300 cal-ev-details">'+str+controls+"</div>");inst.alignBox()}else{return false}}catch(err){}}})}}AbstractBalloon.makeSubclass(CalendarBalloon);function InfoDropdown(){this.pClassName="infoBalloon";this.setContent=function(b){var a=$(b.contentId);this.box.getContentNode().update(a);a.style.display="block";this.alignBox()}}AbstractBalloon.makeSubclass(InfoDropdown);function FileInfoBalloon(){this.pClassName="finfoBalloon";this.hasLoader=true;this.setContent=function(params){var inst=this;var loadParams={action:"get_event",spid:params.spid,recid:params.recid,type:"i"};function _columns(hash){var ret="";for(var label in hash){if(hash[label]){ret+='<div class="bbl-cols bm10"><span class="bbl-cols-label">'+label+":</span>"+hash[label]+"</div>"}}return ret}function _wrap(tpl,value,force){return(value||!!force)?tpl.replace("%s%",value):""}new CD.Ajax.Request("/spaces/rpc.php",{asynchronous:false,parameters:loadParams,onSuccess:function(responseObj){eval(responseObj.responseText);if(response!="INVALID ID"&&response!="BAD REQUEST"){var str="";if(response.thumbnail_image!=""){str+='<a class="pin-right" href="'+response.url+'" title="'+response.title+' more..."><img border="0" src="'+response.thumbnail_image+'" alt="thumbnail"></a>'}str+='<a href="'+response.url+'" title="'+response.title+' more..."><ins class="icon '+response.fileicon_class+'"></ins>Go to Detail View</a><br/><br/>';str+=_columns({"File Size":response.file_size,Revision:response.revision,"Last Modified":response.lastmodified+" by "+response.lastmodified_by,Status:response.status?response.status:"&mdash;",Folder:response.in_folder,Action:response.actions});inst.box.getContentNode().update(_wrap('<div class="w250 m10">%s%</div>',str))}else{inst.box.getContentNode().update("Failed to retrieve info")}this.alignBox()}})}}AbstractBalloon.makeSubclass(FileInfoBalloon);function WikiBalloon(){this.pClassName="bbl-wiki";this.setContent=function(b){var a=new Element("div",{"class":"w200 m10"});a.update('This wiki page does not exist. <a href="'+b.url+'" class="redbold">Create It Now?</a>');this.box.getContentNode().update(a)}}AbstractBalloon.makeSubclass(WikiBalloon);function TipBalloon(){this.pClassName="bbl-tip";var b="";function a(d){var c=new Element("div",{"class":"w170 m5"});c.update(d);return c}this.setup=function(c,f,d){b=d.tip||"";this._self.prototype.setup.call(this,c,f,d)};this.hideBox=function(c,f,d){this.updateContent(b);this._self.prototype.hideBox.call(this)};this.setContent=function(c){this.controlElm._tip=this;this.box.getContentNode().update(a(b))};this.updateContent=function(c){this._self.prototype.updateContent.call(this,a(c))}}AbstractBalloon.makeSubclass(TipBalloon);function PplDropdown(){this.pClassName="ppldd";this.setContent=function(f){var a=this;f.sourceURL=mkProtocolConsistent(f.sourceURL);var c=new UserPicker(f);this.box.content.innerHTML="";this.box.content.appendChild(c).init();if(f.selectable){var d=new Element("input",{type:"button","class":"rbutton",value:"Update Subscribers"});d.onclick=function(g){var k=this.value;this.disabled=true;this.value="Updating...";c.send();this.disabled=false;this.value=k;notify("Subscribers list successfully updated","success");PplDropdown.hide(g,a.boxId)};buttCancel=new Element("a",{href:"#close-dialog","class":"attention-cancel lp10"});buttCancel.update("Cancel");buttCancel.onclick=function(g){PplDropdown.hide(g,a.boxId);return false};var b=this.box.content.appendChild(new Element("div",{"class":"ppldd-buttons"})).appendChild(new Element("div"));b.appendChild(d);b.appendChild(buttCancel)}}}CapDropdown.makeSubclass(PplDropdown);PplDropdown.classMethod("showItemSubscribers",function(b,a,f,c){var d={sourceURL:f+"/?doaction=handleAssignments&format=json",selectable:c,selectedOnly:!c,showGroups:false,emptySectionMessage:"There are no subscribers in this space",maxHeight:200,ownUserId:uid?uid:null};PplDropdown.show(a,"ddItemSubscribers",d)});PplDropdown.classMethod("showDBRecSubscribers",function(b,a,f,d,c){if(!spid){return}var g={sourceURL:"/spaces/doaction_db?spid="+spid+"&guid="+f+"&recid="+d+"&do=handle_subscribers",selectable:c,selectedOnly:!c,showGroups:false,emptySectionMessage:"There are no subscribers in this space",maxHeight:200,ownUserId:uid?uid:null};PplDropdown.show(a,"ddDBRecSubscribers",g)});PplDropdown.classMethod("showFolderUsers",function(b,a,c){var d={sourceURL:cd_spaceurl+CD.Folder.namespace+"/"+c+"/?doaction=handleMembers&format=json",selectable:false,selectedOnly:false,emptyListMessage:"There are no users",maxHeight:200};PplDropdown.show(a,"ddFolderUsers",d)});function CCDropdown(){this.pClassName="dd ccdd";this.setContent=function(k){var b=this;var n=k.emails||[];var d=!!k.editable;var a=new Element("div",{"class":"ccd-hint"});a.innerHTML="cc Non Workspace Members with comments to this record. Replies will be logged as comments to this record.";this.box.content.appendChild(a);var f=this.box.content.appendChild(document.createElement("textarea"));f.value=n.join("\n");f.disabled=!d;this.box.inp=f;var a=new Element("div",{"class":"ccd-hint"});a.innerHTML="One Email Address per Line.";this.box.content.appendChild(a);if(d){var g=new Element("input",{type:"button","class":"rbutton",value:"Update cc List"});g.onclick=function(o){var q=f.value.strip().replace(/[\n,]+/g,",").split(",");function p(r){f.value=r.responseText;notify("CC list successfully updated","success");CCDropdown.hide(o,b.boxId);$$(".cc_dynamic_list").each(function(u){var t=r.responseText.strip()?r.responseText.split("\n"):[];u.title=t.join(", ");u.update(t.slice(0,3).join(", ")+(t.length>3?"&hellip;":""));var s=u.up("label");if(s){t.length?s.removeClassName("bl-dynamic"):s.addClassName("bl-dynamic")}})}CD.Ajax.Request(k.handlerURL,{parameters:{emails:q.join(",")},onSuccess:p},false)};buttCancel=new Element("a",{href:"#close-dialog","class":"attention-cancel lp10"});buttCancel.update("Cancel");buttCancel.onclick=function(o){CCDropdown.hide(o,b.boxId);return false};var c=this.box.content.appendChild(new Element("div",{"class":"ccdd-buttons"})).appendChild(new Element("div"));c.appendChild(g);c.appendChild(buttCancel)}}}CapDropdown.makeSubclass(CCDropdown);CCDropdown.classMethod("show",function(b,a,f,d){var c=b.createInstance(a,f,d);c.params.onAfterShow=function(){c.box.inp.focus()};c.showBox()});CCDropdown.classMethod("showDBRecList",function(b,a,f,d,n,c){var k=CD.Environment.space.id;var n=n instanceof Array?n:[];var c=!!c;var g={handlerURL:"/spaces/doaction_db?spid="+k+"&guid="+f+"&recid="+d+"&do=update_cclist",editable:c,emails:n};CCDropdown.show(a,"ddDBRecCC",g)});function FolderSelectDropdown(){this.pClassName="folder-dd";this.updateTabContent=function(a){this.box.cap.content.style.width=(dom.utils.getElementWidth(a)-10)+"px";this.box.cap.content.innerHTML=a.innerHTML}}CapDropdown.makeSubclass(FolderSelectDropdown);FolderSelectDropdown.classMethod("show",function(b,a,f,d){var c=b.createInstance(a,f,d);c.showBox();c.updateTabContent(a);CD.AdvancedFolderSelect.setCurrentId(f);if(d.treeId){CD.AdvancedFolderSelect.setCurrentTreeId(d.treeId)}else{CD.AdvancedFolderSelect.setCurrentTreeId(null)}setTimeout(function(){var g=dom.utils.getZIndex(a,true);$(f).style.zIndex=g+1;c.alignBox()},30)});function toggleFavoritesSorting(n){try{var d=$(n.parentNode.parentNode);var b=d.select('input[type="button"]')[0];var c=d.select("a.plainlink")[0];var f=$("favoritesList");if(d.sortEnabled!=undefined&&d.sortEnabled==true){b.disabled=true;var a="/home/favorites/";var k="doaction=sort&format=json&r="+Math.random()+"&"+Sortable.serialize(f.id,{tag:"li",name:"fav_order"});new Ajax.Request(a,{method:"post",parameters:k,onSuccess:function(o){b.disabled=false;b.addClassName("bl-dynamic");c.removeClassName("bl-dynamic");d.sortEnabled=false;f.removeClassName("sortable");Sortable.destroy(f)},onError:function(){b.disabled=false;cdwm.alert("There was an error trying to save your sort. Please try again.")}})}else{d.sortEnabled=true;b.removeClassName("bl-dynamic");c.addClassName("bl-dynamic");f.addClassName("sortable");Position.includeScrollOffsets=true;Sortable.create("favoritesList",{format:/\_([0-9]*)$/,constraint:"vertical",handle:"handle",scroll:f.parentNode,tag:"LI"})}}catch(g){}}CD=CD||{};CD.Signup=(function(){var a={username:null,domain:null,email:null};var b={checkEmailAvailability:function(d){var c="/spaces/ns_doaction";var f={"do":"check_valid_email",email:d,r:Math.random()};a.email=null;new Ajax.Request(c,{method:"post",asynchronous:false,parameters:f,onComplete:function(g){if(g.responseText=="exists"){a.email=false}else{a.email=true}}});return a.email},checkUsernameAvailability:function(f){var c="/spaces/ns_doaction";var d={"do":"check_valid_username",username:f,r:Math.random()};a.username=null;new Ajax.Request(c,{method:"post",asynchronous:false,parameters:d,onComplete:function(g){if(g.responseText=="exists"){a.username=false}else{a.username=true}}});return a.username},checkDomainAvailability:function(d){var c="/spaces/ns_doaction";var f={"do":"check_valid_company",company:d,r:Math.random()};a.domain=null;new Ajax.Request(c,{method:"post",asynchronous:false,parameters:f,onComplete:function(g){if(g.responseText=="exists"){a.domain=false}else{a.domain=true}}});return a.domain},onSubmit:function(c){}};return b})();var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;function ControlVersion(){var a;var b;var c;try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");a=b.GetVariable("$version")}catch(c){}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");a="WIN 6,0,21,0";b.AllowScriptAccess="always";a=b.GetVariable("$version")}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");a=b.GetVariable("$version")}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");a="WIN 3,0,18,0"}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");a="WIN 2,0,0,11"}catch(c){a=-1}}return a}function GetSwfVer(){var k=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var g=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var a=navigator.plugins["Shockwave Flash"+g].description;var f=a.split(" ");var c=f[2].split(".");var n=c[0];var b=c[1];var d=f[3];if(d==""){d=f[4]}if(d[0]=="d"){d=d.substring(1)}else{if(d[0]=="r"){d=d.substring(1);if(d.indexOf("d")>0){d=d.substring(0,d.indexOf("d"))}}}var k=n+"."+b+"."+d}}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1){k=4}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1){k=3}else{if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1){k=2}else{if(isIE&&isWin&&!isOpera){k=ControlVersion()}}}}}return k}function DetectFlashVer(g,d,c){versionStr=GetSwfVer();if(versionStr==-1){return false}else{if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",")}else{versionArray=versionStr.split(".")}var f=versionArray[0];var a=versionArray[1];var b=versionArray[2];if(f>parseFloat(g)){return true}else{if(f==parseFloat(g)){if(a>parseFloat(d)){return true}else{if(a==parseFloat(d)){if(b>=parseFloat(c)){return true}}}}}return false}}}function AC_AddExtension(b,a){if(b.indexOf("?")!=-1){return b.replace(/\?/,a+"?")}else{return b+a}}function AC_Generateobj(f,d,a){var c="";if(isIE&&isWin&&!isOpera){c+="<object ";for(var b in f){c+=b+'="'+f[b]+'" '}c+=">";for(var b in d){c+='<param name="'+b+'" value="'+d[b]+'" /> '}c+="</object>"}else{c+="<embed ";for(var b in a){c+=b+'="'+a[b]+'" '}c+="> </embed>"}if(a.fillelement&&$(a.fillelement)){elem=$(a.fillelement);elem.innerHTML=c}else{a.window.document.write(c)}}function AC_FL_RunContent(){var a=AC_GetArgs(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");AC_Generateobj(a.objAttrs,a.params,a.embedAttrs)}function AC_SW_RunContent(){var a=AC_GetArgs(arguments,".dcr","src","clsid:166B1BCA-3F9C-11CF-8075-444553540000",null);AC_Generateobj(a.objAttrs,a.params,a.embedAttrs)}function AC_GetArgs(b,f,k,d,n){var a=new Object();a.embedAttrs=new Object();a.params=new Object();a.objAttrs=new Object();for(var c=0;c<b.length;c=c+2){var g=b[c].toLowerCase();switch(g){case"classid":break;case"pluginspage":a.embedAttrs[b[c]]=b[c+1];break;case"src":case"movie":b[c+1]=AC_AddExtension(b[c+1],f);a.embedAttrs.src=b[c+1];a.params[k]=b[c+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblclick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":case"id":a.objAttrs[b[c]]=b[c+1];break;case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":case"fillelement":a.embedAttrs[b[c]]=a.objAttrs[b[c]]=b[c+1];break;default:a.embedAttrs[b[c]]=a.params[b[c]]=b[c+1]}}a.objAttrs.classid=d;if(n){a.embedAttrs.type=n}return a}var FlashDetect=new function(){var a=this;a.installed=false;a.raw="";a.major=-1;a.minor=-1;a.revision=-1;a.revisionStr="";var b=[{name:"ShockwaveFlash.ShockwaveFlash.7",version:function(n){return d(n)}},{name:"ShockwaveFlash.ShockwaveFlash.6",version:function(p){var n="6,0,21";try{p.AllowScriptAccess="always";n=d(p)}catch(o){}return n}},{name:"ShockwaveFlash.ShockwaveFlash",version:function(n){return d(n)}}];var d=function(p){var n=-1;try{n=p.GetVariable("$version")}catch(o){}return n};var k=function(n){var p=-1;try{p=new ActiveXObject(n)}catch(o){p={activeXError:true}}return p};var c=function(o){var n=o.split(",");return{raw:o,major:parseInt(n[0].split(" ")[1],10),minor:parseInt(n[1],10),revision:parseInt(n[2],10),revisionStr:n[2]}};var g=function(q){var o=q.split(/ +/);var p=o[2].split(/\./);var n=o[3];return{raw:q,major:parseInt(p[0],10),minor:parseInt(p[1],10),revisionStr:n,revision:f(n)}};var f=function(n){return parseInt(n.replace(/[a-zA-Z]/g,""),10)||a.revision};a.majorAtLeast=function(n){return a.major>=n};a.minorAtLeast=function(n){return a.minor>=n};a.revisionAtLeast=function(n){return a.revision>=n};a.versionAtLeast=function(o){var p=[a.major,a.minor,a.revision];var n=Math.min(p.length,arguments.length);for(i=0;i<n;i++){if(p[i]>=arguments[i]){if(i+1<n&&p[i]==arguments[i]){continue}else{return true}}else{return false}}};a.FlashDetect=function(){if(navigator.plugins&&navigator.plugins.length>0){var q="application/x-shockwave-flash";var p=navigator.mimeTypes;if(p&&p[q]&&p[q].enabledPlugin&&p[q].enabledPlugin.description){var n=p[q].enabledPlugin.description;var r=g(n);a.raw=r.raw;a.major=r.major;a.minor=r.minor;a.revisionStr=r.revisionStr;a.revision=r.revision;a.installed=true}}else{if(navigator.appVersion.indexOf("Mac")==-1&&window.execScript){var n=-1;for(var o=0;o<b.length&&n==-1;o++){var s=k(b[o].name);if(!s.activeXError){a.installed=true;n=b[o].version(s);if(n!=-1){var r=c(n);a.raw=r.raw;a.major=r.major;a.minor=r.minor;a.revision=r.revision;a.revisionStr=r.revisionStr}}}}}}()};FlashDetect.JS_RELEASE="1.0.4";(function(window,undefined){var S={version:"3.0.3"};var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("windows")>-1||ua.indexOf("win32")>-1){S.isWindows=true}else{if(ua.indexOf("macintosh")>-1||ua.indexOf("mac os x")>-1){S.isMac=true}else{if(ua.indexOf("linux")>-1){S.isLinux=true}}}S.isIE=ua.indexOf("msie")>-1;S.isIE6=ua.indexOf("msie 6")>-1;S.isIE7=ua.indexOf("msie 7")>-1;S.isGecko=ua.indexOf("gecko")>-1&&ua.indexOf("safari")==-1;S.isWebKit=ua.indexOf("applewebkit/")>-1;var inlineId=/#(.+)$/,galleryName=/^(light|shadow)box\[(.*?)\]/i,inlineParam=/\s*([a-z_]*?)\s*=\s*(.+)\s*/,fileExtension=/[0-9a-z]+$/i,scriptPath=/(.+\/)shadowbox\.js/i;var open=false,initialized=false,lastOptions={},slideDelay=0,slideStart,slideTimer;S.current=-1;S.dimensions=null;S.ease=function(state){return 1+Math.pow(state-1,3)};S.errorInfo={fla:{name:"Flash",url:"http://www.adobe.com/products/flashplayer/"},qt:{name:"QuickTime",url:"http://www.apple.com/quicktime/download/"},wmp:{name:"Windows Media Player",url:"http://www.microsoft.com/windows/windowsmedia/"},f4m:{name:"Flip4Mac",url:"http://www.flip4mac.com/wmv_download.htm"}};S.gallery=[];S.onReady=noop;S.path=null;S.player=null;S.playerId="sb-player";S.options={animate:true,animateFade:true,autoplayMovies:true,continuous:false,enableKeys:true,flashParams:{bgcolor:"#000000",allowfullscreen:true},flashVars:{},flashVersion:"9.0.115",handleOversize:"resize",handleUnsupported:"link",onChange:noop,onClose:noop,onFinish:noop,onOpen:noop,showMovieControls:true,skipSetup:false,slideshowDelay:0,viewportPadding:20};S.getCurrent=function(){return S.current>-1?S.gallery[S.current]:null};S.hasNext=function(){return S.gallery.length>1&&(S.current!=S.gallery.length-1||S.options.continuous)};S.isOpen=function(){return open};S.isPaused=function(){return slideTimer=="pause"};S.applyOptions=function(options){lastOptions=apply({},S.options);apply(S.options,options)};S.revertOptions=function(){apply(S.options,lastOptions)};S.init=function(options,callback){if(initialized){return}initialized=true;if(S.skin.options){apply(S.options,S.skin.options)}if(options){apply(S.options,options)}if(!S.path){var path,scripts=document.getElementsByTagName("script");for(var i=0,len=scripts.length;i<len;++i){path=scriptPath.exec(scripts[i].src);if(path){S.path=path[1];break}}}if(callback){S.onReady=callback}bindLoad()};S.open=function(obj){if(open){return}var gc=S.makeGallery(obj);S.gallery=gc[0];S.current=gc[1];obj=S.getCurrent();if(obj==null){return}S.applyOptions(obj.options||{});filterGallery();if(S.gallery.length){obj=S.getCurrent();if(S.options.onOpen(obj)===false){return}open=true;S.skin.onOpen(obj,load)}};S.close=function(){if(!open){return}open=false;if(S.player){S.player.remove();S.player=null}if(typeof slideTimer=="number"){clearTimeout(slideTimer);slideTimer=null}slideDelay=0;listenKeys(false);S.options.onClose(S.getCurrent());S.skin.onClose();S.revertOptions()};S.play=function(){if(!S.hasNext()){return}if(!slideDelay){slideDelay=S.options.slideshowDelay*1000}if(slideDelay){slideStart=now();slideTimer=setTimeout(function(){slideDelay=slideStart=0;S.next()},slideDelay);if(S.skin.onPlay){S.skin.onPlay()}}};S.pause=function(){if(typeof slideTimer!="number"){return}slideDelay=Math.max(0,slideDelay-(now()-slideStart));if(slideDelay){clearTimeout(slideTimer);slideTimer="pause";if(S.skin.onPause){S.skin.onPause()}}};S.change=function(index){if(!(index in S.gallery)){if(S.options.continuous){index=(index<0?S.gallery.length+index:0);if(!(index in S.gallery)){return}}else{return}}S.current=index;if(typeof slideTimer=="number"){clearTimeout(slideTimer);slideTimer=null;slideDelay=slideStart=0}S.options.onChange(S.getCurrent());load(true)};S.next=function(){S.change(S.current+1)};S.previous=function(){S.change(S.current-1)};S.setDimensions=function(height,width,maxHeight,maxWidth,topBottom,leftRight,padding,preserveAspect){var originalHeight=height,originalWidth=width;var extraHeight=2*padding+topBottom;if(height+extraHeight>maxHeight){height=maxHeight-extraHeight}var extraWidth=2*padding+leftRight;if(width+extraWidth>maxWidth){width=maxWidth-extraWidth}var changeHeight=(originalHeight-height)/originalHeight,changeWidth=(originalWidth-width)/originalWidth,oversized=(changeHeight>0||changeWidth>0);if(preserveAspect&&oversized){if(changeHeight>changeWidth){width=Math.round((originalWidth/originalHeight)*height)}else{if(changeWidth>changeHeight){height=Math.round((originalHeight/originalWidth)*width)}}}S.dimensions={height:height+topBottom,width:width+leftRight,innerHeight:height,innerWidth:width,top:Math.floor((maxHeight-(height+extraHeight))/2+padding),left:Math.floor((maxWidth-(width+extraWidth))/2+padding),oversized:oversized};return S.dimensions};S.makeGallery=function(obj){var gallery=[],current=-1;if(typeof obj=="string"){obj=[obj]}if(typeof obj.length=="number"){each(obj,function(i,o){if(o.content){gallery[i]=o}else{gallery[i]={content:o}}});current=0}else{if(obj.tagName){var cacheObj=S.getCache(obj);obj=cacheObj?cacheObj:S.makeObject(obj)}if(obj.gallery){gallery=[];var o;for(var key in S.cache){o=S.cache[key];if(o.gallery&&o.gallery==obj.gallery){if(current==-1&&o.content==obj.content){current=gallery.length}gallery.push(o)}}if(current==-1){gallery.unshift(obj);current=0}}else{gallery=[obj];current=0}}each(gallery,function(i,o){gallery[i]=apply({},o)});return[gallery,current]};S.makeObject=function(link,options){var obj={content:link.href,title:link.getAttribute("title")||"",link:link};if(options){options=apply({},options);each(["player","title","height","width","gallery"],function(i,o){if(typeof options[o]!="undefined"){obj[o]=options[o];delete options[o]}});obj.options=options}else{obj.options={}}if(!obj.player){obj.player=S.getPlayer(obj.content)}var rel=link.getAttribute("rel");if(rel){var match=rel.match(galleryName);if(match){obj.gallery=escape(match[2])}each(rel.split(";"),function(i,p){match=p.match(inlineParam);if(match){obj[match[1]]=match[2]}})}return obj};S.getPlayer=function(content){if(content.indexOf("#")>-1&&content.indexOf(document.location.href)==0){return"inline"}var q=content.indexOf("?");if(q>-1){content=content.substring(0,q)}var ext,m=content.match(fileExtension);if(m){ext=m[0].toLowerCase()}if(ext){if(S.img&&S.img.ext.indexOf(ext)>-1){return"img"}if(S.swf&&S.swf.ext.indexOf(ext)>-1){return"swf"}if(S.flv&&S.flv.ext.indexOf(ext)>-1){return"flv"}if(S.qt&&S.qt.ext.indexOf(ext)>-1){if(S.wmp&&S.wmp.ext.indexOf(ext)>-1){return"qtwmp"}else{return"qt"}}if(S.wmp&&S.wmp.ext.indexOf(ext)>-1){return"wmp"}}return"iframe"};function filterGallery(){var err=S.errorInfo,plugins=S.plugins,obj,remove,needed,m,format,replace,inlineEl,flashVersion;for(var i=0;i<S.gallery.length;++i){obj=S.gallery[i];remove=false;needed=null;switch(obj.player){case"flv":case"swf":if(!plugins.fla){needed="fla"}break;case"qt":if(!plugins.qt){needed="qt"}break;case"wmp":if(S.isMac){if(plugins.qt&&plugins.f4m){obj.player="qt"}else{needed="qtf4m"}}else{if(!plugins.wmp){needed="wmp"}}break;case"qtwmp":if(plugins.qt){obj.player="qt"}else{if(plugins.wmp){obj.player="wmp"}else{needed="qtwmp"}}break}if(needed){if(S.options.handleUnsupported=="link"){switch(needed){case"qtf4m":format="shared";replace=[err.qt.url,err.qt.name,err.f4m.url,err.f4m.name];break;case"qtwmp":format="either";replace=[err.qt.url,err.qt.name,err.wmp.url,err.wmp.name];break;default:format="single";replace=[err[needed].url,err[needed].name]}obj.player="html";obj.content='<div class="sb-message">'+sprintf(S.lang.errors[format],replace)+"</div>"}else{remove=true}}else{if(obj.player=="inline"){m=inlineId.exec(obj.content);if(m){inlineEl=get(m[1]);if(inlineEl){obj.content=inlineEl.innerHTML}else{remove=true}}else{remove=true}}else{if(obj.player=="swf"||obj.player=="flv"){flashVersion=(obj.options&&obj.options.flashVersion)||S.options.flashVersion;if(S.flash&&!S.flash.hasFlashPlayerVersion(flashVersion)){obj.width=310;obj.height=177}}}}if(remove){S.gallery.splice(i,1);if(i<S.current){--S.current}else{if(i==S.current){S.current=i>0?i-1:i}}--i}}}function listenKeys(on){if(!S.options.enableKeys){return}(on?addEvent:removeEvent)(document,"keydown",handleKey)}function handleKey(e){if(e.metaKey||e.shiftKey||e.altKey||e.ctrlKey){return}var code=keyCode(e),handler;switch(code){case 81:case 88:case 27:handler=S.close;break;case 37:handler=S.previous;break;case 39:handler=S.next;break;case 32:handler=typeof slideTimer=="number"?S.pause:S.play;break}if(handler){preventDefault(e);handler()}}function load(changing){listenKeys(false);var obj=S.getCurrent();var player=(obj.player=="inline"?"html":obj.player);if(typeof S[player]!="function"){throw"unknown player "+player}if(changing){S.player.remove();S.revertOptions();S.applyOptions(obj.options||{})}S.player=new S[player](obj,S.playerId);if(S.gallery.length>1){var next=S.gallery[S.current+1]||S.gallery[0];if(next.player=="img"){var a=new Image();a.src=next.content}var prev=S.gallery[S.current-1]||S.gallery[S.gallery.length-1];if(prev.player=="img"){var b=new Image();b.src=prev.content}}S.skin.onLoad(changing,waitReady)}function waitReady(){if(!open){return}if(typeof S.player.ready!="undefined"){var timer=setInterval(function(){if(open){if(S.player.ready){clearInterval(timer);timer=null;S.skin.onReady(show)}}else{clearInterval(timer);timer=null}},10)}else{S.skin.onReady(show)}}function show(){if(!open){return}S.player.append(S.skin.body,S.dimensions);S.skin.onShow(finish)}function finish(){if(!open){return}if(S.player.onLoad){S.player.onLoad()}S.options.onFinish(S.getCurrent());if(!S.isPaused()){S.play()}listenKeys(true)}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(obj,from){var len=this.length>>>0;from=from||0;if(from<0){from+=len}for(;from<len;++from){if(from in this&&this[from]===obj){return from}}return -1}}function now(){return(new Date).getTime()}function apply(original,extension){for(var property in extension){original[property]=extension[property]}return original}function each(obj,callback){var i=0,len=obj.length;for(var value=obj[0];i<len&&callback.call(value,i,value)!==false;value=obj[++i]){}}function sprintf(str,replace){return str.replace(/\{(\w+?)\}/g,function(match,i){return replace[i]})}function noop(){}function get(id){return document.getElementById(id)}function remove(el){el.parentNode.removeChild(el)}var supportsOpacity=true,supportsFixed=true;function checkSupport(){var body=document.body,div=document.createElement("div");supportsOpacity=typeof div.style.opacity==="string";div.style.position="fixed";div.style.margin=0;div.style.top="20px";body.appendChild(div,body.firstChild);supportsFixed=div.offsetTop==20;body.removeChild(div)}S.getStyle=(function(){var opacity=/opacity=([^)]*)/,getComputedStyle=document.defaultView&&document.defaultView.getComputedStyle;return function(el,style){var ret;if(!supportsOpacity&&style=="opacity"&&el.currentStyle){ret=opacity.test(el.currentStyle.filter||"")?(parseFloat(RegExp.$1)/100)+"":"";return ret===""?"1":ret}if(getComputedStyle){var computedStyle=getComputedStyle(el,null);if(computedStyle){ret=computedStyle[style]}if(style=="opacity"&&ret==""){ret="1"}}else{ret=el.currentStyle[style]}return ret}})();S.appendHTML=function(el,html){if(el.insertAdjacentHTML){el.insertAdjacentHTML("BeforeEnd",html)}else{if(el.lastChild){var range=el.ownerDocument.createRange();range.setStartAfter(el.lastChild);var frag=range.createContextualFragment(html);el.appendChild(frag)}else{el.innerHTML=html}}};S.getWindowSize=function(dimension){if(document.compatMode==="CSS1Compat"){return document.documentElement["client"+dimension]}return document.body["client"+dimension]};S.setOpacity=function(el,opacity){var style=el.style;if(supportsOpacity){style.opacity=(opacity==1?"":opacity)}else{style.zoom=1;if(opacity==1){if(typeof style.filter=="string"&&(/alpha/i).test(style.filter)){style.filter=style.filter.replace(/\s*[\w\.]*alpha\([^\)]*\);?/gi,"")}}else{style.filter=(style.filter||"").replace(/\s*[\w\.]*alpha\([^\)]*\)/gi,"")+" alpha(opacity="+(opacity*100)+")"}}};S.clearOpacity=function(el){S.setOpacity(el,1)};function getTarget(e){var target=e.target?e.target:e.srcElement;return target.nodeType==3?target.parentNode:target}function getPageXY(e){var x=e.pageX||(e.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),y=e.pageY||(e.clientY+(document.documentElement.scrollTop||document.body.scrollTop));return[x,y]}function preventDefault(e){e.preventDefault()}function keyCode(e){return e.which?e.which:e.keyCode}function addEvent(el,type,handler){if(el.addEventListener){el.addEventListener(type,handler,false)}else{if(el.nodeType===3||el.nodeType===8){return}if(el.setInterval&&(el!==window&&!el.frameElement)){el=window}if(!handler.__guid){handler.__guid=addEvent.guid++}if(!el.events){el.events={}}var handlers=el.events[type];if(!handlers){handlers=el.events[type]={};if(el["on"+type]){handlers[0]=el["on"+type]}}handlers[handler.__guid]=handler;el["on"+type]=addEvent.handleEvent}}addEvent.guid=1;addEvent.handleEvent=function(event){var result=true;event=event||addEvent.fixEvent(((this.ownerDocument||this.document||this).parentWindow||window).event);var handlers=this.events[event.type];for(var i in handlers){this.__handleEvent=handlers[i];if(this.__handleEvent(event)===false){result=false}}return result};addEvent.preventDefault=function(){this.returnValue=false};addEvent.stopPropagation=function(){this.cancelBubble=true};addEvent.fixEvent=function(e){e.preventDefault=addEvent.preventDefault;e.stopPropagation=addEvent.stopPropagation;return e};function removeEvent(el,type,handler){if(el.removeEventListener){el.removeEventListener(type,handler,false)}else{if(el.events&&el.events[type]){delete el.events[type][handler.__guid]}}}var loaded=false,DOMContentLoaded;if(document.addEventListener){DOMContentLoaded=function(){document.removeEventListener("DOMContentLoaded",DOMContentLoaded,false);S.load()}}else{if(document.attachEvent){DOMContentLoaded=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",DOMContentLoaded);S.load()}}}}function doScrollCheck(){if(loaded){return}try{document.documentElement.doScroll("left")}catch(e){setTimeout(doScrollCheck,1);return}S.load()}function bindLoad(){if(document.readyState==="complete"){return S.load()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",DOMContentLoaded,false);window.addEventListener("load",S.load,false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",DOMContentLoaded);window.attachEvent("onload",S.load);var topLevel=false;try{topLevel=window.frameElement===null}catch(e){}if(document.documentElement.doScroll&&topLevel){doScrollCheck()}}}}S.load=function(){if(loaded){return}if(!document.body){return setTimeout(S.load,13)}loaded=true;checkSupport();S.onReady();if(!S.options.skipSetup){S.setup()}S.skin.init()};S.plugins={};if(navigator.plugins&&navigator.plugins.length){var names=[];each(navigator.plugins,function(i,p){names.push(p.name)});names=names.join(",");var f4m=names.indexOf("Flip4Mac")>-1;S.plugins={fla:names.indexOf("Shockwave Flash")>-1,qt:names.indexOf("QuickTime")>-1,wmp:!f4m&&names.indexOf("Windows Media")>-1,f4m:f4m}}else{var detectPlugin=function(name){var axo;try{axo=new ActiveXObject(name)}catch(e){}return !!axo};S.plugins={fla:detectPlugin("ShockwaveFlash.ShockwaveFlash"),qt:detectPlugin("QuickTime.QuickTime"),wmp:detectPlugin("wmplayer.ocx"),f4m:false}}var relAttr=/^(light|shadow)box/i,expando="shadowboxCacheKey",cacheKey=1;S.cache={};S.select=function(selector){var links=[];if(!selector){var rel;each(document.getElementsByTagName("a"),function(i,el){rel=el.getAttribute("rel");if(rel&&relAttr.test(rel)){links.push(el)}})}else{var length=selector.length;if(length){if(typeof selector=="string"){if(S.find){links=S.find(selector)}}else{if(length==2&&typeof selector[0]=="string"&&selector[1].nodeType){if(S.find){links=S.find(selector[0],selector[1])}}else{for(var i=0;i<length;++i){links[i]=selector[i]}}}}else{links.push(selector)}}return links};S.setup=function(selector,options){each(S.select(selector),function(i,link){S.addCache(link,options)})};S.teardown=function(selector){each(S.select(selector),function(i,link){S.removeCache(link)})};S.addCache=function(link,options){var key=link[expando];if(key==undefined){key=cacheKey++;link[expando]=key;addEvent(link,"click",handleClick)}S.cache[key]=S.makeObject(link,options)};S.removeCache=function(link){removeEvent(link,"click",handleClick);delete S.cache[link[expando]];link[expando]=null};S.getCache=function(link){var key=link[expando];return(key in S.cache&&S.cache[key])};S.clearCache=function(){for(var key in S.cache){S.removeCache(S.cache[key].link)}S.cache={}};function handleClick(e){S.open(this);if(S.gallery.length){preventDefault(e)}}S.find=(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,done=0,toString=Object.prototype.toString,hasDuplicate=false,baseHasDuplicate=true;[0,0].sort(function(){baseHasDuplicate=false;return 0});var Sizzle=function(selector,context,results,seed){results=results||[];var origContext=context=context||document;if(context.nodeType!==1&&context.nodeType!==9){return[]}if(!selector||typeof selector!=="string"){return results}var parts=[],m,set,checkSet,extra,prune=true,contextXML=isXML(context),soFar=selector;while((chunker.exec(""),m=chunker.exec(soFar))!==null){soFar=m[3];parts.push(m[1]);if(m[2]){extra=m[3];break}}if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context)}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector]){selector+=parts.shift()}set=posProcess(selector,set)}}}else{if(!seed&&parts.length>1&&context.nodeType===9&&!contextXML&&Expr.match.ID.test(parts[0])&&!Expr.match.ID.test(parts[parts.length-1])){var ret=Sizzle.find(parts.shift(),context,contextXML);context=ret.expr?Sizzle.filter(ret.expr,ret.set)[0]:ret.set[0]}if(context){var ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&(parts[0]==="~"||parts[0]==="+")&&context.parentNode?context.parentNode:context,contextXML);set=ret.expr?Sizzle.filter(ret.expr,ret.set):ret.set;if(parts.length>0){checkSet=makeArray(set)}else{prune=false}while(parts.length){var cur=parts.pop(),pop=cur;if(!Expr.relative[cur]){cur=""}else{pop=parts.pop()}if(pop==null){pop=context}Expr.relative[cur](checkSet,pop,contextXML)}}else{checkSet=parts=[]}}if(!checkSet){checkSet=set}if(!checkSet){throw"Syntax error, unrecognized expression: "+(cur||selector)}if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet)}else{if(context&&context.nodeType===1){for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&contains(context,checkSet[i]))){results.push(set[i])}}}else{for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i])}}}}}else{makeArray(checkSet,results)}if(extra){Sizzle(extra,origContext,results,seed);Sizzle.uniqueSort(results)}return results};Sizzle.uniqueSort=function(results){if(sortOrder){hasDuplicate=baseHasDuplicate;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1)}}}}return results};Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set)};Sizzle.find=function(expr,context,isXML){var set,match;if(!expr){return[]}for(var i=0,l=Expr.order.length;i<l;i++){var type=Expr.order[i],match;if((match=Expr.leftMatch[type].exec(expr))){var left=match[1];match.splice(1,1);if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break}}}}if(!set){set=context.getElementsByTagName("*")}return{set:set,expr:expr}};Sizzle.filter=function(expr,set,inplace,not){var old=expr,result=[],curLoop=set,match,anyFound,isXMLFilter=set&&set[0]&&isXML(set[0]);while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.match[type].exec(expr))!=null){var filter=Expr.filter[type],found,item;anyFound=false;if(curLoop===result){result=[]}if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not,isXMLFilter);if(!match){anyFound=found=true}else{if(match===true){continue}}}if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);var pass=not^!!found;if(inplace&&found!=null){if(pass){anyFound=true}else{curLoop[i]=false}}else{if(pass){result.push(item);anyFound=true}}}}}if(found!==undefined){if(!inplace){curLoop=result}expr=expr.replace(Expr.match[type],"");if(!anyFound){return[]}break}}}if(expr===old){if(anyFound==null){throw"Syntax error, unrecognized expression: "+expr}else{break}}old=expr}return curLoop};var Expr=Sizzle.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\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(elem){return elem.getAttribute("href")}},relative:{"+":function(checkSet,part){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;if(isTag){part=part.toLowerCase()}for(var i=0,l=checkSet.length,elem;i<l;i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}checkSet[i]=isPartStrNotTag||elem&&elem.nodeName.toLowerCase()===part?elem||false:elem===part}}if(isPartStrNotTag){Sizzle.filter(part,checkSet,true)}},">":function(checkSet,part){var isPartStr=typeof part==="string";if(isPartStr&&!/\W/.test(part)){part=part.toLowerCase();for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName.toLowerCase()===part?parent:false}}}else{for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){checkSet[i]=isPartStr?elem.parentNode:elem.parentNode===part}}if(isPartStr){Sizzle.filter(part,checkSet,true)}}},"":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!/\W/.test(part)){var nodeCheck=part=part.toLowerCase();checkFn=dirNodeCheck}checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML)},"~":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!/\W/.test(part)){var nodeCheck=part=part.toLowerCase();checkFn=dirNodeCheck}checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML)}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?[m]:[]}},NAME:function(match,context){if(typeof context.getElementsByName!=="undefined"){var ret=[],results=context.getElementsByName(match[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i])}}return ret.length===0?null:ret}},TAG:function(match,context){return context.getElementsByTagName(match[1])}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" "+match[1].replace(/\\/g,"")+" ";if(isXML){return match}for(var i=0,elem;(elem=curLoop[i])!=null;i++){if(elem){if(not^(elem.className&&(" "+elem.className+" ").replace(/[\t\n]/g," ").indexOf(match)>=0)){if(!inplace){result.push(elem)}}else{if(inplace){curLoop[i]=false}}}}return false},ID:function(match){return match[1].replace(/\\/g,"")},TAG:function(match,curLoop){return match[1].toLowerCase()},CHILD:function(match){if(match[1]==="nth"){var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2]==="even"&&"2n"||match[2]==="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);match[2]=(test[1]+(test[2]||1))-0;match[3]=test[3]-0}match[0]=done++;return match},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1].replace(/\\/g,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name]}if(match[2]==="~="){match[4]=" "+match[4]+" "}return match},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if((chunker.exec(match[3])||"").length>1||/^\w/.test(match[3])){match[3]=Sizzle(match[3],null,null,curLoop)}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret)}return false}}else{if(Expr.match.POS.test(match[0])||Expr.match.CHILD.test(match[0])){return true}}return match},POS:function(match){match.unshift(true);return match}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden"},disabled:function(elem){return elem.disabled===true},checked:function(elem){return elem.checked===true},selected:function(elem){elem.parentNode.selectedIndex;return elem.selected===true},parent:function(elem){return !!elem.firstChild},empty:function(elem){return !elem.firstChild},has:function(elem,i,match){return !!Sizzle(match[3],elem).length},header:function(elem){return/h\d/i.test(elem.nodeName)},text:function(elem){return"text"===elem.type},radio:function(elem){return"radio"===elem.type},checkbox:function(elem){return"checkbox"===elem.type},file:function(elem){return"file"===elem.type},password:function(elem){return"password"===elem.type},submit:function(elem){return"submit"===elem.type},image:function(elem){return"image"===elem.type},reset:function(elem){return"reset"===elem.type},button:function(elem){return"button"===elem.type||elem.nodeName.toLowerCase()==="button"},input:function(elem){return/input|select|textarea|button/i.test(elem.nodeName)}},setFilters:{first:function(elem,i){return i===0},last:function(elem,i,match,array){return i===array.length-1},even:function(elem,i){return i%2===0},odd:function(elem,i){return i%2===1},lt:function(elem,i,match){return i<match[3]-0},gt:function(elem,i,match){return i>match[3]-0},nth:function(elem,i,match){return match[3]-0===i},eq:function(elem,i,match){return match[3]-0===i}},filter:{PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array)}else{if(name==="contains"){return(elem.textContent||elem.innerText||getText([elem])||"").indexOf(match[3])>=0}else{if(name==="not"){var not=match[3];for(var i=0,l=not.length;i<l;i++){if(not[i]===elem){return false}}return true}else{throw"Syntax error, unrecognized expression: "+name}}}},CHILD:function(elem,match){var type=match[1],node=elem;switch(type){case"only":case"first":while((node=node.previousSibling)){if(node.nodeType===1){return false}}if(type==="first"){return true}node=elem;case"last":while((node=node.nextSibling)){if(node.nodeType===1){return false}}return true;case"nth":var first=match[2],last=match[3];if(first===1&&last===0){return true}var doneName=match[0],parent=elem.parentNode;if(parent&&(parent.sizcache!==doneName||!elem.nodeIndex)){var count=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++count}}parent.sizcache=doneName}var diff=elem.nodeIndex-last;if(first===0){return diff===0}else{return(diff%first===0&&diff/first>=0)}}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName.toLowerCase()===match},CLASS:function(elem,match){return(" "+(elem.className||elem.getAttribute("class"))+" ").indexOf(match)>-1},ATTR:function(elem,match){var name=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),value=result+"",type=match[2],check=match[4];return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!check?value&&result!==false:type==="!="?value!==check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];if(filter){return filter(elem,i,match,array)}}}};var origPOS=Expr.match.POS;for(var type in Expr.match){Expr.match[type]=new RegExp(Expr.match[type].source+/(?![^\[]*\])(?![^\(]*\))/.source);Expr.leftMatch[type]=new RegExp(/(^(?:.|\r|\n)*?)/.source+Expr.match[type].source)}var makeArray=function(array,results){array=Array.prototype.slice.call(array,0);if(results){results.push.apply(results,array);return results}return array};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(e){makeArray=function(array,results){var ret=results||[];if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array)}else{if(typeof array.length==="number"){for(var i=0,l=array.length;i<l;i++){ret.push(array[i])}}else{for(var i=0;array[i];i++){ret.push(array[i])}}}return ret}}var sortOrder;if(document.documentElement.compareDocumentPosition){sortOrder=function(a,b){if(!a.compareDocumentPosition||!b.compareDocumentPosition){if(a==b){hasDuplicate=true}return a.compareDocumentPosition?-1:1}var ret=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(ret===0){hasDuplicate=true}return ret}}else{if("sourceIndex" in document.documentElement){sortOrder=function(a,b){if(!a.sourceIndex||!b.sourceIndex){if(a==b){hasDuplicate=true}return a.sourceIndex?-1:1}var ret=a.sourceIndex-b.sourceIndex;if(ret===0){hasDuplicate=true}return ret}}else{if(document.createRange){sortOrder=function(a,b){if(!a.ownerDocument||!b.ownerDocument){if(a==b){hasDuplicate=true}return a.ownerDocument?-1:1}var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();aRange.setStart(a,0);aRange.setEnd(a,0);bRange.setStart(b,0);bRange.setEnd(b,0);var ret=aRange.compareBoundaryPoints(Range.START_TO_END,bRange);if(ret===0){hasDuplicate=true}return ret}}}}function getText(elems){var ret="",elem;for(var i=0;elems[i];i++){elem=elems[i];if(elem.nodeType===3||elem.nodeType===4){ret+=elem.nodeValue}else{if(elem.nodeType!==8){ret+=getText(elem.childNodes)}}}return ret}(function(){var form=document.createElement("div"),id="script"+(new Date).getTime();form.innerHTML="<a name='"+id+"'/>";var root=document.documentElement;root.insertBefore(form,root.firstChild);if(document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[]}};Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return elem.nodeType===1&&node&&node.nodeValue===match}}root.removeChild(form);root=form=null})();(function(){var div=document.createElement("div");div.appendChild(document.createComment(""));if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);if(match[1]==="*"){var tmp=[];for(var i=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i])}}results=tmp}return results}}div.innerHTML="<a href='#'></a>";if(div.firstChild&&typeof div.firstChild.getAttribute!=="undefined"&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2)}}div=null})();if(document.querySelectorAll){(function(){var oldSizzle=Sizzle,div=document.createElement("div");div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return}Sizzle=function(query,context,extra,seed){context=context||document;if(!seed&&context.nodeType===9&&!isXML(context)){try{return makeArray(context.querySelectorAll(query),extra)}catch(e){}}return oldSizzle(query,context,extra,seed)};for(var prop in oldSizzle){Sizzle[prop]=oldSizzle[prop]}div=null})()}(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";if(!div.getElementsByClassName||div.getElementsByClassName("e").length===0){return}div.lastChild.className="e";if(div.getElementsByClassName("e").length===1){return}Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1])}};div=null})();function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break}if(elem.nodeType===1&&!isXML){elem.sizcache=doneName;elem.sizset=i}if(elem.nodeName.toLowerCase()===cur){match=elem;break}elem=elem[dir]}checkSet[i]=match}}}function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break}if(elem.nodeType===1){if(!isXML){elem.sizcache=doneName;elem.sizset=i}if(typeof cur!=="string"){if(elem===cur){match=true;break}}else{if(Sizzle.filter(cur,[elem]).length>0){match=elem;break}}}elem=elem[dir]}checkSet[i]=match}}}var contains=document.compareDocumentPosition?function(a,b){return a.compareDocumentPosition(b)&16}:function(a,b){return a!==b&&(a.contains?a.contains(b):true)};var isXML=function(elem){var documentElement=(elem?elem.ownerDocument||elem:0).documentElement;return documentElement?documentElement.nodeName!=="HTML":false};var posProcess=function(selector,context){var tmpSet=[],later="",match,root=context.nodeType?[context]:context;while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];selector=selector.replace(Expr.match.PSEUDO,"")}selector=Expr.relative[selector]?selector+"*":selector;for(var i=0,l=root.length;i<l;i++){Sizzle(selector,root[i],tmpSet)}return Sizzle.filter(later,tmpSet)};return Sizzle})();S.flash=(function(){var swfobject=function(){var UNDEF="undefined",OBJECT="object",SHOCKWAVE_FLASH="Shockwave Flash",SHOCKWAVE_FLASH_AX="ShockwaveFlash.ShockwaveFlash",FLASH_MIME_TYPE="application/x-shockwave-flash",EXPRESS_INSTALL_ID="SWFObjectExprInst",win=window,doc=document,nav=navigator,domLoadFnArr=[],regObjArr=[],objIdArr=[],listenersArr=[],script,timer=null,storedAltContent=null,storedAltContentId=null,isDomLoaded=false,isExpressInstallActive=false;var ua=function(){var w3cdom=typeof doc.getElementById!=UNDEF&&typeof doc.getElementsByTagName!=UNDEF&&typeof doc.createElement!=UNDEF,playerVersion=[0,0,0],d=null;if(typeof nav.plugins!=UNDEF&&typeof nav.plugins[SHOCKWAVE_FLASH]==OBJECT){d=nav.plugins[SHOCKWAVE_FLASH].description;if(d&&!(typeof nav.mimeTypes!=UNDEF&&nav.mimeTypes[FLASH_MIME_TYPE]&&!nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)){d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");playerVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);playerVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);playerVersion[2]=/r/.test(d)?parseInt(d.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof win.ActiveXObject!=UNDEF){var a=null,fp6Crash=false;try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".7")}catch(e){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".6");playerVersion=[6,0,21];a.AllowScriptAccess="always"}catch(e){if(playerVersion[0]==6){fp6Crash=true}}if(!fp6Crash){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX)}catch(e){}}}if(!fp6Crash&&a){try{d=a.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");playerVersion=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)]}}catch(e){}}}}var u=nav.userAgent.toLowerCase(),p=nav.platform.toLowerCase(),webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,ie=false,windows=p?/win/.test(p):/win/.test(u),mac=p?/mac/.test(p):/mac/.test(u);
/*@cc_on
			ie = true;
			@if (@_win32)
				windows = true;
			@elif (@_mac)
				mac = true;
			@end
		@*/
return{w3cdom:w3cdom,pv:playerVersion,webkit:webkit,ie:ie,win:windows,mac:mac}}();var onDomLoad=function(){if(!ua.w3cdom){return}addDomLoadEvent(main);if(ua.ie&&ua.win){try{doc.write("<script id=__ie_ondomload defer=true src='/utils/secure.htm'><\/script>");script=getElementById("__ie_ondomload");if(script){addListener(script,"onreadystatechange",checkReadyState)}}catch(e){}}if(ua.webkit&&typeof doc.readyState!=UNDEF){timer=setInterval(function(){if(/loaded|complete/.test(doc.readyState)){callDomLoadFunctions()}},10)}if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("DOMContentLoaded",callDomLoadFunctions,null)}addLoadEvent(callDomLoadFunctions)}();function checkReadyState(){if(script.readyState=="complete"&&script.parentNode){script.parentNode.removeChild(script);callDomLoadFunctions()}}function callDomLoadFunctions(){if(isDomLoaded){return}if(ua.ie&&ua.win){var s=createElement("span");try{var t=doc.getElementsByTagName("body")[0].appendChild(s);t.parentNode.removeChild(t)}catch(e){return}}isDomLoaded=true;if(timer){clearInterval(timer);timer=null}var dl=domLoadFnArr.length;for(var i=0;i<dl;i++){domLoadFnArr[i]()}}function addDomLoadEvent(fn){if(isDomLoaded){fn()}else{domLoadFnArr[domLoadFnArr.length]=fn}}function addLoadEvent(fn){if(typeof win.addEventListener!=UNDEF){win.addEventListener("load",fn,false)}else{if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("load",fn,false)}else{if(typeof win.attachEvent!=UNDEF){addListener(win,"onload",fn)}else{if(typeof win.onload=="function"){var fnOld=win.onload;win.onload=function(){fnOld();fn()}}else{win.onload=fn}}}}}function main(){var rl=regObjArr.length;for(var i=0;i<rl;i++){var id=regObjArr[i].id;if(ua.pv[0]>0){var obj=getElementById(id);if(obj){regObjArr[i].width=obj.getAttribute("width")?obj.getAttribute("width"):"0";regObjArr[i].height=obj.getAttribute("height")?obj.getAttribute("height"):"0";if(hasPlayerVersion(regObjArr[i].swfVersion)){if(ua.webkit&&ua.webkit<312){fixParams(obj)}setVisibility(id,true)}else{if(regObjArr[i].expressInstall&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){showExpressInstall(regObjArr[i])}else{displayAltContent(obj)}}}}else{setVisibility(id,true)}}}function fixParams(obj){var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var e=createElement("embed"),a=nestedObj.attributes;if(a){var al=a.length;for(var i=0;i<al;i++){if(a[i].nodeName=="DATA"){e.setAttribute("src",a[i].nodeValue)}else{e.setAttribute(a[i].nodeName,a[i].nodeValue)}}}var c=nestedObj.childNodes;if(c){var cl=c.length;for(var j=0;j<cl;j++){if(c[j].nodeType==1&&c[j].nodeName=="PARAM"){e.setAttribute(c[j].getAttribute("name"),c[j].getAttribute("value"))}}}obj.parentNode.replaceChild(e,obj)}}function showExpressInstall(regObj){isExpressInstallActive=true;var obj=getElementById(regObj.id);if(obj){if(regObj.altContentId){var ac=getElementById(regObj.altContentId);if(ac){storedAltContent=ac;storedAltContentId=regObj.altContentId}}else{storedAltContent=abstractAltContent(obj)}if(!(/%$/.test(regObj.width))&&parseInt(regObj.width,10)<310){regObj.width="310"}if(!(/%$/.test(regObj.height))&&parseInt(regObj.height,10)<137){regObj.height="137"}doc.title=doc.title.slice(0,47)+" - Flash Player Installation";var pt=ua.ie&&ua.win?"ActiveX":"PlugIn",dt=doc.title,fv="MMredirectURL="+win.location+"&MMplayerType="+pt+"&MMdoctitle="+dt,replaceId=regObj.id;if(ua.ie&&ua.win&&obj.readyState!=4){var newObj=createElement("div");replaceId+="SWFObjectNew";newObj.setAttribute("id",replaceId);obj.parentNode.insertBefore(newObj,obj);obj.style.display="none";var fn=function(){obj.parentNode.removeChild(obj)};addListener(win,"onload",fn)}createSWF({data:regObj.expressInstall,id:EXPRESS_INSTALL_ID,width:regObj.width,height:regObj.height},{flashvars:fv},replaceId)}}function displayAltContent(obj){if(ua.ie&&ua.win&&obj.readyState!=4){var el=createElement("div");obj.parentNode.insertBefore(el,obj);el.parentNode.replaceChild(abstractAltContent(obj),el);obj.style.display="none";var fn=function(){obj.parentNode.removeChild(obj)};addListener(win,"onload",fn)}else{obj.parentNode.replaceChild(abstractAltContent(obj),obj)}}function abstractAltContent(obj){var ac=createElement("div");if(ua.win&&ua.ie){ac.innerHTML=obj.innerHTML}else{var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var c=nestedObj.childNodes;if(c){var cl=c.length;for(var i=0;i<cl;i++){if(!(c[i].nodeType==1&&c[i].nodeName=="PARAM")&&!(c[i].nodeType==8)){ac.appendChild(c[i].cloneNode(true))}}}}}return ac}function createSWF(attObj,parObj,id){var r,el=getElementById(id);if(el){if(typeof attObj.id==UNDEF){attObj.id=id}if(ua.ie&&ua.win){var att="";for(var i in attObj){if(attObj[i]!=Object.prototype[i]){if(i.toLowerCase()=="data"){parObj.movie=attObj[i]}else{if(i.toLowerCase()=="styleclass"){att+=' class="'+attObj[i]+'"'}else{if(i.toLowerCase()!="classid"){att+=" "+i+'="'+attObj[i]+'"'}}}}}var par="";for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par+='<param name="'+j+'" value="'+parObj[j]+'" />'}}el.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+att+">"+par+"</object>";objIdArr[objIdArr.length]=attObj.id;r=getElementById(attObj.id)}else{if(ua.webkit&&ua.webkit<312){var e=createElement("embed");e.setAttribute("type",FLASH_MIME_TYPE);for(var k in attObj){if(attObj[k]!=Object.prototype[k]){if(k.toLowerCase()=="data"){e.setAttribute("src",attObj[k])}else{if(k.toLowerCase()=="styleclass"){e.setAttribute("class",attObj[k])}else{if(k.toLowerCase()!="classid"){e.setAttribute(k,attObj[k])}}}}}for(var l in parObj){if(parObj[l]!=Object.prototype[l]){if(l.toLowerCase()!="movie"){e.setAttribute(l,parObj[l])}}}el.parentNode.replaceChild(e,el);r=e}else{var o=createElement(OBJECT);o.setAttribute("type",FLASH_MIME_TYPE);for(var m in attObj){if(attObj[m]!=Object.prototype[m]){if(m.toLowerCase()=="styleclass"){o.setAttribute("class",attObj[m])}else{if(m.toLowerCase()!="classid"){o.setAttribute(m,attObj[m])}}}}for(var n in parObj){if(parObj[n]!=Object.prototype[n]&&n.toLowerCase()!="movie"){createObjParam(o,n,parObj[n])}}el.parentNode.replaceChild(o,el);r=o}}}return r}function createObjParam(el,pName,pValue){var p=createElement("param");p.setAttribute("name",pName);p.setAttribute("value",pValue);el.appendChild(p)}function removeSWF(id){var obj=getElementById(id);if(obj&&(obj.nodeName=="OBJECT"||obj.nodeName=="EMBED")){if(ua.ie&&ua.win){if(obj.readyState==4){removeObjectInIE(id)}else{win.attachEvent("onload",function(){removeObjectInIE(id)})}}else{obj.parentNode.removeChild(obj)}}}function removeObjectInIE(id){var obj=getElementById(id);if(obj){for(var i in obj){if(typeof obj[i]=="function"){obj[i]=null}}obj.parentNode.removeChild(obj)}}function getElementById(id){var el=null;try{el=doc.getElementById(id)}catch(e){}return el}function createElement(el){return doc.createElement(el)}function addListener(target,eventType,fn){target.attachEvent(eventType,fn);listenersArr[listenersArr.length]=[target,eventType,fn]}function hasPlayerVersion(rv){var pv=ua.pv,v=rv.split(".");v[0]=parseInt(v[0],10);v[1]=parseInt(v[1],10)||0;v[2]=parseInt(v[2],10)||0;return(pv[0]>v[0]||(pv[0]==v[0]&&pv[1]>v[1])||(pv[0]==v[0]&&pv[1]==v[1]&&pv[2]>=v[2]))?true:false}function createCSS(sel,decl){if(ua.ie&&ua.mac){return}var h=doc.getElementsByTagName("head")[0],s=createElement("style");s.setAttribute("type","text/css");s.setAttribute("media","screen");if(!(ua.ie&&ua.win)&&typeof doc.createTextNode!=UNDEF){s.appendChild(doc.createTextNode(sel+" {"+decl+"}"))}h.appendChild(s);if(ua.ie&&ua.win&&typeof doc.styleSheets!=UNDEF&&doc.styleSheets.length>0){var ls=doc.styleSheets[doc.styleSheets.length-1];if(typeof ls.addRule==OBJECT){ls.addRule(sel,decl)}}}function setVisibility(id,isVisible){var v=isVisible?"visible":"hidden";if(isDomLoaded&&getElementById(id)){getElementById(id).style.visibility=v}else{createCSS("#"+id,"visibility:"+v)}}function urlEncodeIfNecessary(s){var regex=/[\\\"<>\.;]/;var hasBadChars=regex.exec(s)!=null;return hasBadChars?encodeURIComponent(s):s}var cleanup=function(){if(ua.ie&&ua.win){window.attachEvent("onunload",function(){var ll=listenersArr.length;for(var i=0;i<ll;i++){listenersArr[i][0].detachEvent(listenersArr[i][1],listenersArr[i][2])}var il=objIdArr.length;for(var j=0;j<il;j++){removeSWF(objIdArr[j])}for(var k in ua){ua[k]=null}ua=null;for(var l in swfobject){swfobject[l]=null}swfobject=null})}}();return{registerObject:function(objectIdStr,swfVersionStr,xiSwfUrlStr){if(!ua.w3cdom||!objectIdStr||!swfVersionStr){return}var regObj={};regObj.id=objectIdStr;regObj.swfVersion=swfVersionStr;regObj.expressInstall=xiSwfUrlStr?xiSwfUrlStr:false;regObjArr[regObjArr.length]=regObj;setVisibility(objectIdStr,false)},getObjectById:function(objectIdStr){var r=null;if(ua.w3cdom){var o=getElementById(objectIdStr);if(o){var n=o.getElementsByTagName(OBJECT)[0];if(!n||(n&&typeof o.SetVariable!=UNDEF)){r=o}else{if(typeof n.SetVariable!=UNDEF){r=n}}}}return r},embedSWF:function(swfUrlStr,replaceElemIdStr,widthStr,heightStr,swfVersionStr,xiSwfUrlStr,flashvarsObj,parObj,attObj){if(!ua.w3cdom||!swfUrlStr||!replaceElemIdStr||!widthStr||!heightStr||!swfVersionStr){return}widthStr+="";heightStr+="";if(hasPlayerVersion(swfVersionStr)){setVisibility(replaceElemIdStr,false);var att={};if(attObj&&typeof attObj===OBJECT){for(var i in attObj){if(attObj[i]!=Object.prototype[i]){att[i]=attObj[i]}}}att.data=swfUrlStr;att.width=widthStr;att.height=heightStr;var par={};if(parObj&&typeof parObj===OBJECT){for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par[j]=parObj[j]}}}if(flashvarsObj&&typeof flashvarsObj===OBJECT){for(var k in flashvarsObj){if(flashvarsObj[k]!=Object.prototype[k]){if(typeof par.flashvars!=UNDEF){par.flashvars+="&"+k+"="+flashvarsObj[k]}else{par.flashvars=k+"="+flashvarsObj[k]}}}}addDomLoadEvent(function(){createSWF(att,par,replaceElemIdStr);if(att.id==replaceElemIdStr){setVisibility(replaceElemIdStr,true)}})}else{if(xiSwfUrlStr&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){isExpressInstallActive=true;setVisibility(replaceElemIdStr,false);addDomLoadEvent(function(){var regObj={};regObj.id=regObj.altContentId=replaceElemIdStr;regObj.width=widthStr;regObj.height=heightStr;regObj.expressInstall=xiSwfUrlStr;showExpressInstall(regObj)})}}},getFlashPlayerVersion:function(){return{major:ua.pv[0],minor:ua.pv[1],release:ua.pv[2]}},hasFlashPlayerVersion:hasPlayerVersion,createSWF:function(attObj,parObj,replaceElemIdStr){if(ua.w3cdom){return createSWF(attObj,parObj,replaceElemIdStr)}else{return undefined}},removeSWF:function(objElemIdStr){if(ua.w3cdom){removeSWF(objElemIdStr)}},createCSS:function(sel,decl){if(ua.w3cdom){createCSS(sel,decl)}},addDomLoadEvent:addDomLoadEvent,addLoadEvent:addLoadEvent,getQueryParamValue:function(param){var q=doc.location.search||doc.location.hash;if(param==null){return urlEncodeIfNecessary(q)}if(q){var pairs=q.substring(1).split("&");for(var i=0;i<pairs.length;i++){if(pairs[i].substring(0,pairs[i].indexOf("="))==param){return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(isExpressInstallActive&&storedAltContent){var obj=getElementById(EXPRESS_INSTALL_ID);if(obj){obj.parentNode.replaceChild(storedAltContent,obj);if(storedAltContentId){setVisibility(storedAltContentId,true);if(ua.ie&&ua.win){storedAltContent.style.display="block"}}storedAltContent=null;storedAltContentId=null;isExpressInstallActive=false}}}}}();return swfobject})();S.lang={code:"en",of:"of",loading:"loading",cancel:"Cancel",next:"Next",previous:"Previous",play:"Play",pause:"Pause",close:"Close",errors:{single:'You must install the <a href="{0}">{1}</a> browser plugin to view this content.',shared:'You must install both the <a href="{0}">{1}</a> and <a href="{2}">{3}</a> browser plugins to view this content.',either:'You must install either the <a href="{0}">{1}</a> or the <a href="{2}">{3}</a> browser plugin to view this content.'}};var pre,proxyId="sb-drag-proxy",dragData,dragProxy,dragTarget;function resetDrag(){dragData={x:0,y:0,startX:null,startY:null}}function updateProxy(){var dims=S.dimensions;apply(dragProxy.style,{height:dims.innerHeight+"px",width:dims.innerWidth+"px"})}function enableDrag(){resetDrag();var style=["position:absolute","cursor:"+(S.isGecko?"-moz-grab":"move"),"background-color:"+(S.isIE?"#fff;filter:alpha(opacity=0)":"transparent")].join(";");S.appendHTML(S.skin.body,'<div id="'+proxyId+'" style="'+style+'"></div>');dragProxy=get(proxyId);updateProxy();addEvent(dragProxy,"mousedown",startDrag)}function disableDrag(){if(dragProxy){removeEvent(dragProxy,"mousedown",startDrag);remove(dragProxy);dragProxy=null}dragTarget=null}function startDrag(e){preventDefault(e);var xy=getPageXY(e);dragData.startX=xy[0];dragData.startY=xy[1];dragTarget=get(S.player.id);addEvent(document,"mousemove",positionDrag);addEvent(document,"mouseup",endDrag);if(S.isGecko){dragProxy.style.cursor="-moz-grabbing"}}function positionDrag(e){var player=S.player,dims=S.dimensions,xy=getPageXY(e);var moveX=xy[0]-dragData.startX;dragData.startX+=moveX;dragData.x=Math.max(Math.min(0,dragData.x+moveX),dims.innerWidth-player.width);var moveY=xy[1]-dragData.startY;dragData.startY+=moveY;dragData.y=Math.max(Math.min(0,dragData.y+moveY),dims.innerHeight-player.height);apply(dragTarget.style,{left:dragData.x+"px",top:dragData.y+"px"})}function endDrag(){removeEvent(document,"mousemove",positionDrag);removeEvent(document,"mouseup",endDrag);if(S.isGecko){dragProxy.style.cursor="-moz-grab"}}S.img=function(obj,id){this.obj=obj;this.id=id;this.ready=false;var self=this;pre=new Image();pre.onload=function(){self.height=obj.height?parseInt(obj.height,10):pre.height;self.width=obj.width?parseInt(obj.width,10):pre.width;self.ready=true;pre.onload=null;pre=null};pre.src=obj.content};S.img.ext=["bmp","gif","jpg","jpeg","png"];S.img.prototype={append:function(body,dims){var img=document.createElement("img");img.id=this.id;img.src=this.obj.content;img.style.position="absolute";var height,width;if(dims.oversized&&S.options.handleOversize=="resize"){height=dims.innerHeight;width=dims.innerWidth}else{height=this.height;width=this.width}img.setAttribute("height",height);img.setAttribute("width",width);body.appendChild(img)},remove:function(){var el=get(this.id);if(el){remove(el)}disableDrag();if(pre){pre.onload=null;pre=null}},onLoad:function(){var dims=S.dimensions;if(dims.oversized&&S.options.handleOversize=="drag"){enableDrag()}},onWindowResize:function(){var dims=S.dimensions;switch(S.options.handleOversize){case"resize":var el=get(this.id);el.height=dims.innerHeight;el.width=dims.innerWidth;break;case"drag":if(dragTarget){var top=parseInt(S.getStyle(dragTarget,"top")),left=parseInt(S.getStyle(dragTarget,"left"));if(top+this.height<dims.innerHeight){dragTarget.style.top=dims.innerHeight-this.height+"px"}if(left+this.width<dims.innerWidth){dragTarget.style.left=dims.innerWidth-this.width+"px"}updateProxy()}break}}};S.iframe=function(obj,id){this.obj=obj;this.id=id;var overlay=get("sb-overlay");this.height=obj.height?parseInt(obj.height,10):overlay.offsetHeight;this.width=obj.width?parseInt(obj.width,10):overlay.offsetWidth};S.iframe.prototype={append:function(body,dims){var html='<iframe id="'+this.id+'" name="'+this.id+'" height="100%" width="100%" frameborder="0" marginwidth="0" marginheight="0" style="visibility:hidden" onload="this.style.visibility=\'visible\'" scrolling="auto"';if(S.isIE){html+=' allowtransparency="true"';if(S.isIE6){html+=" src=\"javascript:false;document.write('');\""}}html+="></iframe>";body.innerHTML=html},remove:function(){var el=get(this.id);if(el){remove(el);if(S.isGecko){delete window.frames[this.id]}}},onLoad:function(){var win=S.isIE?get(this.id).contentWindow:window.frames[this.id];win.location.href=this.obj.content}};S.html=function(obj,id){this.obj=obj;this.id=id;this.height=obj.height?parseInt(obj.height,10):300;this.width=obj.width?parseInt(obj.width,10):500};S.html.prototype={append:function(body,dims){var div=document.createElement("div");div.id=this.id;div.className="html";div.innerHTML=this.obj.content;body.appendChild(div)},remove:function(){var el=get(this.id);if(el){remove(el)}}};S.swf=function(obj,id){this.obj=obj;this.id=id;this.height=obj.height?parseInt(obj.height,10):300;this.width=obj.width?parseInt(obj.width,10):300};S.swf.ext=["swf"];S.swf.prototype={append:function(body,dims){var tmp=document.createElement("div");tmp.id=this.id;body.appendChild(tmp);var height=dims.innerHeight,width=dims.innerWidth,swf=this.obj.content,version=S.options.flashVersion,express=S.path+"expressInstall.swf",flashvars=S.options.flashVars,params=S.options.flashParams;S.flash.embedSWF(swf,this.id,width,height,version,express,flashvars,params)},remove:function(){S.flash.expressInstallCallback();S.flash.removeSWF(this.id)},onWindowResize:function(){var dims=S.dimensions,el=get(this.id);el.height=dims.innerHeight;el.width=dims.innerWidth}};var jwControllerHeight=20;S.flv=function(obj,id){this.obj=obj;this.id=id;this.height=obj.height?parseInt(obj.height,10):300;if(S.options.showMovieControls){this.height+=jwControllerHeight}this.width=obj.width?parseInt(obj.width,10):300};S.flv.ext=["flv","m4v"];S.flv.prototype={append:function(body,dims){var tmp=document.createElement("div");tmp.id=this.id;body.appendChild(tmp);var height=dims.innerHeight,width=dims.innerWidth,swf=S.path+"player.swf",version=S.options.flashVersion,express=S.path+"expressInstall.swf",flashvars=apply({file:this.obj.content,height:height,width:width,autostart:(S.options.autoplayMovies?"true":"false"),controlbar:(S.options.showMovieControls?"bottom":"none"),backcolor:"0x000000",frontcolor:"0xCCCCCC",lightcolor:"0x557722"},S.options.flashVars),params=S.options.flashParams;S.flash.embedSWF(swf,this.id,width,height,version,express,flashvars,params)},remove:function(){S.flash.expressInstallCallback();S.flash.removeSWF(this.id)},onWindowResize:function(){var dims=S.dimensions,el=get(this.id);el.height=dims.innerHeight;el.width=dims.innerWidth}};var overlayOn=false,visibilityCache=[],pngIds=["sb-nav-close","sb-nav-next","sb-nav-play","sb-nav-pause","sb-nav-previous"],container,overlay,wrapper,doWindowResize=true;function animate(el,property,to,duration,callback){var isOpacity=(property=="opacity"),anim=isOpacity?S.setOpacity:function(el,value){el.style[property]=""+value+"px"};if(duration==0||(!isOpacity&&!S.options.animate)||(isOpacity&&!S.options.animateFade)){anim(el,to);if(callback){callback()}return}var from=parseFloat(S.getStyle(el,property))||0;var delta=to-from;if(delta==0){if(callback){callback()}return}duration*=1000;var begin=now(),ease=S.ease,end=begin+duration,time;var interval=setInterval(function(){time=now();if(time>=end){clearInterval(interval);interval=null;anim(el,to);if(callback){callback()}}else{anim(el,from+ease((time-begin)/duration)*delta)}},10)}function setSize(){container.style.height=S.getWindowSize("Height")+"px";container.style.width=S.getWindowSize("Width")+"px"}function setPosition(){container.style.top=document.documentElement.scrollTop+"px";container.style.left=document.documentElement.scrollLeft+"px"}function toggleTroubleElements(on){if(on){each(visibilityCache,function(i,el){el[0].style.visibility=el[1]||""})}else{visibilityCache=[];each(S.options.troubleElements,function(i,tag){each(document.getElementsByTagName(tag),function(j,el){visibilityCache.push([el,el.style.visibility]);el.style.visibility="hidden"})})}}function toggleNav(id,on){var el=get("sb-nav-"+id);if(el){el.style.display=on?"":"none"}}function toggleLoading(on,callback){var loading=get("sb-loading"),playerName=S.getCurrent().player,anim=(playerName=="img"||playerName=="html");if(on){S.setOpacity(loading,0);loading.style.display="block";var wrapped=function(){S.clearOpacity(loading);if(callback){callback()}};if(anim){animate(loading,"opacity",1,S.options.fadeDuration,wrapped)}else{wrapped()}}else{var wrapped=function(){loadi
