ClassFactory.createPackage("core.ui.quirks");ClassFactory.createClass(core.ui.quirks,"TextSelection");with(core.ui.quirks){core.ui.quirks.TextSelection.constructor=function(){};core.ui.quirks.TextSelection.preventSelection=function(A){if(defined(A.onselectstart)){A.onselectstart=new Function("return false")}else{if(defined(A.style.MozUserSelect)){A.style.MozUserSelect="none"}else{A.onmousedown=new Function("return false")}}};core.ui.quirks.TextSelection.allowSelection=function(A,B){if(false===B){this.preventSelection(A)}else{if(defined(A.onselectstart)){A.onselectstart=new Function("return true")}else{if(defined(A.style.MozUserSelect)){A.style.MozUserSelect="text"}else{A.onmousedown=new Function("return true")}}}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Event");with(core.ui){core.ui.Event.constructor=function(){this.stopped=false;this.cancelled=false;this.Event=function(){if(!this.target){this.target=this.srcElement}};this.stop=function(){if(undefined!==this.stopPropagation){this.stopPropagation()}else{if(undefined!==this.cancelBubble){this.cancelBubble=true}}this.stopped=true};this.isStopped=function(){return this.stopped};this.cancel=function(){if(undefined!==this.preventDefault){this.preventDefault()}this.returnValue=false;this.cancelled=true};this.isCancelled=function(){return this.cancelled};this.getType=function(){return this.type};this.getX=function(){return this.clientX+document.body.scrollLeft};this.getScreenX=function(){return this.screenX+document.body.scrollLeft};this.getScreenY=function(){return this.screenY+document.body.scrollTop};this.getY=function(){return this.clientY+document.body.scrollTop};this.getChar=function(){return String.fromCharCode(this.keyCode||this.charCode).toUpperCase()};this.toString=function(){return'[Event type="'+this.type+'"]'}};core.ui.Event.improve=function(A){if(!A){A=window.event}this.apply(A);return A};core.ui.Event.addListener=function(B,A,C){if(undefined!==B.attachEvent){B.attachEvent("on"+A,C)}else{if(undefined!==B.addEventListener){B.addEventListener(A,C,false)}else{B["on"+A]=C}}};core.ui.Event.removeListener=function(B,A,C){if(undefined!==B.detachEvent){B.detachEvent("on"+A,C)}else{if(undefined!==B.removeEventListener){B.removeEventListener(A,C,false)}else{}}};core.ui.Event.addLoadListener=function(A){Event.addListener(window,"load",A)};core.ui.Event.removeLoadListener=function(A){Event.removeListener(window,"load",A)};core.ui.Event.addUnloadListener=function(A){Event.addListener(window,"unload",A)};core.ui.Event.removeUnloadListener=function(A){Event.removeListener(window,"unload",A)};core.ui.Event.types=["blur","change","click","contextmenu","dblclick","focus","keydown","keypress","keyup","load","mousedown","mousemove","mouseout","mouseover","mouseup","select","scroll","unload"];core.ui.Event.KEY_BACKSPACE=8;core.ui.Event.KEY_TAB=9;core.ui.Event.KEY_ENTER=13;core.ui.Event.KEY_SHIFT=16;core.ui.Event.KEY_CTRL=17;core.ui.Event.KEY_ALT=18;core.ui.Event.KEY_PAUSE=19;core.ui.Event.KEY_CAPS_LOCK=20;core.ui.Event.KEY_ESCAPE=27;core.ui.Event.KEY_SPACE=32;core.ui.Event.KEY_PAGE_UP=33;core.ui.Event.KEY_PAGE_DOWN=34;core.ui.Event.KEY_END=35;core.ui.Event.KEY_HOME=36;core.ui.Event.KEY_LEFT_ARROW=37;core.ui.Event.KEY_UP_ARROW=38;core.ui.Event.KEY_RIGHT_ARROW=39;core.ui.Event.KEY_DOWN_ARROW=40;core.ui.Event.KEY_INSERT=45;core.ui.Event.KEY_DELETE=46;core.ui.Event.KEY_LEFT_WINDOW=91;core.ui.Event.KEY_RIGHT_WINDOW=92;core.ui.Event.KEY_SELECT=93;core.ui.Event.KEY_F1=112;core.ui.Event.KEY_F2=113;core.ui.Event.KEY_F3=114;core.ui.Event.KEY_F4=115;core.ui.Event.KEY_F5=116;core.ui.Event.KEY_F6=117;core.ui.Event.KEY_F7=118;core.ui.Event.KEY_F8=119;core.ui.Event.KEY_F9=120;core.ui.Event.KEY_F10=121;core.ui.Event.KEY_F11=122;core.ui.Event.KEY_F12=123;core.ui.Event.KEY_NUM_LOCK=144;core.ui.Event.KEY_SCROLL_LOCK=145}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Notification");with(core.ui){core.ui.Notification.constructor=function(){this.listeners=[];this.addListener=function(C,B){var A=this.findListener(C);if(-1==A){this.listeners.push([C,B])}};this.removeListener=function(B){var A=this.findListener(B);if(-1!=A){delete this.listeners[A];this.listeners.splice(A,1)}};this.send=function(){for(var B=0;B<this.listeners.length;B++){var C=this.listeners[B][0];var A=this.listeners[B][1];C.apply(null,arguments);if(A){this.removeListener(C);B--}}};this.clear=function(){while(this.listeners.length>0){this.listeners.pop()}};this.findListener=function(B){for(var A=0;A<this.listeners.length;A++){if(this.listeners[A]&&(B==this.listeners[A][0])){return A}}return -1};this.toString=function(){return"[Notification]"}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Window");with(core.ui){core.ui.Window.constructor=function(){this.id;this.element;this.parent;this.visible=false;this.enabled=true;this.children={};this.Window=function(B,A,F,D,E,C){this.id=this.constructor.className+Window.NEXTID++;this.parent=(defined(B))?B:null;if(!C){C=this.createElement();C.className=this.constructor.className;C.style.overflow="hidden";if((B&&(B.constructor===Window||defined(B.constructor.isSubclassOf)&&B.constructor.isSubclassOf(Window)))){C.style.position="relative";B.addElement(C)}else{C.style.position="absolute";C.style.visibility="hidden";C.style.zIndex=Window.NEXTZINDEX++;document.body.appendChild(C)}}this.attach(C);if(B){B.children[this.getId()]=this}if(defined(A)){C.style.left=("string"==typeof A)?A:(A+"px")}if(defined(F)){C.style.top=("string"==typeof F)?F:(F+"px")}if(defined(D)){C.style.width=("string"==typeof D)?D:(D+"px")}if(defined(E)){C.style.height=("string"==typeof E)?E:(E+"px")}Window.all[this.getId()]=Window.active=this};this.attach=function(B){B.winid=this.getId();for(var A=0;A<Event.types.length;A++){Event.addListener(B,Event.types[A],this.handleEvent)}if(!defined(this.element)){this.element=B}};this.detach=function(B){if(!defined(B)){B=this.element}for(var A=0;A<Event.types.length;A++){Event.removeListener(B,Event.types[A],this.handleEvent)}B.winid=undefined;if(this.element==B){delete this.element;this.element=undefined}};this.isAttached=function(){return defined(this.element)};this.attachGlobalEvent=function(A){if(!Window.global[A]){Window.global[A]={}}Window.global[A][this.getId()]=true};this.detachGlobalEvent=function(A){if(Window.global[A]){delete Window.global[A][this.getId()]}};this.getElement=function(){return this.element};this.getParent=function(){return this.parent};this.setVisible=function(A){this.visible=A;if(A){this.setStyle("visibility",(this.isChild())?"inherit":"visible")}else{this.setStyle("visibility","hidden")}};this.show=function(){this.setVisible(true)};this.hide=function(){this.setVisible(false)};this.isHidden=function(){return("hidden"==this.getStyle("visibility"))};this.isVisible=function(){return !this.isHidden()};this.move=function(A,B){this.element.style.left=A+"px";this.element.style.top=B+"px"};this.resize=function(A,B){this.element.style.width=A+"px";this.element.style.height=B+"px"};this.center=function(){var A,B;if(this.isChild()){A=this.parent.getClientWidth()/2-this.getWidth()/2+this.parent.getElement().scrollLeft/2;B=this.parent.getClientHeight()/2-this.getHeight()/2+this.parent.getElement().scrollTop/2}else{A=Window.getWidth()/2-this.getWidth()/2+document.body.scrollLeft/2;B=Window.getHeight()/2-this.getHeight()/2+document.body.scrollTop/2}this.move(Math.round(A),Math.round(B))};this.getId=function(){return this.id};this.setText=function(A){this.element.innerHTML=A};this.getText=function(){return this.element.innerHTML};this.getX=function(){return this.element.offsetLeft};this.getY=function(){return this.element.offsetTop};this.getAbsX=function(){var B=this.getElement();var A=B.offsetLeft;while(B=B.offsetParent){A+=B.offsetLeft;A-=B.scrollLeft}return document.body.scrollLeft+A};this.getAbsY=function(){var A=this.getElement();var B=A.offsetTop;while(A=A.offsetParent){B+=A.offsetTop;B-=A.scrollTop}return document.body.scrollTop+B};this.getWidth=function(){return this.element.offsetWidth};this.getHeight=function(){return this.element.offsetHeight};this.getClientWidth=function(){return this.element.clientWidth};this.getClientHeight=function(){return this.element.clientHeight};this.getClientX=function(){return(this.getWidth()-this.getClientWidth())/2};this.getClientY=function(){return(this.getHeight()-this.getClientHeight())/2};this.setToolTip=function(A){this.element.title=A};this.getToolTip=function(){return this.element.title};this.close=function(){for(var A in this.children){this.children[A].close();delete this.children[A]}if(this.parent){delete this.parent.children[this.getId()];delete this.parent}if(this.element){if(this.element.parentNode){this.element.parentNode.removeChild(this.element)}delete this.element}delete Window.all[this.getId()]};this.isClosed=function(){return(!defined(Window.all[this.getId()]))};this.activate=function(){if(!this.isActive()){if(this.isChild()){this.parent.activate()}else{this.setStyle("z-index",Window.NEXTZINDEX++);Window.active=this}}};this.isActive=function(){return(Window.active&&Window.active==this)};this.setEnabled=function(A){this.enabled=A;this.getElement().disabled=!A;for(var B in this.children){this.children[B].setEnabled(A)}};this.enable=function(){this.setEnabled(true)};this.disable=function(){this.setEnabled(false)};this.isEnabled=function(){return this.enabled};this.isDisabled=function(){return this.getElement().disabled};this.isChild=function(){return(null!=this.parent)};this.isChildOf=function(A){for(var B in A.children){if(A.children[B]==this){return true}if(this.isChildOf(A.children[B])){return true}}return false};this.setStyle=function(B,C){switch(B.toLowerCase()){case"float":this.element.style["styleFloat"]=this.element.style["cssFloat"]=C;break;case"opacity":this.element.style.opacity=C/100;this.element.style.MozOpacity=C/100;this.element.style.KhtmlOpacity=C/100;this.element.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+C+")";break;default:var A=B.replace(/\-([a-z])/g,function(D){return D.charAt(1).toUpperCase()});this.element.style[A]=C}};this.getStyle=function(B){switch(B.toLowerCase()){case"float":return defined(this.element.style["styleFloat"])?this.element.style["styleFloat"]:this.element.style["cssFloat"];case"opacity":return(this.element.style.opacity||(0===this.element.style.opacity))?(this.element.style.opacity*100):100;default:var A=B.replace(/\-([a-z])/g,function(C){return C.charAt(1).toUpperCase()});return this.element.style[A]}};this.setStyleId=function(A){this.element.id=A};this.getStyleId=function(){return this.element.id};this.setStyleName=function(A){this.element.className=A};this.getStyleName=function(){return this.element.className.split(" ")[0]};this.addStyleName=function(A){var C=this.element.className.split(" ");for(var B=0;B<C.length;B++){if(A==C[B]){return }}C.push(A);this.element.className=C.join(" ")};this.removeStyleName=function(A){var C=this.element.className.split(" ");for(var B=0;B<C.length;B++){if(A==C[B]){C.splice(B,1);break}}this.element.className=C.join(" ")};this.hasStyleName=function(A){var C=this.element.className.split(" ");for(var B=0;B<C.length;B++){if(C[B]===A){return true}}return false};this.clearStyleName=function(){var A=this.element.className.split(" ");this.element.className=defined(A[0])?A[0]:this.constructor.className};this.createElement=function(){return document.createElement("div")};this.addElement=function(A){this.getElement().appendChild(A)};this.handleEvent=callback(this,function(B){B=Event.improve(B);var C=(B.target)?Window.all[B.target.winid]:undefined;var A=Window.processEvent(B,C);if(!B.isStopped()){if(("function"==typeof this["on"+B.getType()])&&this.isEnabled()){if(false===this["on"+B.getType()](B,C,this)){A=false}}}if(false===A){B.cancel()}return A});this.toString=function(){return"["+this.constructor.className+"]"}};core.ui.Window.eventHandler=function(A){A=Event.improve(A);var B=(A.target)?Window.all[A.target.winid]:undefined;if(false===Window.processEvent(A,B)){A.cancel()}return !A.isCancelled()};core.ui.Window.processEvent=function(B,E){var A=true;for(var D in Window.global[B.getType()]){var C=Window.all[D];if(("function"==typeof C["on"+B.getType()])&&C.isEnabled()){if(false===C["on"+B.getType()](B,E,C)){A=false}}}return A};core.ui.Window.NEXTID=1;core.ui.Window.NEXTZINDEX=1;core.ui.Window.all={};core.ui.Window.active=null;core.ui.Window.global={};core.ui.Window.getWidth=function(){return document.body.clientWidth+document.body.scrollLeft};core.ui.Window.getHeight=function(){return document.body.clientHeight+document.body.scrollTop};core.ui.Window.forId=function(A){return Window.all[A]};core.ui.Window.registerDocument=function(B){for(var A=0;A<Event.types.length;A++){Event.addListener(B,Event.types[A],Window.eventHandler)}};core.ui.Window.unregisterDocument=function(B){for(var A=0;A<Event.types.length;A++){Event.removeListener(B,Event.types[A],Window.eventHandler)}};core.ui.Window.notifyScroll=new Notification();core.ui.Window.notifyResize=new Notification();core.ui.Window.cleanup=function(){for(var A in Window.all){if(!Window.all[A].isChild()){Window.all[A].close()}}};core.ui.Window.onresize=function(){Window.notifyResize.send(Window.getWidth(),Window.getHeight())};core.ui.Window.onscroll=function(){Window.notifyScroll.send(document.body.scrollLeft,document.body.scrollTop)};core.ui.Window.registerDocument(window.document);Event.addListener(window,"resize",Window.onresize);Event.addListener(window,"scroll",Window.onscroll);Event.addUnloadListener(Window.cleanup)}ClassFactory.createPackage("core.app");ClassFactory.createClass(core.app,"Config");with(core.app){core.app.Config.constructor=function(){this.properties={};this.load=function(url){try{var json=HTTPFileLoader.loadFile(url);this.properties=eval("("+json+")");return true}catch(e){this.properties={};return false}};this.get=function(name,def){return(defined(this.properties[name]))?this.properties[name]:def};this.set=function(name,value){this.properties[name]=value};this.exists=function(name){return defined(this.properties[name])}}}ClassFactory.createPackage("core.ajax");ClassFactory.createClass(core.ajax,"Response");with(core.ajax){core.ajax.Response.constructor=function(){this.Response=function(A){core.ajax.Response.convert(A,this)};this.toString=function(){return"[Response]"}};core.ajax.Response.getBool=function(A){return("1"==A.firstChild.nodeValue)};core.ajax.Response.getInt=function(A){return parseInt(A.firstChild.nodeValue)};core.ajax.Response.getFloat=function(A){return parseFloat(A.firstChild.nodeValue)};core.ajax.Response.getArray=function(C){var A=new Array();for(var B=0;B<C.childNodes.length;B++){if(C.childNodes.item(B).nodeType==1){A.push(this.getValue(C.childNodes.item(B)))}}return A};core.ajax.Response.getObject=function(A){var B=new Object();this.convert(A,B);return B};core.ajax.Response.getString=function(A){try{return A.firstChild.nodeValue}catch(B){return""}};core.ajax.Response.getValue=function(C){var A=C.attributes.getNamedItem("type");var B=(A)?A.nodeValue:"string";switch(B){case"null":return null;case"bool":return this.getBool(C);case"int":return this.getInt(C);case"float":return this.getFloat(C);case"array":return this.getArray(C);case"object":return this.getObject(C);default:return this.getString(C)}};core.ajax.convert=core.ajax.Response.convert=function(C,D){for(var B=0;B<C.childNodes.length;B++){if(C.childNodes.item(B).nodeType==1){var E=C.childNodes.item(B);var A=E.nodeName;D[A]=this.getValue(E)}}}}ClassFactory.createPackage("core.ajax");ClassFactory.createClass(core.ajax,"Request");with(core.ajax){core.ajax.Request.constructor=function(){this.url;this.http;this.handler;this.Request=function(url,handler){this.url=url;this.handler=handler||{};this.http=XMLHttpRequestFactory.createRequest();this.http.onreadystatechange=this.onRequestStateChange};this.send=function(content){if(defined(content)&&content.length>0){this.http.open("POST",this.url,true);this.http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");this.http.send(content)}else{this.http.open("GET",this.url,true);this.http.send(null)}};this.onSuccess=function(response){if("function"==typeof this.handler.onSuccess){this.handler.onSuccess(response)}};this.onError=function(error){if("function"==typeof this.handler.onError){this.handler.onError(error)}};this.onComplete=function(){if("function"==typeof this.handler.onComplete){this.handler.onComplete()}};this.onRequestStateChange=callback(this,function(){if(4==this.http.readyState){if((200==this.http.status)||(304==this.http.status)){switch(this.http.getResponseHeader("Content-Type")){case"text/xml":case"application/xml":var rootNode;if(this.http.responseXML&&(rootNode=this.http.responseXML.documentElement)){rootNode.normalize();if("response"==rootNode.nodeName){this.onSuccess(new Response(rootNode))}else{if("error"==rootNode.nodeName){this.onError(new Response(rootNode))}else{}}}break;case"text/json":case"application/json":this.onSuccess(eval("("+this.http.responseText+")"));break;default:this.onSuccess(this.http.responseText);break}}else{this.onError("There was a problem retrieving the XML data:\n"+this.http.statusText)}this.onComplete()}});this.toString=function(){return"[Request]"}};core.ajax.sendRequest=core.ajax.Request.send=function(B,E,F){var C=new core.ajax.Request(B,{onSuccess:E});var D=new Array();if(defined(F)){for(var A in F){D.push(encodeURIComponent(A)+"="+encodeURIComponent(F[A]))}}C.send(D.join("&"))};core.ajax.sendFormData=core.ajax.Request.sendFormData=function(C,E){var F={};for(var D=2;D<arguments.length;D++){if(defined(arguments[D].elements)&&arguments[D].elements.length){for(var B=0;B<arguments[D].elements.length;B++){if(arguments[D].elements[B].name!=""){F[arguments[D].elements[B].name]=arguments[D].elements[B].value}}}else{for(var A in arguments[D]){F[A]=arguments[D][A]}}}return core.ajax.sendRequest(C,E,F)}}ClassFactory.createPackage("core.util");ClassFactory.createClass(core.util,"Iterator");with(core.util){core.util.Iterator.constructor=function(){this.collection=[];this.index=0;this.Iterator=function(B){if((B&&(B.constructor===Array||defined(B.constructor.isSubclassOf)&&B.constructor.isSubclassOf(Array)))){this.collection=B}else{for(var A in B){this.collection.push(B[A])}}};this.hasNext=function(){return(this.index<this.collection.length)};this.next=function(){if(!this.hasNext()){throw new Error("The iteration has no more elements")}else{return this.collection[this.index++]}};this.current=function(){return this.collection[this.index]}}}ClassFactory.createPackage("core.util");ClassFactory.createClass(core.util,"OrderedSet");with(core.util){core.util.OrderedSet.constructor=function(){this.elements=[];this.add=function(A){if(!this.contains(A)){this.elements.push(A)}};this.remove=function(A){var B=this.indexOf(A);if(B>=0){delete this.elements[B];this.elements.splice(B,1)}};this.clear=function(){while(this.elements.length>0){this.elements.pop()}};this.contains=function(A){return(-1!=this.indexOf(A))};this.indexOf=function(A){for(var B=0;B<this.elements.length;B++){if(this.elements[B]&&(A===this.elements[B])){return B}}return -1};this.size=function(){return this.elements.length};this.iterator=function(){return new Iterator(this.elements)};this.toArray=function(){return this.elements}}}ClassFactory.createPackage("core.util");ClassFactory.createClass(core.util,"Listeners");with(core.util){core.util.Listeners.superClass=core.util.OrderedSet;core.util.Listeners.constructor=function(){this.call=function(D,A){var B=this.iterator();while(B.hasNext()){var C=B.next();if("function"==typeof C[D]){C[D].apply(C,A)}}}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"ModalGlassPane");with(core.ui){core.ui.ModalGlassPane.superClass=core.ui.Window;core.ui.ModalGlassPane.constructor=function(){this.zIndexes=[];this.dialogs=[];this.ModalGlassPane=function(){arguments.callee.prototype.apply(this,[]);this.setStyle("z-index",0);Window.notifyResize.addListener(this.onUpdateLayout);Window.notifyScroll.addListener(this.onUpdateLayout);this.updateLayout()};this.modalize=function(A){this.dialogs.push(A);this.move(0,0);this.resize(Window.getWidth(),Window.getHeight());this.zIndexes.push(this.getStyle("z-index"));this.activate();this.show();A.activate();A.show()};this.unmodalize=function(A){this.setStyle("z-index",this.zIndexes.pop());var A=this.dialogs.pop();if(0==this.dialogs.length){this.hide()}A.hide()};this.getActiveDialog=function(){return this.dialogs[this.dialogs.length-1]};this.updateLayout=function(){this.resize(Window.getWidth(),Window.getHeight())};this.onUpdateLayout=callback(this,function(){this.updateLayout()});this.onmousedown=function(){this.getActiveDialog().fireLooseActivity()}};core.ui.ModalGlassPane.getInstance=function(){if(!defined(this.instance)){this.instance=new ModalGlassPane()}return this.instance}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Dialog");with(core.ui){core.ui.Dialog.superClass=core.ui.Window;core.ui.Dialog.constructor=function(){this.modal=false;this.listeners=new core.util.Listeners();this.addDialogListener=function(A){this.listeners.add(A)};this.removeDialogListener=function(A){this.listeners.remove(A)};this.doModal=function(A){ModalGlassPane.getInstance().modalize(this);this.modal=true;this.fireBeginModal()};this.endModal=function(){if(!this.isModal()){return }ModalGlassPane.getInstance().unmodalize(this);this.modal=false;this.fireEndModal()};this.isModal=function(){return this.modal};this.fireBeginModal=function(){this.listeners.call("onDialogBeginModal",[this])};this.fireEndModal=function(){this.listeners.call("onDialogEndModal",[this])};this.fireLooseActivity=function(){this.listeners.call("onDialogLooseActivity",[this])}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Handle");with(core.ui){core.ui.Handle.superClass=core.ui.Window;core.ui.Handle.constructor=function(){this.target;this.direction=Handle.DIRECTION_ALL;this.draginfo={};this.notifyBeginDrag=new Notification();this.notifyEndDrag=new Notification();this.notifyDrag=new Notification();this.setDragWindow=function(A){this.target=A};this.getDragWindow=function(){return this.target};this.setDirection=function(A){this.direction=A};this.getDirection=function(){return this.direction};this.beginDrag=function(A){if((this.target&&(this.target.constructor===Window||defined(this.target.constructor.isSubclassOf)&&this.target.constructor.isSubclassOf(Window)))){this.draginfo={"startX":A.getScreenX(),"startY":A.getScreenY(),"targetX":this.target.getX(),"targetY":this.target.getY(),"dragState":true}}this.attachGlobalEvent("mouseup");this.attachGlobalEvent("mousemove");this.notifyBeginDrag.send(this)};this.doDrag=function(A,F){var C=this.target.getX();var B=this.target.getY();var E=this.draginfo.targetX+A-this.draginfo.startX;var D=this.draginfo.targetY+F-this.draginfo.startY;this.target.move(E,D);this.notifyDrag.send(this,E-C,D-B)};this.endDrag=function(){if(this.isDragging()){this.detachGlobalEvent("mouseup");this.detachGlobalEvent("mousemove");this.draginfo.dragState=false}};this.isDragging=function(){return this.draginfo.dragState};this.close=override(this.close,function(){if(this.isDragging()){this.endDrag()}arguments.callee.prototype.apply(this,[])});this.onmousedown=function(A){this.beginDrag(A)};this.onmousemove=function(D){if(this.isDragging()){var A=this.draginfo.startX;var E=this.draginfo.startY;var C=D.getScreenX()-A;var B=D.getScreenY()-E;if(C>=0){C*=(this.direction&Handle.DIRECTION_EAST)?1:0}else{C*=(this.direction&Handle.DIRECTION_WEST)?1:0}if(B>=0){B*=(this.direction&Handle.DIRECTION_NORTH)?1:0}else{B*=(this.direction&Handle.DIRECTION_SOUTH)?1:0}this.doDrag(A+C,E+B);D.stop()}};this.onmouseup=function(A){if(this.isDragging()){this.endDrag();this.notifyEndDrag.send(this)}}};core.ui.Handle.DIRECTION_NORTH=1;core.ui.Handle.DIRECTION_SOUTH=4;core.ui.Handle.DIRECTION_EAST=8;core.ui.Handle.DIRECTION_WEST=16;core.ui.Handle.DIRECTION_ALL=(core.ui.Handle.DIRECTION_NORTH|core.ui.Handle.DIRECTION_SOUTH|core.ui.Handle.DIRECTION_EAST|core.ui.Handle.DIRECTION_WEST)}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"FocusWindow");with(core.ui){core.ui.FocusWindow.superClass=core.ui.Window;core.ui.FocusWindow.constructor=function(){this.FocusWindow=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.setTabIndex(-1)};this.setFocus=function(A){if(A){if(defined(this.getElement().focus)){window.setTimeout(this.setFocusTimeout,0)}}else{if(defined(this.getElement().blur)){this.getElement().blur()}}};this.hasFocus=function(){};this.setTabIndex=function(A){this.getElement().tabIndex=A};this.getTabIndex=function(){return this.getElement().tabIndex};this.setAccessKey=function(A){this.getElement().accessKey=A};this.getAccessKey=function(){return this.getElement().accessKey};this.setFocusTimeout=callback(this,function(){try{this.getElement().focus()}catch(A){}})}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"ImageButton");with(core.ui){core.ui.ImageButton.superClass=core.ui.FocusWindow;core.ui.ImageButton.constructor=function(){this.images={};this.imageList;this.state;this.ImageButton=function(B,A,G,E,F){arguments.callee.prototype.apply(this,[B,A,G,E,F]);this.getElement().setAttribute("unselectable","on");core.ui.quirks.TextSelection.preventSelection(this.getElement());var D=[ImageButton.STATE_NORMAL,ImageButton.STATE_HOVER,ImageButton.STATE_PRESSED,ImageButton.STATE_DISABLED];for(var C=0;C<D.length;C++){this.images[D[C]]=new window.Image()}this.setState(ImageButton.STATE_NORMAL)};this.setState=function(A){this.getElement().setAttribute("state",A);this.removeStyleName(this.getStyleName()+"-"+ImageButton.states[this.state]);this.addStyleName(this.getStyleName()+"-"+ImageButton.states[A]);this.state=A;if(defined(this.imageList)){this.setStyle("background-position",-(this.getWidth()*A)+"px top")}else{if(this.images[A].src.length>0){this.setImage(this.images[A].src)}}};this.getState=function(){return this.state};this.setImages=function(D,C,A,B){if(defined(D)){this.images[ImageButton.STATE_NORMAL].src=D}if(defined(C)){this.images[ImageButton.STATE_HOVER].src=C}if(defined(A)){this.images[ImageButton.STATE_PRESSED].src=A}if(defined(B)){this.images[ImageButton.STATE_DISABLED].src=B}if(this.images[this.state].src.length>0){this.setImage(this.images[this.state].src)}};this.setImageList=function(A){if(!defined(this.imageList)){this.imageList=new window.Image()}this.imageList.src=A;this.setImage(A);this.setStyle("background-position",-(this.getWidth()*this.state)+"px top")};this.setImage=function(A){this.setStyle("background-image",'url("'+A+'")')};this.setEnabled=override(this.setEnabled,function(A){if(A){arguments.callee.prototype.apply(this,[A]);this.setState(ImageButton.STATE_NORMAL)}else{this.setState(ImageButton.STATE_DISABLED);arguments.callee.prototype.apply(this,[A])}});this.onmousedown=function(A){this.setState(ImageButton.STATE_PRESSED);this.setFocus(true);this.activate();A.stop();A.cancel()};this.onmouseover=this.onmouseup=function(A){this.setState(ImageButton.STATE_HOVER);A.stop()};this.onmouseout=function(A){this.setState(ImageButton.STATE_NORMAL);A.stop()};this.ondblclick=function(A){A.stop()};this.onclick=function(C,B,A){if("function"==typeof this.oncommand){this.oncommand(C,B,A)}};this.onkeydown=function(C,B,A){if(Event.KEY_SPACE==C.keyCode){C.stop();this.setState(ImageButton.STATE_PRESSED)}else{if(Event.KEY_ENTER==C.keyCode){C.stop();if("function"==typeof this.oncommand){this.oncommand(C,B,A)}}}};this.onkeyup=function(C,B,A){if(Event.KEY_SPACE==C.keyCode){C.stop();this.setState(ImageButton.STATE_NORMAL);if("function"==typeof this.oncommand){this.oncommand(C,B,A)}}}};core.ui.ImageButton.STATE_NORMAL=0;core.ui.ImageButton.STATE_HOVER=1;core.ui.ImageButton.STATE_PRESSED=2;core.ui.ImageButton.STATE_DISABLED=3;core.ui.ImageButton.states=["normal","hover","pressed","disabled"]}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"InputWindow");with(core.ui){core.ui.InputWindow.superClass=core.ui.FocusWindow;core.ui.InputWindow.constructor=function(){this.setSelected=function(A){if(A){this.getInput().select()}else{this.getInput().blur()}};this.setName=function(A){this.getInput().name=A};this.getName=function(){return this.getInput().name};this.setValue=function(A){this.getInput().value=A};this.getValue=function(){return this.getInput().value};this.setText=function(A){this.setValue(A)};this.getText=function(){return this.getValue()};this.setFocus=function(A){if(A){try{this.getInput().focus()}catch(B){}}else{this.getInput().blur()}};this.setTabIndex=function(A){this.getInput().tabIndex=A};this.getTabIndex=function(){return getInput().tabIndex};this.setAccessKey=function(A){this.getInput().accessKey=A};this.getAccessKey=function(){return this.getInput().accessKey};this.getInput=function(){return this.getElement()};this.createElement=function(){var A=document.createElement("input");A.type=this.getType();return A};this.getType=function(){return"text"}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Edit");with(core.ui){core.ui.Edit.superClass=core.ui.InputWindow;core.ui.Edit.constructor=function(){this.Edit=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.getInput().setAttribute("autocomplete","off");if(defined(this.getInput().onselectstart)){this.getInput().onselectstart=new Function("window.event.cancelBubble = true")}};this.setReadOnly=function(A){this.getElement().readOnly=A};this.isReadOnly=function(){return this.getElement().readOnly};this.getType=function(){return"text"}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"TextArea");with(core.ui){core.ui.TextArea.superClass=core.ui.FocusWindow;core.ui.TextArea.constructor=function(){this.TextArea=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);if(defined(this.getElement().onselectstart)){this.getElement().onselectstart=new Function("window.event.cancelBubble = true")}};this.setName=function(A){this.getElement().name=A};this.getName=function(){return this.getElement().name};this.setValue=function(A){this.getElement().value=A};this.getValue=function(){return this.getElement().value};this.setText=function(A){this.setValue(A)};this.getText=function(){return this.getValue()};this.createElement=function(){return document.createElement("textarea")}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Static");with(core.ui){core.ui.Static.superClass=core.ui.Window;core.ui.Static.constructor=function(){this.Static=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);core.ui.quirks.TextSelection.preventSelection(this.getElement())}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Balloon");with(core.ui){core.ui.Balloon.superClass=core.ui.Window;core.ui.Balloon.constructor=function(){this.owner;this.position;this.timeout;this.tail;this.timerId;this.Balloon=function(C,D,B,A){arguments.callee.prototype.apply(this,[]);this.setStyle("overflow","visible");this.setStyle("z-index",Balloon.ZINDEX);this.tail=this.createTail();this.setPosition(defined(B)?B:Balloon.TOP);this.setTimeout(defined(A)?A:10);this.setOwner(C);this.setText(D)};this.setOwner=function(A){this.owner=A};this.getOwner=function(){return this.owner};this.setPosition=function(B){var A={};A[Balloon.LEFT]="left";A[Balloon.TOP]="top";A[Balloon.RIGHT]="right";A[Balloon.BOTTOM]="bottom";this.removeStyleName(this.getStyleName()+"-"+A[this.position&Balloon.MASK_POSTITON]);this.tail.removeStyleName(this.tail.getStyleName()+"-"+A[this.position&Balloon.MASK_POSTITON]);this.position=B;this.addStyleName(this.getStyleName()+"-"+A[this.position&Balloon.MASK_POSTITON]);this.tail.addStyleName(this.tail.getStyleName()+"-"+A[this.position&Balloon.MASK_POSTITON])};this.getPosition=function(){return this.position};this.setTimeout=function(A){this.timeout=A};this.getTimeout=function(){return this.timeout};this.setVisible=override(this.setVisible,function(A){if(A){this.attachGlobalEvent("mousemove");this.adjustPosition();if(0!==this.timeout){window.clearTimeout(this.timerId);this.timerId=window.setTimeout(this.onTimeout,this.timeout*1000)}}else{window.clearTimeout(this.timerId);this.detachGlobalEvent("mousemove")}this.tail.setVisible(A);arguments.callee.prototype.apply(this,[A])});this.getTail=function(){return this.tail};this.setEnabled=override(this.setEnabled,function(A){this.tail.setEnabled(A);arguments.callee.prototype.apply(this,[A])});this.close=override(this.close,function(){window.clearTimeout(this.timerId);this.tail.close();delete this.tail;arguments.callee.prototype.apply(this,[])});this.createTail=function(){var A=new Window();A.setStyleName(this.getStyleName()+"Tail");A.setStyle("z-index",Balloon.ZINDEX);return A};this.correctPosition=function(){var E=0;var F=0;if(this.position&Balloon.LEFT){var C=this.owner.getAbsX()-this.tail.getWidth();var B=this.owner.getAbsY()+(this.owner.getHeight()-this.tail.getHeight())/2;E=C-this.getWidth();F=B-(this.getHeight()-this.tail.getHeight())/2}else{if(this.position&Balloon.RIGHT){var C=this.owner.getAbsX()+this.owner.getWidth();var B=this.owner.getAbsY()+(this.owner.getHeight()-this.tail.getHeight())/2;E=C+this.tail.getWidth();F=B-(this.getHeight()-this.tail.getHeight())/2}else{if(this.position&Balloon.TOP){var C=this.owner.getAbsX()+(this.owner.getWidth()-this.tail.getWidth())/2;var B=this.owner.getAbsY()-this.tail.getHeight();E=C-(this.getWidth()-this.tail.getWidth())/2;F=B-this.getHeight()}else{if(this.position&Balloon.BOTTOM){var C=this.owner.getAbsX()+(this.owner.getWidth()-this.tail.getWidth())/2;var B=this.owner.getAbsY()+this.owner.getHeight();E=C-(this.getWidth()-this.tail.getWidth())/2;F=B+this.tail.getHeight()}}}}var G=document.body.scrollLeft;var A=document.body.clientWidth+document.body.scrollLeft;var D=document.body.scrollTop;var H=document.body.clientHeight+document.body.scrollTop;if(E<G){this.setPosition(Balloon.RIGHT|(this.position&Balloon.FLOATING))}else{if(E+this.getWidth()>A){this.setPosition(Balloon.LEFT|(this.position&Balloon.FLOATING))}}if(F<D){this.setPosition(Balloon.BOTTOM|(this.position&Balloon.FLOATING))}else{if(F+this.getHeight()>H){this.setPosition(Balloon.TOP|(this.position&Balloon.FLOATING))}}};this.adjustPosition=function(){if(this.position&Balloon.FLOATING){this.correctPosition()}if(this.position&Balloon.LEFT){this.tail.move(this.owner.getAbsX()-this.tail.getWidth(),this.owner.getAbsY()+(this.owner.getHeight()-this.tail.getHeight())/2);this.move(this.tail.getX()-this.getWidth(),this.tail.getY()-(this.getHeight()-this.tail.getHeight())/2)}else{if(this.position&Balloon.RIGHT){this.tail.move(this.owner.getAbsX()+this.owner.getWidth(),this.owner.getAbsY()+(this.owner.getHeight()-this.tail.getHeight())/2);this.move(this.tail.getX()+this.tail.getWidth(),this.tail.getY()-(this.getHeight()-this.tail.getHeight())/2)}else{if(this.position&Balloon.TOP){this.tail.move(this.owner.getAbsX()+(this.owner.getWidth()-this.tail.getWidth())/2,this.owner.getAbsY()-this.tail.getHeight());this.move(this.tail.getX()-(this.getWidth()-this.tail.getWidth())/2,this.tail.getY()-this.getHeight())}else{if(this.position&Balloon.BOTTOM){this.tail.move(this.owner.getAbsX()+(this.owner.getWidth()-this.tail.getWidth())/2,this.owner.getAbsY()+this.owner.getHeight());this.move(this.tail.getX()-(this.getWidth()-this.tail.getWidth())/2,this.tail.getY()+this.tail.getHeight())}}}}};this.onmousedown=function(A,B){if(((B&&(B.constructor===Window||defined(B.constructor.isSubclassOf)&&B.constructor.isSubclassOf(Window))))&&((B==this)||B.isChildOf(this))){if(this.isVisible()){this.hide()}}};this.onmousemove=function(A){var B=arguments.callee;if((this.owner.getAbsX()!==B.x)||(this.owner.getAbsY()!==B.y)){B.x=this.owner.getX();B.y=this.owner.getY();this.adjustPosition()}};this.onTimeout=callback(this,function(){if(this.isVisible()){this.hide()}})};core.ui.Balloon.LEFT=1;core.ui.Balloon.TOP=2;core.ui.Balloon.RIGHT=4;core.ui.Balloon.BOTTOM=8;core.ui.Balloon.FLOATING=16;core.ui.Balloon.MASK_POSTITON=15;core.ui.Balloon.ZINDEX=10000}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"Balloon");with(editor.ui){editor.ui.Balloon.superClass=core.ui.Balloon;editor.ui.Balloon.constructor=function(){this.Balloon=function(C,D,B,A){arguments.callee.prototype.apply(this,[C,D,B,A]);this.top=new core.ui.Window(this);this.top.setStyleName(this.getStyleName()+"Top");this.top.setStyle("z-index",core.ui.Balloon.ZINDEX+1);this.center=new core.ui.Window(this);this.center.setStyleName(this.getStyleName()+"Center");this.center.setStyle("z-index",core.ui.Balloon.ZINDEX+1);this.bottom=new core.ui.Window(this);this.bottom.setStyleName(this.getStyleName()+"Bottom");this.bottom.setStyle("z-index",core.ui.Balloon.ZINDEX+1);this.text=new core.ui.Window(this,0,0,"100%","auto");this.text.setStyleName(this.getStyleName()+"Text");this.text.setStyle("position","absolute");this.text.setStyle("z-index",core.ui.Balloon.ZINDEX+2);this.updateLayout()};this.setText=function(A){if((this.text&&(this.text.constructor===core.ui.Window||defined(this.text.constructor.isSubclassOf)&&this.text.constructor.isSubclassOf(core.ui.Window)))){this.text.setText(A)}};this.getText=function(){return this.text.getText()};this.updateLayout=function(){this.text.move(0,0);this.top.setStyle("width","100%");this.center.setStyle("width","100%");this.center.setStyle("height",(this.text.getHeight()-this.top.getHeight()-this.bottom.getHeight())+"px");this.bottom.setStyle("width","100%");this.setStyle("height",this.text.getHeight()+"px")};this.setVisible=override(this.setVisible,function(A){this.updateLayout();arguments.callee.prototype.apply(this,[A])})}}ClassFactory.createPackage("common.util");ClassFactory.createClass(common.util,"MemorialUtils");with(common.util){common.util.MemorialUtils.constructor=function(){};common.util.MemorialUtils.getPageId=function(){if(defined(window.theApp)){return theApp.config.get("page.id")}else{return common.Page.getInstance().config.get("page.id")}};common.util.MemorialUtils.getBaseUri=function(){if(defined(window.theApp)){return theApp.config.get("app.baseUri")}else{return common.Page.getInstance().config.get("page.baseUri")}};common.util.MemorialUtils.htmlEncode=function(A){return A.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")};common.util.MemorialUtils.htmlDecode=function(A){return A.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"')}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"MessageDialog");with(editor.ui){editor.ui.MessageDialog.superClass=core.ui.Dialog;editor.ui.MessageDialog.constructor=function(){this.name;this.mail;this.text;this.notifySubmitClicked=new core.ui.Notification();this.notifyCancelClicked=new core.ui.Notification();this.MessageDialog=function(B,A,E,C,D){this.Dialog();this.initHeader();this.initBody();this.balloon=new editor.ui.Balloon()};this.initBody=function(){var B=new core.ui.Window(this);B.addStyleName("MessageDialogBody");var A=new core.ui.Static(B);A.setStyle("text-align","left");A.setText("Enter your name");this.name=new core.ui.Edit(B);this.name.setTabIndex(1);var D=new core.ui.Static(B);D.setText("Enter your e-mail");this.mail=new core.ui.Edit(B);this.mail.setTabIndex(2);var C=new core.ui.Static(B);C.setText("Enter your message");this.text=new core.ui.TextArea(B);this.text.setTabIndex(3);this.text.setStyle("overflow-y","auto");this.cancel=new core.ui.ImageButton(B);this.cancel.setImageList("images/MessageDialog/close_button.gif");this.cancel.addStyleName("CloseButton");this.cancel.setToolTip("Close window");this.cancel.oncommand=this.onCancelClick;this.submit=new core.ui.ImageButton(B);this.submit.setImageList("images/MessageDialog/ok_button.gif");this.submit.addStyleName("OkButton");this.submit.setToolTip("Add message");this.submit.oncommand=this.onSubmitClick};this.initHeader=function(){var C=new core.ui.Handle(this);C.setDragWindow(this);C.addStyleName("MessageDialogHeader");var B=new core.ui.Window(C);B.addStyleName("HeaderLeftCorner");var A=new core.ui.Window(C);A.addStyleName("HeaderRightCorner")};this.show=override(this.show,function(){arguments.callee.prototype.apply(this,[]);if(this.name.getText()){this.text.setFocus(true)}else{this.name.setFocus(true)}});this.setData=function(B,A,C){this.name.setText(B);this.mail.setText(A);this.text.setText(C)};this.reset=function(){this.text.setText("")};this.showBalloon=function(B,C,A){this.balloon.setOwner(B);this.balloon.setText(C);this.balloon.setPosition(A);this.balloon.show()};this.hideBalloon=function(){this.balloon.hide()};this.validate=function(){var A=/^[_A-Za-z0-9-]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)+$/;if(!this.name.getText()){this.showBalloon(this.name,"Please enter your name.",core.ui.Balloon.RIGHT);this.name.setFocus(true);return false}else{if(!this.mail.getText().match(A)){this.showBalloon(this.mail,"Please enter a valid email address.",core.ui.Balloon.RIGHT);this.mail.setFocus(true);return false}else{if(!this.text.getText()){this.text.setFocus(true);this.showBalloon(this.text,"Please type your message.",core.ui.Balloon.RIGHT);return false}}}return true};this.doModal=override(this.doModal,function(){arguments.callee.prototype.apply(this,[]);editor.ui.SelectionManager.get().clearSelection(true)});this.endModal=override(this.endModal,function(){this.hideBalloon();arguments.callee.prototype.apply(this,[]);editor.ui.SelectionManager.get().restoreSelection()});this.submitClicked=function(){this.endModal()};this.cancelClicked=function(){this.endModal()};this.onSubmitClick=callback(this,function(){if(this.validate()){this.submitClicked();this.notifySubmitClicked.send(this)}});this.onCancelClick=callback(this,function(){this.cancelClicked();this.notifyCancelClicked.send(this)})}}ClassFactory.createPackage("common");ClassFactory.createClass(common,"ReportAbuseDialog");with(common){common.ReportAbuseDialog.superClass=editor.ui.MessageDialog;common.ReportAbuseDialog.constructor=function(){this.notifyAbuseSent=new core.ui.Notification();this.ReportAbuseDialog=function(parent,x,y,width,height){this.MessageDialog(parent,x,y,width,height);with(core.ui){Window.notifyResize.addListener(this.onUpdatePosition);Window.notifyScroll.addListener(this.onUpdatePosition)}};this.submitClicked=override(this.submitClicked,function(){core.ajax.sendRequest("ajax.PostAbuseMessage",this.onServerResponse,{"id":Page.getInstance().config.get("page.id"),"name":this.name.getText(),"email":this.mail.getText(),"message":this.text.getText()})});this.onServerResponse=callback(this,function(response){if(response.status=="OK"){alert("Your message has been sent.");this.endModal();this.notifyAbuseSent.send(this,this.name.getText(),this.mail.getText())}else{alert(response.message)}});this.cancelClicked=override(this.cancelClicked,function(){arguments.callee.prototype.apply(this,[]);this.endModal()});this.onUpdatePosition=callback(this,function(){this.center()})}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Link");with(core.ui){core.ui.Link.superClass=core.ui.Window;core.ui.Link.constructor=function(){this.Link=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.setStyle("display","block");this.setTarget(Link.TARGET_SELF);this.setHref("#")};this.setHref=function(A){this.getElement().href=A};this.getHref=function(){return this.getElement().href};this.setTarget=function(A){this.getElement().target=A};this.getTarget=function(){return this.getElement().target};this.createElement=function(){return document.createElement("a")}};core.ui.Link.TARGET_BLANK="_blank";core.ui.Link.TARGET_PARENT="_parent";core.ui.Link.TARGET_SELF="_self";core.ui.Link.TARGET_TOP="_top"}ClassFactory.createPackage("editor.plugins.comments");ClassFactory.createClass(editor.plugins.comments,"CommentsControls");with(editor.plugins.comments){editor.plugins.comments.CommentsControls.superClass=core.ui.Window;editor.plugins.comments.CommentsControls.constructor=function(){this.owner=null;this.showComments;this.addComment;this.CommentsControls=function(element){arguments.callee.prototype.apply(this,[]);this.owner=element;this.owner.addElementListener(this);this.createButtons();this.updateLayout();this.updateInfo()};this.getMinWidth=function(){return 170};this.onElementChanged=function(){this.updateLayout()};this.close=override(this.close,function(){this.owner.removeElementListener(this);arguments.callee.prototype.apply(this,[])});this.createButtons=function(){with(core.ui){this.showComments=new Link(this);this.showComments.addStyleName("ShowCommentsLink");this.showComments.onclick=this.onShowComments;this.showComments.setText("Loading...");this.addComment=new Link(this);this.addComment.addStyleName("AddCommentLink");this.addComment.onclick=this.onAddComment;this.addComment.setText("Add&nbsp;comment")}};this.updateInfo=function(){core.ajax.sendRequest("ajax.CountComments",this.onServerResponse,{"pageId":common.util.MemorialUtils.getPageId(),"elementId":ObjectComments.getInstance().getElementId(this.owner)});this.countingComments=true;this.showComments.setText("Loading...")};this.updatePosition=function(){var root=this.getElement();root.parentNode.removeChild(root);if(this.owner.getElement().nextSibling){this.owner.getElement().parentNode.insertBefore(root,this.owner.getElement().nextSibling)}else{this.owner.getElement().parentNode.appendChild(root)}};this.updateLayout=function(){if(this.owner.isInEditMode()){if(this.prevPosition!=this.owner.getPosition()){this.updatePosition();this.prevPosition=this.owner.getPosition()}}else{this.updatePosition()}this.setVisible(this.owner.isVisible());this.setStyle("z-index",this.owner.getStyle("z-index"));if(this.owner.getWidth()>this.getMinWidth()){this.move(this.owner.getX(),this.owner.getY()+this.owner.getHeight());this.resize(this.owner.getWidth(),this.getHeight())}else{var offset=(this.getMinWidth()-this.owner.getWidth())/2;this.move(this.owner.getX()-offset,this.owner.getY()+this.owner.getHeight());this.resize(this.getMinWidth(),this.getHeight())}};this.onAddComment=callback(this,function(event){var dialog=ObjectComments.getInstance().getAddCommentDialog();dialog.setOwner(this.owner);dialog.reset();dialog.center();dialog.doModal();event.stop();event.cancel()});this.onShowComments=callback(this,function(event){if(!this.countingComments){var dialog=ObjectComments.getInstance().getViewCommentsDialog();dialog.setCommentId(null);dialog.setOwner(this.owner);dialog.center();dialog.doModal()}event.stop();event.cancel()});this.onServerResponse=callback(this,function(response){if((response.status=="OK")&&(response.count>0)){this.countingComments=false}this.showComments.setText("Comments&nbsp;("+(response.count?response.count:"0")+")")})}}ClassFactory.createPackage("editor.plugins.comments");ClassFactory.createClass(editor.plugins.comments,"AddCommentDialog");with(editor.plugins.comments){editor.plugins.comments.AddCommentDialog.superClass=editor.ui.MessageDialog;editor.plugins.comments.AddCommentDialog.constructor=function(){this.notifyAdded=new core.ui.Notification();this.setOwner=function(A){this.owner=A};this.submitClicked=override(this.submitClicked,function(){core.ajax.sendRequest("ajax.AddComment",this.onCommentAdded,{"pageId":common.util.MemorialUtils.getPageId(),"elementId":ObjectComments.getInstance().getElementId(this.owner),"name":this.name.getText(),"email":this.mail.getText(),"text":this.text.getText()})});this.onCommentAdded=callback(this,function(A){if(A.status=="OK"){alert("Your message was added.");ObjectComments.getInstance().update(this.owner);this.notifyAdded.send(this);this.endModal()}})}}ClassFactory.createPackage("common.util");ClassFactory.createClass(common.util,"DateUtils");with(common.util){common.util.DateUtils.constructor=function(){};common.util.DateUtils.formatInt=function(A){return(A>=0&&A<10?"0":"")+A};common.util.DateUtils.dateToInt=function(A){return(A.indexOf("0")==0)?parseInt(A.substr(A.indexOf("0")+1)):parseInt(A)};common.util.DateUtils.getMonth=function(A){if(!A){return false}var B=A.indexOf("/",0);var C=this.dateToInt(A.substring(0,B));if(B<0){B=A.indexOf("-",0);j=A.indexOf("-",B+1);C=this.dateToInt(A.substring(B+1,j))}return C};common.util.DateUtils.getYear=function(B){if(!B){return false}var C=B.indexOf("/",0);var A=B.indexOf("/",C+1);var D=this.dateToInt(B.substring(A+1));if(C<0){C=B.indexOf("-",0);A=B.indexOf("-",C+1);D=this.dateToInt(B.substring(0,C))}return D};common.util.DateUtils.getDay=function(C){if(!C){return false}var D=C.indexOf("/",0);var B=C.indexOf("/",D+1);var A=this.dateToInt(C.substring(D+1,B));if(D<0){D=C.indexOf("-",0);B=C.indexOf("-",D+1);A=this.dateToInt(C.substring(B+1))}return A};common.util.DateUtils.toServerDate=function(C,E){if(!C){return false}date=new Date(C);var B=this.formatInt(date.getDate());var G=this.formatInt(date.getMonth()+1);var D=date.getFullYear();var A=this.formatInt(date.getHours());var H=this.formatInt(date.getMinutes());var F="";E=defined(E)?E:false;if(E){F=D+"-"+G+"-"+B+" "+A+":"+min}else{F=D+"-"+G+"-"+B}return F};common.util.DateUtils.toClientDate=function(C,F){if(!C){return false}date=new Date(C);var B=this.formatInt(date.getDate());var G=this.formatInt(date.getMonth()+1);var E=date.getFullYear();var A=this.formatInt(date.getHours());var H=this.formatInt(date.getMinutes());var D="";F=defined(F)?F:false;if(F){D=G+"/"+B+"/"+E+" "+A+":"+H}else{D=G+"/"+B+"/"+E}return D};common.util.DateUtils.toMilliseconds=function(B){if(!B){return false}var C=new Date(this.getYear(B),this.getMonth(B)-1,this.getDay(B));var A=Date.parse(C.toString());return A};common.util.DateUtils.server2client=function(B){var A=this.toMilliseconds(B);return this.toClientDate(A)};common.util.DateUtils.client2server=function(B){var A=this.toMilliseconds(B);return this.toServerDate(A)};common.util.DateUtils.timestamp2millisec=function(A){if(!A){return null}return A*1000};common.util.DateUtils.getSeconds=function(A){return this.formatInt((A%60).toFixed())};common.util.DateUtils.getMinutes=function(A){return this.formatInt(parseInt(A/60))};common.util.DateUtils.exist=function(A){if(this.getMonth(A)>12){return false}else{if(this.getDay(A)>31){return false}else{if(this.toClientDate(this.toMilliseconds(A))!=A){return false}}}return true}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"Grid");with(editor.ui){editor.ui.Grid.superClass=core.ui.Window;editor.ui.Grid.constructor=function(){this.Grid=function(){arguments.callee.prototype.apply(this,[null,0,0,"100%","100%"]);this.setStyle("z-index",0);core.ui.Window.notifyResize.addListener(this.onUpdateLayout);core.ui.Window.notifyScroll.addListener(this.onUpdateLayout)};this.close=override(this.close,function(){core.ui.Window.notifyResize.removeListener(this.onUpdateLayout);core.ui.Window.notifyScroll.removeListener(this.onUpdateLayout);arguments.callee.prototype.apply(this,[])});this.onUpdateLayout=callback(this,function(){this.resize(core.ui.Window.getWidth(),core.ui.Window.getHeight())})};editor.ui.Grid.SIZE=10}ClassFactory.createPackage("core.util");ClassFactory.createClass(core.util,"ArrayList");with(core.util){core.util.ArrayList.constructor=function(){this.ArrayList=function(A){this.elements=A||[]};this.add=function(A){this.elements.push(A)};this.indexOf=function(A){for(var B=0;B<this.elements.length;B++){if(A===this.elements[B]){return B}}return -1};this.get=function(A){return this.elements[A]};this.size=function(){return this.elements.length};this.clear=function(){delete this.elements;this.elements=[]};this.iterator=function(){return new Iterator(this.elements)};this.toArray=function(){return this.elements}}}ClassFactory.createPackage("core.util");ClassFactory.createClass(core.util,"HashMap");with(core.util){core.util.HashMap.constructor=function(){this.HashMap=function(A){this.elements=A||{};this.elementCount=0};this.set=function(A,B){if(!this.hasKey(A)){this.elementCount++}this.elements[A]=B};this.get=function(A){return this.elements[A]};this.remove=function(A){if(this.hasKey(A)){delete this.elements[A];this.elementCount--}};this.hasKey=function(A){return defined(this.elements[A])};this.clear=function(){delete this.elements;this.elements={}};this.size=function(){return this.elementCount};this.getKeys=function(){var B=new OrderedSet();for(var A in this.elements){B.add(A)}return B};this.getValues=function(){var B=new ArrayList();for(var A in this.elements){B.add(this.elements[A])}return B};this.toObject=function(){return this.elements}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"AbstractSelection");with(editor.ui){editor.ui.AbstractSelection.superClass=core.ui.FocusWindow;editor.ui.AbstractSelection.constructor=function(){this.target;this.listeners=new core.util.Listeners();this.AbstractSelection=function(A){arguments.callee.prototype.apply(this,[]);this.target=A};this.setTarget=function(A){this.target=A};this.getTarget=function(){return this.target};this.addSelectionListener=function(A){this.listeners.add(A)};this.removeSelectionListener=function(A){this.listeners.remove(A)};this.select=function(){this.show();this.fireSelected()};this.unselect=function(){this.hide();this.fireUnselected()};this.isSelected=function(){return this.isVisible()};this.updateLayout=function(){};this.fireSelected=function(){this.listeners.call("onElementSelected",[this])};this.fireUnselected=function(){this.listeners.call("onElementUnselected",[this])}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"SelectionManager");with(editor.ui){editor.ui.SelectionManager.constructor=function(){this.selections=new core.util.HashMap();this.listeners=new core.util.Listeners();this.SelectionManager=function(){editor.Application.getInstance().addAppListener(this)};this.addSelectionListener=function(A){this.listeners.add(A)};this.removeSelectionListener=function(A){this.listeners.remove(A)};this.isSelected=function(A){return this.selections.hasKey(A.getId())};this.hasSelection=function(){return(this.selections.size()>0)};this.setSelection=function(A){this.clearSelection();return this.addSelection(A)};this.addSelection=function(B){if(!this.isSelected(B)){this.selections.set(B.getId(),B.createSelection());this.fireSelectionChange(B)}var A=this.selections.get(B.getId());A.select();return A};this.removeSelection=function(B){if(this.isSelected(B)){var A=this.getSelection(B);this.selections.remove(B.getId());if(A.isSelected()){A.unselect();this.fireSelectionChange(B)}}};this.getSelection=function(A){return this.selections.get(A.getId())};this.updateSelection=function(){for(var A=this.selections.getValues().iterator();A.hasNext();A.next()){A.current().select()}};this.clearSelection=function(D){if(D){this.elements=this.getSelectedElements()}for(var C=this.selections.getValues().iterator();C.hasNext();C.next()){var A=C.current();if(A.isSelected()){var B=A.getTarget();A.unselect();this.selections.remove(B.getId());this.fireSelectionChange(B)}}};this.restoreSelection=function(){if((this.elements&&(this.elements.constructor===core.util.ArrayList||defined(this.elements.constructor.isSubclassOf)&&this.elements.constructor.isSubclassOf(core.util.ArrayList)))){for(var A=this.elements.iterator();A.hasNext();A.next()){this.addSelection(A.current())}delete this.elements}};this.getSelectedElements=function(){var A=[];for(var B=this.selections.getValues().iterator();B.hasNext();B.next()){A.push(B.current().getTarget())}return new core.util.ArrayList(A)};this.handleMove=function(C,A,D){for(var E=this.selections.getValues().iterator();E.hasNext();E.next()){var B=E.current();if(B!==D){B.move(B.getX()+C,B.getY()+A)}}};this.fireSelectionChange=function(A){this.listeners.call("onElementSelectionChange",[this,A])};this.onAppClear=function(){this.clearSelection()};this.onAppModeChanged=function(B){for(var A=this.selections.getValues().iterator();A.hasNext();A.next()){A.current().setVisible(B.getMode()===editor.Application.MODE_EDIT)}}};editor.ui.SelectionManager.get=function(){if(!defined(this.instance)){this.instance=new SelectionManager()}return this.instance}}ClassFactory.createPackage("editor.commands");ClassFactory.createClass(editor.commands,"CommandHistory");with(editor.commands){editor.commands.CommandHistory.constructor=function(){this.commands=new core.util.ArrayList();this.listeners=new core.util.Listeners();this.CommandHistory=function(){this.commandIndex=-1;editor.Application.getInstance().addAppListener(this)};this.addHistoryListener=function(A){this.listeners.add(A)};this.removeHistoryListener=function(A){this.listeners.remove(A)};this.execute=function(A){this.commands.toArray().splice(this.commandIndex+1);A.execute();this.commands.add(A);if(++this.commandIndex>CommandHistory.MAX_SIZE-1){this.commands.toArray().shift()}this.fireChanged()};this.getUndoCommands=function(){return new core.util.ArrayList(this.commands.toArray().slice(0,this.commandIndex+1))};this.getRedoCommands=function(){return new core.util.ArrayList(this.commands.toArray().slice(this.commandIndex+1))};this.canUndo=function(){return(this.commandIndex>=0)};this.canRedo=function(){return(this.commandIndex<(this.commands.size()-1))};this.undo=function(){if(this.canUndo()){this.commands.get(this.commandIndex--).unexecute();this.fireChanged()}};this.redo=function(){if(this.canRedo()){this.commands.get(++this.commandIndex).execute();this.fireChanged()}};this.fireChanged=function(){this.listeners.call("onHistoryChanged",[this])};this.onAppClear=function(){this.commandIndex=-1;this.commands.clear();this.fireChanged()}};editor.commands.CommandHistory.get=function(){if(!defined(this.instance)){this.instance=new CommandHistory()}return this.instance};editor.commands.CommandHistory.MAX_SIZE=10}ClassFactory.createPackage("editor.commands");ClassFactory.createClass(editor.commands,"AbstractCommand");with(editor.commands){editor.commands.AbstractCommand.constructor=function(){this.AbstractCommand=function(B,A){this.target=B;this.name=A};this.setTarget=function(A){this.target=A};this.getTarget=function(){return this.target};this.getName=function(){return this.name};this.setName=function(A){this.name=A};this.execute=function(){};this.unexecute=function(){}}}ClassFactory.createPackage("editor.commands");ClassFactory.createClass(editor.commands,"RemoveObjectsGroupCommand");with(editor.commands){editor.commands.RemoveObjectsGroupCommand.superClass=editor.commands.AbstractCommand;editor.commands.RemoveObjectsGroupCommand.constructor=function(){}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"MultipleSelection");with(editor.ui){editor.ui.MultipleSelection.superClass=core.ui.Window;editor.ui.MultipleSelection.constructor=function(){this.startX;this.startY;this.ctrlPressed=false;this.selectionInProgress=false;this.keyEventsAttached=false;this.MultipleSelection=function(){arguments.callee.prototype.apply(this,[]);this.setStyle("position","absolute");this.setStyle("z-index",1024);this.resize(0,0);this.hide()};this.elementsIntersected=function(r1,r2){var left1=r1.getX();var left2=r2.getX();var min=left1>left2?left1:left2;var right1=r1.getX()+r1.getWidth();var right2=r2.getX()+r2.getWidth();var max=right1<right2?right1:right2;if(min>max){return false}var top1=r1.getY();var top2=r2.getY();min=top1>top2?top1:top2;var bottom1=r1.getY()+r1.getHeight();var bottom2=r2.getY()+r2.getHeight();max=bottom1<bottom2?bottom1:bottom2;return min<=max};this.deleteSelection=function(){with(editor.commands){CommandHistory.get().execute(new RemoveObjectsGroupCommand())}};this.collectSelectedObjects=function(){if((this.getWidth()>0)&&(this.getHeight()>0)){var i=editor.Application.getInstance().getCollection().iterator();while(i.hasNext()){var element=i.next();if(this.elementsIntersected(this,element)&&(element.getStyle("z-index")>0)){editor.ui.SelectionManager.get().addSelection(element).setFocus(true)}}}};this.onWorkspaceMouseMove=function(subject,event){if(!this.selectionInProgress){return }if(!this.isVisible()){this.show()}var x=event.getX();var y=event.getY();var width=this.startX-x;var height=this.startY-y;if(width>0){this.move(x,this.getY())}if(height>0){this.move(this.getX(),y)}this.resize(Math.abs(width),Math.abs(height))};this.onWorkspaceMouseUp=function(){this.hide();this.selectionInProgress=false;this.attachGlobalEvent("keydown");if(this.getWidth()>2||this.getHeight()>2){this.collectSelectedObjects()}this.resize(0,0)};this.onWorkspaceMouseDown=function(subject,event){this.selectionInProgress=true;this.detachGlobalEvent("keydown");this.startX=event.getX();this.startY=event.getY();this.move(this.startX,this.startY);this.show()};this.onkeydown=function(event){if(core.ui.Event.KEY_DELETE==event.keyCode){this.deleteSelection()}};this.close=override(this.close,function(){this.detachGlobalEvent("keydown");editor.Application.getInstance().getWorkspace().removeMouseListener(this);arguments.callee.prototype.apply(this,[])})}}ClassFactory.createPackage("editor");ClassFactory.createClass(editor,"Workspace");with(editor){editor.Workspace.constructor=function(){this.mouseListeners=new core.util.Listeners();this.addMouseListener=function(A){this.mouseListeners.add(A)};this.removeMouseListener=function(A){this.mouseListeners.remove(A)};this.init=function(){editor.Application.getInstance().addAppListener(this);this.grid=new editor.ui.Grid();this.selection=new editor.ui.MultipleSelection();this.map={"mouseup":"onWorkspaceMouseUp","mousedown":"onWorkspaceMouseDown","mousemove":"onWorkspaceMouseMove"};for(var A in this.map){core.ui.Event.addListener(document.documentElement,A,this.onDocumentMouseEvent)}};this.isGridVisible=function(){return this.grid.isVisible()};this.setGridVisible=function(A){this.grid.setVisible(A)};this.setTitle=function(A){window.document.title=A};this.getTitle=function(){return window.document.title};this.onAppModeChanged=function(A){if(editor.Application.MODE_PREVIEW===A.getMode()){editor.ui.VisibilityManager.hide(this.selection,this.grid)}else{editor.ui.VisibilityManager.restore(this.selection,this.grid)}};this.onDocumentMouseEvent=callback(this,function(A){A=core.ui.Event.improve(A);if("mousedown"==A.getType()){if((document.body!=A.target)&&(document.documentElement!=A.target)&&(this.grid.getElement()!=A.target)){return }}this.mouseListeners.call(this.map[A.getType()],[this,A])})}}ClassFactory.createPackage("editor");ClassFactory.createClass(editor,"SaveContext");with(editor){editor.SaveContext.superClass=core.util.HashMap;editor.SaveContext.constructor=function(){this.SaveContext=function(A){arguments.callee.prototype.apply(this,[]);this.url=A};this.setUrl=function(A){this.url=A};this.getUrl=function(){return this.url}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Menu");with(core.ui){core.ui.Menu.superClass=core.ui.Window;core.ui.Menu.constructor=function(){this.origin;this.items=[];this.popupinfo={};this.notifyEndPopup=new Notification();this.Menu=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.setStyle("overflow","visible")};this.doPopup=function(B,A,C){this.origin=B;if(defined(A)&&defined(C)){this.move(A,C)}this.attachGlobalEvent("mousedown");this.attachGlobalEvent("keydown");this.popupinfo.popupState=true;this.activate();this.show()};this.endPopup=function(){if(this.popupinfo.popupState){delete this.origin;this.popupinfo.popupState=false;this.detachGlobalEvent("mousedown");this.detachGlobalEvent("keydown");this.notifyEndPopup.send(this);this.hide()}};this.isPopup=function(A){if(this.popupinfo.popupState){if(defined(A)){return(this.origin==A)}return true}return false};this.getOrigin=function(){return this.origin};this.addItem=function(A){this.items.push(A);return A};this.getItem=function(A){return this.items[A]};this.getItemCount=function(){return this.items.length};this.removeItem=function(A){this.items[A].close();delete this.items[A];this.items.splice(A,1)};this.removeItems=function(){while(this.items.length>0){var A=this.items.pop();A.close();delete A}};this.ensureVisible=function(A){this.getElement().scrollTop=this.items[A].getY()};this.onmousedown=function(A,B){if((B&&(B.constructor===Window||defined(B.constructor.isSubclassOf)&&B.constructor.isSubclassOf(Window)))){if((B==this)||B.isChildOf(this)||this.isChildOf(B)){return }if(((this.origin&&(this.origin.constructor===Window||defined(this.origin.constructor.isSubclassOf)&&this.origin.constructor.isSubclassOf(Window))))&&((B==this.origin)||B.isChildOf(this.origin))){return }while(B.isChild()){B=B.getParent()}if(((B&&(B.constructor===Menu||defined(B.constructor.isSubclassOf)&&B.constructor.isSubclassOf(Menu))))&&B.isPopup()){return }}this.endPopup()};this.onkeydown=function(A){if(Event.KEY_ESCAPE==A.keyCode){this.endPopup()}}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"MenuItem");with(core.ui){core.ui.MenuItem.superClass=core.ui.FocusWindow;core.ui.MenuItem.constructor=function(){}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"CompositeWindow");with(core.ui){core.ui.CompositeWindow.superClass=core.ui.Window;core.ui.CompositeWindow.constructor=function(){this.updateLayout=function(){};this.resize=override(this.resize,function(A,B){arguments.callee.prototype.apply(this,[A,B]);this.updateLayout()});this.setStyle=override(this.setStyle,function(A,B){arguments.callee.prototype.apply(this,[A,B]);this.updateLayout()});this.setStyleId=override(this.setStyleId,function(A){arguments.callee.prototype.apply(this,[A]);this.updateLayout()});this.setStyleName=override(this.setStyleName,function(A){arguments.callee.prototype.apply(this,[A]);this.updateLayout()});this.addStyleName=override(this.addStyleName,function(A){arguments.callee.prototype.apply(this,[A]);this.updateLayout()});this.removeStyleName=override(this.removeStyleName,function(A){arguments.callee.prototype.apply(this,[A]);this.updateLayout()});this.clearStyleName=override(this.clearStyleName,function(){arguments.callee.prototype.apply(this,[]);this.updateLayout()})}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"DragWindow");with(core.ui){core.ui.DragWindow.superClass=core.ui.Handle;core.ui.DragWindow.constructor=function(){this.DragWindow=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.setDragWindow(this)}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Slider");with(core.ui){core.ui.Slider.superClass=core.ui.FocusWindow;core.ui.Slider.constructor=function(){this.indicator;this.vertical=false;this.pos=0;this.min=0;this.max=100;this.notifyPositionChanged=new Notification();this.Slider=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.indicator=new DragWindow(this);this.indicator.setStyleName("Indicator");this.indicator.setDirection(Handle.DIRECTION_EAST|Handle.DIRECTION_WEST);this.indicator.notifyDrag.addListener(this.onIndicatorDrag);this.setVertical(false);core.ui.quirks.TextSelection.preventSelection(this.getElement())};this.setRange=function(B,A){this.min=B;this.max=A};this.getRangeMin=function(){return this.min};this.getRangeMax=function(){return this.max};this.setPos=function(C){if(C<this.min){this.setPos(this.min)}else{if(C>this.max){this.setPos(this.max)}else{this.pos=C}}if(this.isVertical()){var B=this.getClientHeight()-this.indicator.getHeight()-(this.pos-this.min)/(this.max-this.min)*(this.getClientHeight()-this.indicator.getHeight());this.indicator.setStyle("left","auto");this.indicator.setStyle("top",B+"px")}else{var A=(this.pos-this.min)/(this.max-this.min)*(this.getClientWidth()-this.indicator.getWidth());this.indicator.setStyle("left",A+"px");this.indicator.setStyle("top","auto")}};this.getPos=function(){return this.pos};this.setVertical=function(A){this.removeStyleName(this.getStyleName()+(this.vertical?"-vertical":"-horisontal"));this.vertical=A;this.addStyleName(this.getStyleName()+(this.vertical?"-vertical":"-horisontal"));this.indicator.setDirection(this.isVertical()?Handle.DIRECTION_NORTH|Handle.DIRECTION_SOUTH:Handle.DIRECTION_EAST|Handle.DIRECTION_WEST);this.setPos(this.pos)};this.isVertical=function(){return this.vertical};this.getProgressIndicator=function(){return this.indicator};this.getPositionByCoords=function(A,C){var B=(this.isVertical())?this.max-Math.floor(C/(this.getClientHeight()-this.indicator.getHeight())*(this.max-this.min)):this.min+Math.floor(A/(this.getClientWidth()-this.indicator.getWidth())*(this.max-this.min));if(B<this.min){return this.min}else{if(B>this.max){return this.max}else{return B}}};this.onIndicatorDrag=callback(this,function(){var A=this.getPositionByCoords(this.indicator.getX(),this.indicator.getY());if((this.min==A)||(this.max==A)){this.setPos(A)}else{this.pos=A}this.notifyPositionChanged.send(this,this.pos)});this.onmousedown=function(A,C){if(this==C){var B=this.getPositionByCoords(A.getX()-this.getAbsX()-this.indicator.getWidth()/2,A.getY()-this.getAbsY()-this.indicator.getHeight()/2);this.setPos(B);this.notifyPositionChanged.send(this,B)}};this.onkeypress=function(A){var C=(this.max-this.min)/100;var B=false;if(this.isVertical()){if(Event.KEY_UP_ARROW==A.keyCode){this.setPos(this.getPos()+C);B=true}else{if(Event.KEY_DOWN_ARROW==A.keyCode){this.setPos(this.getPos()-C);B=true}}}else{if(Event.KEY_LEFT_ARROW==A.keyCode){this.setPos(this.getPos()-C);B=true}else{if(Event.KEY_RIGHT_ARROW==A.keyCode){this.setPos(this.getPos()+C);B=true}}}this.notifyPositionChanged.send(this,this.pos);if(B){A.cancel()}}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"ScrollBar");with(core.ui){core.ui.ScrollBar.superClass=core.ui.Window;core.ui.ScrollBar.constructor=function(){this.orienation=ScrollBar.VERTICAL;this.step=0;this.target;this.backwardButton;this.forwardButton;this.slider;this.ScrollBar=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.backwardButton=new ImageButton(this);this.backwardButton.setStyleName("BackwardButton");this.backwardButton.setStyle("position","absolute");this.backwardButton.onmousedown=this.onBackwardMouseDown;this.slider=new Slider(this);this.slider.setStyle("position","absolute");this.slider.notifyPositionChanged.addListener(this.onSliderPositionChanged);this.forwardButton=new ImageButton(this);this.forwardButton.setStyleName("ForwardButton");this.forwardButton.setStyle("position","absolute");this.forwardButton.onmousedown=this.onForwardMouseDown;this.setOrientation(ScrollBar.VERTICAL);Event.addListener(this.getElement(),"resize",this.onResize)};this.setOrientation=function(A){this.removeStyleName(this.getStyleName()+"-"+(this.isVertical()?"vertical":"horisontal"));this.orientation=A;this.addStyleName(this.getStyleName()+"-"+(this.isVertical()?"vertical":"horisontal"));this.slider.setVertical(this.isVertical());this.backwardButton.setStyle("left","0px");this.backwardButton.setStyle("top","0px");this.forwardButton.setStyle("left",this.isVertical()?"0px":"");this.forwardButton.setStyle("right",this.isVertical()?"":"0px");this.forwardButton.setStyle("top",this.isVertical()?"":"0px");this.forwardButton.setStyle("bottom",this.isVertical()?"0px":"");this.slider.setStyle("left",this.isVertical()?"0px":"");this.slider.setStyle("top",this.isVertical()?"":"0px");this.updateLayout()};this.getOrientation=function(){return this.orientation};this.isVertical=function(){return(ScrollBar.VERTICAL==this.orientation)};this.setPosition=function(A){A=Math.max(A,0);A=Math.min(A,100);this.slider.setPos(this.isVertical()?100-A:A);this.updateTarget(A)};this.getPosition=function(){var A=this.slider.getPos();return this.isVertical()?100-A:A};this.setScrollTarget=function(A){this.target=A;this.target.setStyle("overflow-"+(this.isVertical()?"y":"x"),"hidden");this.updateLayout()};this.getScrollTarget=function(){return this.target};this.getBackwardButton=function(){return this.backwardButton};this.getForwardButton=function(){return this.forwardButton};this.getSliderControl=function(){return this.slider};this.updateLayout=function(){if((this.target&&(this.target.constructor===Window||defined(this.target.constructor.isSubclassOf)&&this.target.constructor.isSubclassOf(Window)))){if(this.isVertical()){this.slider.setStyle("top",this.backwardButton.getHeight()+"px");this.slider.setStyle("height",Math.max(this.getClientHeight()-this.backwardButton.getHeight()-this.forwardButton.getHeight(),0)+"px");var B=(this.target.getElement().scrollHeight>0)?this.slider.getClientHeight()*this.target.getClientHeight()/this.target.getElement().scrollHeight:0;this.slider.indicator.setStyle("height",Math.max(B,8)+"px");var C=this.target.getElement().scrollTop/(this.target.getElement().scrollHeight-this.target.getHeight())*100}else{this.slider.setStyle("left",this.backwardButton.getWidth()+"px");this.slider.setStyle("width",Math.max(this.getClientWidth()-this.backwardButton.getWidth()-this.forwardButton.getWidth(),0)+"px");var A=(this.target.getElement().scrollWidth>0)?this.slider.getClientWidth()*this.target.getClientWidth()/this.target.getElement().scrollWidth:0;this.slider.indicator.setStyle("width",Math.max(A,8)+"px");var C=this.target.getElement().scrollLeft/(this.target.getElement().scrollWidth-this.target.getWidth())*100}this.setPosition(isNaN(C)?0:C)}};this.updateTarget=function(A){if((this.target&&(this.target.constructor===Window||defined(this.target.constructor.isSubclassOf)&&this.target.constructor.isSubclassOf(Window)))){if(this.isVertical()){this.target.getElement().scrollTop=(this.target.getElement().scrollHeight-this.target.getHeight())*A/100}else{this.target.getElement().scrollLeft=(this.target.getElement().scrollWidth-this.target.getWidth())*A/100}}};this.doScroll=callback(this,function(){if(0!=this.step){this.setPosition(this.getPosition()+this.step);window.setTimeout(this.doScroll,50)}});this.onSliderPositionChanged=callback(this,function(A,B){this.updateTarget(this.isVertical()?100-B:B)});this.onBackwardMouseDown=callback(this,function(){this.attachGlobalEvent("mouseup");this.backwardButton.setState(ImageButton.STATE_PRESSED);this.setPosition(this.getPosition()+(this.step=-3));window.setTimeout(this.doScroll,600)});this.onForwardMouseDown=callback(this,function(){this.attachGlobalEvent("mouseup");this.forwardButton.setState(ImageButton.STATE_PRESSED);this.setPosition(this.getPosition()+(this.step=3));window.setTimeout(this.doScroll,600)});this.onResize=callback(this,function(){this.updateLayout()});this.onmouseup=callback(this,function(){this.detachGlobalEvent("mouseup");this.step=0})};core.ui.ScrollBar.HORISONTAL=1;core.ui.ScrollBar.VERTICAL=2}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"SplitWindow");with(core.ui){core.ui.SplitWindow.superClass=core.ui.CompositeWindow;core.ui.SplitWindow.constructor=function(){this.panes={};this.splitLeft;this.splitRight;this.splitTop;this.splitBottom;this.SplitWindow=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.updateLayout()};this.addPane=function(A,B){A.setStyle("position","absolute");A.setStyle("float","none");this.adjustPane(A,B);this.panes[A.getId()]=B};this.adjustPane=function(B,D){var A=this.splitLeft;var C=this.splitTop;if(defined(D)){if(D&SplitWindow.SPLIT_LEFT){this.splitLeft+=B.getWidth()}if(D&SplitWindow.SPLIT_TOP){this.splitTop+=B.getHeight()}if(D&SplitWindow.SPLIT_RIGHT){this.splitRight-=B.getWidth();A=this.splitRight}if(D&SplitWindow.SPLIT_BOTTOM){this.splitBottom-=B.getHeight();C=this.splitBottom}if(D&SplitWindow.SPLIT_FILL){B.resize(Math.abs(this.splitRight-this.splitLeft),Math.abs(this.splitBottom-this.splitTop))}}B.move(A,C)};this.updateLayout=function(){this.splitLeft=0;this.splitTop=0;this.splitRight=this.getClientWidth();this.splitBottom=this.getClientHeight();for(var C in this.panes){var B=Window.forId(C);var A=this.panes[C];this.adjustPane(B,A)}}};core.ui.SplitWindow.SPLIT_LEFT=1;core.ui.SplitWindow.SPLIT_RIGHT=4;core.ui.SplitWindow.SPLIT_TOP=8;core.ui.SplitWindow.SPLIT_BOTTOM=16;core.ui.SplitWindow.SPLIT_FILL=64}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"ScrollWindow");with(core.ui){core.ui.ScrollWindow.superClass=core.ui.SplitWindow;core.ui.ScrollWindow.constructor=function(){this.vscroll;this.hscroll;this.content;this.ScrollWindow=function(parent,x,y,width,height){arguments.callee.prototype.apply(this,[parent,x,y,width,height]);this.vscroll=this.createScrollBar(0,0,undefined,"100%");this.hscroll=this.createScrollBar(0,0,"100%",undefined);this.hscroll.setOrientation(ScrollBar.HORISONTAL);this.addPane(this.hscroll,SplitWindow.SPLIT_BOTTOM);this.addPane(this.vscroll,SplitWindow.SPLIT_RIGHT);this.updateLayout()};this.createScrollBar=function(x,y,width,height){return new ScrollBar(this,x,y,width,height)};this.setText=function(text){if((this.content&&(this.content.constructor===Window||defined(this.content.constructor.isSubclassOf)&&this.content.constructor.isSubclassOf(Window)))){this.content.setText(text);this.updateLayout()}};this.getText=function(){return((this.content&&(this.content.constructor===Window||defined(this.content.constructor.isSubclassOf)&&this.content.constructor.isSubclassOf(Window))))?this.content.getText():""};this.ensureVisible=function(child){if(((this.content&&(this.content.constructor===Window||defined(this.content.constructor.isSubclassOf)&&this.content.constructor.isSubclassOf(Window))))&&((child&&(child.constructor===Window||defined(child.constructor.isSubclassOf)&&child.constructor.isSubclassOf(Window))))&&child.isChildOf(this.content)){with(this.content.getElement()){scrollLeft=child.getX();scrollTop=child.getY()}this.vscroll.updateLayout();this.hscroll.updateLayout()}};this.setContentWindow=function(wnd){wnd.setStyle("overflow","hidden");this.addPane(wnd,SplitWindow.SPLIT_FILL);this.vscroll.setScrollTarget(wnd);this.hscroll.setScrollTarget(wnd);this.content=wnd};this.getContentWindow=function(){return this.content};this.getVerticalScroll=function(){return this.vscroll};this.getHorisontalScroll=function(){return this.hscroll};this.updateLayout=override(this.updateLayout,function(){if((this.content&&(this.content.constructor===Window||defined(this.content.constructor.isSubclassOf)&&this.content.constructor.isSubclassOf(Window)))){var w,h;with(this.content.getElement()){this.vscroll.setStyle("display",(scrollHeight>offsetHeight)?"block":"none");this.hscroll.setStyle("display",(scrollWidth>offsetWidth)?"block":"none");h=(scrollWidth>offsetWidth)?(this.getClientHeight()-this.hscroll.getHeight()):this.getClientHeight();w=(scrollHeight>offsetHeight)?(this.getClientWidth()-this.vscroll.getWidth()):this.getClientWidth()}this.hscroll.setStyle("width",Math.max(w,0)+"px");this.vscroll.setStyle("height",Math.max(h,0)+"px");this.hscroll.updateLayout();this.vscroll.updateLayout()}arguments.callee.prototype.apply(this,[])});this.reset=function(){this.vscroll.setPosition(0);this.hscroll.setPosition(0);this.updateLayout()}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"ComboBoxMenu");with(core.ui){core.ui.ComboBoxMenu.superClass=core.ui.Menu;core.ui.ComboBoxMenu.constructor=function(){this.selectedItem;this.notifyItemSelected=new Notification();this.ComboBoxMenu=function(){arguments.callee.prototype.apply(this,[]);this.setStyle("overflow-y","auto");this.setStyle("display","none")};this.addItem=override(this.addItem,function(D,C,A){var B=new MenuItem(this);B.setStyleName("ComboBoxMenuItem");B.setStyle("overflow","hidden");B.setText(D);B.value=C;B.onmouseover=this.onItemMouseOver;B.onmouseout=this.onItemMouseOut;B.onclick=this.onItemClick;if(A){this.selectedItem=B}return arguments.callee.prototype.apply(this,[B])});this.removeItems=override(this.removeItems,function(){this.selectedItem=undefined;arguments.callee.prototype.apply(this,[])});this.setSelectedItem=function(A){if((this.selectedItem&&(this.selectedItem.constructor===Window||defined(this.selectedItem.constructor.isSubclassOf)&&this.selectedItem.constructor.isSubclassOf(Window)))){this.selectedItem.removeStyleName("ComboBoxMenuItem-selected")}A.addStyleName("ComboBoxMenuItem-selected");this.selectedItem=A};this.getSelectedItem=function(){return this.selectedItem};this.doPopup=override(this.doPopup,function(B,A,C){if((this.selectedItem&&(this.selectedItem.constructor===Window||defined(this.selectedItem.constructor.isSubclassOf)&&this.selectedItem.constructor.isSubclassOf(Window)))){this.selectedItem.addStyleName("ComboBoxMenuItem-selected")}this.setStyle("display","");arguments.callee.prototype.apply(this,[B,A,C])});this.endPopup=override(this.endPopup,function(){arguments.callee.prototype.apply(this,[]);this.setStyle("display","none")});this.onItemMouseOver=callback(this,function(B,A){if((this.selectedItem&&(this.selectedItem.constructor===Window||defined(this.selectedItem.constructor.isSubclassOf)&&this.selectedItem.constructor.isSubclassOf(Window)))){this.selectedItem.removeStyleName("ComboBoxMenuItem-selected")}A.addStyleName("ComboBoxMenuItem-highlight")});this.onItemMouseOut=callback(this,function(B,A){A.removeStyleName("ComboBoxMenuItem-highlight")});this.onItemClick=callback(this,function(B,A){this.setSelectedItem(A);this.notifyItemSelected.send(this,A)})}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"ComboBox");with(core.ui){core.ui.ComboBox.superClass=core.ui.CompositeWindow;core.ui.ComboBox.constructor=function(){this.menu;this.text;this.dropDownButton;this.value;this.notifyValueChanged=new Notification();this.ComboBox=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.text=new Edit(this,0,0);this.text.setStyle("float","left");this.text.onkeypress=this.onTextKeyPress;this.dropDownButton=new ImageButton(this);this.dropDownButton.setStyleName("DropDownButton");this.dropDownButton.setState(ImageButton.STATE_NORMAL);this.dropDownButton.setStyle("float","right");this.dropDownButton.oncommand=this.onDropDownButtonClick;this.menu=this.createMenu();this.menu.notifyItemSelected.addListener(this.onMenuItemSelected);this.menu.notifyEndPopup.addListener(this.onMenuEndPopup);this.setEditable(false);this.updateLayout()};this.addItem=function(D,C,A){var B=this.menu.addItem(D,C);if(A){this.setText(D)}return B};this.insertItem=function(A,C,B){};this.removeItem=function(A){this.menu.removeItem(A)};this.removeItems=function(){this.menu.removeItems()};this.setText=function(A){this.text.setText(A)};this.getText=function(){return this.text.getText()};this.setValue=function(C){if(this.value==C){return }this.value=C;for(var A=0;A<this.menu.getItemCount();A++){var B=this.menu.getItem(A);if(C==B.value){this.menu.setSelectedItem(B);this.setText(B.getText());this.scrollTo(A)}}};this.getValue=function(){return this.value};this.getMenu=function(){return this.menu};this.getDropDownButton=function(){return this.dropDownButton};this.getEditControl=function(){return this.text};this.setEditable=function(A){this.text.setReadOnly(!A);this.text.setStyle("cursor",(A)?"text":"default");this.text.onclick=(A)?null:this.onDropDownButtonClick;this.text.onkeypress=(A)?this.onTextKeyPress:null;if(A){core.ui.quirks.TextSelection.allowSelection(this.text.getElement())}else{core.ui.quirks.TextSelection.preventSelection(this.text.getElement())}};this.isEditable=function(){return !this.text.isReadOnly()};this.scrollTo=function(A){this.menu.ensureVisible(A)};this.close=override(this.close,function(){this.menu.close();arguments.callee.prototype.apply(this,[])});this.expand=function(){this.addStyleName(this.getStyleName()+"-expanded");this.text.setSelected(true);this.menu.doPopup(this.isEditable()?this.dropDownButton:this,this.getAbsX(),this.getAbsY()+this.getHeight())};this.collapse=function(){this.menu.endPopup()};this.createMenu=function(){return new ComboBoxMenu()};this.updateLayout=function(){this.text.setStyle("width",(this.getClientWidth()-this.dropDownButton.getWidth())+"px");this.menu.setStyle("width",this.getWidth()+"px")};this.onDropDownButtonClick=callback(this,function(A){if(this.menu.isPopup()){this.collapse()}else{this.expand()}});this.onMenuEndPopup=callback(this,function(){this.removeStyleName(this.getStyleName()+"-expanded")});this.onMenuItemSelected=callback(this,function(A,B){this.menu.endPopup();this.setText(B.getText());this.setValue(B.value);this.text.setSelected(false);this.notifyValueChanged.send(this,B.value)});this.onTextKeyPress=callback(this,function(A){if(Event.KEY_ENTER==A.keyCode){this.value=this.text.getText();this.notifyValueChanged.send(this,this.value)}})}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Calendar");with(core.ui){core.ui.Calendar.superClass=core.ui.Menu;core.ui.Calendar.constructor=function(){this.format=Calendar.FORMAT_DEFAULT;this.startYear;this.endYear;this.day;this.month;this.year;this.monthList;this.yearList;this.notifyDateSelected=new Notification();this.Calendar=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.year=Calendar.currentYear;this.month=Calendar.currentMonth;this.day=Calendar.currentDay;this.startYear=Calendar.currentYear-5;this.endYear=Calendar.currentYear+5;this.createMonthList();this.createYearList();this.createGrid();this.updateData()};this.setDate=function(B,C,A){if(B){this.year=B}if(C){this.month=C}if(A){this.day=A}this.updateData()};this.setYear=function(A){this.year=A;this.updateData()};this.getYear=function(){return this.year};this.setMonth=function(A){this.month=A;this.updateData()};this.getMonth=function(){return this.month};this.setDay=function(A){this.day=A;this.updateData()};this.getDay=function(){return this.day};this.setYears=function(B,A){if(B){this.startYear=B}if(A){this.endYear=A}this.initYearList()};this.getStartYear=function(){return this.startYear};this.getEndYear=function(){return this.endYear};this.setFormat=function(A){this.format=A};this.getFormat=function(){return this.format};this.setFormattedDate=function(A,H){if(!defined(H)){H=this.format}if(Calendar.FORMAT_TIMESTAMP==H){var E=parseInt(A);if(isNaN(E)){throw new Error("Invalid `date` parameter ("+A+") (should be a timestamp)")}var D=new Date();D.setTime(E*1000);this.year=D.getFullYear();this.month=D.getMonth();this.day=D.getDay()}else{var G={"MM":"month","DD":"day","YYYY":"year"};for(var C in G){var B=H.indexOf(C);if(-1!=B){value=parseInt(A.substr(B,C.length).replace(/^0/,""));if(isNaN(value)){throw new Error("Invalid `date` parameter ("+A+")")}var F=G[C];if("year"==F){this.year=(value>100)?value:(2000+value)}else{this[F]=value}}}}this.updateData()};this.getFormattedDate=function(H){if(!defined(H)){H=this.format}if(Calendar.FORMAT_TIMESTAMP==H){return this.getTimestamp()}var E=this.year.toString();var G=(this.month<10)?"0"+this.month:this.month.toString();var B=(this.day<10)?"0"+this.day:this.day.toString();var C={"MM":G,"DD":B,"YYYY":E};for(var A in C){var D=new RegExp(A);var F=C[A];H=H.replace(D,F)}return H};this.getTimestamp=function(A){return(defined(A))?new Date(Date.UTC(this.year,this.month-1,this.day,-A)).getTime()/1000:new Date(Date.UTC(this.year,this.month-1,this.day)).getTime()/1000};this.getYearList=function(){return this.yearList};this.getMonthList=function(){return this.monthList};this.updateData=function(){var F=((this.year%4==0)&&(this.year%100!=0))||(this.year%400==0);var A=[31,F?29:28,31,30,31,30,31,31,30,31,30,31];var D=new Date(this.year,this.month-1).getDay();if(this.year<this.startYear){this.year=this.startYear}else{if(this.year>this.endYear){this.year=this.endYear}}var E,C;if(this.month>1){E=this.month-1;C=this.year}else{E=12;C=this.year-1}var H,I;if(this.month<12){H=this.month+1;I=this.year}else{H=1;I=this.year+1}for(var G=0,B=A[E-1]-D+1;G<D;G++){this.items[G].month=E;this.items[G].year=C;this.items[G].day=B+G}for(var G=D;G<A[this.month-1]+D;G++){this.items[G].year=this.year;this.items[G].month=this.month;this.items[G].day=G-D+1}for(var G=A[this.month-1]+D;G<42;G++){this.items[G].year=I;this.items[G].month=H;this.items[G].day=G-(A[this.month-1]+D)+1}this.updateControls()};this.updateControls=function(){this.yearList.setValue(this.year);this.monthList.setValue(this.month);for(var A=0;A<this.items.length;A++){var B=this.items[A];B.clearStyleName();if((B.year==this.year)&&(B.month==this.month)&&(B.day==this.day)){B.addStyleName("CalendarMenuItem-selected")}if((B.year==Calendar.currentYear)&&(B.month==Calendar.currentMonth)&&(B.day==Calendar.currentDay)){B.addStyleName("CalendarMenuItem-today")}if((B.year!=this.year)||(B.month!=this.month)){B.addStyleName("CalendarMenuItem-grayed")}if(A%7==0||A%7==6){B.addStyleName("CalendarMenuItem-holiday")}B.setText(B.day)}};this.createMonthList=function(){this.monthList=new ComboBox(this);this.monthList.addStyleName("CalendarMonthList");this.monthList.setStyle("float","left");this.monthList.notifyValueChanged.addListener(this.onMonthValueChanged);var A=["January","February","March","April","May","June","July","August","September","October","November","December"];for(var B=0;B<A.length;B++){this.monthList.addItem(A[B],B+1,(B==this.month-1))}};this.createYearList=function(){this.yearList=new ComboBox(this);this.yearList.addStyleName("CalendarYearList");this.yearList.setStyle("float","right");this.yearList.notifyValueChanged.addListener(this.onYearValueChanged);this.initYearList()};this.initYearList=function(){this.yearList.removeItems();for(var A=this.startYear;A<=this.endYear;A++){this.yearList.addItem(A.toString(),A,(A==this.year))}};this.createGrid=function(){var C=["Su","Mo","Tu","W","Th","Fr","Sa"];for(var A=0;A<C.length;A++){var B=new MenuItem(this);B.setStyleName("CalendarHeaderItem");B.setStyle("float","left");B.setText(C[A])}for(var A=0;A<42;A++){var B=new MenuItem(this);B.setStyleName("CalendarMenuItem");B.setStyle("float","left");B.onclick=this.onItemClick;B.onmouseover=this.onItemMouseOver;B.onmouseout=this.onItemMouseOut;this.addItem(B)}};this.onMonthValueChanged=callback(this,function(A,B){this.day=-1;this.month=B;this.updateData()});this.onYearValueChanged=callback(this,function(A,B){this.day=-1;this.year=B;this.updateData()});this.onItemClick=callback(this,function(B,A){this.day=A.day;if((this.month!=A.month)||(this.year!=A.year)){this.month=A.month;this.year=A.year;this.updateData()}else{this.updateControls()}this.notifyDateSelected.send(this,this.getFormattedDate())});this.onItemMouseOver=callback(this,function(B,A){A.addStyleName("CalendarMenuItem-highlight")});this.onItemMouseOut=callback(this,function(B,A){A.removeStyleName("CalendarMenuItem-highlight")})};core.ui.Calendar.currentYear=new Date().getFullYear();core.ui.Calendar.currentMonth=new Date().getMonth()+1;core.ui.Calendar.currentDay=new Date().getDate();core.ui.Calendar.FORMAT_TIMESTAMP="TIMESTAMP";core.ui.Calendar.FORMAT_DEFAULT="MM/DD/YYYY"}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Frame");with(core.ui){core.ui.Frame.superClass=core.ui.Window;core.ui.Frame.constructor=function(){this.content;this.Frame=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.setStyle("overflow","visible")};this.setContentWindow=function(B){this.content=B;var A=this.getWidth()-this.getClientWidth()+B.getWidth();this.setStyle("width",A+"px")};this.getContentWindow=function(){return this.content};this.onmousedown=function(){this.activate()}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"PanelFrame");with(editor.ui){editor.ui.PanelFrame.superClass=core.ui.Frame;editor.ui.PanelFrame.constructor=function(){this.resizeinfo={};this.PanelFrame=function(parent){arguments.callee.prototype.apply(this,[parent]);with(core.ui){this.titleBar=new Handle(this);this.titleBar.setStyleName("TitleBar");this.titleBar.setDragWindow(this);this.title=new Static(this.titleBar);this.title.addStyleName("Title");this.resizeButton=new core.ui.ImageButton(this.titleBar);this.resizeButton.addStyleName("ResizeButton");this.resizeButton.setImageList("images/PanelFrame/minimize.gif");this.resizeButton.setToolTip("Minimize");this.resizeButton.oncommand=this.titleBar.ondblclick=this.onResizeButtonClick}};this.getTitleBar=function(){return this.titleBar};this.setTitle=function(text){this.title.setText(text)};this.getTitle=function(){return this.title.getText()};this.minimize=function(){this.resizeinfo.maxHeight=this.getHeight();this.setStyle("overflow","hidden");this.resize(this.getWidth(),this.titleBar.getHeight()+(this.getHeight()-this.getClientHeight()));this.resizeinfo.minimizedState=true};this.maximize=function(){this.setStyle("overflow","visible");this.resize(this.getWidth(),this.resizeinfo.maxHeight);this.resizeinfo.minimizedState=false};this.isMinimized=function(){return this.resizeinfo.minimizedState};this.onResizeButtonClick=callback(this,function(){if(this.isMinimized()){this.maximize();this.resizeButton.setImageList("images/PanelFrame/minimize.gif");this.resizeButton.setToolTip("Minimize")}else{this.minimize();this.resizeButton.setImageList("images/PanelFrame/maximize.gif");this.resizeButton.setToolTip("Maximize")}})}}ClassFactory.createPackage("core.ui.effect");ClassFactory.createClass(core.ui.effect,"BaseEffect");with(core.ui.effect){core.ui.effect.BaseEffect.constructor=function(){this.source;this.time=0;this.duration=100;this.interval=1;this.state=BaseEffect.STATE_READY;this.timerId;this.notifyStarted=new core.ui.Notification();this.notifyPaused=new core.ui.Notification();this.notifyResumed=new core.ui.Notification();this.notifyStopped=new core.ui.Notification();this.notifyFinished=new core.ui.Notification();this.BaseEffect=function(A,C,B){this.source=A;if(C){this.duration=C}if(B){this.interval=B}};this.play=function(C,A,B){if(C){this.duration=C}if(A){this.interval=A}if(BaseEffect.STATE_STARTED==this.state){return }if(BaseEffect.STATE_PAUSED==this.state){this.notifyResumed.send(this)}else{this.time=defined(B)?B:0;this.timerId=window.setTimeout(this.onTimer,this.interval);this.notifyStarted.send(this)}this.state=BaseEffect.STATE_STARTED};this.stop=function(){window.clearTimeout(this.timerId);this.state=BaseEffect.STATE_STOPPED;this.notifyStopped.send(this)};this.pause=function(){this.state=BaseEffect.STATE_PAUSED;this.notifyPaused.send(this)};this.finish=function(){window.clearTimeout(this.timerId);this.state=BaseEffect.STATE_FINISHED;this.notifyFinished.send(this)};this.playback=function(){};this.onTimer=callback(this,function(){if(BaseEffect.STATE_PAUSED==this.state){return }this.time+=this.interval;if(this.time>this.duration){this.finish()}else{this.playback();this.timerId=window.setTimeout(this.onTimer,this.interval)}})};core.ui.effect.BaseEffect.STATE_READY=1;core.ui.effect.BaseEffect.STATE_STARTED=2;core.ui.effect.BaseEffect.STATE_PAUSED=3;core.ui.effect.BaseEffect.STATE_STOPPED=4;core.ui.effect.BaseEffect.STATE_FINISHED=5}ClassFactory.createPackage("core.ui.effect");ClassFactory.createClass(core.ui.effect,"Blink");with(core.ui.effect){core.ui.effect.Blink.superClass=core.ui.effect.BaseEffect;core.ui.effect.Blink.constructor=function(){this.finish=override(this.finish,function(){this.source.setVisible(true);arguments.callee.prototype.apply(this,[])});this.playback=function(){this.source.setVisible(!this.source.isVisible())}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"DialogFrame");with(editor.ui){editor.ui.DialogFrame.superClass=core.ui.Frame;editor.ui.DialogFrame.constructor=function(){this.listeners=new core.util.Listeners();this.DialogFrame=function(parent){arguments.callee.prototype.apply(this,[parent]);with(core.ui){var titleBar=new Handle(this);titleBar.setStyleName("TitleBar");titleBar.setDragWindow(this);this.title=new Static(titleBar);this.title.addStyleName("Title");this.closeButton=new ImageButton(titleBar);this.closeButton.addStyleName("CloseButton");this.closeButton.setToolTip("Close");this.closeButton.setImageList("images/DialogFrame/close.gif");this.closeButton.oncommand=this.onCloseButtonClick;this.blinkEffect=new core.ui.effect.Blink(titleBar)}};this.addCloseListener=function(listener){this.listeners.add(listener)};this.removeCloseListener=function(listener){this.listeners.remove(listener)};this.fireClose=function(){this.listeners.call("onFrameClose",[this])};this.doModal=function(top){this.getContentWindow().doModal(top);this.center();this.show()};this.endModal=function(){this.getContentWindow().endModal();this.hide()};this.setTitle=function(text){this.title.setText(text)};this.getTitle=function(){return this.title.getText()};this.onDialogLooseActivity=function(){this.blinkEffect.play(420,70)};this.onDialogEndModal=function(){this.hide()};this.setContentWindow=override(this.setContentWindow,function(dialog){dialog.addDialogListener(this);arguments.callee.prototype.apply(this,[dialog])});this.onCloseButtonClick=callback(this,function(){this.fireClose()})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"PopupMenuFrame");with(editor.ui){editor.ui.PopupMenuFrame.superClass=core.ui.Frame;editor.ui.PopupMenuFrame.constructor=function(){this.PopupMenuFrame=function(B,A,E,C,D){this.Frame(B,A,E,C,D)};this.doPopupNear=function(C,B){if(!B){B=PopupMenuFrame.POSITION_UNDER}var A;var D;if(B&PopupMenuFrame.POSITION_LEFT){A=C.getAbsX()-this.getWidth()}else{if(B&PopupMenuFrame.POSITION_RIGHT){A=C.getAbsX()+C.getWidth()}else{A=C.getAbsX()}}if(B&PopupMenuFrame.POSITION_ABOVE){D=C.getAbsY()-this.getHeight()}else{if(B&PopupMenuFrame.POSITION_UNDER){D=C.getAbsY()+C.getHeight()}else{D=C.getAbsY()}}this.move(A,D);this.getContentWindow().doPopup(C,0,0);this.show()};this.setContentWindow=override(this.setContentWindow,function(A){var B=this.getContentWindow();if(B){B.notifyEndPopup.removeListener(this.onMenuEndPopup)}A.notifyEndPopup.addListener(this.onMenuEndPopup);arguments.callee.prototype.apply(this,[A])});this.endPopup=function(){this.getContentWindow().endPopup()};this.isPopup=function(){return this.getContentWindow().isPopup()};this.onMenuEndPopup=callback(this,function(A){this.hide()})};editor.ui.PopupMenuFrame.POSITION_ABOVE=1;editor.ui.PopupMenuFrame.POSITION_UNDER=4;editor.ui.PopupMenuFrame.POSITION_LEFT=8;editor.ui.PopupMenuFrame.POSITION_RIGHT=16}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"ProgressBar");with(core.ui){core.ui.ProgressBar.superClass=core.ui.Window;core.ui.ProgressBar.constructor=function(){this.pos=0;this.rangeMax=100;this.rangeMin=0;this.current=0;this.items=[];this.setRange=function(B,A){this.rangeMin=B;this.rangeMax=A;this.setPos(B)};this.getRangeMin=function(){return this.rangeMin};this.getRangeMax=function(){return this.rangeMax};this.setItemCount=function(C){if(this.items.length==C){return }while(this.items.length>0){this.items.pop().close()}for(var B=0;B<C;B++){var A=new Window(this);A.getElement().style.styleFloat=A.getElement().style.cssFloat="left";A.setStyleName("ProgressBarItem");A.hide();this.items.push(A)}};this.getItemCount=function(){return this.items.length};this.next=function(){var A=(this.items.length>0)?((this.rangeMax-this.rangeMin)/this.items.length):1;this.setPos(this.pos+A)};this.setPos=function(C){var B=Math.ceil((this.items.length-1)*C/(this.rangeMax-this.rangeMin));if(B>=0&&B<this.items.length){for(var A=this.current;A>=B;A--){this.items[A].hide()}for(var A=this.current;A<=B;A++){this.items[A].show()}this.current=B}else{if(0==this.items.length){}}this.pos=C};this.getPos=function(){return this.pos}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"LoadingDialog");with(editor.ui){editor.ui.LoadingDialog.superClass=core.ui.Dialog;editor.ui.LoadingDialog.constructor=function(){this.progressBar;this.LoadingDialog=function(A){arguments.callee.prototype.apply(this,[A]);this.progressBar=new core.ui.ProgressBar(this);this.progressBar.setItemCount(20)}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Image");with(core.ui){core.ui.Image.superClass=core.ui.Window;core.ui.Image.constructor=function(){this.source;this.Image=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.setStyle("display","block")};this.setSource=function(A){this.getElement().src=this.source=A};this.getSource=function(){return this.source};this.isLoaded=function(){return this.getElement().complete};this.createElement=function(){var A=document.createElement("img");A.ondragstart=new Function("return false");return A}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"MenuButton");with(editor.ui){editor.ui.MenuButton.superClass=core.ui.ImageButton;editor.ui.MenuButton.constructor=function(){this.icon;this.text;this.MenuButton=function(B,A,E,C,D){this.ImageButton(B,A,E,C,D);this.icon=new core.ui.Image(this);this.text=new core.ui.Static(this);this.icon.hide()};this.setText=function(A){this.text.setText(A)};this.getText=function(){return this.text.getText()};this.setIcon=function(A){this.icon.setSource(A);this.icon.show()}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"SplitButton");with(editor.ui){editor.ui.SplitButton.superClass=core.ui.SplitWindow;editor.ui.SplitButton.constructor=function(){this.leftButton;this.rightButton;this.popupMenu;this.defaultValue;this.imageList;this.state;this.notifyDefaultAction=new core.ui.Notification();this.notifyPopup=new core.ui.Notification();this.SplitButton=function(B,A,E,C,D){this.SplitWindow(B,A,E,C,D);this.leftButton=new editor.ui.MenuButton(this);this.leftButton.addStyleName("SplitButtonLeft");this.leftButton.oncommand=this.onLeftButtonClick;this.rightButton=new core.ui.ImageButton(this);this.rightButton.addStyleName("SplitButtonRight");this.rightButton.oncommand=this.onRightButtonClick;this.setState(core.ui.ImageButton.STATE_NORMAL);this.setImageList("images/SplitButton/splitbutton.gif");this.rightButton.onmousedown=this.leftButton.onmousedown=this.onButtonMouseDown;this.rightButton.onmouseout=this.leftButton.onmouseout=this.onButtonMouseOut;this.rightButton.onmouseover=this.leftButton.onmouseover=this.rightButton.onmouseup=this.leftButton.onmouseup=this.onButtonMouseOver;this.addPane(this.leftButton,core.ui.SplitWindow.SPLIT_LEFT);this.addPane(this.rightButton,core.ui.SplitWindow.SPLIT_RIGHT)};this.setImages=function(E,A,F,H,C,B,G,D){this.leftButton.setImages(E,F,C,G);this.rightButton.setImages(A,H,B,D)};this.setImageList=override(this.setImageList,function(A){if(!defined(this.imageList)){this.imageList=new window.Image()}this.imageList.src=A;this.leftButton.imageList=this.rightButton.imageList=this.imageList;this.leftButton.setImage(A);this.leftButton.setStyle("background-position",-(this.getWidth()*this.state)+"px top");this.rightButton.setImage(A);this.rightButton.setStyle("background-position",-(this.getWidth()*this.state+this.leftButton.getWidth())+"px top")});this.setEnabled=override(this.setEnabled,function(A){arguments.callee.prototype.apply(this,[A]);this.setState(A?core.ui.ImageButton.STATE_NORMAL:core.ui.ImageButton.STATE_DISABLED)});this.setState=function(A){this.getElement().setAttribute("state",A);if(defined(this.imageList)){this.leftButton.setStyle("background-position",-(this.getWidth()*A)+"px top");this.rightButton.setStyle("background-position",-(this.getWidth()*A+this.leftButton.getWidth())+"px top")}else{if(this.rightButton.images[A].src.length>0&&this.leftButton.images[A].src.length>0){this.leftButton.setImage(this.leftButton.images[A].src);this.rightButton.setImage(this.rightButton.images[A].src)}}this.state=A};this.setDefaultValue=function(A){this.defaultValue=A};this.getDefaultValue=function(){return this.defaultValue};this.setIcon=function(A){this.leftButton.setIcon(A)};this.setText=function(A){this.leftButton.setText(A)};this.setPopupMenu=function(A){this.popupMenu=A};this.onRightButtonClick=callback(this,function(){if(defined(this.popupMenu)){if(this.popupMenu.isPopup()){this.popupMenu.endPopup()}else{this.popupMenu.doPopupNear(this);this.notifyPopup.send(this)}}});this.onLeftButtonClick=callback(this,function(){if(this.popupMenu.isPopup()){this.popupMenu.endPopup()}this.notifyDefaultAction.send(this,this.defaultValue)});this.onButtonMouseDown=callback(this,function(A){this.setState(core.ui.ImageButton.STATE_PRESSED);this.activate();A.stop();return false});this.onButtonMouseOver=callback(this,function(A){this.setState(core.ui.ImageButton.STATE_HOVER);A.stop()});this.onButtonMouseOut=callback(this,function(A){this.setState(core.ui.ImageButton.STATE_NORMAL);A.stop()})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"Shortcut");with(editor.ui){editor.ui.Shortcut.constructor=function(){this.listeners=new core.util.Listeners();this.modifiers=0;this.key;this.Shortcut=function(A){this.combination=A;var D=A.split("+");for(var C=0;C<D.length;C++){var B=D[C].toUpperCase();if(defined(Shortcut.ctrlFlags[B])){this.modifiers|=Shortcut.ctrlFlags[B]}else{this.key=B}}};this.addShortcutListener=function(A){this.listeners.add(A)};this.removeShortcutListener=function(A){this.listeners.remove(A)};this.getKeyCombination=function(){return this.combination};this.getKeyChar=function(){return this.key};this.getKeyCode=function(){if(!defined(this.key)){return undefined}return defined(Shortcut.keymap[this.key])?Shortcut.keymap[this.key]:this.key.charCodeAt(0)};this.getModifiers=function(){return this.modifiers};this.activate=function(){this.fireActivated()};this.fireActivated=function(){this.listeners.call("onShortcutActivated",[this])}};editor.ui.Shortcut.get=function(A){if(!this.initialized){this.init();this.initialized=true}if(!this.instances.hasKey(A)){this.instances.set(A,new Shortcut(A))}return this.instances.get(A)};editor.ui.Shortcut.init=function(){if(document.all){core.ui.Event.addListener(document,"keydown",this.handleEvent)}else{core.ui.Event.addListener(document,"keypress",this.handleEvent)}};editor.ui.Shortcut.handleEvent=function(C){C=core.ui.Event.improve(C);var E=String.fromCharCode(document.all?C.keyCode:C.charCode).toUpperCase();for(var B=Shortcut.instances.getValues().iterator();B.hasNext();B.next()){var D=B.current();var A=D.getModifiers();if(((E===D.getKeyChar().toUpperCase())||(C.keyCode==D.getKeyCode()))&&(C.ctrlKey===((A&Shortcut.CTRL_MASK)!=0))&&(C.shiftKey===((A&Shortcut.SHIFT_MASK)!=0))&&(C.altKey===((A&Shortcut.ALT_MASK)!=0))){D.activate();C.cancel();C.stop()}}};editor.ui.Shortcut.instances=new core.util.HashMap();editor.ui.Shortcut.CTRL_MASK=1;editor.ui.Shortcut.ALT_MASK=2;editor.ui.Shortcut.SHIFT_MASK=4;editor.ui.Shortcut.ctrlFlags={"CTRL":Shortcut.CTRL_MASK,"ALT":Shortcut.ALT_MASK,"SHIFT":Shortcut.SHIFT_MASK};editor.ui.Shortcut.keymap={"BACKSPACE":8,"BSP":8,"BACK":8,"TAB":9,"ENTER":13,"ENT":13,"PAUSE":19,"ESCAPE":27,"ESC":27,"PAGE UP":33,"PGUP":33,"PAGE DOWN":34,"PGDN":34,"END":35,"HOME":36,"LEFT":37,"UP":38,"RIGHT":39,"DOWN":40,"INSERT":45,"INS":45,"DELETE":46,"DEL":46,"F1":112,"F2":113,"F3":114,"F4":115,"F5":116,"F6":117,"F7":118,"F8":119,"F9":120,"F10":121,"F11":122,"F12":123,"/":191,"\\":220}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"PopupMenu");with(editor.ui){editor.ui.PopupMenu.superClass=core.ui.Menu;editor.ui.PopupMenu.constructor=function(){this.createItem=function(D,C,B){var A=new core.ui.ImageButton(this);A.setText(D);if(this.isSubMenu()){A.setImageList("images/PopupMenu/subitem.gif");A.setStyleId("popup-submenu-item")}else{A.setImageList("images/PopupMenu/item.gif");A.setStyleId("popup-menu-item")}A.data=B;A.callback=C;A.oncommand=this.onItemClick;return this.addItem(A)};this.createSubMenu=function(D,C){if(!C){C=PopupMenu}if(D){var B=new core.ui.ImageButton(this);B.setText(D);B.setToolTip("Expand submenu");B.setImageList("images/PopupMenu/expand.gif");B.oncommand=this.onSubMenuClick}var A=new C(this);A.endPopup=this.onSubmenuEndPopup;A.submenuFlag=true;if(D){A.setStyle("display","none");B.menu=A}return A};this.isSubMenu=function(){return this.submenuFlag};this.onItemClick=callback(this,function(B,C,A){if(A.callback){A.callback(A.data)}});this.onSubMenuClick=callback(this,function(B,C,A){if("none"==A.menu.getStyle("display")){A.menu.setStyle("display","block");A.setImageList("images/PopupMenu/collapse.gif");A.setToolTip("Collapse submenu")}else{A.menu.setStyle("display","none");A.setImageList("images/PopupMenu/expand.gif");A.setToolTip("Expand submenu")}});this.onSubmenuEndPopup=callback(this,function(){this.endPopup()})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"RangeMenu");with(editor.ui){editor.ui.RangeMenu.superClass=editor.ui.PopupMenu;editor.ui.RangeMenu.constructor=function(){this.createItem=override(this.createItem,function(text,callback,data){var item=arguments.callee.prototype.apply(this,[text,callback,data]);item.onmouseover=this.onItemMouseOver;item.onmouseout=this.onItemMouseOut;return item});this.isSubMenu=function(){return true};this.onItemMouseOver=callback(this,function(event,target){var hover=true;var items=new core.util.ArrayList(this.items);for(var i=items.iterator();i.hasNext();i.next()){var item=i.current();with(core.ui){item.setState(hover?ImageButton.STATE_HOVER:ImageButton.STATE_NORMAL)}if(item==target){hover=false}}event.stop()});this.onItemMouseOut=callback(this,function(event){event.stop()})}}ClassFactory.createPackage("editor.commands");ClassFactory.createClass(editor.commands,"UndoMenu");with(editor.commands){editor.commands.UndoMenu.superClass=editor.ui.RangeMenu;editor.commands.UndoMenu.constructor=function(){this.UndoMenu=function(A){arguments.callee.prototype.apply(this,[A]);this.createItems();var B=CommandHistory.get();B.addHistoryListener(this);this.updateControls(B)};this.createItem=override(this.createItem,function(A){var B=arguments.callee.prototype.apply(this,["",this.onItemCommand,A]);B.setToolTip((A==0)?"Undo last change":("Undo last "+(A+1)+" changes"));B.setStyle("display","none");return B});this.updateControls=function(E){var D=E.getUndoCommands();var B=D.size();for(var A=0;A<this.getItemCount();A++){var C=this.getItem(A);if(A<B){C.setText(D.get(B-A-1).getName());C.setStyle("display","")}else{C.setStyle("display","none")}}};this.createItems=function(){for(var A=0;A<CommandHistory.MAX_SIZE;A++){this.createItem(A)}};this.onHistoryChanged=function(A){this.updateControls(A)};this.onItemCommand=callback(this,function(C){var B=CommandHistory.get();for(var A=0;A<=C;A++){B.undo()}this.endPopup()})}}ClassFactory.createPackage("editor.commands");ClassFactory.createClass(editor.commands,"RedoMenu");with(editor.commands){editor.commands.RedoMenu.superClass=editor.commands.UndoMenu;editor.commands.RedoMenu.constructor=function(){this.createItem=override(this.createItem,function(A){var B=arguments.callee.prototype.apply(this,[A]);B.setToolTip((A==0)?"Redo last change":("Redo last "+(A+1)+" changes"));return B});this.updateControls=function(E){var D=E.getRedoCommands();var B=D.size();for(var A=0;A<this.getItemCount();A++){var C=this.getItem(A);if(A<B){C.setText(D.get(A).getName());C.setStyle("display","")}else{C.setStyle("display","none")}}};this.onItemCommand=callback(this,function(C){var B=CommandHistory.get();for(var A=0;A<=C;A++){B.redo()}this.endPopup()})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"WorkspacePanel");with(editor.ui){editor.ui.WorkspacePanel.superClass=core.ui.Window;editor.ui.WorkspacePanel.constructor=function(){this.WorkspacePanel=function(parent){arguments.callee.prototype.apply(this,[parent]);var app=editor.Application.getInstance();with(core.ui){this.samplesButton=new ImageButton(this);this.samplesButton.setStyle("position","absolute");this.samplesButton.addStyleName("SamplesButton");this.samplesButton.setImageList("images/WorkspacePanel/samples.gif");this.samplesButton.setText("Load sample");this.samplesButton.setToolTip("Show samples menu");this.samplesButton.oncommand=this.onSamplesButtonClick;this.saveButton=new ImageButton(this);this.saveButton.setStyle("position","absolute");this.saveButton.addStyleName("SaveButton");this.saveButton.setImageList("images/WorkspacePanel/save.gif");this.saveButton.setText("Save page");this.saveButton.setToolTip("Save changes");this.saveButton.oncommand=this.onSaveButtonClick;this.previewButton=new ImageButton(this);this.previewButton.setStyle("position","absolute");this.previewButton.addStyleName("PreviewButton");this.previewButton.setImageList("images/WorkspacePanel/preview.gif");this.previewButton.setText("Preview");this.previewButton.setToolTip("Switch to preview mode");this.previewButton.oncommand=this.onPreviewButtonClick;this.clearButton=new ImageButton(this);this.clearButton.setStyle("position","absolute");this.clearButton.addStyleName("ClearButton");this.clearButton.setImageList("images/WorkspacePanel/clear.gif");this.clearButton.setToolTip("Clear page");this.clearButton.oncommand=this.onClearButtonClick;this.exitButton=new core.ui.ImageButton(this);this.exitButton.setStyle("position","absolute");this.exitButton.setStyleName("ExitButton");this.exitButton.setImageList("images/WorkspacePanel/exit.gif");this.exitButton.setToolTip("Exit editor");this.exitButton.oncommand=this.onExitButtonClick;this.undoButton=new SplitButton(this);this.undoButton.setStyle("position","absolute");this.undoButton.addStyleName("UndoButton");this.undoButton.setImageList("images/WorkspacePanel/undo.gif");this.undoButton.setToolTip("Undo");this.undoButton.notifyDefaultAction.addListener(this.onUndoButtonClick);this.undoButton.setPopupMenu(app.factory.createMenuWithFrame(editor.commands.UndoMenu));this.redoButton=new SplitButton(this);this.redoButton.setStyle("position","absolute");this.redoButton.addStyleName("RedoButton");this.redoButton.setImageList("images/WorkspacePanel/redo.gif");this.redoButton.setToolTip("Redo");this.redoButton.notifyDefaultAction.addListener(this.onRedoButtonClick);this.redoButton.setPopupMenu(app.factory.createMenuWithFrame(editor.commands.RedoMenu));this.editButton=new ImageButton();this.editButton.addStyleName("EditModeButton");this.editButton.setImages("images/WorkspacePanel/back-normal.png","images/WorkspacePanel/back-hover.png","images/WorkspacePanel/back-pressed.png");this.editButton.setText("Back to edit mode");this.editButton.setToolTip("Go back to edit mode");this.editButton.oncommand=this.onEditModeButtonClick;this.editButton.hide()}app.addAppListener(this);Shortcut.get("Ctrl+S").addShortcutListener(this);Shortcut.get("Ctrl+Z").addShortcutListener(this);Shortcut.get("Ctrl+Y").addShortcutListener(this);editor.commands.CommandHistory.get().addHistoryListener(this);this.updateControls()};this.getPreviewButton=function(){return this.previewButton};this.getEditButton=function(){return this.editButton};this.getSaveButton=function(){return this.saveButton};this.onHistoryChanged=function(){this.updateControls()};this.updateControls=function(){this.undoButton.setEnabled(editor.commands.CommandHistory.get().canUndo());this.redoButton.setEnabled(editor.commands.CommandHistory.get().canRedo());this.saveButton.setEnabled(!this.saving);this.saveButton.setText(this.saving?"Saving...":"Save page")};this.save=function(){var app=editor.Application.getInstance();if(!app.config.get("registration.complete")){app.factory.getRegistrationDialog().doModal()}else{app.save()}};this.onAppInitComplete=function(app){this.save()};this.onAppSaving=function(){this.saving=true;this.updateControls()};this.onAppSaved=function(){this.saving=false;this.updateControls()};this.onShortcutActivated=function(s){switch(s.getKeyCombination()){case"Ctrl+S":this.save();break;case"Ctrl+Z":editor.commands.CommandHistory.get().undo();break;case"Ctrl+Y":editor.commands.CommandHistory.get().redo();break}};this.onSaveButtonClick=callback(this,function(){this.save()});this.onClearButtonClick=callback(this,function(){if(confirm("This will delete all page content. Do you want to continue?")){editor.Application.getInstance().clear()}});this.onSamplesButtonClick=callback(this,function(){var dialog=editor.Application.getInstance().factory.getTemplatesDialog();dialog.getContentWindow().getMenu().notifyTemplateSelected.addListener(this.onTemplateSelected);dialog.center();dialog.doModal()});this.onExitButtonClick=callback(this,function(){try{window.location.href="SelectWebsite"}catch(e){console.error(e)}});this.onTemplateSelected=callback(this,function(sender,template){var app=editor.Application.getInstance();if((app.getCollection().getElementCount()>1)&&!confirm("The existing data won't be saved. Would you like to continue?")){return }app.loadTemplate(template);var dialog=app.factory.getTemplatesDialog();dialog.getContentWindow().getMenu().notifyTemplateSelected.removeListener(this.onTemplateSelected);dialog.endModal()});this.onPreviewButtonClick=callback(this,function(){editor.Application.getInstance().switchMode(editor.Application.MODE_PREVIEW);this.editButton.move(core.ui.Window.getWidth()-this.editButton.getWidth()-100,core.ui.Window.getHeight()-this.editButton.getHeight()-100);this.editButton.activate();this.editButton.show()});this.onEditModeButtonClick=callback(this,function(){editor.Application.getInstance().switchMode(editor.Application.MODE_EDIT);this.editButton.hide()});this.onUndoButtonClick=callback(this,function(){editor.commands.CommandHistory.get().undo()});this.onRedoButtonClick=callback(this,function(){editor.commands.CommandHistory.get().redo()})}}ClassFactory.createPackage("core.url");ClassFactory.createClass(core.url,"Encoder");with(core.url){core.url.Encoder.constructor=function(){};core.url.encode=core.url.Encoder.encode=function(A){if(!defined(A)){return""}A=encodeURI(A);A=A.replace(/\+/g,"%2B");A=A.replace(/\#/g,"%23");A=A.replace(/\?/g,"%3F");A=A.replace(/&amp;/g,"%26");return A}}ClassFactory.createPackage("core.url");ClassFactory.createClass(core.url,"Parser");with(core.url){core.url.Parser.constructor=function(){};core.url.parse=core.url.Parser.parse=function(C){var E={scheme:"http",host:"",port:"",user:"",password:"",path:"/",query:"",fragment:""};var D=C.indexOf("://");if(D!=-1){E.scheme=C.slice(0,D);C=C.slice(D+3)}D=C.indexOf("/");if(D!=-1){var B=C.slice(0,D);C=C.slice(D);D=B.indexOf("@");if(D!=-1){var A=B.slice(0,D).split(":");E.user=A[0];E.password=(A[1])?A[1]:"";B=B.slice(D+1)}D=B.indexOf(":");if(D!=-1){E.port=parseInt(B.slice(D+1));B=B.slice(0,D)}E.host=B}D=C.indexOf("#");if(D!=-1){E.fragment=C.slice(D+1);C=C.slice(0,D)}D=C.indexOf("?");if(D!=-1){E.query=C.slice(D+1);C=C.slice(0,D)}E.path=C;return E}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"LoadingMessage");with(editor.ui){editor.ui.LoadingMessage.constructor=function(){};editor.ui.LoadingMessage.icons={};editor.ui.LoadingMessage.texts={};editor.ui.LoadingMessage.showIcon=function(B,C){if(!defined(C)){C="images/loading.gif"}if(!defined(this.icons[B.getId()])){this.icons[B.getId()]=new core.ui.Image(B);this.icons[B.getId()].setStyle("position","absolute")}var A=this.icons[B.getId()];A.setSource(C);A.center();A.show()};editor.ui.LoadingMessage.showText=function(B,C){if(!defined(C)){C="Loading..."}if(!defined(this.texts[B.getId()])){this.texts[B.getId()]=new core.ui.Static(B);this.texts[B.getId()].setStyle("position","absolute")}var A=this.texts[B.getId()];A.setText(C);A.center();A.show()};editor.ui.LoadingMessage.hideMessage=function(A){if(defined(this.icons[A.getId()])){this.icons[A.getId()].hide()}if(defined(this.texts[A.getId()])){this.texts[A.getId()].hide()}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"ImageLibrary");with(editor.ui){editor.ui.ImageLibrary.superClass=core.ui.Dialog;editor.ui.ImageLibrary.constructor=function(){this.categories;this.images;this.closeButton;this.selectedItem;this.preloadImages={};this.thumbnailSources={};this.imagesCounter=0;this.notifyImageSelected=new core.ui.Notification();this.ImageLibrary=function(parent){this.Dialog(parent);with(core.ui){var splitter=new SplitWindow(this,0,0,"100%","100%");this.categories=new ScrollWindow(splitter);this.categories.setContentWindow(new Menu(this.categories));this.categories.addStyleName("Categories");this.images=new ScrollWindow(splitter);this.images.setContentWindow(new Menu(this.images));this.images.addStyleName("Images");var buttons=new Window(splitter);buttons.addStyleName("ButtonsPane");this.closeButton=new ImageButton(buttons);this.closeButton.addStyleName("CloseButton");this.closeButton.setImageList("images/ImageLibrary/apply.gif");this.closeButton.setToolTip("Close library dialog");this.closeButton.setText("Close");this.closeButton.oncommand=parent.onCloseButtonClick;splitter.addPane(buttons,SplitWindow.SPLIT_BOTTOM);splitter.addPane(this.categories,SplitWindow.SPLIT_LEFT);splitter.addPane(this.images)}this.loadCategories()};this.loadCategories=function(){this.loadedCategories=false;LoadingMessage.showText(this);core.ajax.sendRequest(theApp.getUserCommand("ajax.EnumerateImages"),this.onLoadCategories)};this.addCategoryItem=function(category,icon){var item=new MenuButton(this.categories.getContentWindow());item.category=category;item.setText(category);item.setIcon(icon);item.setToolTip('Select images in category "'+category+'"');item.setImageList("images/ImageLibrary/category.gif");item.oncommand=this.onCategoryClick;this.categories.getContentWindow().addItem(item)};this.onLoadCategories=callback(this,function(response){try{if("OK"==response.status){this.addCategoryItem("My images","images/ImageLibrary/my-images.png");var path=response.path;for(var i=0;i<response.categories.length;i++){var c=response.categories[i];this.addCategoryItem(c,path+"/"+c+"/"+c+".png")}this.categories.reset();this.selectCategoryItem(this.categories.getContentWindow().getItem(0));this.loadedCategories=true}else{if(defined(response.message)){throw new Error("Error while loading image categories. Server response is: "+response.message)}else{throw new Error("Unspecified error while loading image categories. See server logs for details.")}}}catch(e){alert("Sorry, the error occurs while loading image categories from server.\n\nError details:"+e.message)}LoadingMessage.hideMessage(this)});this.loadImages=function(c){this.images.getContentWindow().removeItems();LoadingMessage.showText(this);core.ajax.sendRequest(theApp.getUserCommand("ajax.EnumerateImages"),this.onLoadImages,{"category":c})};this.onLoadImages=callback(this,function(response){try{if("OK"==response.status){var path=response.path;for(var i=0;i<response.images.length;i++){var item=new MenuButton(this.images.getContentWindow());item.path=path;item.image=response.images[i];var img=new core.ui.Image();img.removeStyleName("Image");this.preloadImages[i]=img;img.place=item;img.onload=this.onThumbnailLoaded;this.thumbnailSources[i]=core.url.encode(path+"/"+item.image)+"?size="+item.icon.getWidth()+"x"+item.icon.getHeight();item.onmousedown=callback(this,function(event){event.stop()});item.setToolTip("Select this image");item.setImageList("images/ImageLibrary/frame.gif");item.oncommand=this.onImageClick;this.images.getContentWindow().addItem(item)}this.images.reset()}else{if(response.message){throw new Error("Failed to load images. Response message is: "+response.message)}else{throw new Error("Unspecified error while loading images from server. See server logs for details.")}}}catch(e){alert("Sorry, the error occurs while loading images from server.\n\nError details:"+e.message)}setTimeout(this.initNextPicture,0);LoadingMessage.hideMessage(this)});this.selectCategoryItem=function(item){this.imagesCounter=0;for(var v in this.preloadImages){delete this.preloadImages[v]}for(var v in this.thumbnailSources){delete this.thumbnailSources[v]}if(defined(this.selectedItem)){if(item==this.selectedItem){if(item.getText()=="My images"){this.loadImages(item.getText())}return }this.selectedItem.setImageList("images/ImageLibrary/category.gif")}this.loadImages(item.getText());item.setImageList("images/ImageLibrary/category-active-2.gif");this.selectedItem=item};this.initNextPicture=callback(this,function(){var img=this.preloadImages[this.imagesCounter];if(defined(img)){if(img.getSource()){return }img.setSource(this.thumbnailSources[this.imagesCounter])}if(defined(this.preloadImages[this.imagesCounter+1])){this.imagesCounter++}});this.onThumbnailLoaded=callback(this,function(event,targetWindow,currentWindow){var owner=currentWindow.place;var width=currentWindow.getWidth();var height=currentWindow.getHeight();try{owner.hide();owner.setIcon(currentWindow.getSource());owner.icon.resize(width,height);owner.icon.center();owner.show()}catch(e){}setTimeout(this.initNextPicture,0)});this.onCategoryClick=callback(this,function(event,target,item){this.selectCategoryItem(item)});this.onImageClick=callback(this,function(event,target,item){this.notifyImageSelected.send(this,item.path+"/"+item.image)});this.refreshMyImages=callback(this,function(){var myImagesItem=this.categories.getContentWindow().getItem(0);if(this.selectedItem==myImagesItem&&this.loadedCategories){this.selectCategoryItem(myImagesItem)}})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"UrlDialog");with(editor.ui){editor.ui.UrlDialog.superClass=core.ui.Dialog;editor.ui.UrlDialog.constructor=function(){this.controlGroupWindow;this.schemesList;this.editUrl;this.buttonsGroup;this.cancelButton;this.okButton;this.notifySetUrl=new core.ui.Notification();this.notifyCancel=new core.ui.Notification();this.UrlDialog=function(C,B,H,F,G){this.Dialog(C,B,H,F,G);this.controlGroupWindow=new core.ui.Window(this);this.controlGroupWindow.setStyleId("url-dialog-ctrl-group");var E=new core.ui.Static(this.controlGroupWindow);E.setStyle("position","absolute");E.setStyleId("url-dialog-static-type");E.setText("Type:");this.schemesList=new core.ui.ComboBox(this.controlGroupWindow);this.schemesList.setStyle("position","absolute");this.schemesList.setStyleId("url-dialog-list-schemes");this.schemesList.addItem("other","");this.schemesList.setToolTip("Select the url scheme");this.schemesList.notifyValueChanged.addListener(this.onSchemeValueChanged);var A=["file","ftp","gopher","http","https","mailto","news","telnet","wais"];for(var D=0;D<A.length;D++){this.schemesList.addItem(A[D]+"://",A[D],("http"==A[D])?true:false)}var E=new core.ui.Static(this.controlGroupWindow);E.setStyle("position","absolute");E.setStyleId("url-dialog-static-url");E.setText("URL:");this.editUrl=new core.ui.Edit(this.controlGroupWindow);this.editUrl.setStyle("position","absolute");this.editUrl.setStyleId("url-dialog-edit-url");this.editUrl.setText("http://");this.editUrl.setToolTip("Enter the URL");this.buttonsGroup=new core.ui.Window(this);this.buttonsGroup.setStyleId("url-dialog-btn-group");this.okButton=new core.ui.ImageButton(this.buttonsGroup);this.okButton.setStyleId("url-dialog-button-ok");this.okButton.setText("OK");this.okButton.setToolTip("Use this URL");this.okButton.setImageList("images/UrlDialog/button.gif");this.okButton.oncommand=this.onOkButtonClick;this.cancelButton=new core.ui.ImageButton(this.buttonsGroup);this.cancelButton.setStyleId("url-dialog-button-cancel");this.cancelButton.setText("Cancel");this.cancelButton.setToolTip("Close this dialog");this.cancelButton.setImageList("images/UrlDialog/button.gif");this.cancelButton.oncommand=this.onCancelButtonClick};this.setUrl=function(A){var B="http";if(!A.match(/^([a-zA-Z]+):\/\//)){A=B+"://"+A}else{B=RegExp.$1}this.editUrl.setText(A);this.schemesList.setValue(B)};this.reset=function(){this.schemesList.setValue("http");this.editUrl.setText("http://")};this.onOkButtonClick=callback(this,function(){this.notifySetUrl.send(this,this.editUrl.getText())});this.onCancelButtonClick=callback(this,function(){this.notifyCancel.send(this)});this.onSchemeValueChanged=callback(this,function(B,C){if(C){var A=this.editUrl.getText();if(A.match(/^[a-zA-Z]+:\/\/(.*)$/)){this.editUrl.setText(C+"://"+RegExp.$1)}else{this.editUrl.setText(C+"://"+A)}}})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"Toolbox");with(editor.ui){editor.ui.Toolbox.superClass=core.ui.Window;editor.ui.Toolbox.constructor=function(){this.showGrid;this.Toolbox=function(A){arguments.callee.prototype.apply(this,[A]);this.showGrid=new core.ui.CheckBox(this);this.showGrid.setStyle("position","absolute");this.showGrid.setText("Show grid");this.showGrid.onclick=this.showGrid.label.onclick=this.onCheckboxClick;editor.Application.getInstance().addAppListener(this)};this.updateControls=function(){var A=editor.Application.getInstance().getWorkspace();this.showGrid.setChecked(A.isGridVisible())};this.getShowGridControl=function(){return this.showGrid};this.onAppPageLoaded=function(){this.updateControls()};this.onCheckboxClick=callback(this,function(){var A=editor.Application.getInstance().getWorkspace();A.setGridVisible(!A.isGridVisible())})}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"FileUpload");with(core.ui){core.ui.FileUpload.superClass=core.ui.ImageButton;core.ui.FileUpload.constructor=function(){this.path="";this.url="";this.form;this.text;this.input;this.iframe;this.notifyFileSelected=new Notification();this.notifyFileUploaded=new Notification();this.notifyUploadError=new Notification();this.upload=function(params){var arr=[];for(var name in params){arr.push(core.url.encode(name)+"="+core.url.encode(params[name]))}this.form.action=this.url;if(arr.length>0){this.form.action+=("?"+arr.join("&"))}this.form.submit()};this.clear=function(){this.form.reset()};this.isFileSelected=function(){return(this.path.length>0)};this.getFilePath=function(){return this.path};this.setUploadUrl=function(url){this.url=url};this.getUploadUrl=function(){return this.url};this.setText=function(text){this.text.innerHTML=text};this.getText=function(){return this.text.innerHTML};this.close=override(this.close,function(){this.getElement().removeChild(this.iframe);this.form.removeChild(this.input);this.getElement().removeChild(this.form);delete this.iframe;delete this.input;delete this.form;arguments.callee.prototype.apply(this,[])});this.setFocus=function(){};this.createElement=override(this.createElement,function(){var root=arguments.callee.prototype.apply(this,[]);this.text=document.createElement("div");this.text.style.position="absolute";this.text.style.left=this.text.style.top="0px";this.text.style.width=this.text.style.height="100%";this.text.style.zIndex=0;root.appendChild(this.text);var id=this.getId()+"_iframe";this.iframe=document.createElement("iframe");this.iframe.setAttribute("id",id);this.iframe.setAttribute("name",id);this.iframe.style.display="none";this.iframe.style.width=this.iframe.style.height="0px";this.iframe.style.margin=this.iframe.style.padding="0px";root.appendChild(this.iframe);Event.addListener(this.iframe,"load",this.onIframeLoad);this.form=document.createElement("form");this.form.target=this.iframe.name;this.form.method="POST";this.form.enctype=this.form.encoding="multipart/form-data";this.form.style.margin=this.form.style.padding="0px";root.appendChild(this.form);this.input=document.createElement("input");this.input.name=this.input.type="file";this.input.style.position="absolute";this.input.style.zIndex=1;this.input.style.opacity=0;this.input.style.MozOpacity=0;this.input.style.KhtmlOpacity=0;this.input.style.filter="progid:DXImageTransform.Micr