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.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;B0){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;D0){this.listeners.pop()}};this.findListener=function(B){for(var A=0;AA){this.setPosition(Balloon.LEFT|(this.position&Balloon.FLOATING))}}if(FH){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("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,"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,"MenuItem");with(core.ui){core.ui.MenuItem.superClass=core.ui.FocusWindow;core.ui.MenuItem.constructor=function(){}}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,"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,"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;C0){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,"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,"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(Cthis.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(Bthis.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;A100)?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.yearthis.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;G0)};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.Microsoft.Alpha(opacity=0)";this.input.style.styleFloat=this.input.style.cssFloat="right";this.input.style.height="100%";this.input.style.right="0px";this.input.onchange=this.onFileInputChange;this.form.appendChild(this.input);return root});this.onIframeLoad=callback(this,function(){if(!this.iframe.contentWindow.name){this.iframe.contentWindow.name=this.iframe.name}var respText=this.iframe.contentWindow.document.body.innerHTML;if(respText.length>0){var status="FAILED";var message="";try{var response=eval("("+respText+")");status=response.status;message=response.message}catch(ex){message=respText}if("OK"==status){this.notifyFileUploaded.send(this,response)}else{this.notifyUploadError.send(this,response)}}});this.onFileInputChange=callback(this,function(){this.path=this.input.value;this.notifyFileSelected.send(this,this.input.value);this.form.reset()});this.onmousemove=function(event){this.input.style.right=this.getAbsX()+this.getWidth()-event.getX()-15+"px";this.input.style.top=event.getY()-this.getAbsY()-this.input.offsetHeight/2+"px"}}}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("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.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=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=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;B0)};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=right1max){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=bottom10)&&(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,"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,"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("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("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;B0)?((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=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;C1)&&!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("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;i15){C>>=4;A=B.substr(C&15,1)+A}return(2==A.length)?A:("0"+A)};core.util.Color.rgb2Hex=function(C,B,A){return Color.dec2Hex(C)+Color.dec2Hex(B)+Color.dec2Hex(A)};core.util.Color.hex2Rgb=function(B){var D="";var C="0123456789abcdef";B=B.toLowerCase();for(var A=0;A<6;A+=2){D+=16*C.indexOf(B.charAt(A))+C.indexOf(B.charAt(A+1))+","}return D.substr(0,D.length-1)};core.util.Color.map={"aliceblue":"f0f8ff","antiquewhite":"faebd7","aqua":"00ffff","aquamarine":"7fffd4","azure":"f0ffff","beige":"f5f5dc","bisque":"ffe4c4","black":"000000","blanchedalmond":"ffebcd","blue":"0000ff","blueviolet":"8a2be2","brown":"a52a2a","burlywood":"deb887","cadetblue":"5f9ea0","chartreuse":"7fff00","chocolate":"d2691e","coral":"ff7f50","cornflowerblue":"6495ed","cornsilk":"fff8dc","crimson":"dc143c","cyan":"00ffff","darkblue":"00008b","darkcyan":"008b8b","darkgoldenrod":"b8860b","darkgray":"a9a9a9","darkgreen":"006400","darkkhaki":"bdb76b","darkmagenta":"8b008b","darkolivegreen":"556b2f","darkorange":"ff8c00","darkorchid":"9932cc","darkred":"8b0000","darksalmon":"e9967a","darkseagreen":"8fbc8f","darkslateblue":"483d8b","darkslategray":"2f4f4f","darkturquoise":"00ced1","darkviolet":"9400d3","deeppink":"ff1493","deepskyblue":"00bfff","dimgray":"696969","dodgerblue":"1e90ff","firebrick":"b22222","floralwhite":"fffaf0","forestgreen":"228b22","fuchsia":"ff00ff","gainsboro":"dcdcdc","ghostwhite":"f8f8ff","gold":"ffd700","goldenrod":"daa520","gray":"808080","green":"008000","greenyellow":"adff2f","honeydew":"f0fff0","hotpink":"ff69b4","indianred":"cd5c5c","indigo":"4b0082","ivory":"fffff0","khaki":"f0e68c","lavender":"e6e6fa","lavenderblush":"fff0f5","lawngreen":"7cfc00","lemonchiffon":"fffacd","lightblue":"add8e6","lightcoral":"f08080","lightcyan":"e0ffff","lightgoldenrodyellow":"fafad2","lightgreen":"90ee90","lightgrey":"d3d3d3","lightpink":"ffb6c1","lightsalmon":"ffa07a","lightseagreen":"20b2aa","lightskyblue":"87cefa","lightslategray":"778899","lightsteelblue":"b0c4de","lightyellow":"ffffe0","lime":"00ff00","limegreen":"32cd32","linen":"faf0e6","magenta":"ff00ff","maroon":"800000","mediumaquamarine":"66cdaa","mediumblue":"0000cd","mediumorchid":"ba55d3","mediumpurple":"9370db","mediumseagreen":"3cb371","mediumslateblue":"7b68ee","mediumspringgreen":"00fa9a","mediumturquoise":"48d1cc","mediumvioletred":"c71585","midnightblue":"191970","mintcream":"f5fffa","mistyrose":"ffe4e1","moccasin":"ffe4b5","navajowhite":"ffdead","navy":"000080","oldlace":"fdf5e6","olive":"808000","olivedrab":"6b8e23","orange":"ffa500","orangered":"ff4500","orchid":"da70d6","palegoldenrod":"eee8aa","palegreen":"98fb98","paleturquoise":"afeeee","palevioletred":"db7093","papayawhip":"ffefd5","peachpuff":"ffdab9","peru":"cd853f","pink":"ffc0cb","plum":"dda0dd","powderblue":"b0e0e6","purple":"800080","red":"ff0000","rosybrown":"bc8f8f","royalblue":"4169e1","saddlebrown":"8b4513","salmon":"fa8072","sandybrown":"f4a460","seagreen":"2e8b57","seashell":"fff5ee","sienna":"a0522d","silver":"c0c0c0","skyblue":"87ceeb","slateblue":"6a5acd","slategray":"708090","snow":"fffafa","springgreen":"00ff7f","steelblue":"4682b4","tan":"d2b48c","teal":"008080","thistle":"d8bfd8","tomato":"ff6347","turquoise":"40e0d0","violet":"ee82ee","wheat":"f5deb3","white":"ffffff","whitesmoke":"f5f5f5","yellow":"ffff00","yellowgreen":"9acd32"}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"ColorMenu");with(editor.ui){editor.ui.ColorMenu.superClass=editor.ui.PopupMenu;editor.ui.ColorMenu.constructor=function(){this.color;this.menuTitle;this.selectedColor;this.transpColor;this.colorEditor;this.okButton;this.notifyColorSelected=new core.ui.Notification();this.notifyColorApplied=new core.ui.Notification();this.ColorMenu=function(B,A,F,D,E){this.Menu(B,A,F,D,E);this.transpColor=new core.ui.MenuItem(this);this.transpColor.color="transparent";this.transpColor.setStyleId("color-menu-transparent-color");this.transpColor.setStyle("background-image","url(images/ColorMenu/transparent.gif)");this.transpColor.setToolTip("Transparent");this.transpColor.onclick=this.onItemClick;this.menuTitle=new core.ui.Static(this);this.menuTitle.setStyleId("color-menu-title");for(var C=0;C0)&&(this.currentLoop>=this.loop)){this.stop();return }this.text.style.left=this.getWidth()+"px"}this.timerId=window.setTimeout(this.onTimer,this.scrollDelay)})}}ClassFactory.createPackage("editor");ClassFactory.createClass(editor,"MusicPlayer");with(editor){editor.MusicPlayer.constructor=function(){};editor.MusicPlayer.STATE_READY=1;editor.MusicPlayer.STATE_STARTED=2;editor.MusicPlayer.STATE_PAUSED=3;editor.MusicPlayer.STATE_STOPPED=4;editor.MusicPlayer.loadCallback;editor.MusicPlayer.completeCallback;editor.MusicPlayer.currentFile=null;editor.MusicPlayer.currentState=editor.MusicPlayer.STATE_READY;editor.MusicPlayer.currentPosition=0;editor.MusicPlayer.currentVolume=100;editor.MusicPlayer.currentPan=0;editor.MusicPlayer.onSoundLoaded=function(){if(this.loadCallback){this.loadCallback()}};editor.MusicPlayer.onSoundComplete=function(){if(this.completeCallback){this.completeCallback()}};editor.MusicPlayer.onFlashLoaded=function(){this.loaded=true;this.sound=new AFLAX.FlashObject(aflax,"Sound");this.sound.exposeFunction("loadSound",this.sound);this.sound.exposeFunction("start",this.sound);this.sound.exposeFunction("stop",this.sound);this.sound.exposeFunction("setVolume",this.sound);this.sound.exposeFunction("setPan",this.sound);this.sound.exposeProperty("position",this.sound);this.sound.exposeProperty("duration",this.sound);this.sound.mapFunction("addEventHandler");this.sound.addEventHandler("onLoad","editor.MusicPlayer.onSoundLoaded");this.sound.addEventHandler("onSoundComplete","editor.MusicPlayer.onSoundComplete");if(defined(this.currentFile)){this.sound.loadSound(this.currentFile,true);this.sound.stop()}};editor.MusicPlayer.load=function(C,B,A){if(!defined(this.sound)){this.currentFile=C;this.loadCallback=B;this.completeCallback=A;return }this.sound.stop();if((MusicPlayer.STATE_STARTED==this.state)||(MusicPlayer.STATE_PAUSED==this.state)){if(this.completeCallback){this.completeCallback()}}this.currentPosition=0;this.loadCallback=B;this.completeCallback=A;if(this.currentFile!==C){this.currentFile=C;this.sound.loadSound(C,true);this.sound.stop()}else{if(defined(this.loadCallback)){this.loadCallback()}}};editor.MusicPlayer.start=function(){if(defined(this.sound)){this.sound.start(this.currentPosition/1000);this.state=MusicPlayer.STATE_STARTED}};editor.MusicPlayer.pause=function(){if(defined(this.sound)){this.sound.stop();this.currentPosition=this.sound.getPosition();this.state=this.STATE_PAUSED}};editor.MusicPlayer.stop=function(){if(defined(this.sound)){this.sound.stop();this.currentPosition=0;this.state=this.STATE_STOPPED}};editor.MusicPlayer.getPosition=function(){if(defined(this.sound)){return this.sound.getPosition()}};editor.MusicPlayer.getDuration=function(){if(defined(this.sound)){return this.sound.getDuration()}};editor.MusicPlayer.setVolume=function(A){if(defined(this.sound)){if(A<0){A=0}if(A>100){A=100}this.sound.setVolume(this.currentVolume=A)}};editor.MusicPlayer.getVolume=function(){return this.currentVolume};editor.MusicPlayer.setPan=function(A){if(defined(this.sound)){if(A<-100){A=-100}if(A>100){A=100}this.sound.setPan(this.currentPan=A)}};editor.MusicPlayer.getPan=function(){return this.currentPan};editor.MusicPlayer.getState=function(){return this.currentState};editor.MusicPlayer.getFileName=function(){return this.currentFile}}ClassFactory.createPackage("editor.ui.wizard");ClassFactory.createClass(editor.ui.wizard,"WizardPane");with(editor.ui.wizard){editor.ui.wizard.WizardPane.superClass=core.ui.Window;editor.ui.wizard.WizardPane.constructor=function(){this.WizardPane=function(A,B){this.Window(A.getContentPane());this.wizard=A;this.paneId=B;this.nextPaneId=null;this.prevPaneId=null};this.getWizard=function(){return this.wizard};this.getPaneId=function(){return this.paneId};this.setNextPaneId=function(A){this.nextPaneId=A};this.getNextPaneId=function(){return this.nextPaneId};this.setPrevPaneId=function(A){this.prevPaneId=A};this.getPrevPaneId=function(){return this.prevPaneId};this.setTitle=function(A){this.title=A};this.getTitle=function(){return this.title};this.setText=function(A){this.text=A};this.getText=function(){return this.text};this.setSkip=function(A){this.skip=A};this.canSkip=function(){return this.skip};this.reset=function(){};this.validate=function(){return true};this.setVisible=override(this.setVisible,function(A){arguments.callee.prototype.apply(this,[A]);if(this.isVisible()){if(!this.initialized){this.init();this.initialized=true}}});this.setActive=function(A){};this.init=function(){}}}ClassFactory.createPackage("editor.plugins.tribute");ClassFactory.createClass(editor.plugins.tribute,"Sound");with(editor.plugins.tribute){editor.plugins.tribute.Sound.constructor=function(){this.file;this.title;this.duration;this.cyclic=false;this.Sound=function(A,B,C){this.file=defined(A)?A:"";this.title=defined(B)?B:"";this.duration=defined(C)?C:0};this.setFile=function(A){this.file=A};this.getFile=function(){return this.file};this.hasFile=function(){return(this.file.length)>0?true:false};this.setDuration=function(A){this.duration=A};this.getDuration=function(){return this.duration};this.setTitle=function(A){this.title=A};this.getTitle=function(){return this.title};this.setCyclic=function(A){this.cyclic=A?true:false};this.isCyclic=function(){return this.cyclic?true:false};this.clone=function(){var A=new Sound(this.file,this.title,this.duration);A.setCyclic(this.isCyclic());return A}}}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.util");ClassFactory.createClass(core.util,"ImagePreloader");with(core.util){core.util.ImagePreloader.constructor=function(){this.url;this.loading=false;this.image=new Image();this.listeners=new Listeners();this.ImagePreloader=function(){this.image.onload=this.onImageLoaded;this.image.onerror=this.onLoadError};this.preload=function(A){this.url=A;this.loading=true;this.image.src=A};this.addListener=function(A){this.listeners.add(A)};this.removeListener=function(A){this.listeners.remove(A)};this.isLoading=function(){return this.loading};this.getUrl=function(){return this.url};this.getWidth=function(){return this.image.width};this.getHeight=function(){return this.image.height};this.toString=function(){return"[ImagePreloader]"};this.fireImagePreloaded=function(A){this.listeners.call("onImagePreloaded",[this,A])};this.firePreloadFailed=function(A){this.listeners.call("onPreloadFailed",[this,A])};this.onImageLoaded=callback(this,function(){this.loading=false;this.fireImagePreloaded(this.url)});this.onLoadError=callback(this,function(){this.loading=false;this.firePreloadFailed(this.url)})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"ImageFrame");with(editor.ui){editor.ui.ImageFrame.superClass=core.ui.Static;editor.ui.ImageFrame.constructor=function(){this.preloader=new core.util.ImagePreloader();this.ImageFrame=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.background=new core.ui.Static(this);this.background.setStyleName("Background");this.background.setStyle("background-repeat","no-repeat");this.background.setStyle("background-position","center center");this.preloader.addListener(this)};this.setImage=function(A){this.src=A;if(!A||"none"==A){this.background.setStyle("background-image",("none"==A)?"none":"")}else{this.background.setStyle("background-image","url(images/loading.gif)");this.preloader.preload(core.url.encode(A)+"?size="+this.background.getWidth()+"x"+this.background.getHeight())}};this.getImage=function(){return this.src};this.close=override(this.close,function(){this.preloader.removeListener(this);arguments.callee.prototype.apply(this,[])});this.onImagePreloaded=function(A){this.background.setStyle("background-image",'url("'+A.getUrl()+'")')}}}ClassFactory.createPackage("editor.plugins.tribute");ClassFactory.createClass(editor.plugins.tribute,"CameraView");with(editor.plugins.tribute){editor.plugins.tribute.CameraView.constructor=function(){this.x;this.y;this.zoom;this.CameraView=function(A,C,B){this.x=defined(A)?A:50;this.y=defined(C)?C:50;this.zoom=defined(B)?B:100};this.setZoom=function(A){this.zoom=Math.max(A,100);if(100==this.zoom){this.x=50;this.y=50}};this.getZoom=function(){return this.zoom};this.center=function(A,B){this.x=A;this.y=B};this.getCenterX=function(){return this.x};this.getCenterY=function(){return this.y};this.reset=function(){this.zoom=100;this.x=50;this.y=50}}}ClassFactory.createPackage("editor.plugins.tribute");ClassFactory.createClass(editor.plugins.tribute,"Subtitles");with(editor.plugins.tribute){editor.plugins.tribute.Subtitles.constructor=function(){this.text;this.size;this.bold=false;this.italic=false;this.underline=false;this.Subtitles=function(B,A){this.text=defined(B)?B:"";this.size=defined(A)?A:12};this.setText=function(A){this.text=A};this.getText=function(){return this.text};this.setSize=function(A){this.size=A};this.getSize=function(){return this.size};this.setBold=function(A){this.bold=(A)?true:false};this.isBold=function(){return(this.bold)?true:false};this.setItalic=function(A){this.italic=(A)?true:false};this.isItalic=function(){return(this.italic)?true:false};this.setUnderline=function(A){this.underline=(A)?true:false};this.isUnderline=function(){return(this.underline)?true:false};this.reset=function(){this.text="";this.size=12;this.bold=false;this.italic=false;this.underline=false}}}ClassFactory.createPackage("editor.plugins.tribute");ClassFactory.createClass(editor.plugins.tribute,"Scene");with(editor.plugins.tribute){editor.plugins.tribute.Scene.constructor=function(){this.period="";this.image="";this.duration;this.fading=Scene.FADING_NORMAL;this.subtitles;this.startView;this.endView;this.notifySceneChanged=new core.ui.Notification();this.Scene=function(A,C,B){this.image=defined(A)?A:"";this.duration=defined(C)?C:10;this.subtitles=new Subtitles(B);this.startView=new CameraView();this.endView=new CameraView()};this.setImage=function(A){this.notifySceneChanged.send(this);this.image=A;this.startView.reset();this.endView.reset()};this.getImage=function(){return this.image};this.setDuration=function(A){this.duration=A};this.getDuration=function(){return this.duration};this.setSubtitles=function(A){this.subtitles=A};this.getSubtitles=function(){return this.subtitles};this.setFadingType=function(A){this.fading=A};this.getFadingType=function(){return this.fading};this.setStartView=function(A){this.startView=A};this.getStartView=function(){return this.startView};this.setEndView=function(A){this.endView=A};this.getEndView=function(){return this.endView};this.setPeriod=function(A){this.period=A};this.getPeriod=function(){return this.period};this.hasImage=function(){return(this.image.length>0)?true:false};this.reset=function(){this.notifySceneChanged.send(this);this.image="";this.fading=Scene.FADING_NORMAL;this.duration=10;this.subtitles.reset();this.startView.reset();this.endView.reset()};this.clone=function(){var B=new Scene(this.image,this.duration);B.setFadingType(this.fading);B.setPeriod(this.period);var D=B.getSubtitles();D.setText(this.subtitles.getText());D.setSize(this.subtitles.getSize());D.setBold(this.subtitles.isBold());D.setItalic(this.subtitles.isItalic());D.setUnderline(this.subtitles.isUnderline());var C=B.getStartView();C.center(this.startView.getCenterX(),this.startView.getCenterY());C.setZoom(this.startView.getZoom());var A=B.getEndView();A.center(this.endView.getCenterX(),this.endView.getCenterY());A.setZoom(this.endView.getZoom());return B}};editor.plugins.tribute.Scene.FADING_NORMAL=0;editor.plugins.tribute.Scene.FADING_CIRCLES=1;editor.plugins.tribute.Scene.FADING_JALOUSIE=2;editor.plugins.tribute.Scene.FADING_SQUARES=3}ClassFactory.createPackage("editor.plugins.tribute.wizard");ClassFactory.createClass(editor.plugins.tribute.wizard,"TributeVideoSubtitlesPane");with(editor.plugins.tribute.wizard){editor.plugins.tribute.wizard.TributeVideoSubtitlesPane.superClass=editor.ui.wizard.WizardPane;editor.plugins.tribute.wizard.TributeVideoSubtitlesPane.constructor=function(){this.TributeVideoSubtitlesPane=function(A){arguments.callee.prototype.apply(this,[A,TributeVideoSubtitlesPane]);this.setPrevPaneId(TributeVideoMusicPane);this.setTitle("Video subtitles");this.setText("Here you can add subtitles to any video scene.");this.items=new core.ui.ScrollWindow(this,0,0,"100%","100%");this.items.setContentWindow(new core.ui.Menu(this.items))};this.createSubtitles=function(){var F=3;var A=[ChildhoodPhotosPane,TeenagePhotosPane,AdultPhotosPane,MaturePhotosPane];for(var C=0;CNote: only mp3 files are supported at the moment.");this.setSkip(true)};this.setActive=function(active){if(active){this.getWizard().addWizardListener(this)}else{this.getWizard().removeWizardListener(this)}};this.init=function(){this.items=new core.ui.ScrollWindow(this,0,0,"100%","100%");this.items.setContentWindow(new core.ui.Menu(this.items));this.addMenuItems(3)};this.addMenuItems=function(count){if(this.addButton){this.addButton.close()}for(var i=0;i0){return arguments.callee.prototype.apply(this,[])}}return undefined});this.createAddButton=function(){this.addButton=new core.ui.ImageButton(this.items.getContentWindow());this.addButton.addStyleName("AddButton");this.addButton.setText("Add more");this.addButton.setToolTip("Add more sounds");this.addButton.setImageList("images/VideoWizard/add.png");this.addButton.oncommand=this.onAddButtonCommand};this.onAddButtonCommand=callback(this,function(){this.addMenuItems(3)});this.stopSound=function(){for(var i=0;i0){this.info.title=E.title}else{this.info.title=E.name}this.info.artist=E.artist;this.info.duration=E.duration;var A=this.info.name;if((this.info.artist.length>0)&&(this.info.title.length>0)){A=this.info.artist+" - "+this.info.title}var C=common.util.DateUtils.getMinutes(this.info.duration);var D=common.util.DateUtils.getSeconds(this.info.duration);A+=" ("+C+":"+D+")";this.track.setStyle("background-image","none");this.track.setText(A);this.track.setToolTip(A);this.track.start();this.updateControls();this.notifyUploaded.send(this,this.info.path,this.info.title,this.info.artist,this.info.duration,this.info.name)});this.onUploadError=callback(this,function(A,B){this.uploaded=false;this.track.setStyle("background-image","none");this.updateControls();this.notifyUploadFailed.send(this);if(defined(B.message)){alert(B.message)}});this.onPlayButtonCommand=callback(this,function(){if(this.started){this.pause();this.notifyMusicPaused.send(this)}else{this.start();this.notifyMusicStarted.send(this)}});this.onStopButtonCommand=callback(this,function(){this.stop();this.notifyMusicStopped.send(this)});this.onSoundLoaded=callback(this,function(){editor.MusicPlayer.start()});this.onSoundComplete=callback(this,function(){this.stop();this.notifyMusicComplete.send(this)})}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"CheckBox");with(core.ui){core.ui.CheckBox.superClass=core.ui.InputWindow;core.ui.CheckBox.constructor=function(){this.input;this.label;this.CheckBox=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.updateLayout()};this.setChecked=function(A){this.getInput().checked=A};this.isChecked=function(){return this.getInput().checked};this.setText=function(A){this.label.innerHTML=A};this.getText=function(){return this.label.innerHTML};this.getInput=function(){return this.input};this.resize=override(this.resize,function(A,B){arguments.callee.prototype.apply(this,[A,B]);this.updateLayout()});this.close=override(this.close,function(){this.getElement().removeChild(this.input);this.getElement().removeChild(this.label);delete this.input;delete this.label;arguments.callee.prototype.apply(this,[])});this.getType=function(){return"checkbox"};this.updateLayout=function(){this.label.style.height=this.getClientHeight()+"px";this.label.style.lineHeight=this.getClientHeight()+"px"};this.createElement=override(this.createElement,function(){var A=document.createElement("div");this.input=arguments.callee.prototype.apply(this,[]);this.input.id=this.getId()+"_input";this.input.style.left="0px";this.input.style.top="0px";this.input.style.height="100%";this.input.style.lineHeight="100%";this.input.style.marginTop=this.input.style.marginBottom="0px";this.input.style.marginRight="3px";this.input.style.styleFloat=this.input.style.cssFloat="left";A.appendChild(this.input);this.label=document.createElement("label");this.label.htmlFor=this.input.id;this.label.style.display="block";core.ui.quirks.TextSelection.preventSelection(this.label);A.appendChild(this.label);return A})}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"RadioButton");with(core.ui){core.ui.RadioButton.superClass=core.ui.CheckBox;core.ui.RadioButton.constructor=function(){this.createElement=function(){var C=document.createElement("div");var A="radio"+this.getParent().getId();try{this.input=document.createElement('')}catch(B){this.input=document.createElement("input");this.input.type="radio";this.input.name=A}this.input.id=this.getId()+"_input";this.input.style.left="0px";this.input.style.top="0px";this.input.style.height="100%";this.input.style.lineHeight="100%";this.input.style.marginTop=this.input.style.marginBottom=0;this.input.style.marginRight="3px";this.input.style.styleFloat=this.input.style.cssFloat="left";C.appendChild(this.input);this.label=document.createElement("label");this.label.htmlFor=this.input.id;core.ui.quirks.TextSelection.preventSelection(this.label);C.appendChild(this.label);return C};this.getType=function(){return"radio"}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"MusicList");with(editor.ui){editor.ui.MusicList.superClass=core.ui.Menu;editor.ui.MusicList.constructor=function(){this.notifyItemSelected=new core.ui.Notification();this.notifyLoaded=new core.ui.Notification();this.MusicList=function(A){this.Menu(A);this.setStyle("overflow","hidden");this.refresh()};this.addItem=override(this.addItem,function(I,E,B,C,G){var H=new core.ui.RadioButton(this);var A=(C&&G)?(C+" - "+G):B;H.path=I;H.duration=E;H.name=A;H.artist=C;H.title=G;var D=common.util.DateUtils.getMinutes(E);var F=common.util.DateUtils.getSeconds(E);var G=A+" ("+D+":"+F+")";H.setText(G);H.setToolTip(G);H.onclick=this.onItemSelected;return arguments.callee.prototype.apply(this,[H])});this.refresh=function(){this.removeItems();LoadingMessage.showIcon(this);core.ajax.sendRequest(theApp.getUserCommand("ajax.EnumerateSounds"),this.onServerResponse)};this.onServerResponse=callback(this,function(B){try{if("OK"==B.status){for(var A=0;A0)};this.setNew=function(B,A){if(A){this.flags[B.getId()]|=Session.FLAG_NEW}else{this.flags[B.getId()]&=~Session.FLAG_NEW}};this.isNew=function(A){return(this.flags[A.getId()]&Session.FLAG_NEW)};this.setDeleted=function(B,A){if(A){this.flags[B.getId()]|=Session.FLAG_DELETED}else{this.flags[B.getId()]&=~Session.FLAG_DELETED}};this.isDeleted=function(A){return(this.flags[A.getId()]&Session.FLAG_DELETED)};this.clear=function(){this.flags={};this.counter=0}};editor.elements.Session.FLAG_NEW=1;editor.elements.Session.FLAG_MODIFIED=2;editor.elements.Session.FLAG_UNMODIFIED=4;editor.elements.Session.FLAG_DELETED=8}ClassFactory.createPackage("editor.elements");ClassFactory.createClass(editor.elements,"Settings");with(editor.elements){editor.elements.Settings.superClass=core.util.HashMap;editor.elements.Settings.constructor=function(){this.toString=function(){var B=[];for(var A=this.getKeys().iterator();A.hasNext();A.next()){B.push(A.current())}return B.join(" ")}}}ClassFactory.createPackage("editor.elements");ClassFactory.createClass(editor.elements,"Collection");with(editor.elements){editor.elements.Collection.constructor=function(){this.elements=[];this.listeners=new core.util.Listeners();this.settings=new Settings();this.session=new Session();this.Collection=function(){editor.Application.getInstance().addAppListener(this)};this.addListener=function(A){this.listeners.add(A)};this.removeListener=function(A){this.listeners.remove(A)};this.getSession=function(){return this.session};this.loadHtml=function(I){this.removeAll();this.settings.clear();this.session.clear();var B=document.createElement("div");B.innerHTML=I;var L=B.getElementsByTagName("div").item(0);var E=editor.Application.getInstance();for(var H=0;H0)){this.moveToBack(B,C)}B.setDeleted(false);return B};this.get=function(A){return this.elements[A]};this.remove=function(A){this.elements.splice(A.getIndex(),1);this.updateIndexes();A.destroy();this.fireElementRemoved(A)};this.removeAll=function(){for(var A=this.iterator();A.hasNext();A.next()){A.current().destroy()}this.elements=[]};this.getElementCount=function(){return this.elements.length};this.iterator=function(){return new core.util.Iterator(this.elements)};this.moveToFront=function(C,E){var D=C.getIndex();if(E==0||D==this.elements.length-1){return false}for(var A=D+1;A0)){C.fireChanged();return true}}}}}C.fireChanged();return false};this.moveToBack=function(B,E){var D=B.getIndex();if(E==0||D==0){return false}for(var A=D-1;A>=0;A--){var C=this.elements[A];if(C.isOverlappable()){this.elements[B.getIndex()]=C;C.setIndex(B.getIndex());this.elements[A]=B;B.setIndex(A);document.body.replaceChild(C.getElement(),B.getElement());document.body.insertBefore(B.getElement(),C.getElement());C.fireChanged();if(this.isOverlap(C,B)){if(defined(E)&&(E!=null)){if(!(--E>0)){B.fireChanged();return true}}}}}B.fireChanged();return false};this.getPosition=function(A){var C=0;for(var B=A.getIndex()+1;B=A.getX())&&(B.getX()<=A.getX()+A.getWidth())&&(B.getY()+B.getHeight()>=A.getY())&&(B.getY()<=A.getY()+A.getHeight()))};this.updateIndexes=function(){for(var A=0;A0)};this.getPaneCount=function(){return this.paneCount};this.iterator=function(){return new core.util.Iterator(this.panes)};this.getNextButton=function(){return this.nextButton};this.getBackButton=function(){return this.backButton};this.getCancelButton=function(){return this.cancelButton};this.next=function(){if(this.currentPane.canSkip()&&this.skipBox.isChecked()){this.fireSkip()}else{if(this.currentPane.getNextPaneId()){this.fireNext();this.getCurrentPane().hide();this.setCurrentPane(this.getNextPane().getPaneId())}else{this.fireFinish()}}};this.back=function(){if(this.currentPane.getPrevPaneId()){this.fireBack();this.currentPane.hide();this.setCurrentPane(this.getPrevPane().getPaneId())}};this.cancel=function(){this.fireCancel()};this.fireNext=function(){this.listeners.call("onWizardNext",[this])};this.fireBack=function(){this.listeners.call("onWizardBack",[this])};this.fireCancel=function(){this.listeners.call("onWizardCancel",[this])};this.fireFinish=function(){this.listeners.call("onWizardFinish",[this])};this.fireSkip=function(){this.listeners.call("onWizardSkip",[this])};this.onNextClick=callback(this,function(){if(this.currentPane.validate()){this.next()}});this.onBackClick=callback(this,function(){this.back()});this.onCancelClick=callback(this,function(){this.cancel()});this.onSkipClick=callback(this,function(){this.updateControls()})}}ClassFactory.createPackage("editor.plugins.wizard");ClassFactory.createClass(editor.plugins.wizard,"MemorialWizardDialog");with(editor.plugins.wizard){editor.plugins.wizard.MemorialWizardDialog.superClass=editor.ui.wizard.WizardDialog;editor.plugins.wizard.MemorialWizardDialog.constructor=function(){this.MemorialWizardDialog=function(B,A){arguments.callee.prototype.apply(this,[B]);this.addPane(new EmailPane(this));this.addPane(new NamePane(this));this.addPane(new SiteNamePane(this));this.addPane(new DatePane(this));this.addPane(new LayoutPane(this));this.addPane(new UploadImagesPane(this));if(A){this.setCurrentPane(EmailPane)}else{this.getPane(NamePane).setPrevPaneId(null);this.setCurrentPane(NamePane)}}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"ImageUpload");with(editor.ui){editor.ui.ImageUpload.superClass=core.ui.Window;editor.ui.ImageUpload.constructor=function(){this.imageSrc;this.fileName;this.uploaded=false;this.fileUpload;this.deleteButton;this.preview;this.notifyUploaded=new core.ui.Notification();this.notifyDeleted=new core.ui.Notification();this.notifyUploadError=new core.ui.Notification();this.ImageUpload=function(B,A,E,C,D){this.Window(B,A,E,C,D);this.preview=new ImageFrame(this);this.fileUpload=new core.ui.FileUpload(this);this.fileUpload.setUploadUrl("ajax.UploadImage");this.fileUpload.setText("Add picture");this.fileUpload.setToolTip("Add picture from your computer");this.fileUpload.setImages("images/ImageUpload/button-normal.png","images/ImageUpload/button-hover.png","images/ImageUpload/button-pressed.png");this.fileUpload.notifyFileSelected.addListener(this.onImageSelected);this.fileUpload.notifyFileUploaded.addListener(this.onImageUploaded);this.fileUpload.notifyUploadError.addListener(this.onUploadError);this.deleteButton=new core.ui.ImageButton(this);this.deleteButton.setStyle("position","absolute");this.deleteButton.addStyleName("DeleteButton");this.deleteButton.setImageList("images/Wizard/x_button.gif");this.deleteButton.setToolTip("Delete this image");this.deleteButton.oncommand=this.onDeleteButtonCommand;this.updateControls()};this.isUploaded=function(){return(this.uploaded)?true:false};this.getImageSrc=function(){return this.imageSrc};this.getFileName=function(){return this.fileName};this.reset=function(){delete this.imageSrc;this.uploaded=false;this.updateControls()};this.getFileUpload=function(){return this.fileUpload};this.updateControls=function(){this.deleteButton.setVisible(this.isUploaded());this.preview.setImage(this.isUploaded()?this.imageSrc:"")};this.onDeleteButtonCommand=callback(this,function(){this.reset();this.notifyDeleted.send(this)});this.onImageSelected=callback(this,function(A,B){this.preview.setImage("images/loading.gif");this.fileUpload.upload()});this.onImageUploaded=callback(this,function(A,B){this.uploaded=true;this.imageSrc=B.src;this.fileName=B.fileName;this.updateControls();this.notifyUploaded.send(this,B.src,B.width,B.height)});this.onUploadError=callback(this,function(A,B){this.reset();this.notifyUploadError.send(this);alert("Sorry, the system does not recognize your file as an image.")})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"ImageUploadMenu");with(editor.ui){editor.ui.ImageUploadMenu.superClass=core.ui.Menu;editor.ui.ImageUploadMenu.constructor=function(){this.notifyImageUploaded=new core.ui.Notification();this.ImageUploadMenu=function(B,A,F,D,E){this.Menu(B,A,F,D,E);for(var C=0;C<9;C++){this.addItem()}};this.addItem=override(this.addItem,function(){var A=new ImageUpload(this);A.notifyUploaded.addListener(this.onFileUploaded);A.notifyUploadError.addListener(this.onUploadError);return arguments.callee.prototype.apply(this,[A])});this.onFileUploaded=callback(this,function(){this.notifyImageUploaded.send(this)});this.onUploadError=callback(this,function(A){A.preview.setImage("images/ImageFrame/placeholder.gif")})}}ClassFactory.createPackage("editor.plugins.wizard");ClassFactory.createClass(editor.plugins.wizard,"UploadImagesPane");with(editor.plugins.wizard){editor.plugins.wizard.UploadImagesPane.superClass=editor.ui.wizard.WizardPane;editor.plugins.wizard.UploadImagesPane.constructor=function(){this.UploadImagesPane=function(A){this.WizardPane(A,UploadImagesPane);this.setTitle("Upload photos");this.setText('Please upload the person\'s photos to the website. These photos wil be placed within "My images" section of the page editor.');this.setPrevPaneId(LayoutPane)};this.init=function(){this.menu=new editor.ui.ImageUploadMenu(this,0,0,"100%","100%");this.menu.notifyImageUploaded.addListener(this.onImageUploaded)};this.setActive=function(A){if(A){editor.ui.TooltipController.showBalloonTip(this.menu.getItem(0).getFileUpload(),"Press this button to upload a photo to the page from your computer. After the photo is uploaded, you can find it in the images library that will be available while editing.",core.ui.Balloon.LEFT)}else{editor.ui.TooltipController.hideBalloonTip(this.menu.getItem(0).getFileUpload())}};this.validate=function(){var A=false;for(var B=0;Bthis.maxLength){this.curLengthLabel.setText(''+length+"")}else{this.curLengthLabel.setText(length)}};this.setText=override(this.setText,function(text){text+=' See example
';arguments.callee.prototype.apply(this,[text])});this.onFieldChange=callback(this,function(){this.updateControls()});this.onExampleClick=function(){editor.ui.TooltipController.showBalloonTip(this.field,this.exampleText,core.ui.Balloon.RIGHT,0,true)};this.onScreenshotLoaded=function(img){var screenshot=new core.ui.Container(img);var c=150/1024;var h=new core.ui.Window(this.getWizard().getDescriptionPane());h.setStyleName("SectionHighlight");h.setStyle("position","absolute");h.move(screenshot.getX()+this.sectionLeft*c,screenshot.getY()+this.sectionTop*c);h.resize(this.sectionWidth*c,this.sectionHeight*c);this.timer=new core.util.Timer(0.5*1000);this.timer.addTimerListener({onTimer:function(){try{h.setVisible(!h.isVisible())}catch(e){}}});this.timer.start()};this.close=override(this.close,function(){if((this.timer&&(this.timer.constructor===core.util.Timer||defined(this.timer.constructor.isSubclassOf)&&this.timer.constructor.isSubclassOf(core.util.Timer)))){this.timer.stop()}arguments.callee.prototype.apply(this,[])});this.setActive=function(active){this.field.setFocus(active);if(!active){editor.ui.TooltipController.hideBalloonTip(this.field)}if((this.timer&&(this.timer.constructor===core.util.Timer||defined(this.timer.constructor.isSubclassOf)&&this.timer.constructor.isSubclassOf(core.util.Timer)))){if(active){this.timer.start()}else{this.timer.stop()}}}}}ClassFactory.createPackage("editor.plugins.wizard");ClassFactory.createClass(editor.plugins.wizard,"LayoutPane");with(editor.plugins.wizard){editor.plugins.wizard.LayoutPane.superClass=editor.ui.wizard.WizardPane;editor.plugins.wizard.LayoutPane.constructor=function(){this.LayoutPane=function(A){arguments.callee.prototype.apply(this,[A,LayoutPane]);this.setTitle("Choose website design and layout");this.setText("Choose design and layout of the website.");this.setPrevPaneId(DatePane);this.setNextPaneId(UploadImagesPane);this.templateText={}};this.getTemplate=function(){return this.template};this.init=function(){this.menu=new editor.ui.TemplatesMenu(this,0,0,"100%","100%");this.menu.notifyCategorySelected.addListener(this.onCategorySelected);this.menu.notifyTemplateSelected.addListener(this.onTemplateSelected)};this.validate=function(){if(!defined(this.template)){editor.ui.TooltipController.showBalloonTip(this.menu.getTemplatesMenu(),"Please select a design template for your website. You can cnahge it later if you want.",core.ui.Balloon.RIGHT)}else{core.ajax.sendRequest("ajax.GetTextPanes",this.onGetTextPanes,{"template":this.template})}return false};this.setActive=function(A){if(A){editor.ui.TooltipController.showBalloonTip(this.menu.getCategoriesMenu(),"Choose the style that you would like to see on your page and click on the corresponding templates category.",core.ui.Balloon.LEFT|core.ui.Balloon.FLOATING)}else{editor.ui.TooltipController.hideBalloonTip(this.menu.getCategoriesMenu());editor.ui.TooltipController.hideBalloonTip(this.menu.getTemplatesMenu());editor.ui.TooltipController.hideBalloonTip(this.getWizard().getNextButton())}};this.onCategorySelected=callback(this,function(){editor.ui.TooltipController.showBalloonTip(this.menu.getTemplatesMenu(),"Template is a ready made page with photos, text boxes and background. These things can be changed in the future. Choose a desired template for your page.",core.ui.Balloon.RIGHT)});this.onTemplateSelected=callback(this,function(A,B){this.template=B;editor.ui.TooltipController.showBalloonTip(this.getWizard().getNextButton(),"Click this button to go to the next step.")});this.onGetTextPanes=callback(this,function(D){if("OK"==D.status){var A=this.getWizard();var J=LayoutPane;var F=A.iterator();while(F.hasNext()){var G=F.next();if((G&&(G.constructor===TextBlockPane||defined(G.constructor.isSubclassOf)&&G.constructor.isSubclassOf(TextBlockPane)))){var I=G.getPaneId();this.templateText[I]=G.getFieldText();A.removePane(G)}}for(var E in D.panes){var H=D.panes[E];var C=H.section;var B=new TextBlockPane(A,C);B.setLabel(H.label);B.setTitle(H.title);B.setExampleText(H.text);B.setMaxLength(H.length);B.setScreenshotUrl(H.screenshot);B.setPosition(H.left,H.top);B.setDimensions(H.width,H.height);B.setPrevPaneId(J);B.setFieldText(defined(this.templateText[C])?this.templateText[C]:"");B.setText(H.info);A.getPane(J).setNextPaneId(C);A.addPane(B);J=C}A.getPane(J).setNextPaneId(UploadImagesPane);A.getPane(UploadImagesPane).setPrevPaneId(J);A.next()}})}}ClassFactory.createPackage("editor.plugins.wizard");ClassFactory.createClass(editor.plugins.wizard,"SiteNameValidator");with(editor.plugins.wizard){editor.plugins.wizard.SiteNameValidator.superClass=core.util.validation.NonEmptyValidator;editor.plugins.wizard.SiteNameValidator.constructor=function(){this.validate=override(this.validate,function(){arguments.callee.prototype.apply(this,[]);with(core.util.validation){var siteName=this.getTarget().getText();if(siteName.match(/[^a-z0-9_-]/i)){throw new ValidationError(this,"Only letters, numbers and hyphens are accepted.
Please do not use spaces.")}if(siteName.length<3){throw new ValidationError(this,"The site name should contain 3 or more characters.")}}})}}ClassFactory.createPackage("editor.plugins.wizard");ClassFactory.createClass(editor.plugins.wizard,"SiteNamePane");with(editor.plugins.wizard){editor.plugins.wizard.SiteNamePane.superClass=editor.ui.wizard.WizardPane;editor.plugins.wizard.SiteNamePane.constructor=function(){this.SiteNamePane=function(wizard){arguments.callee.prototype.apply(this,[wizard,SiteNamePane]);this.setTitle("Enter site name");this.setText("Enter your site name. You can leave it as is if you're not sure about it.");this.setNextPaneId(DatePane);this.setPrevPaneId(NamePane)};this.setSiteName=function(name){if((this.siteName&&(this.siteName.constructor===core.ui.Edit||defined(this.siteName.constructor.isSubclassOf)&&this.siteName.constructor.isSubclassOf(core.ui.Edit)))){this.siteName.setText(name)}else{this.suggestedName=name}};this.getSiteName=function(){return this.siteName.getText()};this.init=function(){with(core.ui){var s1=new Static(this);s1.setStyle("position","absolute");s1.addStyleName("SiteNameTitle");s1.setText("Enter site name:");this.siteName=new Edit(this);this.siteName.setStyle("position","absolute");this.siteName.addStyleName("SiteNameField");this.siteName.setTabIndex(4);this.siteName.setText(this.suggestedName||"");this.siteName.onkeyup=this.onSiteNameKeyUp;var s2=new Static(this);s2.setStyle("position","absolute");s2.addStyleName("UrlDescr");s2.setText("Once you create a website, You will be able to access it via the following link:");this.url=new Static(this);this.url.setStyle("position","absolute");this.url.addStyleName("UrlLabel")}with(core.util.validation){this.validator=new SiteNameValidator(new TextField(this.siteName))}};this.setActive=function(active){this.siteName.setFocus(active);if(active){this.updateControls()}else{editor.ui.TooltipController.hideBalloonTip(this.siteName)}};this.updateControls=function(){this.url.setText("http://"+this.siteName.getText()+".LifeMemory.com")};this.validate=function(){try{this.validator.validate();core.ajax.sendRequest("ajax.CheckPersonData",this.onCheckComplete,{"siteName":this.siteName.getText()})}catch(e){editor.ui.TooltipController.showBalloonTip(this.siteName,e.message,core.ui.Balloon.RIGHT)}return false};this.onCheckComplete=callback(this,function(response){if("OK"==response.status){this.getWizard().next()}else{editor.ui.TooltipController.showBalloonTip(this.siteName,response.message,core.ui.Balloon.RIGHT)}});this.onSiteNameKeyUp=callback(this,function(event){this.updateControls();if((core.ui.Event.KEY_ENTER==event.keyCode)&&this.validate()){this.getWizard().next()}})}}ClassFactory.createPackage("editor.plugins.wizard");ClassFactory.createClass(editor.plugins.wizard,"PersonNameValidator");with(editor.plugins.wizard){editor.plugins.wizard.PersonNameValidator.superClass=core.util.validation.AbstractValidator;editor.plugins.wizard.PersonNameValidator.constructor=function(){this.PersonNameValidator=function(firstName,lastName){with(core.util.validation){this.firstName=new NonEmptyValidator(new TextField(firstName));this.lastName=new NonEmptyValidator(new TextField(lastName))}};this.validate=function(){this.firstName.validate();this.lastName.validate()}}}ClassFactory.createPackage("editor.plugins.wizard");ClassFactory.createClass(editor.plugins.wizard,"NamePane");with(editor.plugins.wizard){editor.plugins.wizard.NamePane.superClass=editor.ui.wizard.WizardPane;editor.plugins.wizard.NamePane.constructor=function(){this.NamePane=function(wizard){arguments.callee.prototype.apply(this,[wizard,NamePane]);this.setTitle("Enter person name");this.setText("Please enter the name of the person for who you are creating a memorial website.");this.setNextPaneId(SiteNamePane);this.setPrevPaneId(EmailPane)};this.getPersonName=function(){return this.firstName.getText()+" "+this.lastName.getText()};this.validate=function(){try{this.validator.validate();core.ajax.sendRequest("ajax.CheckPersonData",this.onCheckComplete,{"firstName":this.firstName.getText(),"lastName":this.lastName.getText()})}catch(e){editor.ui.TooltipController.showBalloonTip(e.getValidator().getTarget().getField(),e.getMessage(),core.ui.Balloon.RIGHT)}return false};this.init=function(){with(core.ui){var s1=new Static(this);s1.setStyle("position","absolute");s1.addStyleName("FirstNameTitle");s1.setText("Enter person's first name:");this.firstName=new Edit(this);this.firstName.setStyle("position","absolute");this.firstName.addStyleName("FirstNameField");this.firstName.setTabIndex(4);this.firstName.onkeyup=this.onInputKeyUp;var s2=new Static(this);s2.setStyle("position","absolute");s2.addStyleName("LastNameTitle");s2.setText("Enter person's last name:");this.lastName=new Edit(this);this.lastName.setStyle("position","absolute");this.lastName.addStyleName("LastNameField");this.lastName.setTabIndex(5);this.lastName.onkeyup=this.onInputKeyUp}with(core.util.validation){this.validator=new PersonNameValidator(this.firstName,this.lastName)}};this.setActive=function(active){this.firstName.setFocus(active);if(!active){editor.ui.TooltipController.hideBalloonTip(this.firstName);editor.ui.TooltipController.hideBalloonTip(this.lastName)}};this.onCheckComplete=callback(this,function(response){if("OK"==response.status){if(defined(response.names[0])){this.getWizard().getPane(SiteNamePane).setSiteName(response.names[0])}this.getWizard().next()}else{editor.ui.TooltipController.showBalloonTip(("lastName"==response.failee)?this.lastName:this.firstName,response.message,core.ui.Balloon.RIGHT)}});this.onInputKeyUp=callback(this,function(event){if((core.ui.Event.KEY_ENTER==event.keyCode)&&this.validate()){this.getWizard().next()}})}}ClassFactory.createPackage("editor.plugins.wizard");ClassFactory.createClass(editor.plugins.wizard,"EmailPane");with(editor.plugins.wizard){editor.plugins.wizard.EmailPane.superClass=editor.ui.wizard.WizardPane;editor.plugins.wizard.EmailPane.constructor=function(){this.EmailPane=function(wizard){arguments.callee.prototype.apply(this,[wizard,EmailPane]);this.setTitle("Enter your email address");this.setText("Enter a working email address you use. We will email a Temporary password to this email address.");this.setNextPaneId(NamePane)};this.getEmail=function(){return this.email.getText()};this.validate=function(){try{this.validator.validate();core.ajax.sendRequest("ajax.CheckRegistrationData",this.onCheckResponse,{"email":this.email.getText()})}catch(e){editor.ui.TooltipController.showBalloonTip(this.email,"Please enter your email address.",core.ui.Balloon.RIGHT)}return false};this.setActive=function(active){this.email.setFocus(active);if(!active){editor.ui.TooltipController.hideBalloonTip(this.email)}};this.init=function(){with(core.ui){var s=new Static(this);s.setStyle("position","absolute");s.addStyleName("EmailTitle");s.setText("Enter your email address:");this.email=new Edit(this);this.email.setStyle("position","absolute");this.email.addStyleName("EmailField");this.email.setTabIndex(4);this.email.setText("");this.email.onkeyup=this.onEmailKeyUp}with(core.util.validation){this.validator=new EmailValidator(new TextField(this.email))}};this.onCheckResponse=callback(this,function(response){if("OK"==response.status){this.getWizard().next()}else{editor.ui.TooltipController.showBalloonTip(this.email,response.message,core.ui.Balloon.RIGHT)}});this.onEmailKeyUp=callback(this,function(event){if((core.ui.Event.KEY_ENTER==event.keyCode)&&this.validate()){this.getWizard().next()}})}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Button");with(core.ui){core.ui.Button.superClass=core.ui.InputWindow;core.ui.Button.constructor=function(){this.Button=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.getElement().setAttribute("unselectable","on")};this.getType=function(){return"button"}}}ClassFactory.createPackage("editor.plugins.wizard");ClassFactory.createClass(editor.plugins.wizard,"SingleDateValidator");with(editor.plugins.wizard){editor.plugins.wizard.SingleDateValidator.superClass=core.util.validation.NonEmptyValidator;editor.plugins.wizard.SingleDateValidator.constructor=function(){this.validate=override(this.validate,function(){arguments.callee.prototype.apply(this,[]);var A=this.getTarget().getText();if(!A.match(/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}$/)||!common.util.DateUtils.exist(A)){throw new core.util.validation.ValidationError(this,"The date is invalid (MM/DD/YYYY format assumed).")}})}}ClassFactory.createPackage("editor.plugins.wizard");ClassFactory.createClass(editor.plugins.wizard,"DateValidator");with(editor.plugins.wizard){editor.plugins.wizard.DateValidator.superClass=core.util.validation.AbstractValidator;editor.plugins.wizard.DateValidator.constructor=function(){this.DateValidator=function(birthDate,deathDate){with(core.util.validation){this.birthDate=new SingleDateValidator(new TextField(birthDate));this.deathDate=new SingleDateValidator(new TextField(deathDate))}};this.validate=function(){this.birthDate.validate();this.deathDate.validate();with(common.util){var ms1=DateUtils.toMilliseconds(this.birthDate.getTarget().getText());var ms2=DateUtils.toMilliseconds(this.deathDate.getTarget().getText());var now=new Date().getTime();if(ms1>ms2){throw new core.util.validation.ValidationError(this.birthDate,"The death date cannot precede the birth date.")}if(ms2>now){throw new core.util.validation.ValidationError(this.deathDate,"The death date cannot be in future.")}}}}}ClassFactory.createPackage("editor.plugins.wizard");ClassFactory.createClass(editor.plugins.wizard,"DatePane");with(editor.plugins.wizard){editor.plugins.wizard.DatePane.superClass=editor.ui.wizard.WizardPane;editor.plugins.wizard.DatePane.constructor=function(){this.DatePane=function(wizard){arguments.callee.prototype.apply(this,[wizard,DatePane]);this.setTitle("Enter obituary information");this.setText("Please enter basic obituary information about the person.");this.setNextPaneId(LayoutPane);this.setPrevPaneId(SiteNamePane)};this.getBirthDate=function(){return this.birthDate.getText()};this.getDeathDate=function(){return this.deathDate.getText()};this.init=function(){with(core.ui){var s=new Static(this);s.setStyle("position","absolute");s.addStyleName("BirthDateTitle");s.setText("Date of birth:");this.birthDate=new Edit(this);this.birthDate.setStyle("position","absolute");this.birthDate.addStyleName("BirthDateField");this.birthDate.setTabIndex(5);this.birthDate.setText("MM/DD/YYYY");this.birthDate.onkeyup=this.onInputKeyUp;var s=new Static(this);s.setStyle("position","absolute");s.addStyleName("DeathDateTitle");s.setText("Date of death:");this.deathDate=new Edit(this);this.deathDate.setStyle("position","absolute");this.deathDate.addStyleName("DeathDateField");this.deathDate.setTabIndex(6);this.deathDate.setText("MM/DD/YYYY");this.deathDate.onkeyup=this.onInputKeyUp;this.calendar=new editor.ui.PopupMenuFrame();this.calendar.setContentWindow(new Calendar(this.calendar));this.calendar.getContentWindow().setYears(1900,new Date().getFullYear());this.calendar.getContentWindow().notifyDateSelected.addListener(this.onCalendarDateSelected);this.calendar.getContentWindow().setStyleName("WizardCalendar");this.calendar.getContentWindow().getYearList().updateLayout();this.calendar.getContentWindow().getMonthList().updateLayout();this.birthDateIcon=new ImageButton(this);this.birthDateIcon.setStyle("position","absolute");this.birthDateIcon.addStyleName("BirthDateIcon");this.birthDateIcon.setImages("images/calendar.gif");this.birthDateIcon.setToolTip("Select birth date");this.birthDateIcon.oncommand=this.onCalendarCommand;this.deathDateIcon=new ImageButton(this);this.deathDateIcon.setStyle("position","absolute");this.deathDateIcon.addStyleName("DeathDateIcon");this.deathDateIcon.setImages("images/calendar.gif");this.deathDateIcon.setToolTip("Select death date");this.deathDateIcon.oncommand=this.onCalendarCommand}with(core.util.validation){this.validator=new DateValidator(this.birthDate,this.deathDate)}};this.setActive=function(active){this.birthDate.setFocus(active);if(active){editor.ui.TooltipController.showBalloonTip(this.birthDateIcon,"Click this button to view a calendar. Click on the calendar to choose date of birth.",core.ui.Balloon.RIGHT)}else{editor.ui.TooltipController.hideBalloonTip(this.birthDate);editor.ui.TooltipController.hideBalloonTip(this.deathDate);editor.ui.TooltipController.hideBalloonTip(this.birthDateIcon);editor.ui.TooltipController.hideBalloonTip(this.deathDateIcon)}};this.validate=function(){try{this.validator.validate();return true}catch(e){editor.ui.TooltipController.showBalloonTip(e.getValidator().getTarget().getField(),e.getMessage(),core.ui.Balloon.RIGHT);return false}};this.showCalendar=function(isBirthCalendar){var currentDate=(isBirthCalendar)?this.getBirthDate():this.getDeathDate();if((currentDate!="MM/DD/YYYY")&&(currentDate.length>0)){var year=common.util.DateUtils.getYear(currentDate);var month=common.util.DateUtils.getMonth(currentDate);var day=common.util.DateUtils.getDay(currentDate);this.calendar.getContentWindow().setDate(year,month,day)}else{this.calendar.getContentWindow().setYear(isBirthCalendar?1900:new Date().getFullYear())}var wnd=isBirthCalendar?this.birthDateIcon:this.deathDateIcon;this.calendar.doPopupNear(wnd)};this.onCalendarCommand=callback(this,function(event,target,icon){if(this.calendar.isPopup()){this.calendar.endPopup()}else{editor.ui.TooltipController.hideBalloonTip(icon);this.showCalendar(icon==this.birthDateIcon)}});this.onCalendarDateSelected=callback(this,function(sender,date){if(sender.getOrigin()==this.birthDateIcon){this.birthDate.setText(date);editor.ui.TooltipController.showBalloonTip(this.deathDateIcon,"Click this button to view a calendar. Click on the calendar to choose date of death.",core.ui.Balloon.RIGHT)}else{if(sender.getOrigin()==this.deathDateIcon){this.deathDate.setText(date);editor.ui.TooltipController.showBalloonTip(this.getWizard().getNextButton(),"Click this button to go to the next step.")}}this.calendar.endPopup()});this.onInputKeyUp=callback(this,function(event){if((core.ui.Event.KEY_ENTER==event.keyCode)&&this.validate()){this.getWizard().next()}})}}ClassFactory.createPackage("editor.plugins.wizard");ClassFactory.createClass(editor.plugins.wizard,"MemorialWizard");with(editor.plugins.wizard){editor.plugins.wizard.MemorialWizard.constructor=function(){this.start=function(B){this.account=B?true:false;var C=new editor.ui.DialogFrame();C.addCloseListener(this);C.setTitle("Create a website");var A=new MemorialWizardDialog(C,B);A.addWizardListener(this);C.setContentWindow(A);C.activate();C.center();C.doModal()};this.finish=function(A){editor.ui.TooltipController.hideBalloonTip();var B=A.getParent();B.endModal();B.close()};this.onWizardFinish=this.onWizardSkip=function(A){this.createPage(A);this.finish(A)};this.onWizardCancel=function(A){this.finish(A)};this.onFrameClose=function(A){this.finish(A.getContentWindow())};this.createPage=function(B){var P=B.getPane(EmailPane);var O=B.getPane(DatePane);var Q=B.getPane(NamePane);var J=B.getPane(SiteNamePane);var E=B.getPane(LayoutPane);var G=B.getPane(UploadImagesPane);var N=E.getTemplate();var C=common.util.DateUtils.client2server(O.getBirthDate());var M=common.util.DateUtils.client2server(O.getDeathDate());var K=(this.account?P.getEmail():"");var A=[];if(defined(G.menu)){for(var H=0;H0){this.ticker.style.left=(left-this.stripeWidth)+"px"}else{this.ticker.style.left=left+"px"}}window.clearTimeout(this.timeoutId);this.timeoutId=window.setTimeout(this.onShift,50)});this.onLeftMouseOver=callback(this,function(){this.setDirection(Ticker.DIRECTION_RIGHT);this.setQuickShift(true);if(!this.isStarted()){this.start()}});this.onLeftMouseOut=callback(this,function(){this.setQuickShift(false);if(this.isAutoScroll()){this.setDirection(Ticker.DIRECTION_LEFT)}else{this.stop()}});this.onRightMouseOver=callback(this,function(){this.setDirection(Ticker.DIRECTION_LEFT);this.setQuickShift(true);if(!this.isStarted()){this.start()}});this.onRightMouseOut=callback(this,function(){this.setQuickShift(false);if(!this.isAutoScroll()){this.stop()}});this.onMiddleMouseOver=callback(this,function(){if(this.isAutoScroll()){this.stop()}});this.onMiddleMouseOut=callback(this,function(){if(this.isAutoScroll()){this.start()}})};common.Ticker.DIRECTION_LEFT=-1;common.Ticker.DIRECTION_RIGHT=1;common.Ticker.SCROLL_AUTO="AUTO";common.Ticker.SCROLL_MANUAL="MANUAL"}