Utilities={update:"",active:false,timer:false,othertimer:false,initListeners:function(){dojo.subscribe("removeElementsByClass",this,"removeElementsByClass");dojo.subscribe("moveElementsByClass",this,"moveElementsByClass");dojo.subscribe("AjaxStarting",this,"ajaxStarting");dojo.subscribe("AjaxDone",this,"ajaxDone");dojo.subscribe("htmlXHR",this,"htmlAction");dojo.subscribe("replaceDom",this,"replaceDomElement");dojo.subscribe("removeWidgets",this,"destroyWidgetsAction");dojo.subscribe("RemoveWidget",this,"destroyWidgetAction");dojo.subscribe("removeDomElement",this,"destroyDomElement");dojo.subscribe("replaceDom",this,"replaceDomElement");dojo.subscribe("feedback",this,"displayFeedback");dojo.subscribe("JS",this,"jsAction");dojo.query("ul a.disabled").forEach(function(a){dojo.connect(a,"onclick",function(b){dojo.stopEvent(b)})})},jsAction:function(params){if(params.script){dojo.eval(params.script)}},displayFeedback:function(a){if(a.feedback!=""){dojo.byId("feedback-message-purple").innerHTML=a.feedback;setTimeout("dojo.show('notifications');dojo.fadeIn({node:'notifications'}).play();",200);clearTimeout(this.timer);clearTimeout(this.othertimer);this.timer=setTimeout("dojo.fadeOut({node:'notifications'}).play();",8000);this.othertimer=setTimeout("dojo.hide('notifications');Utilities.timer = false;",10000)}},removeElementsByClass:function(a){dojo.query("."+a.className).destroy()},moveElementsByClass:function(c){var b,a;dojo.query("."+c.className).forEach(function(d){b=d.previousSibling;a=d.nextSibling;if(b.nodeType==3){b=b.previousSibling}if(a.nodeType==3){a=a.nextSibling}if(c.direction=="up"){dojo.place(d,b,"before")}if(c.direction=="down"){dojo.place(d,a,"after")}})},ajaxStarting:function(c){var b,a;if(document.compatMode=="CSS1Compat"){b=document.body.parentNode.scrollTop}else{b=window.scrollY}dojo.style("loading","top",b+"px");dojo.show("loading");a={node:"loading",duration:10};dojo.fadeIn(a).play()},ajaxDone:function(b){var a={node:"loading",duration:200,onEnd:function(){dojo.hide("loading")}};dojo.fadeOut(a).play()},htmlAction:function(b){var a=b.href;if(b.form!=undefined){this.makeHtmlRequest("post",a,b.form,b.update)}else{this.makeHtmlRequest("get",a,null,b.update)}},makeHtmlRequest:function(method,url,form,update){var hasBody,ajax=false;if(form!=null&&method=="post"){hasBody=true}dojo.publish("AjaxStarting");ajax=dojo.xhr(method,{url:url,timeout:10000,form:form,load:function(response,ioArgs){dojo.publish("AjaxDone");dojo.byId(update).innerHTML=response;dojo.parser.parse(dojo.byId(update));dojo.query("script",dojo.byId(update)).forEach(function(n){eval(n.innerHTML)});return response},error:function(response,ioArgs){console.error("HTTP status code: ",ioArgs);return response}},hasBody)},replaceDomElement:function(params){var dijits;if(params.removeDijits){dijits=dojo.query("."+params.dijitClass,dojo.byId(params.id));dojo.forEach(dijits,function(node){dijit.getEnclosingWidget(node).destroy()})}dojo.byId(params.id).innerHTML=params.content;if(params.parse){dojo.query("script",dojo.byId(params.id)).forEach(function(n){eval(n.innerHTML)});dojo.parser.parse(dojo.byId(params.id))}},destroyWidgetsAction:function(b){var a=dojo.query(b.query);if(a.length>0){dojo.forEach(a,function(c){dijit.getEnclosingWidget(c).destroy()})}},destroyWidgetAction:function(b){var a=dijit.byId(b.widgetId);a.destroy()},destroyDomElement:function(a){dojo.byId(a.id).parentNode.removeChild(dojo.byId(a.id))},replaceDomElement:function(params){var node,dijits;node=dojo.byId(params.id);if(!node){return}if(params.removeDijits){dijits=dojo.query("."+params.dijitClass,dojo.byId(params.id));dojo.forEach(dijits,function(node){dijit.getEnclosingWidget(node).destroy()})}dojo.byId(params.id).innerHTML=params.content;if(params.parse){dojo.query("script",dojo.byId(params.id)).forEach(function(n){eval(n.innerHTML)});dojo.parser.parse(dojo.byId(params.id))}},fadeBackground:function(b,c,e,a,d){dojo.animateProperty({node:b,duration:c,properties:{backgroundColor:{start:e,end:a}},onEnd:function(){if(d==false){}else{this.fadeBackground(b,c,a,e,false)}}}).play()}};function isMouseLeaveOrEnter(c,b){var a=c.relatedTarget?c.relatedTarget:c.type=="mouseout"?c.toElement:c.fromElement;while(a&&a!=b){a=a.parentNode}return(a!=b)}function printwindow(){if(!window.print){alert(Translation.noprint);return}window.print()}function MultiSelector(b,a){this.list_target=b;this.count=0;this.id=0;if(a){this.max=a}else{this.max=-1}this.addElement=function(c){if(c.tagName=="INPUT"&&c.type=="file"){c.name="file[]";this.id++;c.multi_selector=this;c.onchange=function(){var d=document.createElement("input");d.type="file";this.parentNode.insertBefore(d,this);this.multi_selector.addElement(d);this.multi_selector.addListRow(this);this.style.position="absolute";this.style.left="-1000px"};if(this.max!=-1&&this.count>=this.max){c.disabled=true}this.count++;this.current_element=c}else{alert("Error: not a file input element")}};this.addListRow=function(d){var c,e;c=document.createElement("div");e=document.createElement("input");e.type="button";e.value="Delete";c.element=d;e.onclick=function(){this.parentNode.element.parentNode.removeChild(this.parentNode.element);this.parentNode.parentNode.removeChild(this.parentNode);this.parentNode.element.multi_selector.count--;this.parentNode.element.multi_selector.current_element.disabled=false;return false};c.innerHTML=d.value;c.appendChild(e);this.list_target.appendChild(c)}};
