dojo.provide("stdlib.behavior.AutoSuggest.SuggestNavigationBehavior");dojo.require("mojo.command.Behavior");dojo.declare("stdlib.behavior.AutoSuggest.SuggestNavigationBehavior",mojo.command.Behavior,{suggestionIndex:-1,suggestion:null,execute:function(H){var E=H.getEvent();var C=38;var G=40;var F=9;var B=H.getParams().suggestions;var A=B.length;if(B[0]&&B[0].innerHTML.indexOf("!{suggestion}")!=-1){A=0}this.suggestionIndex=-1;for(var D=0;D<A;D++){if(dojo.hasClass(B[D],"selected")){this.suggestionIndex=D;break}}if(E&&E.which){E=E;characterCode=E.which}else{E=event;characterCode=E.keyCode}if(A>0){switch(characterCode){case C:this.suggestionIndex--;if(this.suggestionIndex<0){this.suggestionIndex=A-1}this.suggestion=B[this.suggestionIndex];this.onNav();break;case G:this.suggestionIndex++;if(this.suggestionIndex>=A){this.suggestionIndex=0}this.suggestion=B[this.suggestionIndex];this.onNav();break}}},onNav:function(){}});dojo.provide("stdlib.behavior.CheckBoxSelectionBehavior");dojo.require("mojo.command.Behavior");dojo.declare("stdlib.behavior.CheckBoxSelectionBehavior",mojo.command.Behavior,{execute:function(E){var D=E.getParams(),C=D.element;if(!dojo.isArray(D.element)){C=[D.element]}for(var B=0,A=C.length;B<A;B++){if(D.checked){C[B].checked=true}else{C[B].checked=false}}}});dojo.provide("stdlib.behavior.ClearFormBehavior");dojo.require("mojo.command.Behavior");dojo.declare("stdlib.behavior.ClearFormBehavior",mojo.command.Behavior,{execute:function(A){var B=A.getParams();var I=A.contextObj;var J=false;var C=false;var E=false;if(!B){B={}}if(B.noload!=null){J=B.noload}if(B.formSet!=null){I=B.formSet}if(B.clearHidden!=null){C=B.clearHidden}if(B.clearImages!=null){E=B.clearImages}if(!J){var F=mojo.query("input",I);for(var D=0;D<F.length;D++){switch(F[D].type){case"hidden":if(C){F[D].value=""}break;case"image":if(E){F[D].value=""}break;case"checkbox":if(F[D].checked){F[D].checked=false}break;case"radio":if(F[D].checked){F[D].checked=false}break;case"button":break;case"submit":break;default:F[D].value=""}}var H=mojo.query("textarea",I);for(var D=0;D<H.length;D++){H[D].value=""}var G=mojo.query("select",I);for(var D=0;D<G.length;D++){G[D].selectedIndex=0}}}});dojo.provide("stdlib.behavior.DisableBoxBehavior");dojo.require("mojo.command.Behavior");dojo.declare("stdlib.behavior.DisableBoxBehavior",mojo.command.Behavior,{_box:null,execute:function(D){var C=D.getParams();if(!this._box){this._box=mojo.queryFirst("#disablebox");if(!this._box){this._box=document.createElement("div");this._box.id="disablebox";document.body.appendChild(this._box);this._box.style.position="absolute"}}this._box.innerHTML="";if(D.getParams().show){var A=document.createElement("div");A.className=C.throbberClass||"throbber";if(D.getParams().target){var B=dojo.position(D.getParams().target,true);this._box.style.top=B.y+"px";this._box.style.left=B.x+"px";this._box.style.width=B.w+"px";this._box.style.height=B.h+"px";A.style.left=((B.w/2)-16)+"px";A.style.top=((B.h/2)-16)+"px";this._box.appendChild(A)}else{var B={h:0,w:0};this._box.style.top="0px";this._box.style.left="0px";this._box.style.width="100%";this._box.style.height=(document.all)?document.body.offsetHeight+"px":"100%";A.style.left=((B.w/2)-16)+"px";A.style.top=((B.h/2)-16)+"px";this._box.appendChild(A)}this._box.style.zIndex="9999";this._box.style.display="block"}else{this._box.style.display="none"}}});dojo.provide("stdlib.behavior.DragBehavior");dojo.require("mojo.command.Behavior");dojo.declare("stdlib.behavior.DragBehavior",mojo.command.Behavior,{selectedIndex:0,execute:function(A){var G=A.getParams();var O=A.eventObj,F=G.element,H=dojo.position(F),P=G.draggable,C=G.container,L=dojo.position(C),D=G.orientation,J=G.tickSize,M,I,B,K;if(D=="vertical"){M="y";I="h";B="top";if(typeof G.position!="undefined"&&!isNaN(parseInt(G.position))){K=G.position+L[M]}else{K=O.clientY}}else{M="x";I="w";B="left";if(typeof G.position!="undefined"&&!isNaN(parseInt(G.position))){K=G.position+L[M]}else{K=O.clientX}}var N=L[M]+L[I]-H[I];if(K>=N){F.style[B]=(L[I]-H[I]-3)+"px"}else{if(K<=L[M]+1){F.style[B]=0+"px"}else{if(J){var E=(K-L[M]);this.selectedIndex=Math.round(E/J);F.style[B]=this.selectedIndex*J+"px"}else{F.style[B]=(K-L[M])+"px"}}}}});dojo.provide("stdlib.behavior.EnterKeyBehavior");dojo.require("mojo.command.Behavior");dojo.declare("stdlib.behavior.EnterKeyBehavior",mojo.command.Behavior,{execute:function(C){var B=C.eventObj;var A;if(B&&B.which){B=B;A=B.which}else{B=event;A=B.keyCode}if(A==13){this.onResponse();return false}else{return true}},onResponse:function(){}});dojo.provide("stdlib.behavior.FilterDropdownBehavior");dojo.require("mojo.command.Behavior");dojo.declare("stdlib.behavior.FilterDropdownBehavior",mojo.command.Behavior,{_optionsStorage:{},execute:function(H){var E=H.getParams();var G=E.selectObj;var F=E.filterClass;var B=E.minoption;if(E.minoption=="undefined"){B=0}else{B=-1}if(!G){return }var D=(G.name||G.id);if(typeof (this._optionsStorage[D])=="undefined"){this._optionsStorage[D]=[];for(var A=0;A<G.options.length;A++){this._optionsStorage[D][A]=G.options[A]}}for(var A=G.options.length-1;A>B;A--){G.removeChild(G.options[A])}for(var A=0;A<this._optionsStorage[D].length;A++){var C=this._optionsStorage[D][A];if(C.className.indexOf(F)>=0){G.appendChild(C)}}if(G.options.length>0&&F.length>0){G.selectedIndex=0}}});dojo.provide("stdlib.behavior.InsertHtmlBehavior");dojo.require("mojo.command.Behavior");dojo.declare("stdlib.behavior.InsertHtmlBehavior",mojo.command.Behavior,{execute:function(G){var D=G.getParams().element;var F=G.getParams().action;var B=G.getParams().insertHtml;if(D&&F){if(!dojo.isArray(D)){D=[D]}elmsLength=D.length;for(var C=0;C<elmsLength;C++){elm=D[C];isIE=elm["insertAdjacentHTML"];var E=B;if(!isIE&&typeof B=="string"){if(B.length==0){F="empty"}else{var A=elm.ownerDocument.createRange();A.setStartBefore(elm);E=A.createContextualFragment(B)}}if(F.length>0){switch(F){case"empty":elm.innerHTML="";break;case"before":if(isIE){elm.insertAdjacentHTML("beforeBegin",B)}else{elm.parentNode.insertBefore(E,elm)}break;case"after":if(isIE){elm.insertAdjacentHTML("afterEnd",B)}else{if(elm.nextSibling){elm.parentNode.insertBefore(E,elm.nextSibling)}else{elm.parentNode.appendChild(E)}}break;case"prepend":if(isIE){elm.insertAdjacentHTML("afterBegin",B)}else{elm.insertBefore(E,elm.firstChild)}break;case"append":if(isIE){elm.insertAdjacentHTML("beforeEnd",B)}else{elm.appendChild(E)}break;case"replace":if(isIE){elm.innerHTML=B}else{elm.innerHTML="";elm.appendChild(E)}break}}}}}});dojo.provide("stdlib.behavior.InvokeFlashInterfaceBehavior");dojo.require("mojo.command.Behavior");dojo.declare("stdlib.behavior.InvokeFlashInterfaceBehavior",mojo.command.Behavior,{execute:function(G){var F=G.getParams();if(F.playerName){var C=F.playerName;var E=F.playerMethod;var B=F.playerArguments;var A=document[C];if(A){try{A[E](B)}catch(D){}}}}});dojo.provide("stdlib.behavior.MessagingBehavior");dojo.require("mojo.command.Behavior");dojo.declare("stdlib.behavior.MessagingBehavior",mojo.command.Behavior,{execute:function(A){mojo.Messaging.publish(A.paramsObj.topic,A.paramsObj.message)}});dojo.provide("stdlib.behavior.PopulateDateBehavior");dojo.require("mojo.command.Behavior");dojo.declare("stdlib.behavior.PopulateDateBehavior",mojo.command.Behavior,{months:["January","February","March","April","May","June","July","August","September","October","November","December"],execute:function(A){var C=A.getParams(),B=C.month,I=C.year,L=1920,F=C.year+50;var J=mojo.queryFirst("select.date-year",C.target);var K=mojo.queryFirst("select.date-month",C.target);J.innerHTML="";K.innerHTML="";for(var D=L;D<F;D++){var E=new Option(D.toString(),D);if(D==I){E.selected=true}J.options.add(E)}for(var D=0,H=this.months.length;D<H;D++){var M=this.months[D];var G=(D<=8)?"0"+(D+1):D+1;var E=new Option(M,G);if(D==B){E.selected=true}K.options.add(E)}}});dojo.provide("stdlib.behavior.PopulateDaysBehavior");dojo.require("mojo.command.Behavior");dojo.declare("stdlib.behavior.PopulateDaysBehavior",mojo.command.Behavior,{daysInMonth:function(B,A){return(new Date(A,B,0)).getDate()},execute:function(G){var F=G.getParams();if(!F.day){F.day=(new Date()).getDate()}var D=F.target;D.innerHTML="";var A=this.daysInMonth(F.month,F.year);for(var B=1;B<=A;B++){var E=(B<=9)?"0"+(B):B;var C=new Option(B,E);if(B==F.day){C.selected=true}D.options.add(C)}}});dojo.provide("stdlib.behavior.PreventDefaultEventBehavior");dojo.require("mojo.command.Command");dojo.declare("stdlib.behavior.PreventDefaultEventBehavior",mojo.command.Command,{execute:function(B){try{var A=B.eventObj;dojo.stopEvent(A)}catch(A){}}});dojo.provide("stdlib.behavior.RedirectBehavior");dojo.require("mojo.command.Behavior");dojo.declare("stdlib.behavior.RedirectBehavior",mojo.command.Behavior,{execute:function(E){var D=E.getParams();var C=25;if(D){var B=D.url;var A=D.removeHash||false;var C=D.delay||25}if(!B){if(A){window.location=window.location.href.replace(/#.*/,"");setTimeout("window.location.reload()",750)}else{window.location.reload()}}else{setTimeout(function(){window.location.href=B},C)}}});dojo.provide("stdlib.behavior.RefreshBehavior");dojo.require("mojo.command.Behavior");dojo.declare("stdlib.behavior.RefreshBehavior",mojo.command.Behavior,{execute:function(A){if(A.getParams()){if(A.getParams().removeHash){window.location=window.location.href.replace(/#.*/,"");setTimeout("window.location.reload()",750)}}else{window.location.reload()}}});dojo.provide("stdlib.behavior.RemoveElementsBehavior");dojo.declare("stdlib.behavior.RemoveElementsBehavior",mojo.command.Behavior,{execute:function(G){var A;var C;var E;var F;var D=G.paramsObj;if(D){if(D.className!=null){A=D.className}if(D.targetId!=null){C=D.targetId}if(D.target!=null){E=D.target}}if((A!=null)&&(C!=null||E!=null)){if(C&&!E){if(C.indexOf("#")!=0){C="#"+C}E=mojo.queryFirst(C)}F=mojo.query(A,E);if(F){if(F.length>0){for(var B=0;B<F.length;B++){if((F[B])&&(F[B].parentNode)){F[B].parentNode.removeChild(F[B])}}}else{if((F)&&(F.parentNode)){F.parentNode.removeChild(F)}}}}}});dojo.provide("stdlib.behavior.SetHistoryBehavior");dojo.require("mojo.command.Behavior");dojo.require("mojo.History");dojo.declare("stdlib.behavior.SetHistoryBehavior",mojo.command.Behavior,{execute:function(E){if(E.getParams()){var A;var B=mojo.History.getInstance();var D=E.getParams();if(D){if(typeof D.clearHash!="undefined"){if(D.clearHash){window.location.hash="#"}}else{var C=B._parseObj(D);mojo.History.getInstance().setHash(C)}}}}});dojo.provide("stdlib.behavior.SubmitFormBehavior");dojo.require("mojo.command.Behavior");dojo.declare("stdlib.behavior.SubmitFormBehavior",mojo.command.Behavior,{execute:function(B){var A=B.getParams();if(A&&A.form){if(A.form.tagName.toLowerCase()!="form"){A.form=mojo.queryFirst("form",A.form)}A.form.submit()}}});dojo.provide("stdlib.behavior.SwfObjectBehavior");dojo.require("mojo.command.Behavior");dojo.declare("stdlib.behavior.SwfObjectBehavior",mojo.command.Behavior,{execute:function(C){var B=C.getParams();if(!deconcept.SWFObject){throw new Error("ERROR stdlib.behavior.SwfObjectBehavior.execute - SWFObject library cannot be found")}if(!B.elementId){throw new Error("ERROR stdlib.behavior.SwfObjectBehavior.execute - elementId is not set")}if(!B.src){throw new Error("ERROR stdlib.behavior.SwfObjectBehavior.execute - src is not set")}if(!B.containerId){throw new Error("ERROR stdlib.behavior.SwfObjectBehavior.execute - containerId is not set")}if(!B.width||!B.height){throw new Error("ERROR stdlib.behavior.SwfObjectBehavior.execute - width and/or height is not set")}if(!B.contentName){B.contentName="flash_module"}if(!B.version){B.version=9}if(!B.defaultBackground){B.defaultBackground="#fff"}if(!B.wmode){B.wmode="window"}var A=new SWFObject(B.src,B.contentName,B.width,B.height,B.version,B.defaultBackground);if(B.expressInstallSrc){A.useExpressInstall(B.expressInstallSrc)}A.addParam("base",B.basePath);A.addParam("wmode",B.wmode);A.addParam("allowFullScreen",B.allowFullScreen);A.addParam("allowScriptAccess",B.allowScriptAccess);A.addParam("flashvars",B.flashvars);A.write(B.elementId)}});dojo.provide("stdlib.behavior.TweenBehavior");dojo.require("mojo.command.Behavior");dojo.declare("stdlib.behavior.TweenBehavior",mojo.command.Behavior,{onComplete:function(){},onStart:function(){},_effect:null,execute:function(H){var C={};var F;if(H.getParams().width!=null){C.width=H.getParams().width}if(H.getParams().height!=null){C.height=H.getParams().height}if(dojo.isIE<7&&C.height==0){C.height=1}if(H.getParams().x!=null){C.left=H.getParams().x}if(H.getParams().y!=null){C.top=H.getParams().y}if(H.getParams().duration!=null){F=H.getParams().duration}else{F=600}var E=H.getParams().element;if(!dojo.isArray(E)){E=[E]}var A=E.length;var G=this;for(var B=0;B<A;B++){if(E[B]){if(E[B].style.height=="auto"&&C.height!=null){E[B].style.height=dojo.position(E[B]).h+"px"}var D=new Fx.Styles(E[B],{duration:F,transition:Fx.Transitions.Expo.easeInOut,onStart:function(){G.onStart();if(dojo.isIE<7&&this.from.height=="1"){this.element.style.display="block"}},onComplete:function(){if(dojo.isIE<7&&this.to.height=="1"){this.element.style.display="none"}if((this.from.height=="0")||(this.from.height=="1")){this.element.style.height="auto"}if(this.element.style.height=="auto"&&this.to.height>0&&dojo.position(this.element).h==0){this.element.style.height=this.to.height+"px"}G.onComplete()}});this._effect=D;D.start(C)}}}});dojo.provide("stdlib.behavior.UpdateCssClassBehavior");dojo.require("mojo.command.Behavior");dojo.declare("stdlib.behavior.UpdateCssClassBehavior",mojo.command.Behavior,{execute:function(H){if(!H.paramsObj){return }var E;var F=H.paramsObj.element;var G=H.paramsObj.action;var B=H.paramsObj.cssClass;if(!F){return }else{if(typeof F=="object"){if(dojo.isArray(F)&&F.length>0){for(var D=0;D<F.length;D++){if(typeof F[D]!="object"){throw new Error("ERROR stdlib.behavior.UpdateCssClassBehavior - element parameter is not an array of type Object");break}}}}else{throw new Error("ERROR stdlib.behavior.UpdateCssClassBehavior - element parameter is not a type Object")}}if(G==null||typeof G=="undefined"){throw new Error("ERROR stdlib.behavior.UpdateCssClassBehavior - action parameter is required")}else{if(typeof G!="string"){throw new Error("ERROR stdlib.behavior.UpdateCssClassBehavior - action parameter is not a type String")}else{if((G!="add")&&(G!="remove")&&(G!="set")&&(G!="toggle")){throw new Error("ERROR stdlib.behavior.UpdateCssClassBehavior - action parameter is invalid")}}}if(B==null||typeof B=="undefined"){throw new Error("ERROR stdlib.behavior.UpdateCssClassBehavior - CssClass parameter is required")}else{if(typeof B=="object"){if(B.length>0){for(var D=0;D<B.length;D++){if(typeof B[D]!="string"){throw new Error("ERROR stdlib.behavior.UpdateCssClassBehavior - CssClass parameter is not an array of type String");break}}}}else{if(typeof B!="string"){throw new Error("ERROR stdlib.behavior.UpdateCssClassBehavior - CssClass parameter is not a type String")}}}if(F){var A=function(I){if(!I.constructor||I.constructor.toString().toLowerCase().indexOf("array")==-1){return false}return true};if(!A(F)){F=[F]}if(!A(B)){B=[B]}cssLength=B.length;E=F.length;for(var D=0;D<E;D++){elm=F[D];for(var C=0;C<cssLength;C++){css=B[C];if(G.length>0){switch(G){case"add":dojo.addClass(elm,css);break;case"remove":dojo.removeClass(elm,css);break;case"set":elm.className="";dojo.addClass(elm,css);break;case"toggle":dojo.toggleClass(elm,css);break}}}}}},onResponse:function(){}});dojo.provide("stdlib.behavior.UpdateFormFieldBehavior");dojo.require("mojo.command.Behavior");dojo.declare("stdlib.behavior.UpdateFormFieldBehavior",mojo.command.Behavior,{execute:function(R){var F;var C=new Array();var B=new Array();var K=["INPUT","SELECT","TEXTAREA"];var Q=R.getParams();if(!Q){Q={}}var I=Q.fields;if(Q.formId!=null){F=mojo.queryFirst("#"+Q.formId)}if(Q.formObj!=null){F=Q.formObj}if(F){for(var O=0,M=K.length;O<M;O++){var D=mojo.query(K[O],F);for(var N=0,P=D.length;N<P;N++){C.push(D[N])}}for(var O=0,M=I.length;O<M;O++){var E=I[O].name;var S=I[O].value;for(var N=0,P=C.length;N<P;N++){var J=false;if(C[N].tagName.toUpperCase()=="SELECT"){if(C[N].name==E){for(var L=0,A=C[N].options.length;L<A;L++){var H=C[N].options[L];if(H.value==S){C[N].selectedIndex=L}}}}else{if(C[N].tagName.toUpperCase()=="TEXTAREA"){if(C[N].name==E){if(C[N].value==S){J=true}if(C[N].innerHTML==S){J=true}C[N].value=S;C[N].innerHTML=S}}else{if(C[N].tagName.toUpperCase()=="INPUT"){if(C[N].name==E){if((C[N].type=="radio")||(C[N].type=="checkbox")){if(C[N].value==S){C[N].checked="checked"}else{C[N].checked=""}}else{if((C[N].type=="text")||(C[N].type=="password")||(C[N].type=="hidden")){if(C[N].value!=S){J=true}C[N].value=S}}}}}}if(J){if(C[N].fireEvent){C[N].fireEvent("onchange")}if(document.createEvent){var G=document.createEvent("HTMLEvents");if(G.initEvent){G.initEvent("change",true,true)}if(C[N].dispatchEvent){C[N].dispatchEvent(G)}}}}}}}});dojo.provide("stdlib.behavior.dialog.DialogBehavior");dojo.require("mojo.command.Behavior");dojo.declare("stdlib.behavior.dialog.DialogBehavior",mojo.command.Behavior,{onComplete:function(){},onDataReady:function(){},_onDataReady:function(E){this.onDataReady();var C=mojo.queryFirst(E.elContent);var B=mojo.queryFirst(E.elContainer);var D=mojo.queryFirst(E.elTitle);var A=mojo.query("embed, object");D.innerHTML=E.title;if(dojo.isFF&&(navigator.appVersion.indexOf("Mac")!=-1)){this.hideFlash(A)}B.style.visibility="";this.onComplete()},execute:function(A){var F=A.getParams();if(!F.elContainer){F.elContainer=".dialog-component"}if(!F.elContent){F.elContent=".dialog-component-content"}if(!F.elTitle){F.elTitle=".dialog-component-title"}var J=mojo.query("embed, object");var D=mojo.queryFirst("#underlay");if(!D){D=document.createElement("div");D.id="underlay";if(dojo.isIE==6){var H=document.createElement("iframe");D.appendChild(H)}document.body.appendChild(D);D.style.display="block"}var B=mojo.queryFirst(F.elContainer);if(!B){throw new Error("stdlib.behavior.dialog.DialogBehavior - Unable to find the Dialog template");return }var K=mojo.queryFirst(F.elContent);var M=mojo.queryFirst(F.elTitle);var C=this;if(F.enabled&&F.width&&F.height){B.style.width=F.width+"px";B.style.height=(F.height==-1)?"auto":F.height+"px";B.style.display="block";D.style.display="block";B.style.visibility="hidden";if(F.href){dojo.xhrGet({url:F.href,load:function(S){K.innerHTML=S;if(F.substitutionMap){for(var Q in F.substitutionMap){var R=dojo.query(Q,K);for(i=0;i<R.length;i++){R[i].innerHTML=F.substitutionMap[Q]}}}C._onDataReady(F)}})}else{if(F.xhrPost){var E=(typeof (F.xhrTimeout)!="undefined")?F.xhrTimeout:"20000";dojo.xhrPost({url:F.xhrPost,form:F.form,timeout:E,load:function(Q){K.innerHTML=Q;C._onDataReady(F)},error:function(){K.innerHTML="<div class='msgError'><p>We're unable to load this content.</p></div>";C._onDataReady(F)}})}else{if(F.id){var G=mojo.queryFirst(F.id);K.innerHTML=G.innerHTML;C._onDataReady(F)}else{if(F.element){K.style.height=(F.height==-1)?"auto":(F.height-52)+"px";F.element.origParent=F.element.parentNode;var P=dojo.position(F.element.parentNode);F.element.origParent.style.height=P.h+"px";var L=document.createElement("div");L.className="hide";L.id="dialog-return-breadcrumb";F.element.parentNode.insertBefore(L,F.element);K.appendChild(F.element);if(F.substitutionMap){for(var O in F.substitutionMap){var I=dojo.query(O,K);for(i=0;i<I.length;i++){I[i].innerHTML=F.substitutionMap[O]}}}C._onDataReady(F)}else{if(F.scriptText){K.innerHTML=F.text;C._onDataReady(F)}else{K.innerHTML="<div class='msgError'><p>We're unable to load this content.</p></div>";C._onDataReady(F);throw new Error("stdlib.behavior.dialog.DialogBehavior - Unable to find the Dialog content")}}}}}if(dojo.isIE){mojo.queryFirst("html").style.overflowX="hidden"}else{document.body.style.overflowX="hidden"}}else{if(K.firstChild&&K.firstChild.origParent){var N=K.firstChild.origParent;N.replaceChild(K.firstChild,document.getElementById("dialog-return-breadcrumb"));N.style.height="";N.style.width=""}if(dojo.isFF&&(navigator.appVersion.indexOf("Mac")!=-1)){this.showFlash(J)}K.innerHTML="";K.style.height="";D.style.display="none";B.style.display="none";if(dojo.isIE){mojo.queryFirst("html").style.overflowX="auto"}else{document.body.style.overflowX="auto"}}},hideFlash:function(C){for(var B=0,A=C.length;B<A;B++){C[B].style.display="none"}},showFlash:function(C){for(var B=0,A=C.length;B<A;B++){C[B].style.display="block"}}});dojo.provide("stdlib.behavior.dialog.EscapeKeyBehavior");dojo.require("mojo.command.Behavior");dojo.declare("stdlib.behavior.dialog.EscapeKeyBehavior",mojo.command.Behavior,{execute:function(C){var B=C.eventObj;var A;if(B&&B.which){B=B;A=B.which}else{B=event;A=B.keyCode}if(A==27){this.onResponse();return false}else{return true}},onResponse:function(){}});dojo.provide("stdlib.behavior.dialog.PositionBehavior");dojo.require("mojo.command.Behavior");dojo.declare("stdlib.behavior.dialog.PositionBehavior",mojo.command.Behavior,{execute:function(A){var F=A.getParams();var C=mojo.queryFirst("#underlay");var B=mojo.queryFirst(".dialog-component");var I=mojo.queryFirst(".dialog-component .dialog-component-content");if(!B||!C||!I){return }var D={};var L=0;if(typeof window.innerWidth!="undefined"){D.w=window.innerWidth;D.h=window.innerHeight;L=window.pageYOffset+window.innerHeight}else{if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0){D.w=document.documentElement.clientWidth,D.h=document.documentElement.clientHeight;L=document.documentElement.scrollTop+document.documentElement.clientHeight}else{D.w=document.body.clientWidth;D.h=document.body.clientHeight;L=document.body.scrollTop+document.body.clientHeight}}C.style.width=D.w+"px";C.style.height=(dojo.position(mojo.queryFirst("body"),true)).h+"px";var J=dojo.position(B,true);var K=dojo.position(I,true);var E=Math.round(L-(D.h/2)-(J.h/2));var G=Math.round((D.w/2)-(J.w/2));B.style.top=E+"px";B.style.left=G+"px";var H;if(H=mojo.queryFirst("iframe",C)){H.style.top=B.style.top;H.style.left=B.style.left;H.style.width=J.w+"px";H.style.height=J.h+"px"}}});dojo.provide("stdlib.command.AutoSuggest.GetSuggestionsCommand");dojo.require("mojo.command.Command");dojo.require("mojo.Model");dojo.declare("stdlib.command.AutoSuggest.GetSuggestionsCommand",mojo.command.Command,{inputValue:null,_clearTimeout:null,_lastValue:null,execute:function(requestObj){if(requestObj.getParams().inputValue){this.inputValue=requestObj.getParams().inputValue.replace(/\s*$/g,"");clearTimeout(this._clearTimeout);if(this.inputValue.length>0){var thisObj=this;dojo.require(requestObj.getParams().serviceLocator);this._clearTimeout=setTimeout(function(){var locator=eval(requestObj.getParams().serviceLocator);locator.getInstance().getService(requestObj.getParams().serviceName).invoke({inputValue:thisObj.inputValue},thisObj)},400)}else{mojo.Model.remove(requestObj.getParams().model)}}},onResponse:function(E){var J=(this.getRequest().getParams().inputValue).length;var C=(this.getRequest().getParams().modelPath)?"."+this.getRequest().getParams().modelPath:"";var I=(this.getRequest().getParams().maxSuggestions);var F=E[this.getRequest().getParams().modelPath];var H=[];for(i=0;i<F.length;i++){if(F[i].suggestion.test("^"+this.inputValue,"i")){var A=F[i].suggestion.substring(0,J);var G=F[i].suggestion.substring(J,F[i].suggestion.length);if(H.length<I){H.push(F[i]);F[i].suggestionFormatted="<strong>"+A+"</strong>"+G}}}if(H.length<1){mojo.Model.remove(this.getRequest().getParams().model,H)}else{mojo.Model.set(this.getRequest().getParams().model,H)}},onError:function(A){}});dojo.provide("stdlib.command.ClearModelCommand");dojo.require("mojo.Model");dojo.declare("stdlib.command.ClearModelCommand",mojo.command.Command,{execute:function(C){var A=C.paramsObj.model;if(A==null||typeof A=="undefined"){throw new Error("ERROR stdlib.command.ClearModelCommand - model parameter is required")}else{if(typeof A=="array"||typeof A=="object"){if(A.length>0){for(var B=0;B<A.length;B++){if(typeof A[B]!="string"){throw new Error("ERROR stdlib.command.ClearModelCommand - model parameter is not an array of type String");break}}}}else{if(typeof A=="string"){if(A==""){throw new Error("ERROR stdlib.command.ClearModelCommand - model parameter must be a non-empty string")}}else{throw new Error("ERROR stdlib.command.ClearModelCommand - model parameter is not a type String")}}}if(A){if(typeof (A)=="string"){A=[A]}if(dojo.isArray(A)){for(B=0;B<A.length;B++){mojo.Model.remove(A[B])}}}}});dojo.provide("stdlib.command.GenericServiceCommand");dojo.require("mojo.command.Command");dojo.declare("stdlib.command.GenericServiceCommand",mojo.command.Command,{_model:null,execute:function(requestObj){var params=requestObj.getParams();if(!params){console.log("stdlib.command.GenericServiceCommand - Warning - No params passed.")}this._model=params.model;dojo.require(params.serviceLocator);(eval(params.serviceLocator)).getInstance().getService(params.serviceName).invoke(params.serviceParams,this)},onResponse:function(A){if(this._model){mojo.Model.set(this._model,A)}},onError:function(A){if(this._model){mojo.Model.set(this._model+".errors",A)}}});dojo.provide("stdlib.command.InsertIntoModelCommand");dojo.require("mojo.command.Command");dojo.require("mojo.Model");dojo.declare("stdlib.command.InsertIntoModelCommand",mojo.command.Command,{execute:function(A){var C;var F;var I;var E;var H=false;var G=A.getParams();if(!G){G={}}if(G.model!=null){C=G.model}if(G.index!=null){F=G.index}if(G.value!=null){I=G.value}if(C==null||typeof C=="undefined"){throw new Error("ERROR stdlib.command.InsertIntoModelCommand - model parameter is required")}else{if(C==""){throw new Error("ERROR stdlib.command.InsertIntoModelCommand - model parameter must be a non-empty string")}if(typeof C!="string"){throw new Error("ERROR stdlib.command.InsertIntoModelCommand - model parameter must be type String")}else{if(!mojo.Model.contains(C)){throw new Error("ERROR stdlib.command.InsertIntoModelCommand - specified model does not exist")}else{E=mojo.Model.get(C).length;if(typeof E!="number"){throw new Error("ERROR stdlib.command.InsertIntoModelCommand - specified model must be type Array")}}}}if(I==null||typeof I=="undefined"){throw new Error("ERROR stdlib.command.InsertIntoModelCommand - value is not set")}if(F!=null){if(typeof F!="number"){throw new Error("ERROR stdlib.command.InsertIntoModelCommand - index parameter must be type Number")}else{}}var B=mojo.Model.get(C);if(B.length!=0){if(typeof F=="undefined"||F<0||F>=B.length){var D=B.length}else{var D=F}}else{var D=0}if(B.length==0){mojo.Model.add(C,I)}else{if(D==B.length-1){mojo.Model.add(C,I)}else{B.splice(D,0,I);mojo.Model.set(C,B)}}},onResponse:function(A){},onError:function(A){}});dojo.provide("stdlib.command.MapControllersCommand");dojo.require("mojo.command.Command");dojo.declare("stdlib.command.MapControllersCommand",mojo.command.Command,{execute:function(B){var A=null;if(B.getParams()){A=B.getParams().contextObj}mojo.controller.Map.mapControllers(A)}});dojo.provide("stdlib.command.PaginationCommand");dojo.require("mojo.command.Command");dojo.declare("stdlib.command.PaginationCommand",mojo.command.Command,{model:"paginationState",execute:function(E){if(E.getParams().model!=null){this.model=E.getParams().model}mojo.Model.remove(this.model);if(typeof E.getParams().pageSize!="undefined"&&typeof E.getParams().total!="undefined"){if(E.getParams().pageSize<=0||E.getParams().total<=0){mojo.Model.set(this.model,{pageIndex:0,pageSize:0,total:0,from:0,to:0,pageNext:-1,pagePrev:-1,pageTotal:0,pages:[]})}else{var C={};C.pageSize=E.getParams().pageSize;C.total=E.getParams().total;C.pageIndex=0;if(E.getParams().pageIndex&&E.getParams().pageIndex>0){C.pageIndex=parseInt(E.getParams().pageIndex)}C.pageTotal=Math.ceil(C.total/C.pageSize);if(C.pageIndex>C.pageTotal){return }C.from=(C.pageSize*C.pageIndex)+1;C.to=C.pageSize*(C.pageIndex+1);if(C.to>C.total){C.to=C.total}C.pageNext=((C.pageIndex+1)>=C.pageTotal)?-1:(C.pageIndex+1);C.pagePrev=(C.pageIndex==0)?-1:(C.pageIndex-1);C.showPages=8;if(E.getParams().showPages&&E.getParams().showPages>0){C.showPages=E.getParams().showPages}var A=Math.ceil(C.showPages/2);var D=0;if((C.pageIndex-A)>0){D=C.pageIndex-A;if(D>0&&(C.pageTotal-C.pageIndex)<A){D=D-(A-(C.pageTotal-C.pageIndex));if(D<=0){D=0}}}C.pages=[];for(var B=D;B<(D+C.showPages);B++){if(B<C.pageTotal){C.pages.push(B+1)}}mojo.Model.set(this.model,C)}}}});dojo.provide("stdlib.command.RemoveFromModelCommand");dojo.require("mojo.command.Command");dojo.require("mojo.Model");dojo.declare("stdlib.command.RemoveFromModelCommand",mojo.command.Command,{execute:function(A){var E;var G;var K;var J;var D=true;var F;var I=false;var C=false;var H=A.getParams();if(!H){H={}}if(H.model!=null){E=H.model}if(H.index!=null){G=H.index}if(H.value!=null){J=H.value}if(H.key!=null){K=H.key}if(H.firstOnly!=null){D=H.firstOnly}if(E==null||typeof E=="undefined"){throw new Error("ERROR stdlib.command.RemoveFromModelCommand - model parameter is required")}else{if(E==""){throw new Error("ERROR stdlib.command.RemoveFromModelCommand - model parameter must be a non-empty string")}else{if(typeof E!="string"){throw new Error("ERROR stdlib.command.RemoveFromModelCommand - model parameter must be type String")}else{if(!mojo.Model.contains(E)){throw new Error("ERROR stdlib.command.RemoveFromModelCommand - specified model does not exist")}else{F=mojo.Model.get(E).length;if(typeof F!="number"){throw new Error("ERROR stdlib.command.RemoveFromModelCommand - specified model must be type Array")}}}}}if(G==null||typeof G=="undefined"){if((K==null||typeof K!="string"||K=="")||(J==null||typeof J=="undefined"||J=="")){if(K==null||typeof K=="undefined"){throw new Error("ERROR stdlib.command.RemoveFromModelCommand - either [index] parameter or [key and value] parameters are required")}else{if(K==""){throw new Error("ERROR stdlib.command.RemoveFromModelCommand - key parameter must be a non-empty string")}else{if(typeof K!="string"){throw new Error("ERROR stdlib.command.RemoveFromModelCommand - key parameter must be type String")}else{if(J==null||typeof J=="undefined"){throw new Error("ERROR stdlib.command.RemoveFromModelCommand - either [index] parameter or [key and value] parameters are required")}}}}}}else{if((K!=null)&&(typeof K!="undefined")&&(K=="")){throw new Error("ERROR stdlib.command.RemoveFromModelCommand - key parameter must be a non-empty string")}if(typeof G!="number"){throw new Error("ERROR stdlib.command.RemoveFromModelCommand - index parameter must be type Number")}else{if(G<0){throw new Error("ERROR stdlib.command.RemoveFromModelCommand - index parameter cannot be less than zero")}else{if(mojo.Model.contains(E)){if(G>=mojo.Model.get(E).length){throw new Error("ERROR stdlib.command.RemoveFromModelCommand - index parameter is out of bounds")}}}}}var B=mojo.Model.get(E);if((K!=null)&&(typeof K!="undefined")&&(K!="")&&(J!=null)&&(typeof J!="undefined")&&(J!="")){if(D){for(i=0;i<B.length;i++){if(typeof B[i][K]!="undefined"){if(B[i][K]==J){B.splice(i,1);mojo.Model.set(E,B);break}}}}else{for(i=B.length-1;i>=0;i--){if(typeof B[i][K]!="undefined"){if(B[i][K]==J){B.splice(i,1);C=true}}}if(C){mojo.Model.set(E,B)}}}else{if((G!=null)&&(typeof G!="undefined")&&(typeof G=="number")){B.splice(G,1);mojo.Model.set(E,B)}}},onResponse:function(A){},onError:function(A){}});dojo.provide("stdlib.command.RemoveObjectsCommand");dojo.declare("stdlib.command.RemoveObjectsCommand",mojo.command.Command,{execute:function(F){var A;var C;var E;var D=F.paramsObj;if(D){if(D.className!=null){A=D.className}if(D.targetId!=null){C=D.targetId}}if((A!=null)&&(C!=null)){if(C.indexOf("#")==0){C.substring(1,C.length)}E=mojo.query(A,C);if(E){if(E.length>0){for(var B=0;B<E.length;B++){if((E[B])&&(E[B].parentNode)){E[B].parentNode.removeChild(E[B])}}}else{if((E)&&(E.parentNode)){E.parentNode.removeChild(E)}}}}}});dojo.provide("stdlib.command.SetModelCommand");dojo.require("mojo.command.Command");dojo.require("mojo.Model");dojo.declare("stdlib.command.SetModelCommand",mojo.command.Command,{execute:function(C){var A=C.paramsObj.model;var B=C.paramsObj.set;if(A==null||typeof A=="undefined"){throw new Error("ERROR stdlib.command.SetModelCommand - model parameter is required")}else{if(typeof A=="string"){if(A==""){throw new Error("ERROR stdlib.command.SetModelCommand - model parameter must be a non-empty string")}}else{throw new Error("ERROR stdlib.command.SetModelCommand - model parameter must be type String")}}if(!B){B=mojo.Model.get(A)}mojo.Model.set(A,B);C.paramsObj.set=null}});dojo.provide("stdlib.command.UpdateControllerParamCommand");dojo.require("mojo.command.Command");dojo.declare("stdlib.command.UpdateControllerParamCommand",mojo.command.Command,{execute:function(G){var F;var C;var D;var B;var E=G.getParams();if(E){if(E.element!=null){F=E.element}if(E.control!=null){C=E.control}if(E.params!=null){D=E.params}if(E.value!=null){B=E.value}}try{if((C!=null)&&(D!=null)&&(B!=null)){if(F){if(F.mojoControllers[C]){F.mojoControllers[C].setValue(D,B)}}else{G.getController().getContextController(C).setValue(D,B)}}}catch(A){}},onResponse:function(){},onError:function(){}});dojo.provide("stdlib.command.UpdateObserversCommand");dojo.require("mojo.controller.Controller");dojo.require("mojo.command.Command");dojo.declare("stdlib.command.UpdateObserversCommand",mojo.command.Command,{execute:function(B){var A=setTimeout(function(){mojo.controller.Controller.updateObservers(B.getParams().controllerName);clearTimeout(A)},20)}});dojo.provide("stdlib.command.ValidateRulesCommand");dojo.require("mojo.command.Command");dojo.require("mojo.helper.Validation");dojo.require("mojo.helper.view.Error");dojo.require("mojo.query");dojo.declare("stdlib.command.ValidateRulesCommand",mojo.command.Command,{_targetElement:null,_checkAll:true,_output:function(B,A){},execute:function(requestObj){var rules;var formSet;var params=requestObj.getParams();if(params){if(params.targetElement!=null){this._targetElement=params.targetElement}if(params.checkAll!=null){this._checkAll=params.checkAll}if(params.rules!=null){rules=params.rules}if(params.formSet!=null){formSet=params.formSet}}if(rules){if(this._targetElement!=null){this._targetElement.innerHTML="";if(formSet){var clearTags=["label","inputs","textarea","select"];for(var i=0;i<clearTags.length;i++){var Tag=mojo.query(clearTags[i],formSet);for(var j=0;j<Tag.length;j++){dojo.removeClass(Tag[j],"error")}}}}if(typeof (rules)=="string"){dojo.require(rules);eval("requestObj.getParams().rules = "+rules)}var val=mojo.helper.Validation.getInstance();if((formSet)&&(this._checkAll)){var errorList=val.execute(requestObj.getParams().rules,formSet)}else{var errorList=val.execute(requestObj.getParams().rules,[requestObj.callerObj])}if(errorList.length>0){if(this._targetElement!=null){mojo.helper.view.Error.showElementErrors(errorList,this._targetElement);for(var i=0;i<errorList.length;i++){dojo.addClass(errorList[i].element,"error");if(errorList[i].element.parentNode.tagName=="LABEL"){dojo.addClass(errorList[i].element.parentNode,"error")}}}else{for(var i=0,len=errorList.length;i<len;i++){var error=errorList[i];var err=document.createElement("span");err.className="mojoValidationError";err.innerHTML=error.message;if(error.element.type=="checkbox"){if(error.element.parentNode.tagName=="LABEL"){dojo.place(err,error.element.parentNode,"after")}else{dojo.place(err,error.element,"after")}}else{dojo.place(err,error.element,"after")}}}this.onError()}else{if(requestObj.invocation){this.onResponse()}}}else{console.debug("ERROR stdlib.command.ValidateRulesCommand - No rules passed")}},onResponse:function(){},onError:function(){}});dojo.provide("stdlib.controller.AccordianController");dojo.require("mojo.controller.Controller");dojo.declare("stdlib.controller.AccordianController",mojo.controller.Controller,{params:{selectedIndex:{required:false,defaultValue:0,type:Number},activeOn:{required:false,defaultValue:"onclick"},toggleClose:{required:false,defaultValue:false},direction:{required:false,defaultValue:"vertical"}},addObservers:function(){var C=mojo.query("> .accordian-panel",this.getContextElement());var A=mojo.query("> .accordian-panel > .accordian",this.getContextElement());var B=mojo.query("> .accordian-panel > .accordian-content",this.getContextElement());this.addObserver("> .accordian-panel > .accordian",this.getValue("activeOn"),"UpdateClass",function(H,E){var G=A;var D=0;for(var F=0;F<G.length;F++){if(G[F]==E){D=F;break}}if(this.getController().getValue("toggleClose")&&D==this.getController().getValue("selectedIndex")){this.getController().setValue("selectedIndex",-1)}else{this.getController().setValue("selectedIndex",D)}});this.addObserver(this.getConfig("params").selectedIndex,"onChange","Tween",function(F,E,D){return{height:(D.getValue("direction")=="vertical")?0:null,width:(D.getValue("direction")=="horizontal")?0:null,element:mojo.query("> .open > .accordian-content",F)}});this.addObserver(this.getConfig("params").selectedIndex,"onChange","UpdateClass",function(E,D){return{element:C,action:"remove",cssClass:"open"}});this.addObserver(this.getConfig("params").selectedIndex,"onChange","UpdateClass",function(E,D){return{element:C[D.getValue()],action:"add",cssClass:"open"}});this.addObserver(this.getConfig("params").selectedIndex,"onChange","Tween",function(F,E,D){var G=B[E.getValue()];if(!G){return }return{element:G,height:(D.getValue("direction")=="vertical")?G.scrollHeight:null,width:(D.getValue("direction")=="horizontal")?G.scrollWidth:null}})},addCommands:function(){this.addCommand("UpdateClass","stdlib.behavior.UpdateCssClassBehavior");this.addCommand("Tween","stdlib.behavior.TweenBehavior")},addIntercepts:function(){}});dojo.provide("stdlib.controller.AutoSuggestController");dojo.require("mojo.controller.Controller");dojo.declare("stdlib.controller.AutoSuggestController",mojo.controller.Controller,{params:{model:{required:false,defaultValue:"suggestions"},modelPath:{required:false,defaultValue:"suggestions"},serviceLocator:{required:true,defaultValue:"cox.service.Locator"},serviceName:{required:false,defaultValue:"getSuggestions"},maxSuggestions:{required:false,defaultValue:"5"},doQuery:{defaultValue:true,type:Boolean}},addObservers:function(){this.addObserver("input.suggest-input","onkeyup","GetSuggestions",function(C,B,A){if(A.getValue("doQuery")){return{inputValue:B.value,model:this.getController().getValue("model"),modelPath:this.getController().getValue("modelPath"),serviceLocator:this.getController().getValue("serviceLocator"),serviceName:this.getController().getValue("serviceName"),maxSuggestions:this.getController().getValue("maxSuggestions")}}});this.addObserver("input.suggest-input","onkeydown","SuggestNavigation",function(B,A){return{suggestions:mojo.query(".suggestion",B)}});this.addObserver(this.getCommand("SuggestNavigation"),"onNav","UpdateClass",function(B,A){return{element:mojo.query(".suggestion",B),action:"remove",cssClass:"selected"}});this.addObserver(this.getCommand("SuggestNavigation"),"onNav","UpdateClass",function(B,A){return{element:A.suggestion,action:"add",cssClass:"selected"}});this.addObserver(".suggestion","onmouseover","UpdateClass",function(B,A){return{element:A,action:"add",cssClass:"selected"}});this.addObserver(".suggestion","onmouseout","UpdateClass",function(B,A){return{element:A,action:"remove",cssClass:"selected"}});this.addObserver(".suggestion a","onclick","PreventDefault");this.addObserver(".suggestion a","onmouseover","UpdateClass",function(C,B){var A=mojo.queryFirst("input.suggest-input",C);A.value=B.innerHTML.replace(/<\/?[^>]+(>|$)/g,"")});this.addObserver(this.getCommand("SuggestNavigation"),"onNav","UpdateClass",function(E,D,C){C.setValue("doQuery",false);var B=mojo.queryFirst("input.suggest-input",E);var A=dojo.trim(D.suggestion.innerHTML);B.value=A.replace(/<\/?[^>]+(>|$)/g,"")});this.addObserver("input.suggest-input","onblur","ClearModel",function(B,A){return{model:this.getController().getValue("model")}})},addCommands:function(){this.addCommand("PreventDefault","stdlib.behavior.PreventDefaultEventBehavior");this.addCommand("SuggestNavigation","stdlib.behavior.AutoSuggest.SuggestNavigationBehavior");this.addCommand("UpdateClass","stdlib.behavior.UpdateCssClassBehavior");this.addCommand("GetSuggestions","stdlib.command.AutoSuggest.GetSuggestionsCommand");this.addCommand("ClearModel","stdlib.command.ClearModelCommand")},addIntercepts:function(){}});dojo.provide("stdlib.controller.DateController");dojo.require("mojo.controller.Controller");dojo.declare("stdlib.controller.DateController",mojo.controller.Controller,{params:{date:{defaultValue:new Date()}},addObservers:function(){this.addObserver(this,"onInit","PopulateDate",function(B,A){return{target:this.getContextElement(),month:this.getController().getValue("date").getMonth(),year:this.getController().getValue("date").getFullYear()}});this.addObserver(this.getCommand("PopulateDate"),"execute","PopulateDays",function(B,A){return{target:mojo.queryFirst("> .date-day",B),day:(new Date()).getDate(),month:mojo.queryFirst("> .date-month",B).value,year:mojo.queryFirst("> .date-year",B).value}});this.addObserver("> .date-month","onchange","PopulateDays",function(B,A){return{target:mojo.queryFirst("> .date-day",B),month:mojo.queryFirst("> .date-month",B).value,year:mojo.queryFirst("> .date-year",B).value}});this.addObserver("> .date-year","onchange","PopulateDays",function(B,A){return{target:mojo.queryFirst("> .date-day",B),month:mojo.queryFirst("> .date-month",B).value,year:mojo.queryFirst("> .date-year",B).value}});this.addObserver(this.getConfig("params").date,"onChange","PopulateDate",function(B,A){return{target:this.getContextElement(),month:this.getController().getValue("date").getMonth(),year:this.getController().getValue("date").getFullYear()}})},addCommands:function(){this.addCommand("PopulateDate","stdlib.behavior.PopulateDateBehavior");this.addCommand("PopulateDays","stdlib.behavior.PopulateDaysBehavior")},addIntercepts:function(){}});dojo.provide("stdlib.controller.DialogController");dojo.require("mojo.controller.Controller");dojo.declare("stdlib.controller.DialogController",mojo.controller.Controller,{params:{container:{required:false,defaultValue:".dialog-component",type:String},title:{required:false,defaultValue:".dialog-component .dialog-component-title",type:String},titleText:{required:false,defaultValue:"Hello World",type:String},content:{required:false,defaultValue:".dialog-component .dialog-component-content",type:String},width:{defaultValue:0,type:Number},height:{defaultValue:0,type:Number}},addObservers:function(){var C=this.getValue("content"),D=this.getValue("title"),B=this.getValue("container"),A=this.getValue("titleText");this.addObserver(mojo.Messaging.getTopic("dialog"),"onPublish","Dialog",function(G,F){var E=F.getMessage();E.elContainer=B;E.elContent=C;E.elTitle=D;if(!E.title){E.title=A}this.getController().setValue("width",E.width);this.getController().setValue("height",E.height);mojo.Model.set("stlib.dialog.params",E);return E});this.addObserver(this.getCommand("Dialog"),"onComplete","MapControllers",function(){return{contextObj:mojo.queryFirst(this.getController().getValue("container"))}});this.addObserver(this.getCommand("Dialog"),"onComplete","UpdateObservers",function(F,E){return{controllerName:this.getController().declaredClass}});this.addObserver(this.getCommand("Dialog"),"onDataReady","Position");this.addObserver(window,"onresize","Position");this.addObserver(window,"onscroll","Position");this.addObserver(mojo.queryFirst(".btn-close"),"onclick","Messaging",function(F,E){return{topic:"dialog",message:{enabled:false}}})},addCommands:function(){this.addCommand("ClearModel","stdlib.command.ClearModelCommand");this.addCommand("Messaging","stdlib.behavior.MessagingBehavior");this.addCommand("Dialog","stdlib.behavior.dialog.DialogBehavior");this.addCommand("Position","stdlib.behavior.dialog.PositionBehavior");this.addCommand("MapControllers","stdlib.command.MapControllersCommand");this.addCommand("UpdateObservers","stdlib.command.UpdateObserversCommand")},addIntercepts:function(){}});dojo.provide("stdlib.controller.FilmStripController");dojo.require("mojo.controller.Controller");dojo.declare("stdlib.controller.FilmStripController",mojo.controller.Controller,{params:{selectedIndex:{required:false,defaultValue:0,type:Number},loop:{required:false,defaultValue:false,type:Boolean}},addObservers:function(){var A=function(B){return mojo.query("> .filmstrip-viewer > .filmstrip-content > .filmstrip-page",B)};this.addObserver("> .filmstrip-next","onclick","UpdateClass",function(E,C){var D=A(E);var B=this.getController().getValue("selectedIndex");B++;if(B>=A(E).length){if(this.getController().getValue("loop")){this.getController().setValue("selectedIndex",0)}}else{this.getController().setValue("selectedIndex",B)}});this.addObserver("> .filmstrip-prev","onclick","UpdateClass",function(E,C){var D=A(E);var B=this.getController().getValue("selectedIndex");B--;if(B<0){if(this.getController().getValue("loop")){this.getController().setValue("selectedIndex",A(E).length-1)}}else{this.getController().setValue("selectedIndex",B)}});this.addObserver(this.getConfig("params").selectedIndex,"onChange","UpdateClass",function(D,C,B){return{element:mojo.query("> .filmstrip-next",D),action:(C.getValue()>=A(D).length-1)?"add":"remove",cssClass:"disabled"}});this.addObserver(this.getConfig("params").selectedIndex,"onChange","UpdateClass",function(D,C,B){return{element:mojo.query("> .filmstrip-prev",D),action:(C.getValue()<=0)?"add":"remove",cssClass:"disabled"}});this.addObserver(this.getConfig("params").selectedIndex,"onChange","Tween",function(D,C,B){return{x:(-1*A(D)[C.getValue()].offsetLeft),y:(-1*A(D)[C.getValue()].offsetTop),element:mojo.query("> .filmstrip-viewer > .filmstrip-content",D)}});this.addObserver(this.getConfig("params").selectedIndex,"onChange","UpdateClass",function(C,B){return{element:A(C),action:"remove",cssClass:"selected"}});this.addObserver(this.getConfig("params").selectedIndex,"onChange","UpdateClass",function(C,B){return{element:A(C)[B.getValue()],action:"add",cssClass:"selected"}})},addCommands:function(){this.addCommand("UpdateClass","stdlib.behavior.UpdateCssClassBehavior");this.addCommand("Tween","stdlib.behavior.TweenBehavior")},addIntercepts:function(){}});dojo.provide("stdlib.controller.FormController");dojo.require("mojo.controller.Controller");dojo.declare("stdlib.controller.FormController",mojo.controller.Controller,{params:{isSubmitted:{required:false,defaultValue:false,type:Boolean},formSubmitCommand:{required:true,defaultValue:"FormSubmitCommand",type:String},formRules:{required:true,defaultValue:"stdlib.rules.Rules",type:String},modelErrors:{required:false,defaultValue:"stdlib.myModel",type:String},formId:{required:true,defaultValue:"#form",type:String},submitButtonId:{required:true,defaultValue:"#submit-form",type:String},cancelButtonId:{required:false,defaultValue:"#cancel-form",type:String}},addObservers:function(){var B=this.getValue("formRules"),C=this.getValue("modelErrors"),A=this.getValue("formId");this.addObserver("input","onkeydown","EnterKey");this.addObserver("input","onblur","ValidateRules",function(E,D){if(!this.getController().getValue("isSubmitted")){return{rules:{},formSet:mojo.query(A)}}return{rules:B,formSet:mojo.query(A)}});this.addObserver("textarea","onblur","ValidateRules",function(E,D){if(!this.getController().getValue("isSubmitted")){return{rules:{},formSet:mojo.query(A)}}return{rules:B,formSet:mojo.query(A)}});this.addObserver("select","onchange","ValidateRules",function(E,D){if(!this.getController().getValue("isSubmitted")){return{rules:{},formSet:mojo.query(A)}}return{rules:B,formSet:mojo.query(A)}});this.addObserver(this.getCommand(this.getValue("formSubmitCommand")),"onResponse","ClearModel",function(){return{model:C}});this.addObserver(this.getValue("submitButtonId"),"onclick","UpdateControllerParam",function(F,E,D){return{control:this.getController().declaredClass,params:"isSubmitted",value:true,element:F}});this.addObserver(this.getConfig("params").isSubmitted,"onChange","ValidateRules",function(E,D){if(!this.getController().getValue("isSubmitted")){return{rules:{},formSet:mojo.query(A)}}return{rules:B,formSet:mojo.query(A)}});this.addObserver(this.getValue("cancelButtonId"),"onclick","ClearForm",function(E,D){return{formSet:mojo.queryFirst(this.getController().getValue("formId"),E)}})},addCommands:function(){this.addCommand("Messaging","stdlib.behavior.MessagingBehavior");this.addCommand("EnterKey","stdlib.behavior.EnterKeyBehavior");this.addCommand("UpdateControllerParam","stdlib.command.UpdateControllerParamCommand");this.addCommand("DisableBox","stdlib.behavior.DisableBoxBehavior");this.addCommand("ClearForm","stdlib.behavior.ClearFormBehavior");this.addCommand("ClearModel","stdlib.command.ClearModelCommand");this.addCommand("Redirect","stdlib.behavior.RedirectBehavior");this.addCommand("ValidateRules","stdlib.command.ValidateRulesCommand")},addIntercepts:function(){this.addIntercept("around",this.getValue("formSubmitCommand"),"ValidateRules",{rules:this.getValue("formRules"),formSet:mojo.query(this.getValue("formId"))})}});dojo.provide("stdlib.controller.FormValidationController");dojo.require("mojo.controller.Controller");dojo.declare("stdlib.controller.FormValidationController",mojo.controller.Controller,{params:{isSubmitted:{required:false,defaultValue:false,type:Boolean},formRules:{required:true,defaultValue:"stdlib.rules.Rules",type:String},submitButtonId:{required:true,defaultValue:"#submit-form",type:String},cancelButtonId:{required:false,defaultValue:"#cancel-form",type:String},errorsContainerId:{required:false,defaultValue:"",type:String},showDisableBox:{required:false,defaultValue:true}},addObservers:function(){var B=this.getValue("formRules");var A=(this.getValue("errorsContainerId")!="")?mojo.queryFirst(this.getValue("errorsContainerId")):null;this.addObserver("input","onkeydown","EnterKey");this.addObserver(this.getCommand("EnterKey"),"onResponse","UpdateControllerParam",function(D,C){return{control:this.getController().declaredClass,params:"isSubmitted",value:true,element:D}});this.addObserver(this.getCommand("EnterKey"),"onResponse","SubmitForm",function(D,C){return{form:this.getContextElement()}});this.addObserver(["input","textarea"],"onblur","ValidateRules",function(D,C){if(!this.getController().getValue("isSubmitted")){return{rules:{},formSet:this.getContextElement()}}return{rules:B,formSet:this.getContextElement(),targetElement:A}});this.addObserver("select","onchange","ValidateRules",function(D,C){if(!this.getController().getValue("isSubmitted")){return{rules:{},formSet:this.getContextElement()}}return{rules:B,formSet:this.getContextElement(),targetElement:A}});this.addObserver(this.getValue("submitButtonId"),"onclick","UpdateControllerParam",function(D,C){return{control:this.getController().declaredClass,params:"isSubmitted",value:true,element:D}});this.addObserver(this.getValue("submitButtonId"),"onclick","SubmitForm",function(D,C){return{form:this.getContextElement()}});this.addObserver(this.getCommand("SubmitForm"),"execute","DisableBox",function(D,C){if(!this.getController().getValue("showDisableBox")){return }return{show:true,target:D}});this.addObserver(this.getConfig("params").isSubmitted,"onChange","ValidateRules",function(D,C){if(!this.getController().getValue("isSubmitted")){return{rules:{},formSet:this.getContextElement()}}return{rules:B,formSet:this.getContextElement(),targetElement:A}});this.addObserver(this.getValue("cancelButtonId"),"onclick","ClearErrors",function(D,C){return{className:".mojoValidationError",target:this.getContextElement()}})},addCommands:function(){this.addCommand("EnterKey","stdlib.behavior.EnterKeyBehavior");this.addCommand("UpdateControllerParam","stdlib.command.UpdateControllerParamCommand");this.addCommand("ClearErrors","stdlib.behavior.RemoveElementsBehavior");this.addCommand("ValidateRules","stdlib.command.ValidateRulesCommand");this.addCommand("SubmitForm","stdlib.behavior.SubmitFormBehavior");this.addCommand("DisableBox","stdlib.behavior.DisableBoxBehavior")},addIntercepts:function(){this.addIntercept("around","SubmitForm","ValidateRules",{rules:this.getValue("formRules"),formSet:this.getContextElement(),targetElement:(this.getValue("errorsContainerId")!="")?mojo.queryFirst(this.getValue("errorsContainerId")):null})}});dojo.provide("stdlib.controller.SliderController");dojo.require("mojo.controller.Controller");dojo.declare("stdlib.controller.SliderController",mojo.controller.Controller,{params:{tickSize:{required:false,defaultValue:10,type:Number},tickValue:{required:false,defaultValue:1,type:Number},tickMaxValue:{required:false,defaultValue:10,type:Number},value:{required:false,defaultValue:0,type:Number},valueInput:{required:false,defaultValue:"slider-value-input",type:String},thumb:{required:false,defaultValue:".slider-thumb",type:String},draggable:{required:false,defaultValue:false,type:Boolean},selectedIndex:{required:false,defaultValue:0,type:Number},orientation:{required:false,defaultValue:"horizontal",type:String}},addObservers:function(){this.addObserver(this.getContextElement(),"onmousedown","UpdateControllerParam",function(B,A){return{control:"stdlib.controller.SliderController",params:"draggable",value:true}});this.addObserver(this.getContextElement(),"onmousedown","Drag",function(B,A){return{element:mojo.queryFirst(".slider-thumb",B),container:mojo.queryFirst(".slider-bg",B),orientation:this.getController().getValue("orientation"),tickSize:this.getController().getValue("tickSize")}});this.addObserver(document.body,"onmouseup","UpdateControllerParam",function(B,A){return{control:"stdlib.controller.SliderController",params:"draggable",value:false}});this.addObserver(this.getContextElement(),"onmousemove","Drag",function(B,A){if(!this.getController().getValue("draggable")){return }return{element:mojo.queryFirst(".slider-thumb",B),container:mojo.queryFirst(".slider-bg",B),orientation:this.getController().getValue("orientation"),tickSize:this.getController().getValue("tickSize")}});this.addObserver(this.getCommand("Drag"),"execute","UpdateControllerParam",function(B,A){if(!this.getController().getValue("draggable")){return }return{control:"stdlib.controller.SliderController",params:"selectedIndex",value:this.getController().getCommand("Drag").selectedIndex}});this.addObserver(this.getConfig("params").selectedIndex,"onChange","UpdateControllerParam",function(B,A){if(!this.getController().getValue("draggable")){return }return{control:"stdlib.controller.SliderController",params:"value",value:A.getValue()*this.getController().getValue("tickValue")}});this.addObserver(this.getConfig("params").draggable,"onChange","UpdateFormField",function(B,A){if(this.getController().getValue("draggable")){return }return{formObj:B,fields:[{name:this.getController().getValue("valueInput"),value:this.getController().getValue("value")}]}});this.addObserver(mojo.queryFirst("#"+this.getValue("valueInput")),"onchange","UpdateControllerParam",function(B,A){if(this.getController().getValue("draggable")){return }return{control:"stdlib.controller.SliderController",params:"value",value:parseInt(A.value)}});this.addObserver(this.getConfig("params").value,"onChange","UpdateControllerParam",function(B,A){if(this.getController().getValue("draggable")){return }return{control:"stdlib.controller.SliderController",params:"selectedIndex",value:Math.round(A.getValue()/this.getController().getValue("tickValue"))}});this.addObserver(this.getConfig("params").selectedIndex,"onChange","Drag",function(B,A){if(this.getController().getValue("draggable")){return }return{element:mojo.queryFirst(".slider-thumb",B),container:mojo.queryFirst(".slider-bg",B),orientation:this.getController().getValue("orientation"),tickSize:this.getController().getValue("tickSize"),position:A.getValue()*this.getController().getValue("tickSize")}})},addCommands:function(){this.addCommand("Drag","stdlib.behavior.DragBehavior");this.addCommand("Tween","stdlib.behavior.TweenBehavior");this.addCommand("UpdateControllerParam","stdlib.command.UpdateControllerParamCommand");this.addCommand("UpdateFormField","stdlib.behavior.UpdateFormFieldBehavior")},addIntercepts:function(){}});dojo.provide("stdlib.controller.TabController");dojo.require("mojo.controller.Controller");dojo.declare("stdlib.controller.TabController",mojo.controller.Controller,{params:{selectedIndex:{required:false,defaultValue:0,type:Number},activeOn:{required:false,defaultValue:"onclick"}},addObservers:function(){this.addObserver("> .tabs-nav > .tab",this.getValue("activeOn"),"UpdateClass",function(E,B){var D=mojo.query("> .tabs-nav > .tab",E);var A=0;for(var C=0;C<D.length;C++){if(D[C]==B){A=C;break}}this.getController().setValue("selectedIndex",A)});this.addObserver(this.getConfig("params").selectedIndex,"onChange","UpdateClass",function(B,A){return{element:mojo.query("> .tabs-nav > .selected",B),action:"remove",cssClass:"selected"}});this.addObserver(this.getConfig("params").selectedIndex,"onChange","UpdateClass",function(B,A){return{element:mojo.query("> .tabs-content > .selected",B),action:"remove",cssClass:"selected"}});this.addObserver(this.getConfig("params").selectedIndex,"onChange","UpdateClass",function(B,A){return{element:mojo.query("> .tabs-nav > .tab",B)[A.getValue()],action:"add",cssClass:"selected"}});this.addObserver(this.getConfig("params").selectedIndex,"onChange","UpdateClass",function(B,A){return{element:mojo.query("> .tabs-content > .tab-content",B)[A.getValue()],action:"add",cssClass:"selected"}});this.addObserver("> .add","onclick","UpdateClass",function(B,A){mojo.Model.add("testData",{name:"new",description:(new Date()).getTime()});this.getController().setValue("selectedIndex",0);this.getController().getConfig("params").selectedIndex.onChange()})},addCommands:function(){this.addCommand("UpdateClass","stdlib.behavior.UpdateCssClassBehavior")},addIntercepts:function(){}});dojo.provide("stdlib.controller.TemplateController");dojo.require("mojo.controller.Controller");dojo.require("lib.trimpath.template");dojo.require("mojo.Model");dojo.declare("stdlib.controller.TemplateController",mojo.controller.Controller,{modelSource:"",_modelSourceHandle:null,templateObj:null,escapeQuotes:false,escapeHtml:false,onInit:function(){var A=this.getContextElement();var B=this._normalize(A.innerHTML);this.templateObj=TrimPath.parseTemplate(B);dojo.style(this.getContextElement(),"display","none");this.setModelSource(A.getAttribute("modelsource"))},getModelSource:function(){if(!this.modelSource){return""}return this.modelSource},setModelSource:function(A){if(this._modelSourceHandle){mojo.Model.removeObserver(this._modelSourceHandle)}this.modelSource=A;this._modelSourceHandle=mojo.Model.addObserver(this.modelSource,this,"onModelUpdate");this.onModelUpdate()},onModelUpdate:function(){this._bindToModel()},_bindToModel:function(){var H={escapeQuotes:function(K){K=K.toString();K=K.replace(/\"/g,"&#34;");K=K.replace(/\'/g,"&#39;");return K}};var E=this.getModelSource();if(E.length>0&&mojo.Model.contains(E)&&this.getContextElement()){var I=mojo.Model.get(E);var J=new Array();if(!dojo.isArray(I)){I=[I]}var C=I.length;for(var D=0,F=C;D<F;D++){if(I[D]){if(typeof (I[D])!="object"){var B=I[D].toString();I[D]=new Object();I[D].data=B}I[D].currentIndex=D;I[D].totalLength=F;if(this.escapeQuotes){I[D]._MODIFIERS=H;I[D].content=H.escapeQuotes(I[D].content)}J.push(this.templateObj.process(I[D]))}}var A=this.getContextElement();var G=J.join("");A.innerHTML="";A.innerHTML=G;dojo.style(this.getContextElement(),"display","block")}else{dojo.style(this.getContextElement(),"display","none")}},_normalize:function(E){var D=/[\!|\$]\{[^\}]*\}/g;var B=E.match(D);var F=E.split(D);var I=new Array();var A=0;if(B){A=B.length}for(var C=0;C<A;C++){I.push(F[C]);var H="$"+B[C].substring(1);var G="";if(this.escapeHtml){G+="|escape"}if(this.escapeQuotes){G+="|escapeQuotes"}H=H.substring(0,H.length-1)+G+"}";I.push(H)}I.push(F[A]);return I.join("")},addObservers:function(){},addCommands:function(){},addIntercepts:function(){}})
