var hui={browser:{},ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,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};hui.browser.opera=/opera/i.test(navigator.userAgent);hui.browser.msie=!hui.browser.opera&&/MSIE/.test(navigator.userAgent);hui.browser.msie6=navigator.userAgent.indexOf("MSIE 6")!==-1;hui.browser.msie7=navigator.userAgent.indexOf("MSIE 7")!==-1;hui.browser.msie8=navigator.userAgent.indexOf("MSIE 8")!==-1;hui.browser.msie9=navigator.userAgent.indexOf("MSIE 9")!==-1;hui.browser.msie9compat=hui.browser.msie7&&navigator.userAgent.indexOf("Trident/5.0")!==-1;hui.browser.webkit=navigator.userAgent.indexOf("WebKit")!==-1;hui.browser.safari=navigator.userAgent.indexOf("Safari")!==-1;hui.browser.chrome=navigator.userAgent.indexOf("Chrome")!==-1;hui.browser.webkitVersion=null;hui.browser.gecko=!hui.browser.webkit&&navigator.userAgent.indexOf("Gecko")!=-1;hui.browser.ipad=hui.browser.webkit&&navigator.userAgent.indexOf("iPad")!=-1;hui.browser.windows=navigator.userAgent.indexOf("Windows")!=-1;hui.browser.opacity=!hui.browser.msie||hui.browser.msie9;(function(){var A=/Safari\/([\d.]+)/.exec(navigator.userAgent);if(A){hui.browser.webkitVersion=parseFloat(A[1])}})();hui.log=function(A){try{console.log(A)}catch(B){}};hui.defer=function(A,B){if(B){A=A.bind(B)}window.setTimeout(A)};hui.override=function(B,A){if(A){for(prop in A){B[prop]=A[prop]}}return B};hui.each=function(A,D){if(hui.isArray(A)){for(var C=0;C<A.length;C++){D(A[C],C)}}else{for(var B in A){D(B,A[B])}}};hui.intOrString=function(B){if(hui.isDefined(B)){var A=/[0-9]+/.exec(B);if(A!==null&&A[0]==B){if(parseInt(B,10)==B){return parseInt(B,10)}}}return B};hui.isBlank=function(A){if(A===null||typeof (A)==="undefined"||A===""){return true}return typeof (A)=="string"&&hui.string.trim(A).length==0};hui.isDefined=function(A){return A!==null&&typeof (A)!=="undefined"};hui.isArray=function(A){if(A==null||A==undefined){return false}if(A.constructor==Array){return true}else{return Object.prototype.toString.call(A)==="[object Array]"}};hui.string={startsWith:function(A,B){if(!typeof (A)=="string"||!typeof (B)=="string"){return false}return(A.match("^"+B)==B)},endsWith:function(B,A){if(!typeof (B)=="string"||!typeof (A)=="string"){return false}return(B.match(A+"$")==A)},camelize:function(F){if(F.indexOf("-")==-1){return F}var D=F.split("-");var B=F.indexOf("-")==0?D[0].charAt(0).toUpperCase()+D[0].substring(1):D[0];for(var C=1,A=D.length;C<A;C++){var E=D[C];B+=E.charAt(0).toUpperCase()+E.substring(1)}return B},trim:function(A){if(A===null||A===undefined){return""}if(typeof (A)!="string"){A=new String(A)}return A.replace(/^[\s\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]+|[\s\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]+$/g,"")},wrap:function(A){if(A===null||A===undefined){return""}return A.split("").join("\u200B")},escapeHTML:function(A){if(A===null||A===undefined){return""}return hui.build("div",{text:A}).innerHTML},escape:function(A){if(!hui.isDefined(A)){return""}return A.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")},fromJSON:function(A){return JSON.parse(A)},toJSON:function(A){return JSON.stringify(A)}};hui.array={add:function(A,C){if(C.constructor==Array){for(var B=0;B<C.length;B++){if(!hui.array.contains(A,C[B])){A.push(C)}}}else{if(!hui.array.contains(A,C)){A.push(C)}}},contains:function(A,C){for(var B=0;B<A.length;B++){if(A[B]===C){return true}}return false},flip:function(A,B){if(hui.array.contains(A,B)){hui.array.remove(A,B)}else{A.push(B)}},remove:function(A,C){for(var B=A.length-1;B>=0;B--){if(A[B]==C){A.splice(B,1)}}},indexOf:function(A,C){for(var B=0;B<A.length;B++){if(A[B]===C){return B}}return -1},toIntegers:function(B){var C=B.split(",");for(var A=C.length-1;A>=0;A--){C[A]=parseInt(C[A])}return C}};hui.dom={isElement:function(B,A){return B.nodeType==hui.ELEMENT_NODE&&(A===undefined?true:B.nodeName.toLowerCase()==A)},isDefinedText:function(A){return A.nodeType==hui.TEXT_NODE&&A.nodeValue.length>0},addText:function(A,B){A.appendChild(document.createTextNode(B))},firstChild:function(C){var B=C.childNodes;for(var A=0;A<B.length;A++){if(B[A].nodeType==hui.ELEMENT_NODE){return B[A]}}return null},clear:function(C){var B=C.childNodes;for(var A=B.length-1;A>=0;A--){B[A].parentNode.removeChild(B[A])}},remove:function(A){if(A.parentNode){A.parentNode.removeChild(A)}},replaceNode:function(B,A){if(A.parentNode){A.parentNode.removeChild(A)}B.parentNode.insertBefore(A,B);B.parentNode.removeChild(B)},insertBefore:function(B,A){B.parentNode.insertBefore(A,B)},replaceHTML:function(B,A){B=hui.get(B);B.innerHTML=A},runScripts:function(node){var scripts=node.getElementsByTagName("script");for(var i=0;i<scripts.length;i++){eval(scripts[i].innerHTML)}},setText:function(C,D){if(D==undefined||D==null){D=""}var E=C.childNodes;var A=false;for(var B=E.length-1;B>=0;B--){if(!A&&E[B].nodeType==hui.TEXT_NODE){E[B].nodeValue=D;A=true}else{C.removeChild(E[B])}}if(!A){hui.dom.addText(C,D)}},getText:function(C){var A="";var D=C.childNodes;for(var B=0;B<D.length;B++){if(D[B].nodeType==hui.TEXT_NODE&&D[B].nodeValue!=null){A+=D[B].nodeValue}else{if(D[B].nodeType==hui.ELEMENT_NODE){A+=hui.dom.getText(D[B])}}}return A},isVisible:function(A){while(A){if(A.style&&(hui.style.get(A,"display")==="none"||hui.style.get(A,"visibility")==="hidden")){return false}A=A.parentNode}return true},isDescendantOrSelf:function(A,B){while(A){if(A==B){return true}A=A.parentNode}return false}};hui.form={getValues:function(C){var D={};var A=C.getElementsByTagName("input");for(var B=0;B<A.length;B++){if(hui.isDefined(A[B].name)){D[A[B].name]=A[B].value}}return D}};hui.get=function(A){if(typeof (A)=="string"){return document.getElementById(A)}return A};hui.get.children=function(D){var C=[];var A=D.childNodes;for(var B=0;B<A.length;B++){if(hui.dom.isElement(A[B])){C.push(A[B])}}return C};hui.get.ancestors=function(A){var C=[];var B=A.parentNode;while(B){C[C.length]=B;B=B.parentNode}return C};hui.get.firstAncestorByClass=function(A,B){while(A){if(hui.cls.has(A,B)){return A}A=A.parentNode}return null};hui.get.next=function(A){if(!A){return null}if(!A.nextSibling){return null}var B=A.nextSibling;while(B&&B.nodeType!=1){B=B.nextSibling}if(B&&B.nodeType==1){return B}return null};hui.get.after=function(A){var C=[];var B=hui.get.next(A);while(B){C.push(B);B=hui.get.next(B)}return C};hui.get.firstByClass=function(B,E,A){B=hui.get(B)||document.body;if(document.querySelector){return B.querySelector((A?A+".":".")+E)}else{var D=B.getElementsByTagName(A||"*");for(var C=0;C<D.length;C++){if(hui.cls.has(D[C],E)){return D[C]}}}return null};hui.get.byClass=function(H,F,I){H=hui.get(H)||document.body;if(document.querySelectorAll){var A=H.querySelectorAll((I?I+".":".")+F);var C=[];for(var E=0,G=A.length;E!=G;C.push(A[E++])){}return C}else{var B=H.getElementsByTagName(I||"*"),D=[];for(var E=0;E<B.length;E++){if(hui.cls.has(B[E],F)){D[D.length]=B[E]}}return D}};hui.get.byTag=function(E,C){var B=E.getElementsByTagName(C),A=[];for(var D=0,F=B.length;D!=F;A.push(B[D++])){}return A};hui.get.byId=function(D,E){var B=D.childNodes;for(var A=B.length-1;A>=0;A--){if(B[A].nodeType===hui.ELEMENT_NODE&&B[A].getAttribute("id")===E){return B[A]}else{var C=hui.get.byId(B[A],E);if(C){return C}}}return null};hui.get.firstParentByTag=function(C,A){var B=C;while(B){if(B.tagName&&B.tagName.toLowerCase()==A){return B}B=B.parentNode}return null};hui.get.firstParentByClass=function(C,A){var B=C;while(B){if(hui.cls.has(B)){return B}B=B.parentNode}return null};hui.get.firstByTag=function(C,A){C=hui.get(C)||document.body;if(document.querySelector&&A!=="*"){return C.querySelector(A)}var B=C.getElementsByTagName(A);return B[0]};hui.get.firstChild=hui.dom.firstChild;hui.build=function(B,A){var C=document.createElement(B);if(A){for(prop in A){if(prop=="text"){C.appendChild(document.createTextNode(A.text))}else{if(prop=="html"){C.innerHTML=A.html}else{if(prop=="parent"){A.parent.appendChild(C)}else{if(prop=="parentFirst"){if(A.parentFirst.childNodes.length==0){A.parentFirst.appendChild(C)}else{A.parentFirst.insertBefore(C,A.parentFirst.childNodes[0])}}else{if(prop=="className"){C.className=A.className}else{if(prop=="class"){C.className=A["class"]}else{if(prop=="style"&&(hui.browser.msie7||hui.browser.msie6)){C.style.setAttribute("cssText",A[prop])}else{if(hui.isDefined(A[prop])){C.setAttribute(prop,A[prop])}}}}}}}}}}return C};hui.position={getTop:function(A){A=hui.get(A);if(A){var B=A.offsetTop,C=A.offsetParent;while(C!=null){B+=C.offsetTop;C=C.offsetParent}return B}else{return 0}},getLeft:function(A){A=hui.get(A);if(A){var B=A.offsetLeft,C=A.offsetParent;while(C!=null){B+=C.offsetLeft;C=C.offsetParent}return B}else{return 0}},get:function(A){return{left:hui.position.getLeft(A),top:hui.position.getTop(A)}},getScrollOffset:function(A){A=hui.get(A);var C=0,B=0;do{C+=A.scrollTop||0;B+=A.scrollLeft||0;A=A.parentNode}while(A);return{top:C,left:B}},place:function(C){var F=0,E=0,G=hui.get(C.source.element),A=hui.get(C.target.element),D={left:hui.position.getLeft(A),top:hui.position.getTop(A)};F=D.left+A.clientWidth*(C.target.horizontal||0);E=D.top+A.clientHeight*(C.target.vertical||0);F-=G.clientWidth*(C.source.horizontal||0);E-=G.clientHeight*(C.source.vertical||0);if(C.insideViewPort){var B=hui.window.getViewWidth();if(F+G.clientWidth>B){F=B-G.clientWidth-(C.viewPartMargin||0);hui.log(C.viewPartMargin)}if(F<0){F=0}if(E<0){E=0}}if(C.top){E+=C.top}if(C.left){F+=C.left}G.style.top=E+"px";G.style.left=F+"px"}};hui.window={getScrollTop:function(){if(window.pageYOffset){return window.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop}else{if(document.body){return document.body.scrollTop}}}return 0},getScrollLeft:function(){if(window.pageYOffset){return window.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollLeft}else{if(document.body){return document.body.scrollLeft}}}return 0},scrollTo:function(D){var E=D.element;var G=hui.position.get(E);var A=hui.window.getScrollTop();var B=hui.window.getViewHeight();var C=A+B;if(A<G.top+E.clientHeight||(G.top)<C){var F=G.top-Math.round((B-E.clientHeight)/2);F=Math.max(0,F);window.scrollTo(0,F)}},getViewHeight:function(){if(window.innerHeight){return window.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){return document.documentElement.clientHeight}else{if(document.body){return document.body.clientHeight}}}},getViewWidth:function(){if(window.innerWidth){return window.innerWidth}else{if(document.documentElement&&document.documentElement.clientWidth){return document.documentElement.clientWidth}else{if(document.body){return document.body.clientWidth}}}}};hui.cls={has:function(C,D){C=hui.get(C);if(!C||!C.className){return false}if(C.hasClassName){return C.hasClassName(D)}if(C.className==D){return true}var A=C.className.split(/\s+/);for(var B=0;B<A.length;B++){if(A[B]==D){return true}}return false},add:function(A,B){A=hui.get(A);if(!A){return }if(A.addClassName){A.addClassName(B)}hui.cls.remove(A,B);A.className+=" "+B},remove:function(D,E){D=hui.get(D);if(!D||!D.className){return }if(D.removeClassName){D.removeClassName(E)}if(D.className=="className"){D.className="";return }var B="";var A=D.className.split(/\s+/);for(var C=0;C<A.length;C++){if(A[C]!=E){if(C>0){B+=" "}B+=A[C]}}D.className=B},toggle:function(A,B){if(hui.cls.has(A,B)){hui.cls.remove(A,B)}else{hui.cls.add(A,B)}},set:function(A,B,C){if(C){hui.cls.add(A,B)}else{hui.cls.remove(A,B)}}};hui.listen=function(B,C,D,A){B=hui.get(B);if(document.addEventListener){B.addEventListener(C,D,A?true:false)}else{B.attachEvent("on"+C,D)}};hui.unListen=function(C,B,D,A){C=hui.get(C);if(document.removeEventListener){C.removeEventListener(B,D,A?true:false)}else{C.detachEvent("on"+B,D)}};hui.event=function(A){return new hui.Event(A)};hui.Event=function(A){this.event=A=A||window.event;this.element=A.target?A.target:A.srcElement;this.shiftKey=A.shiftKey;this.altKey=A.altKey;this.returnKey=A.keyCode==13;this.escapeKey=A.keyCode==27;this.spaceKey=A.keyCode==32;this.upKey=A.keyCode==38;this.downKey=A.keyCode==40;this.leftKey=A.keyCode==37;this.rightKey=A.keyCode==39;this.keyCode=A.keyCode};hui.Event.prototype={getLeft:function(){var A=0;if(this.event){if(this.event.pageX){A=this.event.pageX}else{if(this.event.clientX){A=this.event.clientX+hui.window.getScrollLeft()}}}return A},getTop:function(){var A=0;if(this.event){if(this.event.pageY){A=this.event.pageY}else{if(this.event.clientY){A=this.event.clientY+hui.window.getScrollTop()}}}return A},getElement:function(){return this.element},findByClass:function(A){return hui.get.firstAncestorByClass(this.element,A)},findByTag:function(A){var B=this.element;while(B){if(B.tagName&&B.tagName.toLowerCase()==A){return B}B=B.parentNode}return null},stop:function(){hui.stop(this.event)}};hui.stop=function(A){if(!A){A=window.event}if(A.stopPropagation){A.stopPropagation()}if(A.preventDefault){A.preventDefault()}A.cancelBubble=true;A.stopped=true};hui.onReady=function(A){if(window.addEventListener){window.addEventListener("DOMContentLoaded",A,false)}else{if(typeof document.addEventListener!="undefined"){document.addEventListener("load",A,false)}else{if(typeof window.attachEvent!="undefined"){window.attachEvent("onload",A)}else{if(typeof window.onload=="function"){var B=window.onload;window.onload=function(){B();A()}}else{window.onload=A}}}}};hui.request=function(B){B=hui.override({method:"POST",async:true,headers:{Ajax:true}},B);var E=hui.request.createTransport();E.onreadystatechange=function(){try{if(E.readyState==4){if(E.status==200&&B.onSuccess){B.onSuccess(E)}else{if(E.status==403&&B.onForbidden){B.onForbidden(E)}else{if(E.status!==0&&B.onFailure){B.onFailure(E)}else{if(E.status==0&&B.onAbort){B.onAbort(E)}}}}}}catch(F){if(B.onException){B.onException(F,E)}else{throw F}}};var D=B.method.toUpperCase();E.open(D,B.url,B.async);var A=null;if(D=="POST"&&B.file){if(false){A=B.file;E.setRequestHeader("Content-type",B.file.type);E.setRequestHeader("X_FILE_NAME",B.file.name)}else{A=new FormData();A.append("file",B.file);if(B.parameters){for(param in B.parameters){A.append(param,B.parameters[param])}}}if(B.onProgress){E.upload.addEventListener("progress",function(F){B.onProgress(F.loaded,F.total)},false)}if(B.onLoad){E.upload.addEventListener("load",function(F){B.onLoad()},false)}}else{if(D=="POST"&&B.files){A=new FormData();for(var C=0;C<B.files.length;C++){A.append("file"+C,B.files[C])}}else{if(D=="POST"&&B.parameters){A=hui.request._buildPostBody(B.parameters);E.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=utf-8")}else{A=""}}}if(B.headers){for(name in B.headers){E.setRequestHeader(name,B.headers[name])}}E.send(A);return E};hui.request.isXMLResponse=function(A){return A.responseXML&&A.responseXML.documentElement&&A.responseXML.documentElement.nodeName!="parsererror"};hui.request._buildPostBody=function(B){if(!B){return null}var A="";for(param in B){if(A.length>0){A+="&"}A+=encodeURIComponent(param)+"=";if(B[param]!==undefined&&B[param]!==null){A+=encodeURIComponent(B[param])}}return A};hui.request.createTransport=function(){try{if(window.XMLHttpRequest){var B=new XMLHttpRequest();if(B.readyState==null){B.readyState=1;B.addEventListener("load",function(){B.readyState=4;if(typeof B.onreadystatechange=="function"){B.onreadystatechange()}},false)}return B}else{if(window.ActiveXObject){return hui.request._getActiveX()}else{this.delegate.onError(this)}}}catch(A){if(this.delegate.onError){this.delegate.onError(this,A)}}};hui.request._getActiveX=function(){var C=["MSXML2","Microsoft","MSXML","MSXML3"];var D;for(var B=0;B<C.length;B++){try{D=new ActiveXObject(C[B]+".XmlHttp");return D}catch(A){}}throw new Error("Could not find an installed XML parser")};hui.style={copy:function(E,F,D){for(var A=0;A<D.length;A++){var B=D[A];var C=hui.style.get(E,B);if(C){F.style[B]=C}}},set:function(A,B){for(style in B){if(style==="transform"){A.style["webkitTransform"]=B[style]}else{if(style==="opacity"){hui.style.setOpacity(A,B[style])}else{A.style[style]=B[style]}}}},get:function(B,C){B=hui.get(B);var E=hui.string.camelize(C);var D=B.style[E];if(!D){if(document.defaultView&&document.defaultView.getComputedStyle){var A=document.defaultView.getComputedStyle(B,null);D=A?A.getPropertyValue(C):null}else{if(B.currentStyle){D=B.currentStyle[E]}}}if(window.opera&&["left","top","right","bottom"].include(C)){if(hui.style.get(B,"position")=="static"){D="auto"}}return D=="auto"?"":D},setOpacity:function(B,A){if(!hui.browser.opacity){if(A==1){B.style["filter"]=null}else{B.style["filter"]="alpha(opacity="+(A*100)+")"}}else{B.style["opacity"]=A}}};hui.frame={getDocument:function(A){if(A.contentDocument){return A.contentDocument}else{if(A.contentWindow){return A.contentWindow.document}else{if(A.document){return A.document}}}},getWindow:function(A){if(A.defaultView){return A.defaultView}else{if(A.contentWindow){return A.contentWindow}}}};hui.selection={clear:function(){var A;if(document.selection&&document.selection.empty){document.selection.empty()}else{if(window.getSelection){A=window.getSelection();if(A&&A.removeAllRanges){A.removeAllRanges()}}}},getText:function(A){A=A||document;if(A.getSelection){return A.getSelection()+""}else{if(A.selection){return A.selection.createRange().text}}return""},getNode:function(B){B=B||document;if(B.getSelection){var A=B.getSelection().getRangeAt(0);return A.commonAncestorContainer()}return null},get:function(A){return{node:hui.selection.getNode(A),text:hui.selection.getText(A)}}};hui.effect={makeFlippable:function(A){if(hui.browser.webkit){hui.cls.add(A.container,"hui_flip_container");hui.cls.add(A.front,"hui_flip_front");hui.cls.add(A.back,"hui_flip_back")}else{hui.cls.add(A.front,"hui_flip_front_legacy");hui.cls.add(A.back,"hui_flip_back_legacy")}},flip:function(B){if(!hui.browser.webkit){hui.cls.toggle(B.element,"hui_flip_flipped_legacy")}else{var C=hui.get(B.element);var E=B.duration||"1s";var D=hui.get.firstByClass(C,"hui_flip_front");var A=hui.get.firstByClass(C,"hui_flip_back");D.style.webkitTransitionDuration=E;A.style.webkitTransitionDuration=E;hui.cls.toggle(B.element,"hui_flip_flipped")}},bounceIn:function(A){var B=A.element;if(hui.browser.msie){hui.style.set(B,{"display":"block",visibility:"visible"})}else{hui.style.set(B,{"display":"block","opacity":0,visibility:"visible"});hui.animate(B,"transform","scale(0.1)",0);window.setTimeout(function(){hui.animate(B,"opacity",1,300);hui.animate(B,"transform","scale(1)",400,{ease:hui.ease.backOut})})}},fadeIn:function(A){var B=A.element;if(hui.style.get(B,"display")=="none"){hui.style.set(B,{opacity:0,display:"inherit"})}hui.animate({node:B,css:{opacity:1},delay:A.delay||null,duration:A.duration||500,onComplete:A.onComplete})},fadeOut:function(A){hui.animate({node:A.element,css:{opacity:0},delay:A.delay||null,duration:A.duration||500,hideOnComplete:true,onComplete:A.onComplete})},wiggle:function(A){var B=hui.ui.getElement(A.element);hui.cls.add(A.element,"hui_effect_wiggle");window.setTimeout(function(){hui.cls.remove(A.element,"hui_effect_wiggle")},A.duration||1000)}};hui.document={getWidth:function(){return Math.max(document.body.clientWidth,document.documentElement.clientWidth,document.documentElement.scrollWidth)},getHeight:function(){if(hui.browser.msie6){var A=Math.max(document.body.clientHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight);var C=document.body.childNodes;for(var B=0;B<C.length;B++){if(hui.dom.isElement(C[B])){A=Math.max(A,C[B].clientHeight)}}return A}if(window.scrollMaxY&&window.innerHeight){return window.scrollMaxY+window.innerHeight}else{return Math.max(document.body.clientHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight)}}};hui.drag={register:function(A){hui.listen(A.element,"mousedown",function(B){hui.stop(B);hui.drag.start(A)})},start:function(B){var E=hui.browser.msie?document:window;if(B.onStart){B.onStart()}var A,D,C=false;A=function(F){F=hui.event(F);F.stop(F);if(!C&&B.onBeforeMove){B.onBeforeMove(F)}C=true;B.onMove(F)}.bind(this);hui.listen(E,"mousemove",A);D=function(){hui.unListen(E,"mousemove",A);hui.unListen(E,"mouseup",D);if(B.onEnd){B.onEnd()}if(C&&B.onAfterMove){B.onAfterMove()}hui.drag._setSelect(true)}.bind(this);hui.listen(E,"mouseup",D);hui.drag._setSelect(false)},_setSelect:function(A){document.onselectstart=A?null:function(){return false};document.body.style.webkitUserSelect=A?null:"none"},_nativeListeners:[],_activeDrop:null,listen:function(A){if(hui.browser.msie){return }hui.drag._nativeListeners.push(A);if(hui.drag._nativeListeners.length>1){return }hui.listen(document.body,"dragenter",function(F){var B=hui.drag._nativeListeners;var E=null;for(var D=0;D<B.length;D++){var C=B[D].element;if(hui.dom.isDescendantOrSelf(F.target,C)){E=B[D];if(hui.drag._activeDrop==null||hui.drag._activeDrop!=E){hui.cls.add(C,E.hoverClass)}break}}if(hui.drag._activeDrop){if(hui.drag._activeDrop!=E){hui.cls.remove(hui.drag._activeDrop.element,hui.drag._activeDrop.hoverClass)}}hui.drag._activeDrop=E});hui.listen(document.body,"dragover",function(B){hui.stop(B)});hui.listen(document.body,"drop",function(D){hui.stop(D);var C=hui.drag._activeDrop;hui.drag._activeDrop=null;if(C){hui.cls.remove(C.element,C.hoverClass);if(C.onDrop){C.onDrop(D)}if(C.onFiles&&D.dataTransfer&&D.dataTransfer.files&&D.dataTransfer.files.length>0){C.onFiles(D.dataTransfer.files)}else{if(C.onURL&&hui.array.contains(D.dataTransfer.types,"public.url")){var B=D.dataTransfer.getData("public.url");if(C.onURL&&!hui.string.startsWith(B,"data:")){C.onURL(B)}}}}})}};hui.Preloader=function(A){this.options=A||{};this.delegate={};this.images=[];this.loaded=0};hui.Preloader.prototype={addImages:function(A){if(typeof (A)=="object"){for(var B=0;B<A.length;B++){this.images.push(A[B])}}else{this.images.push(A)}},setDelegate:function(A){this.delegate=A},load:function(E){E=E||0;var B=this;this.obs=[];for(var D=E;D<this.images.length+E;D++){var C=D;if(C>=this.images.length){C=C-this.images.length}var A=new Image();A.huiPreloaderIndex=C;A.onload=function(){B._imageChanged(this.huiPreloaderIndex,"imageDidLoad")};A.onerror=function(){B._imageChanged(this.huiPreloaderIndex,"imageDidGiveError")};A.onabort=function(){B._imageChanged(this.huiPreloaderIndex,"imageDidAbort")};A.src=(this.options.context?this.options.context:"")+this.images[C];this.obs.push(A)}},_imageChanged:function(A,B){this.loaded++;if(this.delegate[B]){this.delegate[B](this.loaded,this.images.length,A)}if(this.loaded==this.images.length&&this.delegate.allImagesDidLoad){this.delegate.allImagesDidLoad()}}};hui.cookie={set:function(C,D,E){var A;if(E){var B=new Date();B.setTime(B.getTime()+(E*24*60*60*1000));A="; expires="+B.toGMTString()}else{A=""}document.cookie=C+"="+D+A+"; path=/"},get:function(B){var D=B+"=";var A=document.cookie.split(";");for(var C=0;C<A.length;C++){var E=A[C];while(E.charAt(0)==" "){E=E.substring(1,E.length)}if(E.indexOf(D)==0){return E.substring(D.length,E.length)}}return null},clear:function(A){this.set(A,"",-1)}};hui.location={getParameter:function(A){var C=hui.location.getParameters();for(var B=0;B<C.length;B++){if(C[B].name==A){return C[B].value}}return null},setParameter:function(A,E){var C=hui.location.getParameters();var D=false;for(var B=0;B<C.length;B++){if(C[B].name==A){C[B].value=E;D=true;break}}if(!D){C.push({name:A,value:E})}hui.location.setParameters(C)},hasHash:function(A){var B=document.location.hash;if(B!==""){return B=="#"+A}return false},getHashParameter:function(A){var D=document.location.hash;if(D!==""){var B=D.indexOf(A+"=");if(B!==-1){var C=D.substring(B+A.length+1);if(C.indexOf("&")!==-1){return C.substring(0,C.indexOf("&"))}return C}}return null},clearHash:function(){document.location.hash="#"},setParameters:function(B){var C="";for(var A=0;A<B.length;A++){C+=A==0?"?":"&";C+=B[A].name+"="+B[A].value}document.location.search=C},getBoolean:function(A){var B=hui.location.getParameter(A);return(B=="true"||B=="1")},getInt:function(A){var B=parseInt(hui.location.getParameter(A));if(B!==NaN){return B}return null},getParameters:function(){var B=document.location.search.substring(1).split("&");var A=[];for(var D=0;D<B.length;D++){var E=B[D].split("=");var C=unescape(E[0]).replace(/^\s*|\s*$/g,"");var F=unescape(E[1]).replace(/^\s*|\s*$/g,"");if(C){A.push({name:C,value:F})}}return A}};if(!Function.prototype.bind){Function.prototype.bind=function(){if(arguments.length<2&&arguments[0]===undefined){return this}var C=this,A=Array.prototype.slice.call(arguments),B=A.shift();return function(){return C.apply(B,A.concat(Array.prototype.slice.call(arguments)))}};Function.bind=function(){var A=Array.prototype.slice.call(arguments);return Function.prototype.bind.apply(A.shift(),A)}}if(!Function.prototype.argumentNames){Function.prototype.argumentNames=function(){var A=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return A.length==1&&!A[0]?[]:A}}hui.animate=function(A,E,D,F,B){if(typeof (A)=="string"||hui.dom.isElement(A)){hui.animation.get(A).animate(null,D,E,F,B)}else{var C=hui.animation.get(A.node);for(prop in A.css){C.animate(null,A.css[prop],prop,A.duration,A)}}};hui.animation={objects:{},running:false,latestId:0,get:function(A){A=hui.get(A);if(!A.huiAnimationId){A.huiAnimationId=this.latestId++}if(!this.objects[A.huiAnimationId]){this.objects[A.huiAnimationId]=new hui.animation.Item(A)}return this.objects[A.huiAnimationId]},start:function(){if(!this.running){hui.animation._render()}}};hui.animation._lengthUpater=function(C,B,A){C.style[A.property]=(A.from+(A.to-A.from)*B)+(A.unit!=null?A.unit:"")};hui.animation._transformUpater=function(D,B,A){var C=A.transform;var E="";if(C.rotate){E+=" rotate("+(C.rotate.from+(C.rotate.to-C.rotate.from)*B)+C.rotate.unit+")"}if(C.scale){E+=" scale("+(C.scale.from+(C.scale.to-C.scale.from)*B)+")"}D.style[hui.animation.TRANSFORM]=E};hui.animation._colorUpater=function(D,C,B){var F=Math.round(B.from.red+(B.to.red-B.from.red)*C);var E=Math.round(B.from.green+(B.to.green-B.from.green)*C);var A=Math.round(B.from.blue+(B.to.blue-B.from.blue)*C);value="rgb("+F+","+E+","+A+")";D.style[B.property]=value};hui.animation._propertyUpater=function(C,B,A){C[A.property]=Math.round(A.from+(A.to-A.from)*B)};hui.animation._ieOpacityUpdater=function(D,B,A){var C=(A.from+(A.to-A.from)*B);if(C==1){D.style.removeAttribute("filter")}else{D.style["filter"]="alpha(opacity="+(C*100)+")"}};hui.animation._render=function(){hui.animation.running=true;var G=false,A=new Date().getTime();for(var B in hui.animation.objects){var D=hui.animation.objects[B];if(D.work){var E=D.element;for(var F=0;F<D.work.length;F++){var H=D.work[F];if(H.finished){continue}var C=(A-H.start)/(H.end-H.start);if(C<0){G=true;continue}else{if(isNaN(C)||C>1){C=1}else{if(C<1){G=true}}}var J=C,I=null;if(H.delegate&&H.delegate.ease){J=H.delegate.ease(J)}if(H.delegate&&H.delegate.callback){H.delegate.callback(E,J)}else{if(H.updater){H.updater(E,J,H)}}if(C==1){H.finished=true;if(H.delegate&&H.delegate.onComplete){window.setTimeout(H.delegate.onComplete)}else{if(H.delegate&&H.delegate.hideOnComplete){E.style.display="none"}}}}}}if(G){window.setTimeout(hui.animation._render,0)}else{hui.animation.running=false}};hui.animation._parseStyle=function(D){var B={type:null,value:null,unit:null};var C;if(!hui.isDefined(D)){return B}else{if(!isNaN(D)){B.value=parseFloat(D)}else{if(C=D.match(/([\-]?[0-9\.]+)(px|pt|%)/)){B.type="length";B.value=parseFloat(C[1]);B.unit=C[2]}else{if(C=D.match(/rgb\(([0-9]+),[ ]?([0-9]+),[ ]?([0-9]+)\)/)){B.type="color";B.value={red:parseInt(C[1]),green:parseInt(C[2]),blue:parseInt(C[3])}}else{var A=new hui.Color(D);if(A.ok){B.value={red:A.r,green:A.g,blue:A.b}}}}}}return B};hui.animation.Item=function(A){this.element=A;this.work=[]};hui.animation.Item.prototype.animate=function(H,I,J,B,F){var G=this.getWork(hui.string.camelize(J));G.delegate=F;G.finished=false;var D=!(J=="scrollLeft"||J=="scrollTop");if(H!==null){G.from=H}else{if(J=="transform"){G.transform=hui.animation.Item.parseTransform(I,this.element)}else{if(!hui.browser.opacity&&J=="opacity"){G.from=this._getIEOpacity(this.element)}else{if(D){var A=hui.style.get(this.element,J);var C=hui.animation._parseStyle(A);G.from=C.value}else{G.from=this.element[J]}}}}if(D){var E=hui.animation._parseStyle(I);G.to=E.value;G.unit=E.unit;if(!hui.browser.opacity&&J=="opacity"){G.updater=hui.animation._ieOpacityUpdater}else{if(J=="transform"){G.updater=hui.browser.msie?function(){}:hui.animation._transformUpater}else{if(E.value.red===undefined){G.updater=hui.animation._lengthUpater}else{G.updater=hui.animation._colorUpater}}}}else{G.to=I;G.unit=null;G.updater=hui.animation._propertyUpater}G.start=new Date().getTime();if(F&&F.delay){G.start+=F.delay}G.end=G.start+B;hui.animation.start()};hui.animation.TRANSFORM=hui.browser.gecko?"MozTransform":"WebkitTransform";hui.animation.Item.parseTransform=function(G,D){var I={};var F,E;var H=/rotate\(([0-9\.]+)([a-z]+)\)/i;var C=G.match(H);if(C){F=0;if(D.style[hui.animation.TRANSFORM]){E=D.style[hui.animation.TRANSFORM].match(H);if(E){F=parseFloat(E[1])}}I.rotate={from:F,to:parseFloat(C[1]),unit:C[2]}}var A=/scale\(([0-9\.]+)\)/i;var B=G.match(A);if(B){F=1;if(D.style[hui.animation.TRANSFORM]){E=D.style[hui.animation.TRANSFORM].match(A);if(E){F=parseFloat(E[1])}}I.scale={from:F,to:parseFloat(B[1])}}return I};hui.animation.Item.prototype._getIEOpacity=function(B){var C=hui.style.get(B,"filter").toLowerCase();var A;if(A=C.match(/opacity=([0-9]+)/)){return parseFloat(A[1])/100}else{return 1}};hui.animation.Item.prototype.getWork=function(C){for(var B=this.work.length-1;B>=0;B--){if(this.work[B].property===C){return this.work[B]}}var A={property:C};this.work[this.work.length]=A;return A};hui.animation.Loop=function(A){this.recipe=A;this.position=-1;this.running=false};hui.animation.Loop.prototype.next=function(){this.position++;if(this.position>=this.recipe.length){this.position=0}var B=this.recipe[this.position];if(typeof (B)=="function"){B()}else{if(B.element){hui.animate(B.element,B.property,B.value,B.duration,{ease:B.ease})}}var A=this;var C=B.duration||0;if(B.wait!==undefined){C=B.wait}window.setTimeout(function(){A.next()},C)};hui.animation.Loop.prototype.start=function(){this.running=true;this.next()};hui.ease={slowFastSlow:function(C){var B=1.6;var A=1.4;return -1*Math.pow(Math.cos((Math.PI/2)*Math.pow(C,B)),Math.pow(Math.PI,A))+1},fastSlow:function(C){var B=0.5;var A=0.7;return -1*Math.pow(Math.cos((Math.PI/2)*Math.pow(C,B)),Math.pow(Math.PI,A))+1},elastic:function(A){return 1-hui.ease.elastic2(1-A)},elastic2:function(B,A,D){if(B<=0||B>=1){return B}if(!D){D=0.45}var C;if(!A||A<1){A=1;C=D/4}else{C=D/(2*Math.PI)*Math.asin(1/A)}return -(A*Math.pow(2,10*(B-=1))*Math.sin((B-C)*(2*Math.PI)/D))},bounce:function(A){if(A<(1/2.75)){return 7.5625*A*A}else{if(A<(2/2.75)){return(7.5625*(A-=(1.5/2.75))*A+0.75)}else{if(A<(2.5/2.75)){return(7.5625*(A-=(2.25/2.75))*A+0.9375)}else{return(7.5625*(A-=(2.625/2.75))*A+0.984375)}}}},flicker:function(A){if(A==1){return 1}return Math.random()*A},linear:function(A){return A},quadIn:function(A){return Math.pow(A,2)},quadOut:function(A){return A*(A-2)*-1},quadInOut:function(A){A=A*2;if(A<1){return Math.pow(A,2)/2}return -1*((--A)*(A-2)-1)/2},cubicIn:function(A){return Math.pow(A,3)},cubicOut:function(A){return Math.pow(A-1,3)+1},cubicInOut:function(A){A=A*2;if(A<1){return Math.pow(A,3)/2}A-=2;return(Math.pow(A,3)+2)/2},quartIn:function(A){return Math.pow(A,4)},quartOut:function(A){return -1*(Math.pow(A-1,4)-1)},quartInOut:function(A){A=A*2;if(A<1){return Math.pow(A,4)/2}A-=2;return -1/2*(Math.pow(A,4)-2)},quintIn:function(A){return Math.pow(A,5)},quintOut:function(A){return Math.pow(A-1,5)+1},quintInOut:function(A){A=A*2;if(A<1){return Math.pow(A,5)/2}A-=2;return(Math.pow(A,5)+2)/2},sineIn:function(A){return -1*Math.cos(A*(Math.PI/2))+1},sineOut:function(A){return Math.sin(A*(Math.PI/2))},sineInOut:function(A){return -1*(Math.cos(Math.PI*A)-1)/2},expoIn:function(A){return(A==0)?0:Math.pow(2,10*(A-1))},expoOut:function(A){return(A==1)?1:(-1*Math.pow(2,-10*A)+1)},expoInOut:function(A){if(A==0){return 0}if(A==1){return 1}A=A*2;if(A<1){return Math.pow(2,10*(A-1))/2}--A;return(-1*Math.pow(2,-10*A)+2)/2},circIn:function(A){return -1*(Math.sqrt(1-Math.pow(A,2))-1)},circOut:function(A){A=A-1;return Math.sqrt(1-Math.pow(A,2))},circInOut:function(A){A=A*2;if(A<1){return -1/2*(Math.sqrt(1-Math.pow(A,2))-1)}A-=2;return 1/2*(Math.sqrt(1-Math.pow(A,2))+1)},backIn:function(B){var A=1.70158;return Math.pow(B,2)*((A+1)*B-A)},backOut:function(B){B=B-1;var A=1.70158;return Math.pow(B,2)*((A+1)*B+A)+1},backInOut:function(B){var A=1.70158*1.525;B=B*2;if(B<1){return(Math.pow(B,2)*((A+1)*B-A))/2}B-=2;return(Math.pow(B,2)*((A+1)*B+A)+2)/2},elasticIn:function(C){if(C==0){return 0}if(C==1){return 1}var B=0.3;var A=B/4;C=C-1;return -1*Math.pow(2,10*C)*Math.sin((C-A)*(2*Math.PI)/B)},elasticOut:function(C){if(C==0){return 0}if(C==1){return 1}var B=0.3;var A=B/4;return Math.pow(2,-10*C)*Math.sin((C-A)*(2*Math.PI)/B)+1},elasticInOut:function(C){if(C==0){return 0}C=C*2;if(C==2){return 1}var B=0.3*1.5;var A=B/4;if(C<1){C-=1;return -0.5*(Math.pow(2,10*C)*Math.sin((C-A)*(2*Math.PI)/B))}C-=1;return 0.5*(Math.pow(2,-10*C)*Math.sin((C-A)*(2*Math.PI)/B))+1},bounceIn:function(A){return(1-hui.ease.bounceOut(1-A))},bounceOut:function(D){var B=7.5625;var C=2.75;var A;if(D<(1/C)){A=B*Math.pow(D,2)}else{if(D<(2/C)){D-=(1.5/C);A=B*Math.pow(D,2)+0.75}else{if(D<(2.5/C)){D-=(2.25/C);A=B*Math.pow(D,2)+0.9375}else{D-=(2.625/C);A=B*Math.pow(D,2)+0.984375}}}return A},bounceInOut:function(A){if(A<0.5){return hui.ease.bounceIn(A*2)/2}return(hui.ease.bounceOut(A*2-1)/2)+0.5}};hui.Color=function(F){this.ok=false;if(hui.isBlank(F)){return }if(F.charAt(0)=="#"){F=F.substr(1,6)}F=F.replace(/ /g,"");F=F.toLowerCase();for(var B in hui.Color.table){if(F==B){F=hui.Color.table[B]}}var G=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,process:function(H){return[parseInt(H[1]),parseInt(H[2]),parseInt(H[3])]}},{re:/^rgb\((\d{1,3})%,\s*(\d{1,3})%,\s*(\d{1,3})%\)$/,process:function(H){return[Math.round(parseInt(H[1])/100*255),Math.round(parseInt(H[2])/100*255),Math.round(parseInt(H[3])/100*255)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,process:function(H){return[parseInt(H[1],16),parseInt(H[2],16),parseInt(H[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,process:function(H){return[parseInt(H[1]+H[1],16),parseInt(H[2]+H[2],16),parseInt(H[3]+H[3],16)]}}];for(var A=0;A<G.length;A++){var D=G[A].re,C=G[A].process,E=D.exec(F);if(E){channels=C(E);this.r=channels[0];this.g=channels[1];this.b=channels[2];this.ok=true;break}}this.r=(this.r<0||isNaN(this.r))?0:((this.r>255)?255:this.r);this.g=(this.g<0||isNaN(this.g))?0:((this.g>255)?255:this.g);this.b=(this.b<0||isNaN(this.b))?0:((this.b>255)?255:this.b)};hui.Color.prototype={toRGB:function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},toHex:function(){var C=this.r.toString(16);var B=this.g.toString(16);var A=this.b.toString(16);if(C.length==1){C="0"+C}if(B.length==1){B="0"+B}if(A.length==1){A="0"+A}return"#"+C+B+A}};hui.Color.table={white:"ffffff",black:"000000",red:"ff0000",green:"00ff00",blue:"0000ff"};hui.Color.hex2rgb=function(D){if(hui.isBlank(D)){return null}if(D[0]=="#"){D=D.substr(1)}if(D.length==3){var A=D;D="";A=/^([a-f0-9])([a-f0-9])([a-f0-9])$/i.exec(A).slice(1);for(var C=0;C<3;C++){D+=A[C]+A[C]}}var B=/^([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i.exec(D).slice(1);return{r:parseInt(B[0],16),g:parseInt(B[1],16),b:parseInt(B[2],16)}};hui.Color.hsv2rgb=function(F,I,E){var N=F/360,K,P,C;if(I==0){K=E*255;P=E*255;C=E*255}else{var L=N*6,D,M,O;var J=Math.floor(L);var A=E*(1-I);var T=E*(1-I*(L-J));var Q=E*(1-I*(1-(L-J)));if(J==0){D=E;M=Q;O=A}else{if(J==1){D=T;M=E;O=A}else{if(J==2){D=A;M=E;O=Q}else{if(J==3){D=A;M=T;O=E}else{if(J==4){D=Q;M=A;O=E}else{D=E;M=A;O=T}}}}}K=Math.round(D*255);P=Math.round(M*255);C=Math.round(O*255)}return new Array(K,P,C)};hui.Color.rgb2hsv=function(G,F,B){G=(G/255);F=(F/255);B=(B/255);var D=Math.min(Math.min(G,F),B),A=Math.max(Math.max(G,F),B),H=A,E,C;if(A==D){C=0}else{if(A==G){C=(60*((F-B)/(A-D)))%360}else{if(A==F){C=60*((B-G)/(A-D))+120}else{if(A==B){C=60*((G-F)/(A-D))+240}}}}if(C<0){C+=360}if(A==0){E=0}else{E=1-(D/A)}return[Math.round(C),Math.round(E*100),Math.round(H*100)]};hui.Color.rgb2hex=function(B){var D="#";for(var A=0;A<3;A++){var C=parseInt(B[A]).toString(16);if(C.length<2){C="0"+C}D+=C}return D};!function(F,T,J){var G=T.getElementsByTagName("head")[0],R={},P={},S={},D={},M="string",Q=false,H="push",K="DOMContentLoaded",B="readyState",O="addEventListener",N="onreadystatechange",U=function(V,Y){for(var X=0,W=V.length;X<W;++X){if(!Y(V[X])){return Q}}return 1};function E(V,W){U(V,function(X){return !W(X)})}if(!T[B]&&T[O]){T[O](K,function I(){T.removeEventListener(K,I,Q);T[B]="complete"},Q);T[B]="loading"}var C=function(d,Z,X){d=d[H]?d:[d];var W=Z&&Z.call,Y=W?Z:X,V=W?d.join(""):Z,a=d.length;function b(e){return e.call?e():R[e]}function c(){if(!--a){R[V]=1;Y&&Y();for(var e in S){U(e.split("|"),b)&&!E(S[e],b)&&(S[e]=[])}}}J(function(){E(d,function(e){if(D[e]){V&&(P[V]=1);c();return }D[e]=1;V&&(P[V]=1);L(C.path?C.path+e+".js":e,c)})},0);return C};function L(Y,X){var W=T.createElement("script"),V=Q;W.onload=W.onerror=W[N]=function(){if((W[B]&&!(/^c|loade/.test(W[B])))||V){return }W.onload=W[N]=null;V=1;X()};W.async=1;W.src=Y;G.insertBefore(W,G.firstChild)}C.get=L;C.ready=function(Y,W,X){Y=Y[H]?Y:[Y];var V=[];!E(Y,function(Z){R[Z]||V[H](Z)})&&U(Y,function(Z){return R[Z]})?W():!function(Z){S[Z]=S[Z]||[];S[Z][H](W);X&&X(V)}(Y.join("|"));return C};var A=F.$script;C.noConflict=function(){F.$script=A;return this};(typeof module!=="undefined"&&module.exports)?(module.exports=C):(F.hui.require=C)}(this,document,setTimeout);hui.ui={domReady:false,context:"",language:"en",layoutWidgets:[],objects:[],delegates:[],state:"default",latestObjectIndex:0,latestIndex:500,latestPanelIndex:1000,latestAlertIndex:1500,latestTopIndex:2000,toolTips:{},confirmOverlays:{},delayedUntilReady:[],texts:{request_error:{en:"An error occurred on the server",da:"Der skete en fejl på serveren"},"continue":{en:"Continue",da:"Fortsæt"},reload_page:{en:"Reload page",da:"Indæs siden igen"},access_denied:{en:"Access denied, maybe you are nolonger logged in",da:"Adgang nægtet, du er måske ikke længere logget ind"}}};hui.onReady(function(){if(window.dwr&&window.dwr.engine&&window.dwr.engine.setErrorHandler){window.dwr.engine.setErrorHandler(function(C,B){hui.log(C);hui.log(B)})}hui.ui.callSuperDelegates(this,"ready");hui.listen(window,"resize",hui.ui._resize);hui.ui._resize();hui.ui.domReady=true;if(window.parent&&window.parent.hui&&window.parent.hui.ui){window.parent.hui.ui._frameLoaded(window)}for(var A=0;A<hui.ui.delayedUntilReady.length;A++){hui.ui.delayedUntilReady[A]()}});hui.ui.get=function(A){if(A){if(A.element){return A}return hui.ui.objects[A]}return null};hui.ui.getText=function(B){var A=this.texts[B];if(!A){return B}if(A[this.language]){return A[this.language]}else{return A["en"]}};hui.ui.onReady=function(A){if(hui.ui.domReady){return A()}if(hui.browser.gecko&&hui.string.endsWith(document.baseURI,"xml")){window.setTimeout(A,1000);return }hui.ui.delayedUntilReady.push(A)};hui.ui._frameLoaded=function(A){hui.ui.callSuperDelegates(this,"frameLoaded",A)};hui.ui._resize=function(){for(var A=hui.ui.layoutWidgets.length-1;A>=0;A--){hui.ui.layoutWidgets[A]["$$resize"]()}};hui.ui.confirmOverlay=function(B){var E=B.element,A;if(!E){E=document.body}if(B.widget){E=B.widget.getElement()}if(hui.ui.confirmOverlays[E]){A=hui.ui.confirmOverlays[E];A.clear()}else{A=hui.ui.Overlay.create({modal:true});hui.ui.confirmOverlays[E]=A}if(B.text){A.addText(B.text)}var C=hui.ui.Button.create({text:B.okText||"OK",highlighted:"true"});C.click(function(){if(B.onOk){B.onOk()}A.hide()});A.add(C);var D=hui.ui.Button.create({text:B.cancelText||"Cancel"});D.onClick(function(){A.hide()});A.add(D);A.show({element:E})};hui.ui.destroy=function(B){var A=hui.ui.objects;delete (A[B.name])};hui.ui.destroyDescendants=function(B){var E=hui.ui.getDescendants(B);var C=hui.ui.objects;for(var A=0;A<E.length;A++){var D=delete (C[E[A].name]);if(!D){hui.log("not found: "+E[A].name)}}};hui.ui.getAncestors=function(E){var H=[];var F=E.element;if(F){var A=hui.get.ancestors(F);var G=[];for(var D in hui.ui.objects){G.push(hui.ui.objects[D])}for(var C=0;C<A.length;C++){for(var B=0;B<G.length;B++){if(G[B].element==A[C]){H.push(G[B])}}}}return H};hui.ui.getDescendants=function(H){var G=[],D=H.getElement?H.getElement():H;if(D){var F=D.getElementsByTagName("*");var E=[];for(var C in hui.ui.objects){E.push(hui.ui.objects[C])}for(var B=0;B<F.length;B++){for(var A=0;A<E.length;A++){if(F[B]==E[A].element){G.push(E[A])}}}}return G};hui.ui.getAncestor=function(D,B){var A=hui.ui.getAncestors(D);for(var C=0;C<A.length;C++){if(hui.cls.has(A[C].getElement(),B)){return A[C]}}return null};hui.ui.changeState=function(C){if(hui.ui.state===C){return }var B=hui.ui.objects,A,D;for(A in B){D=B[A];if(D.options&&D.options.state){if(D.options.state==C){D.show()}else{D.hide()}}}hui.ui.state=C;this.reLayout()};hui.ui.reLayout=function(){var A=hui.ui.objects,B;for(key in A){B=A[key];if(B["$$layout"]){B["$$layout"]()}}};hui.ui.Widget=function(){};hui.ui.Widget.prototype={hide:function(){this.element.style.display="none"},show:function(){this.element.style.display=""}};hui.ui.nextIndex=function(){hui.ui.latestIndex++;return hui.ui.latestIndex};hui.ui.nextPanelIndex=function(){hui.ui.latestPanelIndex++;return hui.ui.latestPanelIndex};hui.ui.nextAlertIndex=function(){hui.ui.latestAlertIndex++;return hui.ui.latestAlertIndex};hui.ui.nextTopIndex=function(){hui.ui.latestTopIndex++;return hui.ui.latestTopIndex};hui.ui.showCurtain=function(C){var D=C.widget;if(!D.curtain){D.curtain=hui.build("div",{"class":"hui_curtain",style:"z-index:none"});var A=hui.get.firstByClass(document.body,"hui_body");if(!A){A=document.body}A.appendChild(D.curtain);hui.listen(D.curtain,"click",function(){if(D["$curtainWasClicked"]){D["$curtainWasClicked"]()}})}if(C.color){if(C.color=="auto"){var B=hui.style.get(document.body,"background-color");if(B=="transparent"||B=="rgba(0, 0, 0, 0)"){B="#fff"}D.curtain.style.backgroundColor=B}else{D.curtain.style.backgroundColor=C.color}}if(hui.browser.msie){D.curtain.style.height=hui.document.getHeight()+"px"}else{D.curtain.style.position="fixed";D.curtain.style.top="0";D.curtain.style.left="0";D.curtain.style.bottom="0";D.curtain.style.right="0"}D.curtain.style.zIndex=C.zIndex;hui.style.setOpacity(D.curtain,0);D.curtain.style.display="block";hui.animate(D.curtain,"opacity",0.7,1000,{ease:hui.ease.slowFastSlow})};hui.ui.hideCurtain=function(A){if(A.curtain){hui.animate(A.curtain,"opacity",0,200,{hideOnComplete:true})}};hui.ui.confirm=function(A){if(!A.name){A.name="huiConfirm"}var D=hui.ui.get(A.name);var B;if(!D){D=hui.ui.Alert.create(A);var C=hui.ui.Button.create({name:name+"_cancel",text:A.cancel||"Cancel",highlighted:A.highlighted==="cancel"});C.listen({$click:function(){D.hide();if(A.onCancel){A.onCancel()}hui.ui.callDelegates(D,"cancel")}});D.addButton(C);B=hui.ui.Button.create({name:name+"_ok",text:A.ok||"OK",highlighted:A.highlighted==="ok"});D.addButton(B)}else{D.update(A);B=hui.ui.get(name+"_ok");B.setText(A.ok||"OK");B.setHighlighted(A.highlighted=="ok");B.clearDelegates();hui.ui.get(name+"_cancel").setText(A.ok||"Cancel");hui.ui.get(name+"_cancel").setHighlighted(A.highlighted=="cancel");if(A.cancel){hui.ui.get(name+"_cancel").setText(A.cancel)}}B.listen({$click:function(){D.hide();if(A.onOK){A.onOK()}hui.ui.callDelegates(D,"ok")}});D.show()};hui.ui.alert=function(A){if(!this.alertBox){this.alertBox=hui.ui.Alert.create(A);this.alertBoxButton=hui.ui.Button.create({name:"huiAlertBoxButton",text:"OK"});this.alertBoxButton.listen({$click$huiAlertBoxButton:function(){hui.ui.alertBox.hide();if(hui.ui.alertBoxCallBack){hui.ui.alertBoxCallBack();hui.ui.alertBoxCallBack=null}}});this.alertBox.addButton(this.alertBoxButton)}else{this.alertBox.update(A)}this.alertBoxCallBack=A.onOK;this.alertBoxButton.setText(A.button?A.button:"OK");this.alertBox.show()};hui.ui.showMessage=function(B){if(typeof (B)=="string"){B={text:B}}if(B.delay){hui.ui.messageDelayTimer=window.setTimeout(function(){B.delay=null;hui.ui.showMessage(B)},B.delay);return }window.clearTimeout(hui.ui.messageDelayTimer);if(!hui.ui.message){hui.ui.message=hui.build("div",{"class":"hui_message",html:"<div><div></div></div>"});if(!hui.browser.msie){hui.style.setOpacity(hui.ui.message,0)}document.body.appendChild(hui.ui.message)}var A=hui.ui.message.getElementsByTagName("div")[1];if(B.icon){hui.dom.clear(A);A.appendChild(hui.ui.createIcon(B.icon,24));hui.dom.addText(A,B.text)}else{if(B.busy){A.innerHTML='<span class="hui_message_busy"></span>';hui.dom.addText(A,B.text)}else{hui.dom.setText(A,B.text)}}hui.ui.message.style.display="block";hui.ui.message.style.zIndex=hui.ui.nextTopIndex();hui.ui.message.style.marginLeft=(hui.ui.message.clientWidth/-2)+"px";hui.ui.message.style.marginTop=hui.window.getScrollTop()+"px";if(hui.browser.opacity){hui.animate(hui.ui.message,"opacity",1,300)}window.clearTimeout(hui.ui.messageTimer);if(B.duration){hui.ui.messageTimer=window.setTimeout(hui.ui.hideMessage,B.duration)}};hui.ui.hideMessage=function(){window.clearTimeout(hui.ui.messageDelayTimer);if(hui.ui.message){if(hui.browser.opacity){hui.animate(hui.ui.message,"opacity",0,300,{hideOnComplete:true})}else{hui.ui.message.style.display="none"}}};hui.ui.showToolTip=function(A){var C=A.key||"common";var B=hui.ui.toolTips[C];if(!B){B=hui.build("div",{"class":"hui_tooltip",style:"display:none;",html:"<div><div></div></div>",parent:document.body});hui.ui.toolTips[C]=B}B.onclick=function(){hui.ui.hideToolTip(A)};var E=hui.get(A.element);var D=hui.position.get(E);hui.dom.setText(B.getElementsByTagName("div")[1],A.text);if(B.style.display=="none"&&hui.browser.opacity){hui.style.setOpacity(B,0)}hui.style.set(B,{"display":"block",zIndex:hui.ui.nextTopIndex()});hui.style.set(B,{left:(D.left-B.clientWidth+4)+"px",top:(D.top+2-(B.clientHeight/2)+(E.clientHeight/2))+"px"});if(hui.browser.opacity){hui.animate(B,"opacity",1,300)}};hui.ui.hideToolTip=function(A){var C=A?A.key||"common":"common";var B=hui.ui.toolTips[C];if(B){if(!hui.browser.msie){hui.animate(B,"opacity",0,300,{hideOnComplete:true})}else{B.style.display="none"}}};hui.ui.getElement=function(A){if(hui.dom.isElement(A)){return A}else{if(A.getElement){return A.getElement()}}return null};hui.ui.isWithin=function(B,A){B=new hui.Event(B);var D={left:hui.position.getLeft(A),top:hui.position.getTop(A)};var C={width:A.clientWidth,height:A.clientHeight};return B.getLeft()>D.left&&B.getLeft()<D.left+C.width&&B.getTop()>D.top&&B.getTop()<D.top+C.height};hui.ui.getIconUrl=function(B,A){return hui.ui.context+"/hui/icons/"+B+A+".png"};hui.ui.createIcon=function(B,A){return hui.build("span",{"class":"hui_icon hui_icon_"+A,style:"background-image: url("+hui.ui.getIconUrl(B,A)+")"})};hui.ui.wrapInField=function(B){var A=hui.build("div",{"class":"hui_field",html:'<span class="hui_field_top"><span><span></span></span></span><span class="hui_field_middle"><span class="hui_field_middle"><span class="hui_field_content"></span></span></span><span class="hui_field_bottom"><span><span></span></span></span>'});hui.get.firstByClass(A,"hui_field_content").appendChild(B);return A};hui.ui.addFocusClass=function(B){var A=B.classElement||B.element,C=B["class"];hui.listen(B.element,"focus",function(){hui.cls.add(A,C)});hui.listen(B.element,"blur",function(){hui.cls.remove(A,C)})};hui.ui.stress=function(A){var B=hui.ui.getElement(A);hui.effect.wiggle({element:B,duration:1000})};hui.ui.NumberValidator=function(A){hui.override({allowNull:false,min:0,max:10},A);this.min=A.min;this.max=A.max;this.allowNull=A.allowNull;this.middle=Math.max(Math.min(this.max,0),this.min)};hui.ui.NumberValidator.prototype={validate:function(B){if(hui.isBlank(B)&&this.allowNull){return{valid:true,value:null}}var A=parseFloat(B);if(isNaN(A)){return{valid:false,value:this.middle}}else{if(A<this.min){return{valid:false,value:this.min}}else{if(A>this.max){return{valid:false,value:this.max}}}}return{valid:true,value:A}}};hui.ui.positionAtElement=function(C,G,B){B=B||{};C=hui.get(C);G=hui.get(G);var D=hui.style.get(C,"display");if(D=="none"){hui.style.set(C,{"visibility":"hidden","display":"block"})}var F=hui.position.getLeft(G),E=hui.position.getTop(G);var A=B.vertical||null;if(B.horizontal&&B.horizontal=="right"){F=F+G.clientWidth-C.clientWidth}if(A=="topOutside"){E=E-C.clientHeight}else{if(A=="bottomOutside"){E=E+G.clientHeight}}F+=(B.left||0);E+=(B.top||0);hui.style.set(C,{"left":F+"px","top":E+"px"});if(D=="none"){hui.style.set(C,{"visibility":"visible","display":"none"})}};hui.ui.getTextAreaHeight=function(A){var C=this.textAreaDummy;if(!C){C=this.textAreaDummy=document.createElement("div");C.className="hui_textarea_dummy";document.body.appendChild(C)}var B=A.value;if(B[B.length-1]==="\n"){B+="x"}B=hui.string.escape(B).replace(/\n/g,"<br/>");C.innerHTML=B;C.style.width=(A.clientWidth)+"px";return C.clientHeight};hui.ui.extend=function(B,A){if(!B.name){hui.ui.latestObjectIndex++;B.name="unnamed"+hui.ui.latestObjectIndex}if(A!==undefined){if(B.options){B.options=hui.override(B.options,A)}B.element=hui.get(A.element);B.name=A.name}hui.ui.objects[B.name]=B;B.delegates=[];B.listen=function(C){hui.array.add(this.delegates,C);return this};B.removeDelegate=function(C){hui.array.remove(this.delegates,C)};B.clearDelegates=function(){this.delegates=[]};B.fire=function(E,D,C){return hui.ui.callDelegates(this,E,D,C)};B.fireProperty=function(C,D){hui.ui.firePropertyChange(this,C,D)};if(!B.getElement){B.getElement=function(){return this.element}}if(!B.valueForProperty){B.valueForProperty=function(C){return this[C]}}if(B["$$resize"]){hui.ui.layoutWidgets.push(B)}};hui.ui.callDelegatesDrop=function(A,C){for(var B=0;B<hui.ui.delegates.length;B++){if(hui.ui.delegates[B]["$drop$"+A.kind+"$"+C.kind]){hui.ui.delegates[B]["$drop$"+A.kind+"$"+C.kind](A,C)}}};hui.ui.callAncestors=function(D,F,C,B){if(typeof (C)=="undefined"){C=D}var E=hui.ui.getAncestors(D);for(var A=0;A<E.length;A++){if(E[A][F]){E[A][F](C,B)}}};hui.ui.callDescendants=function(D,F,C,B){if(typeof (C)=="undefined"){C=D}if(!F[0]=="$"){F="$"+F}var E=hui.ui.getDescendants(D);for(var A=0;A<E.length;A++){if(E[A][F]){thisResult=E[A][F](C,B)}}};hui.ui.callVisible=function(A){hui.ui.callDescendants(A,"$visibilityChanged")};hui.ui.listen=function(A){hui.ui.delegates.push(A)};hui.ui.callDelegates=function(E,A,I,B){if(typeof (I)=="undefined"){I=E}var J=undefined;if(E.delegates){for(var F=0;F<E.delegates.length;F++){var G=E.delegates[F],C=undefined,H="$"+A+"$"+E.name;if(E.name&&G[H]){C=G[H](I,B)}else{if(G["$"+A]){C=G["$"+A](I,B)}}if(J===undefined&&C!==undefined&&typeof (C)!="undefined"){J=C}}}var D=hui.ui.callSuperDelegates(E,A,I,B);if(J===undefined&&D!==undefined){J=D}return J};hui.ui.callSuperDelegates=function(F,H,E,D){if(typeof (E)=="undefined"){E=F}var A=undefined;for(var B=0;B<hui.ui.delegates.length;B++){var C=hui.ui.delegates[B];var G=undefined;if(F.name&&C["$"+H+"$"+F.name]){G=C["$"+H+"$"+F.name](E,D)}else{if(C["$"+H]){G=C["$"+H](E,D)}}if(A===undefined&&G!==undefined&&typeof (G)!="undefined"){A=G}}return A};hui.ui.resolveImageUrl=function(G,B,F,A){for(var D=0;D<G.delegates.length;D++){if(G.delegates[D].$resolveImageUrl){return G.delegates[D].$resolveImageUrl(B,F,A)}}for(var C=0;C<hui.ui.delegates.length;C++){var E=hui.ui.delegates[C];if(E.$resolveImageUrl){return E.$resolveImageUrl(B,F,A)}}return null};hui.ui.firePropertyChange=function(C,A,B){hui.ui.callDelegates(C,"propertyChanged",{property:A,value:B})};hui.ui.bind=function(E,A){if(E.charAt(0)=="@"){var D=E.substring(1).split(".");var C=hui.ui.get(D[0]);if(!C){hui.log("Unable to bind to "+E);return }var B=D.slice(1).join(".");C.listen({$propertyChanged:function(F){if(F.property==B){A(F.value)}}});return C.valueForProperty(B)}return E};hui.ui.handleRequestError=function(B){hui.log("General request error received");var A=hui.ui.callSuperDelegates(B||this,"requestError");if(!A){hui.ui.confirmOverlay({element:document.body,text:hui.ui.getText("request_error"),okText:hui.ui.getText("reload_page"),cancelText:hui.ui.getText("continue"),onOk:function(){document.location.reload()}})}};hui.ui.handleForbidden=function(B){hui.log("General access denied received");var A=hui.ui.callSuperDelegates(B||this,"accessDenied");if(!A){hui.ui.confirmOverlay({element:document.body,text:hui.ui.getText("access_denied"),okText:hui.ui.getText("reload_page"),cancelText:hui.ui.getText("continue"),onOk:function(){document.location.reload()}})}};hui.ui.request=function(B){B=hui.override({method:"post",parameters:{}},B);if(B.json){for(var C in B.json){B.parameters[C]=hui.string.toJSON(B.json[C])}}var F=B.onSuccess;var E=B.message;B.onSuccess=function(H){if(E){if(E.success){hui.ui.showMessage({text:E.success,icon:"common/success",duration:E.duration||2000})}else{if(E.start){hui.ui.hideMessage()}}}var I,G;if(typeof (F)=="string"){if(!hui.request.isXMLResponse(H)){I=H.responseText.replace(/^\s+|\s+$/g,"");if(I.length>0){G=hui.string.fromJSON(H.responseText)}else{G=""}hui.ui.callDelegates(G,"success$"+F)}else{hui.ui.callDelegates(H,"success$"+F)}}else{if(hui.request.isXMLResponse(H)&&B.onXML){B.onXML(H.responseXML)}else{if(B.onJSON){I=H.responseText.replace(/^\s+|\s+$/g,"");if(I.length>0){G=hui.string.fromJSON(H.responseText)}else{G=null}B.onJSON(G)}else{if(typeof (F)=="function"){F(H)}else{if(B.onText){B.onText(H.responseText)}}}}}};var D=B.onFailure;B.onFailure=function(G){if(typeof (D)=="string"){hui.ui.callDelegates(G,"failure$"+D)}else{if(typeof (D)=="function"){D(G)}else{if(B.message&&B.message.start){hui.ui.hideMessage()}hui.ui.handleRequestError()}}};B.onException=function(G,H){hui.log(G);hui.log(H)};var A=B.onForbidden;B.onForbidden=function(G){if(B.message&&B.message.start){hui.ui.hideMessage()}if(A){A(G)}else{B.onFailure(G);hui.ui.handleForbidden()}};if(B.message&&B.message.start){hui.ui.showMessage({text:B.message.start,busy:true,delay:B.message.delay})}hui.request(B)};hui.ui.parseItems=function(C){var A=C.documentElement;var B=[];hui.ui.parseSubItems(A,B);return B};hui.ui.parseSubItems=function(D,F){var B=D.childNodes;for(var A=0;A<B.length;A++){var E=B[A];if(E.nodeType==1&&E.nodeName=="title"){F.push({title:E.getAttribute("title"),type:"title"})}else{if(E.nodeType==1&&E.nodeName=="item"){var C=[];hui.ui.parseSubItems(E,C);F.push({title:E.getAttribute("title"),value:E.getAttribute("value"),icon:E.getAttribute("icon"),kind:E.getAttribute("kind"),badge:E.getAttribute("badge"),children:C})}}}};hui.ui.Bundle=function(A){this.strings=A};hui.ui.Bundle.prototype={get:function(B){var A=this.strings[B];if(A){return A[hui.ui.language]}hui.log(B+" not found for language:"+hui.ui.language);return B}};hui.ui.require=function(C,B){for(var A=C.length-1;A>=0;A--){C[A]=hui.ui.context+"hui/js/"+C[A]+".js"}hui.require(C,B)};hui.ui.ImageViewer=function(A){this.options=hui.override({maxWidth:800,maxHeight:600,perimeter:100,sizeSnap:100,margin:0,ease:hui.ease.slowFastSlow,easeEnd:hui.ease.bounce,easeAuto:hui.ease.slowFastSlow,easeReturn:hui.ease.cubicInOut,transition:400,transitionEnd:1000,transitionReturn:300},A);this.element=hui.get(A.element);this.box=this.options.box;this.viewer=hui.get.firstByClass(this.element,"hui_imageviewer_viewer");this.innerViewer=hui.get.firstByClass(this.element,"hui_imageviewer_inner_viewer");this.status=hui.get.firstByClass(this.element,"hui_imageviewer_status");this.previousControl=hui.get.firstByClass(this.element,"hui_imageviewer_previous");this.controller=hui.get.firstByClass(this.element,"hui_imageviewer_controller");this.nextControl=hui.get.firstByClass(this.element,"hui_imageviewer_next");this.playControl=hui.get.firstByClass(this.element,"hui_imageviewer_play");this.closeControl=hui.get.firstByClass(this.element,"hui_imageviewer_close");this.text=hui.get.firstByClass(this.element,"hui_imageviewer_text");this.dirty=false;this.width=600;this.height=460;this.index=0;this.playing=false;this.name=A.name;this.images=[];this.box.listen(this);this._addBehavior();hui.ui.extend(this)};hui.ui.ImageViewer.create=function(A){A=A||{};var B=A.element=hui.build("div",{"class":"hui_imageviewer",html:'<div class="hui_imageviewer_viewer"><div class="hui_imageviewer_inner_viewer"></div></div><div class="hui_imageviewer_text"></div><div class="hui_imageviewer_status"></div><div class="hui_imageviewer_controller"><div><div><a class="hui_imageviewer_previous"></a><a class="hui_imageviewer_play"></a><a class="hui_imageviewer_next"></a><a class="hui_imageviewer_close"></a></div></div></div>'});var C=A.box=hui.ui.Box.create({absolute:true,modal:true,closable:true});C.add(B);C.addToDocument();return new hui.ui.ImageViewer(A)};hui.ui.ImageViewer.prototype={_addBehavior:function(){var A=this;this.nextControl.onclick=function(){A.next(true)};this.previousControl.onclick=function(){A.previous(true)};this.playControl.onclick=function(){A.playOrPause()};this.closeControl.onclick=this.hide.bind(this);hui.listen(this.viewer,"click",this._zoom.bind(this));this._timer=function(){A.next(false)};this._keyListener=function(B){B=hui.event(B);if(B.rightKey){A.next(true)}else{if(B.leftKey){A.previous(true)}else{if(B.escapeKey){A.hide()}else{if(B.returnKey){A.playOrPause()}}}}},hui.listen(this.viewer,"mousemove",this._onMouseMove.bind(this));hui.listen(this.controller,"mouseover",function(){A.overController=true});hui.listen(this.controller,"mouseout",function(){A.overController=false});hui.listen(this.viewer,"mouseout",function(B){if(!hui.ui.isWithin(B,this.viewer)){A._hideController()}}.bind(this))},_onMouseMove:function(){window.clearTimeout(this.ctrlHider);if(this._shouldShowController()){this.ctrlHider=window.setTimeout(this._hideController.bind(this),2000);if(hui.browser.msie){this.controller.style.display="block"}else{hui.effect.fadeIn({element:this.controller,duration:200})}}},_hideController:function(){if(!this.overController){if(hui.browser.msie){this.controller.style.display="none"}else{hui.effect.fadeOut({element:this.controller,duration:500})}}},_getLargestSize:function(A,B){if(B.width<=A.width&&B.height<=A.height){return{width:B.width,height:B.height}}else{if(A.width/A.height>B.width/B.height){return{width:Math.round(A.height/B.height*B.width),height:A.height}}else{if(A.width/A.height<B.width/B.height){return{width:A.width,height:Math.round(A.width/B.width*B.height)}}else{return{width:A.width,height:A.height}}}}},_calculateSize:function(){var A=this.options.sizeSnap;var F=hui.window.getViewWidth()-this.options.perimeter;F=Math.floor(F/A)*A;F=Math.min(F,this.options.maxWidth);var B=hui.window.getViewHeight()-this.options.perimeter;B=Math.floor(B/A)*A;B=Math.min(B,this.options.maxHeight);var E=0;var D=0;for(var C=0;C<this.images.length;C++){var G=this._getLargestSize({width:F,height:B},this.images[C]);E=Math.max(E,G.width);D=Math.max(D,G.height)}B=Math.floor(Math.min(B,D));F=Math.floor(Math.min(F,E));if(F!=this.width||B!=this.height){this.width=F;this.height=B;this.dirty=true}},_updateUI:function(){if(this.dirty){this.innerViewer.innerHTML="";for(var B=0;B<this.images.length;B++){var A=hui.build("div",{"class":"hui_imageviewer_image"});hui.style.set(A,{width:(this.width+this.options.margin)+"px",height:(this.height-1)+"px"});this.innerViewer.appendChild(A)}if(this._shouldShowController()){this.controller.style.display="block"}else{this.controller.style.display="none"}this.dirty=false;this._preload()}},_shouldShowController:function(){return this.images.length>1},_goToImage:function(C,D,B){if(C){if(D>1){hui.animate(this.viewer,"scrollLeft",this.index*(this.width+this.options.margin),Math.min(D*this.options.transitionReturn,2000),{ease:this.options.easeReturn})}else{var A=this.index==0||this.index==this.images.length-1;var F=(A?this.options.easeEnd:this.options.ease);if(!B){F=this.options.easeAuto}hui.animate(this.viewer,"scrollLeft",this.index*(this.width+this.options.margin),(A?this.options.transitionEnd:this.options.transition),{ease:F})}}else{this.viewer.scrollLeft=this.index*(this.width+this.options.margin)}var E=this.images[this.index].text;if(E){this.text.innerHTML=E;this.text.style.display="block"}else{this.text.innerHTML="";this.text.style.display="none"}},showById:function(B){for(var A=0;A<this.images.length;A++){if(this.images[A].id==B){this.show(A);break}}},show:function(A){this.index=A||0;this._calculateSize();this._updateUI();var B=this.options.margin;hui.style.set(this.element,{width:(this.width+B)+"px",height:(this.height+B*2-1)+"px"});hui.style.set(this.viewer,{width:(this.width+B)+"px",height:(this.height-1)+"px"});hui.style.set(this.innerViewer,{width:((this.width+B)*this.images.length)+"px",height:(this.height-1)+"px"});hui.style.set(this.controller,{marginLeft:((this.width-180)/2+B*0.5)+"px",display:"none"});this.box.show();this._goToImage(false,0,false);hui.listen(document,"keydown",this._keyListener)},hide:function(){this.pause();this.box.hide();hui.unListen(document,"keydown",this._keyListener)},$boxCurtainWasClicked:function(){this.hide()},$boxWasClosed:function(){this.hide()},clearImages:function(){this.images=[];this.dirty=true},addImages:function(A){for(var B=0;B<A.length;B++){this.addImage(A[B])}},addImage:function(A){this.images.push(A);this.dirty=true},play:function(){if(!this.interval){this.interval=window.setInterval(this._timer,6000)}this.next(false);this.playing=true;this.playControl.className="hui_imageviewer_pause"},pause:function(){window.clearInterval(this.interval);this.interval=null;this.playControl.className="hui_imageviewer_play";this.playing=false},playOrPause:function(){if(this.playing){this.pause()}else{this.play()}},_resetPlay:function(){if(this.playing){window.clearInterval(this.interval);this.interval=window.setInterval(this._timer,6000)}},previous:function(A){var B=1;this.index--;if(this.index<0){this.index=this.images.length-1;B=this.images.length-1}this._goToImage(true,B,A);this._resetPlay()},next:function(A){var B=1;this.index++;if(this.index==this.images.length){this.index=0;B=this.images.length-1}this._goToImage(true,B,A);this._resetPlay()},_preload:function(){var B=new hui.Preloader();B.addImages(hui.ui.context+"hui/gfx/imageviewer_controls.png");var A=this;B.setDelegate({allImagesDidLoad:function(){A._preloadImages()}});B.load()},_preloadImages:function(){var A=new hui.Preloader();A.setDelegate(this);for(var C=0;C<this.images.length;C++){var B=hui.ui.resolveImageUrl(this,this.images[C],this.width,this.height);if(B!==null){A.addImages(B)}}this.status.innerHTML="0%";this.status.style.display="";A.load(this.index)},allImagesDidLoad:function(){this.status.style.display="none"},imageDidLoad:function(C,D,B){this.status.innerHTML=Math.round(C/D*100)+"%";var A=hui.ui.resolveImageUrl(this,this.images[B],this.width,this.height);A=A.replace(/&amp;/g,"&");this.innerViewer.childNodes[B].style.backgroundImage="url('"+A+"')";hui.cls.set(this.innerViewer.childNodes[B],"hui_imageviewer_image_abort",false);hui.cls.set(this.innerViewer.childNodes[B],"hui_imageviewer_image_error",false)},imageDidGiveError:function(B,C,A){hui.cls.set(this.innerViewer.childNodes[A],"hui_imageviewer_image_error",true)},imageDidAbort:function(B,C,A){hui.cls.set(this.innerViewer.childNodes[A],"hui_imageviewer_image_abort",true)},_zoom:function(D){var A=this.images[this.index];if(A.width<=this.width&&A.height<=this.height){return }if(!this.zoomer){this.zoomer=hui.build("div",{"class":"hui_imageviewer_zoomer",style:"width:"+this.viewer.clientWidth+"px;height:"+this.viewer.clientHeight+"px"});this.element.insertBefore(this.zoomer,hui.dom.firstChild(this.element));hui.listen(this.zoomer,"mousemove",this._onZoomMove.bind(this));hui.listen(this.zoomer,"click",function(){this.zoomer.style.display="none"}.bind(this))}this.pause();var C=this._getLargestSize({width:2000,height:2000},A);var B=hui.ui.resolveImageUrl(this,A,C.width,C.height);this.zoomer.innerHTML='<div style="width:'+C.width+"px;height:"+C.height+'px; margin: 0 auto;"><img src="'+B+'"/></div>';this.zoomer.style.display="block";this.zoomInfo={width:C.width,height:C.height};this._onZoomMove(D)},_onZoomMove:function(B){B=new hui.Event(B);if(!this.zoomInfo){return }var C={left:hui.position.getLeft(this.zoomer),top:hui.position.getTop(this.zoomer)};var A=(B.getLeft()-C.left)/this.zoomer.clientWidth*(this.zoomInfo.width-this.zoomer.clientWidth);var D=(B.getTop()-C.top)/this.zoomer.clientHeight*(this.zoomInfo.height-this.zoomer.clientHeight);this.zoomer.scrollLeft=A;this.zoomer.scrollTop=D}};hui.ui.Box=function(A){this.options=hui.override({},A);this.name=A.name;this.element=hui.get(A.element);this.body=hui.get.firstByClass(this.element,"hui_box_body");this.close=hui.get.firstByClass(this.element,"hui_box_close");this.visible=!this.options.absolute;if(this.close){hui.listen(this.close,"click",function(B){hui.stop(B);this.hide();this.fire("boxWasClosed")}.bind(this))}hui.ui.extend(this)};hui.ui.Box.create=function(A){A=A||{};A.element=hui.build("div",{"class":A.absolute?"hui_box hui_box_absolute":"hui_box",html:(A.closable?'<a class="hui_box_close" href="#"></a>':"")+'<div class="hui_box_top"><div><div></div></div></div><div class="hui_box_middle"><div class="hui_box_middle">'+(A.title?'<div class="hui_box_header"><strong class="hui_box_title">'+hui.string.escape(A.title)+"</strong></div>":"")+'<div class="hui_box_body" style="'+(A.padding?"padding: "+A.padding+"px;":"")+(A.width?"width: "+A.width+"px;":"")+'"></div></div></div><div class="hui_box_bottom"><div><div></div></div></div>',style:A.width?A.width+"px":null});return new hui.ui.Box(A)};hui.ui.Box.prototype={addToDocument:function(){document.body.appendChild(this.element)},add:function(A){if(A.getElement){this.body.appendChild(A.getElement())}else{this.body.appendChild(A)}},show:function(){var D=this.element;if(this.options.modal){var B=hui.ui.nextPanelIndex();D.style.zIndex=B+1;hui.ui.showCurtain({widget:this,zIndex:B})}if(this.options.absolute){hui.style.set(D,{display:"block",visibility:"hidden"});var A=D.clientWidth;var C=(hui.window.getViewHeight()-D.clientHeight)/2+hui.window.getScrollTop();hui.style.set(D,{"marginLeft":(A/-2)+"px",top:C+"px"});hui.style.set(D,{display:"block",visibility:"visible"})}else{D.style.display="block"}this.visible=true;hui.ui.callVisible(this)},$$resize:function(){if(this.options.absolute&&this.visible){var C=this.element;var A=C.clientWidth;var B=(hui.window.getViewHeight()-C.clientHeight)/2+hui.window.getScrollTop();hui.style.set(C,{"marginLeft":(A/-2)+"px",top:B+"px"})}},hide:function(){hui.ui.hideCurtain(this);this.element.style.display="none";this.visible=false;hui.ui.callVisible(this)},curtainWasClicked:function(){this.fire("boxCurtainWasClicked")}};hui.ui.SearchField=function(A){this.options=hui.override({expandedWidth:null},A);this.element=hui.get(A.element);this.name=A.name;this.field=hui.get.firstByTag(this.element,"input");this.value=this.field.value;this.adaptive=hui.cls.has(this.element,"hui_searchfield_adaptive");hui.ui.onReady(function(){this.initialWidth=parseInt(hui.style.get(this.element,"width"))}.bind(this));hui.ui.extend(this);this.addBehavior();this.updateClass()};hui.ui.SearchField.create=function(A){A=A||{};A.element=hui.build("span",{"class":A.adaptive?"hui_searchfield hui_searchfield_adaptive":"hui_searchfield",html:'<em class="hui_searchfield_placeholder"></em><a href="javascript:void(0);" class="hui_searchfield_reset"></a><span><span><input type="text"/></span></span>'});return new hui.ui.SearchField(A)};hui.ui.SearchField.prototype={addBehavior:function(){var B=this;hui.listen(this.field,"keyup",this.onKeyUp.bind(this));var C=hui.get.firstByTag(this.element,"a");C.tabIndex=-1;if(!hui.browser.ipad){var A=function(){B.field.focus();B.field.select()};hui.listen(this.element,"mousedown",A);hui.listen(this.element,"mouseup",A);hui.listen(hui.get.firstByTag(this.element,"em"),"mousedown",A)}else{var A=function(){B.field.focus()};hui.listen(hui.get.firstByTag(this.element,"em"),"click",A)}hui.listen(C,"mousedown",function(D){hui.stop(D);B.reset();A()});hui.listen(this.field,"focus",function(){B.focused=true;B.updateClass()});hui.listen(this.field,"blur",function(){B.focused=false;B.updateClass()});if(this.options.expandedWidth>0){this.field.onfocus=function(){hui.animate(B.element,"width",B.options.expandedWidth+"px",500,{ease:hui.ease.slowFastSlow})};this.field.onblur=function(){hui.animate(B.element,"width",B.initialWidth+"px",500,{ease:hui.ease.slowFastSlow,delay:100})}}},onKeyUp:function(A){this.fieldChanged();if(A.keyCode===hui.KEY_RETURN){this.fire("submit")}},setValue:function(A){this.field.value=A===undefined||A===null?"":A;this.fieldChanged()},getValue:function(){return this.field.value},isEmpty:function(){return this.field.value==""},isBlank:function(){return hui.isBlank(this.field.value)},reset:function(){this.field.value="";this.fieldChanged()},updateClass:function(){var A="hui_searchfield";if(this.adaptive){A+=" hui_searchfield_adaptive"}if(this.focused&&this.value!=""){A+=" hui_searchfield_focus_dirty"}else{if(this.focused){A+=" hui_searchfield_focus"}else{if(this.value!=""){A+=" hui_searchfield_dirty"}}}this.element.className=A},fieldChanged:function(){if(this.field.value!=this.value){this.value=this.field.value;this.updateClass();this.fire("valueChanged",this.value);hui.ui.firePropertyChange(this,"value",this.value)}}}
