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;B<C.childNodes.length;B++){if(C.childNodes.item(B).nodeType==1){A.push(this.getValue(C.childNodes.item(B)))}}return A};core.ajax.Response.getObject=function(A){var B=new Object();this.convert(A,B);return B};core.ajax.Response.getString=function(A){try{return A.firstChild.nodeValue}catch(B){return""}};core.ajax.Response.getValue=function(C){var A=C.attributes.getNamedItem("type");var B=(A)?A.nodeValue:"string";switch(B){case"null":return null;case"bool":return this.getBool(C);case"int":return this.getInt(C);case"float":return this.getFloat(C);case"array":return this.getArray(C);case"object":return this.getObject(C);default:return this.getString(C)}};core.ajax.convert=core.ajax.Response.convert=function(C,D){for(var B=0;B<C.childNodes.length;B++){if(C.childNodes.item(B).nodeType==1){var E=C.childNodes.item(B);var A=E.nodeName;D[A]=this.getValue(E)}}}}ClassFactory.createPackage("core.ajax");ClassFactory.createClass(core.ajax,"Request");with(core.ajax){core.ajax.Request.constructor=function(){this.url;this.http;this.handler;this.Request=function(url,handler){this.url=url;this.handler=handler||{};this.http=XMLHttpRequestFactory.createRequest();this.http.onreadystatechange=this.onRequestStateChange};this.send=function(content){if(defined(content)&&content.length>0){this.http.open("POST",this.url,true);this.http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");this.http.send(content)}else{this.http.open("GET",this.url,true);this.http.send(null)}};this.onSuccess=function(response){if("function"==typeof this.handler.onSuccess){this.handler.onSuccess(response)}};this.onError=function(error){if("function"==typeof this.handler.onError){this.handler.onError(error)}};this.onComplete=function(){if("function"==typeof this.handler.onComplete){this.handler.onComplete()}};this.onRequestStateChange=callback(this,function(){if(4==this.http.readyState){if((200==this.http.status)||(304==this.http.status)){switch(this.http.getResponseHeader("Content-Type")){case"text/xml":case"application/xml":var rootNode;if(this.http.responseXML&&(rootNode=this.http.responseXML.documentElement)){rootNode.normalize();if("response"==rootNode.nodeName){this.onSuccess(new Response(rootNode))}else{if("error"==rootNode.nodeName){this.onError(new Response(rootNode))}else{}}}break;case"text/json":case"application/json":this.onSuccess(eval("("+this.http.responseText+")"));break;default:this.onSuccess(this.http.responseText);break}}else{this.onError("There was a problem retrieving the XML data:\n"+this.http.statusText)}this.onComplete()}});this.toString=function(){return"[Request]"}};core.ajax.sendRequest=core.ajax.Request.send=function(B,E,F){var C=new core.ajax.Request(B,{onSuccess:E});var D=new Array();if(defined(F)){for(var A in F){D.push(encodeURIComponent(A)+"="+encodeURIComponent(F[A]))}}C.send(D.join("&"))};core.ajax.sendFormData=core.ajax.Request.sendFormData=function(C,E){var F={};for(var D=2;D<arguments.length;D++){if(defined(arguments[D].elements)&&arguments[D].elements.length){for(var B=0;B<arguments[D].elements.length;B++){if(arguments[D].elements[B].name!=""){F[arguments[D].elements[B].name]=arguments[D].elements[B].value}}}else{for(var A in arguments[D]){F[A]=arguments[D][A]}}}return core.ajax.sendRequest(C,E,F)}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Notification");with(core.ui){core.ui.Notification.constructor=function(){this.listeners=[];this.addListener=function(C,B){var A=this.findListener(C);if(-1==A){this.listeners.push([C,B])}};this.removeListener=function(B){var A=this.findListener(B);if(-1!=A){delete this.listeners[A];this.listeners.splice(A,1)}};this.send=function(){for(var B=0;B<this.listeners.length;B++){var C=this.listeners[B][0];var A=this.listeners[B][1];C.apply(null,arguments);if(A){this.removeListener(C);B--}}};this.clear=function(){while(this.listeners.length>0){this.listeners.pop()}};this.findListener=function(B){for(var A=0;A<this.listeners.length;A++){if(this.listeners[A]&&(B==this.listeners[A][0])){return A}}return -1};this.toString=function(){return"[Notification]"}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Window");with(core.ui){core.ui.Window.constructor=function(){this.id;this.element;this.parent;this.visible=false;this.enabled=true;this.children={};this.Window=function(B,A,F,D,E,C){this.id=this.constructor.className+Window.NEXTID++;this.parent=(defined(B))?B:null;if(!C){C=this.createElement();C.className=this.constructor.className;C.style.overflow="hidden";if((B&&(B.constructor===Window||defined(B.constructor.isSubclassOf)&&B.constructor.isSubclassOf(Window)))){C.style.position="relative";B.addElement(C)}else{C.style.position="absolute";C.style.visibility="hidden";C.style.zIndex=Window.NEXTZINDEX++;document.body.appendChild(C)}}this.attach(C);if(B){B.children[this.getId()]=this}if(defined(A)){C.style.left=("string"==typeof A)?A:(A+"px")}if(defined(F)){C.style.top=("string"==typeof F)?F:(F+"px")}if(defined(D)){C.style.width=("string"==typeof D)?D:(D+"px")}if(defined(E)){C.style.height=("string"==typeof E)?E:(E+"px")}Window.all[this.getId()]=Window.active=this};this.attach=function(B){B.winid=this.getId();for(var A=0;A<Event.types.length;A++){Event.addListener(B,Event.types[A],this.handleEvent)}if(!defined(this.element)){this.element=B}};this.detach=function(B){if(!defined(B)){B=this.element}for(var A=0;A<Event.types.length;A++){Event.removeListener(B,Event.types[A],this.handleEvent)}B.winid=undefined;if(this.element==B){delete this.element;this.element=undefined}};this.isAttached=function(){return defined(this.element)};this.attachGlobalEvent=function(A){if(!Window.global[A]){Window.global[A]={}}Window.global[A][this.getId()]=true};this.detachGlobalEvent=function(A){if(Window.global[A]){delete Window.global[A][this.getId()]}};this.getElement=function(){return this.element};this.getParent=function(){return this.parent};this.setVisible=function(A){this.visible=A;if(A){this.setStyle("visibility",(this.isChild())?"inherit":"visible")}else{this.setStyle("visibility","hidden")}};this.show=function(){this.setVisible(true)};this.hide=function(){this.setVisible(false)};this.isHidden=function(){return("hidden"==this.getStyle("visibility"))};this.isVisible=function(){return !this.isHidden()};this.move=function(A,B){this.element.style.left=A+"px";this.element.style.top=B+"px"};this.resize=function(A,B){this.element.style.width=A+"px";this.element.style.height=B+"px"};this.center=function(){var A,B;if(this.isChild()){A=this.parent.getClientWidth()/2-this.getWidth()/2+this.parent.getElement().scrollLeft/2;B=this.parent.getClientHeight()/2-this.getHeight()/2+this.parent.getElement().scrollTop/2}else{A=Window.getWidth()/2-this.getWidth()/2+document.body.scrollLeft/2;B=Window.getHeight()/2-this.getHeight()/2+document.body.scrollTop/2}this.move(Math.round(A),Math.round(B))};this.getId=function(){return this.id};this.setText=function(A){this.element.innerHTML=A};this.getText=function(){return this.element.innerHTML};this.getX=function(){return this.element.offsetLeft};this.getY=function(){return this.element.offsetTop};this.getAbsX=function(){var B=this.getElement();var A=B.offsetLeft;while(B=B.offsetParent){A+=B.offsetLeft;A-=B.scrollLeft}return document.body.scrollLeft+A};this.getAbsY=function(){var A=this.getElement();var B=A.offsetTop;while(A=A.offsetParent){B+=A.offsetTop;B-=A.scrollTop}return document.body.scrollTop+B};this.getWidth=function(){return this.element.offsetWidth};this.getHeight=function(){return this.element.offsetHeight};this.getClientWidth=function(){return this.element.clientWidth};this.getClientHeight=function(){return this.element.clientHeight};this.getClientX=function(){return(this.getWidth()-this.getClientWidth())/2};this.getClientY=function(){return(this.getHeight()-this.getClientHeight())/2};this.setToolTip=function(A){this.element.title=A};this.getToolTip=function(){return this.element.title};this.close=function(){for(var A in this.children){this.children[A].close();delete this.children[A]}if(this.parent){delete this.parent.children[this.getId()];delete this.parent}if(this.element){if(this.element.parentNode){this.element.parentNode.removeChild(this.element)}delete this.element}delete Window.all[this.getId()]};this.isClosed=function(){return(!defined(Window.all[this.getId()]))};this.activate=function(){if(!this.isActive()){if(this.isChild()){this.parent.activate()}else{this.setStyle("z-index",Window.NEXTZINDEX++);Window.active=this}}};this.isActive=function(){return(Window.active&&Window.active==this)};this.setEnabled=function(A){this.enabled=A;this.getElement().disabled=!A;for(var B in this.children){this.children[B].setEnabled(A)}};this.enable=function(){this.setEnabled(true)};this.disable=function(){this.setEnabled(false)};this.isEnabled=function(){return this.enabled};this.isDisabled=function(){return this.getElement().disabled};this.isChild=function(){return(null!=this.parent)};this.isChildOf=function(A){for(var B in A.children){if(A.children[B]==this){return true}if(this.isChildOf(A.children[B])){return true}}return false};this.setStyle=function(B,C){switch(B.toLowerCase()){case"float":this.element.style["styleFloat"]=this.element.style["cssFloat"]=C;break;case"opacity":this.element.style.opacity=C/100;this.element.style.MozOpacity=C/100;this.element.style.KhtmlOpacity=C/100;this.element.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+C+")";break;default:var A=B.replace(/\-([a-z])/g,function(D){return D.charAt(1).toUpperCase()});this.element.style[A]=C}};this.getStyle=function(B){switch(B.toLowerCase()){case"float":return defined(this.element.style["styleFloat"])?this.element.style["styleFloat"]:this.element.style["cssFloat"];case"opacity":return(this.element.style.opacity||(0===this.element.style.opacity))?(this.element.style.opacity*100):100;default:var A=B.replace(/\-([a-z])/g,function(C){return C.charAt(1).toUpperCase()});return this.element.style[A]}};this.setStyleId=function(A){this.element.id=A};this.getStyleId=function(){return this.element.id};this.setStyleName=function(A){this.element.className=A};this.getStyleName=function(){return this.element.className.split(" ")[0]};this.addStyleName=function(A){var C=this.element.className.split(" ");for(var B=0;B<C.length;B++){if(A==C[B]){return }}C.push(A);this.element.className=C.join(" ")};this.removeStyleName=function(A){var C=this.element.className.split(" ");for(var B=0;B<C.length;B++){if(A==C[B]){C.splice(B,1);break}}this.element.className=C.join(" ")};this.hasStyleName=function(A){var C=this.element.className.split(" ");for(var B=0;B<C.length;B++){if(C[B]===A){return true}}return false};this.clearStyleName=function(){var A=this.element.className.split(" ");this.element.className=defined(A[0])?A[0]:this.constructor.className};this.createElement=function(){return document.createElement("div")};this.addElement=function(A){this.getElement().appendChild(A)};this.handleEvent=callback(this,function(B){B=Event.improve(B);var C=(B.target)?Window.all[B.target.winid]:undefined;var A=Window.processEvent(B,C);if(!B.isStopped()){if(("function"==typeof this["on"+B.getType()])&&this.isEnabled()){if(false===this["on"+B.getType()](B,C,this)){A=false}}}if(false===A){B.cancel()}return A});this.toString=function(){return"["+this.constructor.className+"]"}};core.ui.Window.eventHandler=function(A){A=Event.improve(A);var B=(A.target)?Window.all[A.target.winid]:undefined;if(false===Window.processEvent(A,B)){A.cancel()}return !A.isCancelled()};core.ui.Window.processEvent=function(B,E){var A=true;for(var D in Window.global[B.getType()]){var C=Window.all[D];if(("function"==typeof C["on"+B.getType()])&&C.isEnabled()){if(false===C["on"+B.getType()](B,E,C)){A=false}}}return A};core.ui.Window.NEXTID=1;core.ui.Window.NEXTZINDEX=1;core.ui.Window.all={};core.ui.Window.active=null;core.ui.Window.global={};core.ui.Window.getWidth=function(){return document.body.clientWidth+document.body.scrollLeft};core.ui.Window.getHeight=function(){return document.body.clientHeight+document.body.scrollTop};core.ui.Window.forId=function(A){return Window.all[A]};core.ui.Window.registerDocument=function(B){for(var A=0;A<Event.types.length;A++){Event.addListener(B,Event.types[A],Window.eventHandler)}};core.ui.Window.unregisterDocument=function(B){for(var A=0;A<Event.types.length;A++){Event.removeListener(B,Event.types[A],Window.eventHandler)}};core.ui.Window.notifyScroll=new Notification();core.ui.Window.notifyResize=new Notification();core.ui.Window.cleanup=function(){for(var A in Window.all){if(!Window.all[A].isChild()){Window.all[A].close()}}};core.ui.Window.onresize=function(){Window.notifyResize.send(Window.getWidth(),Window.getHeight())};core.ui.Window.onscroll=function(){Window.notifyScroll.send(document.body.scrollLeft,document.body.scrollTop)};core.ui.Window.registerDocument(window.document);Event.addListener(window,"resize",Window.onresize);Event.addListener(window,"scroll",Window.onscroll);Event.addUnloadListener(Window.cleanup)}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Balloon");with(core.ui){core.ui.Balloon.superClass=core.ui.Window;core.ui.Balloon.constructor=function(){this.owner;this.position;this.timeout;this.tail;this.timerId;this.Balloon=function(C,D,B,A){arguments.callee.prototype.apply(this,[]);this.setStyle("overflow","visible");this.setStyle("z-index",Balloon.ZINDEX);this.tail=this.createTail();this.setPosition(defined(B)?B:Balloon.TOP);this.setTimeout(defined(A)?A:10);this.setOwner(C);this.setText(D)};this.setOwner=function(A){this.owner=A};this.getOwner=function(){return this.owner};this.setPosition=function(B){var A={};A[Balloon.LEFT]="left";A[Balloon.TOP]="top";A[Balloon.RIGHT]="right";A[Balloon.BOTTOM]="bottom";this.removeStyleName(this.getStyleName()+"-"+A[this.position&Balloon.MASK_POSTITON]);this.tail.removeStyleName(this.tail.getStyleName()+"-"+A[this.position&Balloon.MASK_POSTITON]);this.position=B;this.addStyleName(this.getStyleName()+"-"+A[this.position&Balloon.MASK_POSTITON]);this.tail.addStyleName(this.tail.getStyleName()+"-"+A[this.position&Balloon.MASK_POSTITON])};this.getPosition=function(){return this.position};this.setTimeout=function(A){this.timeout=A};this.getTimeout=function(){return this.timeout};this.setVisible=override(this.setVisible,function(A){if(A){this.attachGlobalEvent("mousemove");this.adjustPosition();if(0!==this.timeout){window.clearTimeout(this.timerId);this.timerId=window.setTimeout(this.onTimeout,this.timeout*1000)}}else{window.clearTimeout(this.timerId);this.detachGlobalEvent("mousemove")}this.tail.setVisible(A);arguments.callee.prototype.apply(this,[A])});this.getTail=function(){return this.tail};this.setEnabled=override(this.setEnabled,function(A){this.tail.setEnabled(A);arguments.callee.prototype.apply(this,[A])});this.close=override(this.close,function(){window.clearTimeout(this.timerId);this.tail.close();delete this.tail;arguments.callee.prototype.apply(this,[])});this.createTail=function(){var A=new Window();A.setStyleName(this.getStyleName()+"Tail");A.setStyle("z-index",Balloon.ZINDEX);return A};this.correctPosition=function(){var E=0;var F=0;if(this.position&Balloon.LEFT){var C=this.owner.getAbsX()-this.tail.getWidth();var B=this.owner.getAbsY()+(this.owner.getHeight()-this.tail.getHeight())/2;E=C-this.getWidth();F=B-(this.getHeight()-this.tail.getHeight())/2}else{if(this.position&Balloon.RIGHT){var C=this.owner.getAbsX()+this.owner.getWidth();var B=this.owner.getAbsY()+(this.owner.getHeight()-this.tail.getHeight())/2;E=C+this.tail.getWidth();F=B-(this.getHeight()-this.tail.getHeight())/2}else{if(this.position&Balloon.TOP){var C=this.owner.getAbsX()+(this.owner.getWidth()-this.tail.getWidth())/2;var B=this.owner.getAbsY()-this.tail.getHeight();E=C-(this.getWidth()-this.tail.getWidth())/2;F=B-this.getHeight()}else{if(this.position&Balloon.BOTTOM){var C=this.owner.getAbsX()+(this.owner.getWidth()-this.tail.getWidth())/2;var B=this.owner.getAbsY()+this.owner.getHeight();E=C-(this.getWidth()-this.tail.getWidth())/2;F=B+this.tail.getHeight()}}}}var G=document.body.scrollLeft;var A=document.body.clientWidth+document.body.scrollLeft;var D=document.body.scrollTop;var H=document.body.clientHeight+document.body.scrollTop;if(E<G){this.setPosition(Balloon.RIGHT|(this.position&Balloon.FLOATING))}else{if(E+this.getWidth()>A){this.setPosition(Balloon.LEFT|(this.position&Balloon.FLOATING))}}if(F<D){this.setPosition(Balloon.BOTTOM|(this.position&Balloon.FLOATING))}else{if(F+this.getHeight()>H){this.setPosition(Balloon.TOP|(this.position&Balloon.FLOATING))}}};this.adjustPosition=function(){if(this.position&Balloon.FLOATING){this.correctPosition()}if(this.position&Balloon.LEFT){this.tail.move(this.owner.getAbsX()-this.tail.getWidth(),this.owner.getAbsY()+(this.owner.getHeight()-this.tail.getHeight())/2);this.move(this.tail.getX()-this.getWidth(),this.tail.getY()-(this.getHeight()-this.tail.getHeight())/2)}else{if(this.position&Balloon.RIGHT){this.tail.move(this.owner.getAbsX()+this.owner.getWidth(),this.owner.getAbsY()+(this.owner.getHeight()-this.tail.getHeight())/2);this.move(this.tail.getX()+this.tail.getWidth(),this.tail.getY()-(this.getHeight()-this.tail.getHeight())/2)}else{if(this.position&Balloon.TOP){this.tail.move(this.owner.getAbsX()+(this.owner.getWidth()-this.tail.getWidth())/2,this.owner.getAbsY()-this.tail.getHeight());this.move(this.tail.getX()-(this.getWidth()-this.tail.getWidth())/2,this.tail.getY()-this.getHeight())}else{if(this.position&Balloon.BOTTOM){this.tail.move(this.owner.getAbsX()+(this.owner.getWidth()-this.tail.getWidth())/2,this.owner.getAbsY()+this.owner.getHeight());this.move(this.tail.getX()-(this.getWidth()-this.tail.getWidth())/2,this.tail.getY()+this.tail.getHeight())}}}}};this.onmousedown=function(A,B){if(((B&&(B.constructor===Window||defined(B.constructor.isSubclassOf)&&B.constructor.isSubclassOf(Window))))&&((B==this)||B.isChildOf(this))){if(this.isVisible()){this.hide()}}};this.onmousemove=function(A){var B=arguments.callee;if((this.owner.getAbsX()!==B.x)||(this.owner.getAbsY()!==B.y)){B.x=this.owner.getX();B.y=this.owner.getY();this.adjustPosition()}};this.onTimeout=callback(this,function(){if(this.isVisible()){this.hide()}})};core.ui.Balloon.LEFT=1;core.ui.Balloon.TOP=2;core.ui.Balloon.RIGHT=4;core.ui.Balloon.BOTTOM=8;core.ui.Balloon.FLOATING=16;core.ui.Balloon.MASK_POSTITON=15;core.ui.Balloon.ZINDEX=10000}ClassFactory.createPackage("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;C<D.length;C++){this.images[D[C]]=new window.Image()}this.setState(ImageButton.STATE_NORMAL)};this.setState=function(A){this.getElement().setAttribute("state",A);this.removeStyleName(this.getStyleName()+"-"+ImageButton.states[this.state]);this.addStyleName(this.getStyleName()+"-"+ImageButton.states[A]);this.state=A;if(defined(this.imageList)){this.setStyle("background-position",-(this.getWidth()*A)+"px top")}else{if(this.images[A].src.length>0){this.setImage(this.images[A].src)}}};this.getState=function(){return this.state};this.setImages=function(D,C,A,B){if(defined(D)){this.images[ImageButton.STATE_NORMAL].src=D}if(defined(C)){this.images[ImageButton.STATE_HOVER].src=C}if(defined(A)){this.images[ImageButton.STATE_PRESSED].src=A}if(defined(B)){this.images[ImageButton.STATE_DISABLED].src=B}if(this.images[this.state].src.length>0){this.setImage(this.images[this.state].src)}};this.setImageList=function(A){if(!defined(this.imageList)){this.imageList=new window.Image()}this.imageList.src=A;this.setImage(A);this.setStyle("background-position",-(this.getWidth()*this.state)+"px top")};this.setImage=function(A){this.setStyle("background-image",'url("'+A+'")')};this.setEnabled=override(this.setEnabled,function(A){if(A){arguments.callee.prototype.apply(this,[A]);this.setState(ImageButton.STATE_NORMAL)}else{this.setState(ImageButton.STATE_DISABLED);arguments.callee.prototype.apply(this,[A])}});this.onmousedown=function(A){this.setState(ImageButton.STATE_PRESSED);this.setFocus(true);this.activate();A.stop();A.cancel()};this.onmouseover=this.onmouseup=function(A){this.setState(ImageButton.STATE_HOVER);A.stop()};this.onmouseout=function(A){this.setState(ImageButton.STATE_NORMAL);A.stop()};this.ondblclick=function(A){A.stop()};this.onclick=function(C,B,A){if("function"==typeof this.oncommand){this.oncommand(C,B,A)}};this.onkeydown=function(C,B,A){if(Event.KEY_SPACE==C.keyCode){C.stop();this.setState(ImageButton.STATE_PRESSED)}else{if(Event.KEY_ENTER==C.keyCode){C.stop();if("function"==typeof this.oncommand){this.oncommand(C,B,A)}}}};this.onkeyup=function(C,B,A){if(Event.KEY_SPACE==C.keyCode){C.stop();this.setState(ImageButton.STATE_NORMAL);if("function"==typeof this.oncommand){this.oncommand(C,B,A)}}}};core.ui.ImageButton.STATE_NORMAL=0;core.ui.ImageButton.STATE_HOVER=1;core.ui.ImageButton.STATE_PRESSED=2;core.ui.ImageButton.STATE_DISABLED=3;core.ui.ImageButton.states=["normal","hover","pressed","disabled"]}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"InputWindow");with(core.ui){core.ui.InputWindow.superClass=core.ui.FocusWindow;core.ui.InputWindow.constructor=function(){this.setSelected=function(A){if(A){this.getInput().select()}else{this.getInput().blur()}};this.setName=function(A){this.getInput().name=A};this.getName=function(){return this.getInput().name};this.setValue=function(A){this.getInput().value=A};this.getValue=function(){return this.getInput().value};this.setText=function(A){this.setValue(A)};this.getText=function(){return this.getValue()};this.setFocus=function(A){if(A){try{this.getInput().focus()}catch(B){}}else{this.getInput().blur()}};this.setTabIndex=function(A){this.getInput().tabIndex=A};this.getTabIndex=function(){return getInput().tabIndex};this.setAccessKey=function(A){this.getInput().accessKey=A};this.getAccessKey=function(){return this.getInput().accessKey};this.getInput=function(){return this.getElement()};this.createElement=function(){var A=document.createElement("input");A.type=this.getType();return A};this.getType=function(){return"text"}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Edit");with(core.ui){core.ui.Edit.superClass=core.ui.InputWindow;core.ui.Edit.constructor=function(){this.Edit=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.getInput().setAttribute("autocomplete","off");if(defined(this.getInput().onselectstart)){this.getInput().onselectstart=new Function("window.event.cancelBubble = true")}};this.setReadOnly=function(A){this.getElement().readOnly=A};this.isReadOnly=function(){return this.getElement().readOnly};this.getType=function(){return"text"}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"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(C<this.min){this.setPos(this.min)}else{if(C>this.max){this.setPos(this.max)}else{this.pos=C}}if(this.isVertical()){var B=this.getClientHeight()-this.indicator.getHeight()-(this.pos-this.min)/(this.max-this.min)*(this.getClientHeight()-this.indicator.getHeight());this.indicator.setStyle("left","auto");this.indicator.setStyle("top",B+"px")}else{var A=(this.pos-this.min)/(this.max-this.min)*(this.getClientWidth()-this.indicator.getWidth());this.indicator.setStyle("left",A+"px");this.indicator.setStyle("top","auto")}};this.getPos=function(){return this.pos};this.setVertical=function(A){this.removeStyleName(this.getStyleName()+(this.vertical?"-vertical":"-horisontal"));this.vertical=A;this.addStyleName(this.getStyleName()+(this.vertical?"-vertical":"-horisontal"));this.indicator.setDirection(this.isVertical()?Handle.DIRECTION_NORTH|Handle.DIRECTION_SOUTH:Handle.DIRECTION_EAST|Handle.DIRECTION_WEST);this.setPos(this.pos)};this.isVertical=function(){return this.vertical};this.getProgressIndicator=function(){return this.indicator};this.getPositionByCoords=function(A,C){var B=(this.isVertical())?this.max-Math.floor(C/(this.getClientHeight()-this.indicator.getHeight())*(this.max-this.min)):this.min+Math.floor(A/(this.getClientWidth()-this.indicator.getWidth())*(this.max-this.min));if(B<this.min){return this.min}else{if(B>this.max){return this.max}else{return B}}};this.onIndicatorDrag=callback(this,function(){var A=this.getPositionByCoords(this.indicator.getX(),this.indicator.getY());if((this.min==A)||(this.max==A)){this.setPos(A)}else{this.pos=A}this.notifyPositionChanged.send(this,this.pos)});this.onmousedown=function(A,C){if(this==C){var B=this.getPositionByCoords(A.getX()-this.getAbsX()-this.indicator.getWidth()/2,A.getY()-this.getAbsY()-this.indicator.getHeight()/2);this.setPos(B);this.notifyPositionChanged.send(this,B)}};this.onkeypress=function(A){var C=(this.max-this.min)/100;var B=false;if(this.isVertical()){if(Event.KEY_UP_ARROW==A.keyCode){this.setPos(this.getPos()+C);B=true}else{if(Event.KEY_DOWN_ARROW==A.keyCode){this.setPos(this.getPos()-C);B=true}}}else{if(Event.KEY_LEFT_ARROW==A.keyCode){this.setPos(this.getPos()-C);B=true}else{if(Event.KEY_RIGHT_ARROW==A.keyCode){this.setPos(this.getPos()+C);B=true}}}this.notifyPositionChanged.send(this,this.pos);if(B){A.cancel()}}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"ScrollBar");with(core.ui){core.ui.ScrollBar.superClass=core.ui.Window;core.ui.ScrollBar.constructor=function(){this.orienation=ScrollBar.VERTICAL;this.step=0;this.target;this.backwardButton;this.forwardButton;this.slider;this.ScrollBar=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.backwardButton=new ImageButton(this);this.backwardButton.setStyleName("BackwardButton");this.backwardButton.setStyle("position","absolute");this.backwardButton.onmousedown=this.onBackwardMouseDown;this.slider=new Slider(this);this.slider.setStyle("position","absolute");this.slider.notifyPositionChanged.addListener(this.onSliderPositionChanged);this.forwardButton=new ImageButton(this);this.forwardButton.setStyleName("ForwardButton");this.forwardButton.setStyle("position","absolute");this.forwardButton.onmousedown=this.onForwardMouseDown;this.setOrientation(ScrollBar.VERTICAL);Event.addListener(this.getElement(),"resize",this.onResize)};this.setOrientation=function(A){this.removeStyleName(this.getStyleName()+"-"+(this.isVertical()?"vertical":"horisontal"));this.orientation=A;this.addStyleName(this.getStyleName()+"-"+(this.isVertical()?"vertical":"horisontal"));this.slider.setVertical(this.isVertical());this.backwardButton.setStyle("left","0px");this.backwardButton.setStyle("top","0px");this.forwardButton.setStyle("left",this.isVertical()?"0px":"");this.forwardButton.setStyle("right",this.isVertical()?"":"0px");this.forwardButton.setStyle("top",this.isVertical()?"":"0px");this.forwardButton.setStyle("bottom",this.isVertical()?"0px":"");this.slider.setStyle("left",this.isVertical()?"0px":"");this.slider.setStyle("top",this.isVertical()?"":"0px");this.updateLayout()};this.getOrientation=function(){return this.orientation};this.isVertical=function(){return(ScrollBar.VERTICAL==this.orientation)};this.setPosition=function(A){A=Math.max(A,0);A=Math.min(A,100);this.slider.setPos(this.isVertical()?100-A:A);this.updateTarget(A)};this.getPosition=function(){var A=this.slider.getPos();return this.isVertical()?100-A:A};this.setScrollTarget=function(A){this.target=A;this.target.setStyle("overflow-"+(this.isVertical()?"y":"x"),"hidden");this.updateLayout()};this.getScrollTarget=function(){return this.target};this.getBackwardButton=function(){return this.backwardButton};this.getForwardButton=function(){return this.forwardButton};this.getSliderControl=function(){return this.slider};this.updateLayout=function(){if((this.target&&(this.target.constructor===Window||defined(this.target.constructor.isSubclassOf)&&this.target.constructor.isSubclassOf(Window)))){if(this.isVertical()){this.slider.setStyle("top",this.backwardButton.getHeight()+"px");this.slider.setStyle("height",Math.max(this.getClientHeight()-this.backwardButton.getHeight()-this.forwardButton.getHeight(),0)+"px");var B=(this.target.getElement().scrollHeight>0)?this.slider.getClientHeight()*this.target.getClientHeight()/this.target.getElement().scrollHeight:0;this.slider.indicator.setStyle("height",Math.max(B,8)+"px");var C=this.target.getElement().scrollTop/(this.target.getElement().scrollHeight-this.target.getHeight())*100}else{this.slider.setStyle("left",this.backwardButton.getWidth()+"px");this.slider.setStyle("width",Math.max(this.getClientWidth()-this.backwardButton.getWidth()-this.forwardButton.getWidth(),0)+"px");var A=(this.target.getElement().scrollWidth>0)?this.slider.getClientWidth()*this.target.getClientWidth()/this.target.getElement().scrollWidth:0;this.slider.indicator.setStyle("width",Math.max(A,8)+"px");var C=this.target.getElement().scrollLeft/(this.target.getElement().scrollWidth-this.target.getWidth())*100}this.setPosition(isNaN(C)?0:C)}};this.updateTarget=function(A){if((this.target&&(this.target.constructor===Window||defined(this.target.constructor.isSubclassOf)&&this.target.constructor.isSubclassOf(Window)))){if(this.isVertical()){this.target.getElement().scrollTop=(this.target.getElement().scrollHeight-this.target.getHeight())*A/100}else{this.target.getElement().scrollLeft=(this.target.getElement().scrollWidth-this.target.getWidth())*A/100}}};this.doScroll=callback(this,function(){if(0!=this.step){this.setPosition(this.getPosition()+this.step);window.setTimeout(this.doScroll,50)}});this.onSliderPositionChanged=callback(this,function(A,B){this.updateTarget(this.isVertical()?100-B:B)});this.onBackwardMouseDown=callback(this,function(){this.attachGlobalEvent("mouseup");this.backwardButton.setState(ImageButton.STATE_PRESSED);this.setPosition(this.getPosition()+(this.step=-3));window.setTimeout(this.doScroll,600)});this.onForwardMouseDown=callback(this,function(){this.attachGlobalEvent("mouseup");this.forwardButton.setState(ImageButton.STATE_PRESSED);this.setPosition(this.getPosition()+(this.step=3));window.setTimeout(this.doScroll,600)});this.onResize=callback(this,function(){this.updateLayout()});this.onmouseup=callback(this,function(){this.detachGlobalEvent("mouseup");this.step=0})};core.ui.ScrollBar.HORISONTAL=1;core.ui.ScrollBar.VERTICAL=2}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"SplitWindow");with(core.ui){core.ui.SplitWindow.superClass=core.ui.CompositeWindow;core.ui.SplitWindow.constructor=function(){this.panes={};this.splitLeft;this.splitRight;this.splitTop;this.splitBottom;this.SplitWindow=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.updateLayout()};this.addPane=function(A,B){A.setStyle("position","absolute");A.setStyle("float","none");this.adjustPane(A,B);this.panes[A.getId()]=B};this.adjustPane=function(B,D){var A=this.splitLeft;var C=this.splitTop;if(defined(D)){if(D&SplitWindow.SPLIT_LEFT){this.splitLeft+=B.getWidth()}if(D&SplitWindow.SPLIT_TOP){this.splitTop+=B.getHeight()}if(D&SplitWindow.SPLIT_RIGHT){this.splitRight-=B.getWidth();A=this.splitRight}if(D&SplitWindow.SPLIT_BOTTOM){this.splitBottom-=B.getHeight();C=this.splitBottom}if(D&SplitWindow.SPLIT_FILL){B.resize(Math.abs(this.splitRight-this.splitLeft),Math.abs(this.splitBottom-this.splitTop))}}B.move(A,C)};this.updateLayout=function(){this.splitLeft=0;this.splitTop=0;this.splitRight=this.getClientWidth();this.splitBottom=this.getClientHeight();for(var C in this.panes){var B=Window.forId(C);var A=this.panes[C];this.adjustPane(B,A)}}};core.ui.SplitWindow.SPLIT_LEFT=1;core.ui.SplitWindow.SPLIT_RIGHT=4;core.ui.SplitWindow.SPLIT_TOP=8;core.ui.SplitWindow.SPLIT_BOTTOM=16;core.ui.SplitWindow.SPLIT_FILL=64}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"ScrollWindow");with(core.ui){core.ui.ScrollWindow.superClass=core.ui.SplitWindow;core.ui.ScrollWindow.constructor=function(){this.vscroll;this.hscroll;this.content;this.ScrollWindow=function(parent,x,y,width,height){arguments.callee.prototype.apply(this,[parent,x,y,width,height]);this.vscroll=this.createScrollBar(0,0,undefined,"100%");this.hscroll=this.createScrollBar(0,0,"100%",undefined);this.hscroll.setOrientation(ScrollBar.HORISONTAL);this.addPane(this.hscroll,SplitWindow.SPLIT_BOTTOM);this.addPane(this.vscroll,SplitWindow.SPLIT_RIGHT);this.updateLayout()};this.createScrollBar=function(x,y,width,height){return new ScrollBar(this,x,y,width,height)};this.setText=function(text){if((this.content&&(this.content.constructor===Window||defined(this.content.constructor.isSubclassOf)&&this.content.constructor.isSubclassOf(Window)))){this.content.setText(text);this.updateLayout()}};this.getText=function(){return((this.content&&(this.content.constructor===Window||defined(this.content.constructor.isSubclassOf)&&this.content.constructor.isSubclassOf(Window))))?this.content.getText():""};this.ensureVisible=function(child){if(((this.content&&(this.content.constructor===Window||defined(this.content.constructor.isSubclassOf)&&this.content.constructor.isSubclassOf(Window))))&&((child&&(child.constructor===Window||defined(child.constructor.isSubclassOf)&&child.constructor.isSubclassOf(Window))))&&child.isChildOf(this.content)){with(this.content.getElement()){scrollLeft=child.getX();scrollTop=child.getY()}this.vscroll.updateLayout();this.hscroll.updateLayout()}};this.setContentWindow=function(wnd){wnd.setStyle("overflow","hidden");this.addPane(wnd,SplitWindow.SPLIT_FILL);this.vscroll.setScrollTarget(wnd);this.hscroll.setScrollTarget(wnd);this.content=wnd};this.getContentWindow=function(){return this.content};this.getVerticalScroll=function(){return this.vscroll};this.getHorisontalScroll=function(){return this.hscroll};this.updateLayout=override(this.updateLayout,function(){if((this.content&&(this.content.constructor===Window||defined(this.content.constructor.isSubclassOf)&&this.content.constructor.isSubclassOf(Window)))){var w,h;with(this.content.getElement()){this.vscroll.setStyle("display",(scrollHeight>offsetHeight)?"block":"none");this.hscroll.setStyle("display",(scrollWidth>offsetWidth)?"block":"none");h=(scrollWidth>offsetWidth)?(this.getClientHeight()-this.hscroll.getHeight()):this.getClientHeight();w=(scrollHeight>offsetHeight)?(this.getClientWidth()-this.vscroll.getWidth()):this.getClientWidth()}this.hscroll.setStyle("width",Math.max(w,0)+"px");this.vscroll.setStyle("height",Math.max(h,0)+"px");this.hscroll.updateLayout();this.vscroll.updateLayout()}arguments.callee.prototype.apply(this,[])});this.reset=function(){this.vscroll.setPosition(0);this.hscroll.setPosition(0);this.updateLayout()}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"ComboBoxMenu");with(core.ui){core.ui.ComboBoxMenu.superClass=core.ui.Menu;core.ui.ComboBoxMenu.constructor=function(){this.selectedItem;this.notifyItemSelected=new Notification();this.ComboBoxMenu=function(){arguments.callee.prototype.apply(this,[]);this.setStyle("overflow-y","auto");this.setStyle("display","none")};this.addItem=override(this.addItem,function(D,C,A){var B=new MenuItem(this);B.setStyleName("ComboBoxMenuItem");B.setStyle("overflow","hidden");B.setText(D);B.value=C;B.onmouseover=this.onItemMouseOver;B.onmouseout=this.onItemMouseOut;B.onclick=this.onItemClick;if(A){this.selectedItem=B}return arguments.callee.prototype.apply(this,[B])});this.removeItems=override(this.removeItems,function(){this.selectedItem=undefined;arguments.callee.prototype.apply(this,[])});this.setSelectedItem=function(A){if((this.selectedItem&&(this.selectedItem.constructor===Window||defined(this.selectedItem.constructor.isSubclassOf)&&this.selectedItem.constructor.isSubclassOf(Window)))){this.selectedItem.removeStyleName("ComboBoxMenuItem-selected")}A.addStyleName("ComboBoxMenuItem-selected");this.selectedItem=A};this.getSelectedItem=function(){return this.selectedItem};this.doPopup=override(this.doPopup,function(B,A,C){if((this.selectedItem&&(this.selectedItem.constructor===Window||defined(this.selectedItem.constructor.isSubclassOf)&&this.selectedItem.constructor.isSubclassOf(Window)))){this.selectedItem.addStyleName("ComboBoxMenuItem-selected")}this.setStyle("display","");arguments.callee.prototype.apply(this,[B,A,C])});this.endPopup=override(this.endPopup,function(){arguments.callee.prototype.apply(this,[]);this.setStyle("display","none")});this.onItemMouseOver=callback(this,function(B,A){if((this.selectedItem&&(this.selectedItem.constructor===Window||defined(this.selectedItem.constructor.isSubclassOf)&&this.selectedItem.constructor.isSubclassOf(Window)))){this.selectedItem.removeStyleName("ComboBoxMenuItem-selected")}A.addStyleName("ComboBoxMenuItem-highlight")});this.onItemMouseOut=callback(this,function(B,A){A.removeStyleName("ComboBoxMenuItem-highlight")});this.onItemClick=callback(this,function(B,A){this.setSelectedItem(A);this.notifyItemSelected.send(this,A)})}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"ComboBox");with(core.ui){core.ui.ComboBox.superClass=core.ui.CompositeWindow;core.ui.ComboBox.constructor=function(){this.menu;this.text;this.dropDownButton;this.value;this.notifyValueChanged=new Notification();this.ComboBox=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.text=new Edit(this,0,0);this.text.setStyle("float","left");this.text.onkeypress=this.onTextKeyPress;this.dropDownButton=new ImageButton(this);this.dropDownButton.setStyleName("DropDownButton");this.dropDownButton.setState(ImageButton.STATE_NORMAL);this.dropDownButton.setStyle("float","right");this.dropDownButton.oncommand=this.onDropDownButtonClick;this.menu=this.createMenu();this.menu.notifyItemSelected.addListener(this.onMenuItemSelected);this.menu.notifyEndPopup.addListener(this.onMenuEndPopup);this.setEditable(false);this.updateLayout()};this.addItem=function(D,C,A){var B=this.menu.addItem(D,C);if(A){this.setText(D)}return B};this.insertItem=function(A,C,B){};this.removeItem=function(A){this.menu.removeItem(A)};this.removeItems=function(){this.menu.removeItems()};this.setText=function(A){this.text.setText(A)};this.getText=function(){return this.text.getText()};this.setValue=function(C){if(this.value==C){return }this.value=C;for(var A=0;A<this.menu.getItemCount();A++){var B=this.menu.getItem(A);if(C==B.value){this.menu.setSelectedItem(B);this.setText(B.getText());this.scrollTo(A)}}};this.getValue=function(){return this.value};this.getMenu=function(){return this.menu};this.getDropDownButton=function(){return this.dropDownButton};this.getEditControl=function(){return this.text};this.setEditable=function(A){this.text.setReadOnly(!A);this.text.setStyle("cursor",(A)?"text":"default");this.text.onclick=(A)?null:this.onDropDownButtonClick;this.text.onkeypress=(A)?this.onTextKeyPress:null;if(A){core.ui.quirks.TextSelection.allowSelection(this.text.getElement())}else{core.ui.quirks.TextSelection.preventSelection(this.text.getElement())}};this.isEditable=function(){return !this.text.isReadOnly()};this.scrollTo=function(A){this.menu.ensureVisible(A)};this.close=override(this.close,function(){this.menu.close();arguments.callee.prototype.apply(this,[])});this.expand=function(){this.addStyleName(this.getStyleName()+"-expanded");this.text.setSelected(true);this.menu.doPopup(this.isEditable()?this.dropDownButton:this,this.getAbsX(),this.getAbsY()+this.getHeight())};this.collapse=function(){this.menu.endPopup()};this.createMenu=function(){return new ComboBoxMenu()};this.updateLayout=function(){this.text.setStyle("width",(this.getClientWidth()-this.dropDownButton.getWidth())+"px");this.menu.setStyle("width",this.getWidth()+"px")};this.onDropDownButtonClick=callback(this,function(A){if(this.menu.isPopup()){this.collapse()}else{this.expand()}});this.onMenuEndPopup=callback(this,function(){this.removeStyleName(this.getStyleName()+"-expanded")});this.onMenuItemSelected=callback(this,function(A,B){this.menu.endPopup();this.setText(B.getText());this.setValue(B.value);this.text.setSelected(false);this.notifyValueChanged.send(this,B.value)});this.onTextKeyPress=callback(this,function(A){if(Event.KEY_ENTER==A.keyCode){this.value=this.text.getText();this.notifyValueChanged.send(this,this.value)}})}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Calendar");with(core.ui){core.ui.Calendar.superClass=core.ui.Menu;core.ui.Calendar.constructor=function(){this.format=Calendar.FORMAT_DEFAULT;this.startYear;this.endYear;this.day;this.month;this.year;this.monthList;this.yearList;this.notifyDateSelected=new Notification();this.Calendar=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.year=Calendar.currentYear;this.month=Calendar.currentMonth;this.day=Calendar.currentDay;this.startYear=Calendar.currentYear-5;this.endYear=Calendar.currentYear+5;this.createMonthList();this.createYearList();this.createGrid();this.updateData()};this.setDate=function(B,C,A){if(B){this.year=B}if(C){this.month=C}if(A){this.day=A}this.updateData()};this.setYear=function(A){this.year=A;this.updateData()};this.getYear=function(){return this.year};this.setMonth=function(A){this.month=A;this.updateData()};this.getMonth=function(){return this.month};this.setDay=function(A){this.day=A;this.updateData()};this.getDay=function(){return this.day};this.setYears=function(B,A){if(B){this.startYear=B}if(A){this.endYear=A}this.initYearList()};this.getStartYear=function(){return this.startYear};this.getEndYear=function(){return this.endYear};this.setFormat=function(A){this.format=A};this.getFormat=function(){return this.format};this.setFormattedDate=function(A,H){if(!defined(H)){H=this.format}if(Calendar.FORMAT_TIMESTAMP==H){var E=parseInt(A);if(isNaN(E)){throw new Error("Invalid `date` parameter ("+A+") (should be a timestamp)")}var D=new Date();D.setTime(E*1000);this.year=D.getFullYear();this.month=D.getMonth();this.day=D.getDay()}else{var G={"MM":"month","DD":"day","YYYY":"year"};for(var C in G){var B=H.indexOf(C);if(-1!=B){value=parseInt(A.substr(B,C.length).replace(/^0/,""));if(isNaN(value)){throw new Error("Invalid `date` parameter ("+A+")")}var F=G[C];if("year"==F){this.year=(value>100)?value:(2000+value)}else{this[F]=value}}}}this.updateData()};this.getFormattedDate=function(H){if(!defined(H)){H=this.format}if(Calendar.FORMAT_TIMESTAMP==H){return this.getTimestamp()}var E=this.year.toString();var G=(this.month<10)?"0"+this.month:this.month.toString();var B=(this.day<10)?"0"+this.day:this.day.toString();var C={"MM":G,"DD":B,"YYYY":E};for(var A in C){var D=new RegExp(A);var F=C[A];H=H.replace(D,F)}return H};this.getTimestamp=function(A){return(defined(A))?new Date(Date.UTC(this.year,this.month-1,this.day,-A)).getTime()/1000:new Date(Date.UTC(this.year,this.month-1,this.day)).getTime()/1000};this.getYearList=function(){return this.yearList};this.getMonthList=function(){return this.monthList};this.updateData=function(){var F=((this.year%4==0)&&(this.year%100!=0))||(this.year%400==0);var A=[31,F?29:28,31,30,31,30,31,31,30,31,30,31];var D=new Date(this.year,this.month-1).getDay();if(this.year<this.startYear){this.year=this.startYear}else{if(this.year>this.endYear){this.year=this.endYear}}var E,C;if(this.month>1){E=this.month-1;C=this.year}else{E=12;C=this.year-1}var H,I;if(this.month<12){H=this.month+1;I=this.year}else{H=1;I=this.year+1}for(var G=0,B=A[E-1]-D+1;G<D;G++){this.items[G].month=E;this.items[G].year=C;this.items[G].day=B+G}for(var G=D;G<A[this.month-1]+D;G++){this.items[G].year=this.year;this.items[G].month=this.month;this.items[G].day=G-D+1}for(var G=A[this.month-1]+D;G<42;G++){this.items[G].year=I;this.items[G].month=H;this.items[G].day=G-(A[this.month-1]+D)+1}this.updateControls()};this.updateControls=function(){this.yearList.setValue(this.year);this.monthList.setValue(this.month);for(var A=0;A<this.items.length;A++){var B=this.items[A];B.clearStyleName();if((B.year==this.year)&&(B.month==this.month)&&(B.day==this.day)){B.addStyleName("CalendarMenuItem-selected")}if((B.year==Calendar.currentYear)&&(B.month==Calendar.currentMonth)&&(B.day==Calendar.currentDay)){B.addStyleName("CalendarMenuItem-today")}if((B.year!=this.year)||(B.month!=this.month)){B.addStyleName("CalendarMenuItem-grayed")}if(A%7==0||A%7==6){B.addStyleName("CalendarMenuItem-holiday")}B.setText(B.day)}};this.createMonthList=function(){this.monthList=new ComboBox(this);this.monthList.addStyleName("CalendarMonthList");this.monthList.setStyle("float","left");this.monthList.notifyValueChanged.addListener(this.onMonthValueChanged);var A=["January","February","March","April","May","June","July","August","September","October","November","December"];for(var B=0;B<A.length;B++){this.monthList.addItem(A[B],B+1,(B==this.month-1))}};this.createYearList=function(){this.yearList=new ComboBox(this);this.yearList.addStyleName("CalendarYearList");this.yearList.setStyle("float","right");this.yearList.notifyValueChanged.addListener(this.onYearValueChanged);this.initYearList()};this.initYearList=function(){this.yearList.removeItems();for(var A=this.startYear;A<=this.endYear;A++){this.yearList.addItem(A.toString(),A,(A==this.year))}};this.createGrid=function(){var C=["Su","Mo","Tu","W","Th","Fr","Sa"];for(var A=0;A<C.length;A++){var B=new MenuItem(this);B.setStyleName("CalendarHeaderItem");B.setStyle("float","left");B.setText(C[A])}for(var A=0;A<42;A++){var B=new MenuItem(this);B.setStyleName("CalendarMenuItem");B.setStyle("float","left");B.onclick=this.onItemClick;B.onmouseover=this.onItemMouseOver;B.onmouseout=this.onItemMouseOut;this.addItem(B)}};this.onMonthValueChanged=callback(this,function(A,B){this.day=-1;this.month=B;this.updateData()});this.onYearValueChanged=callback(this,function(A,B){this.day=-1;this.year=B;this.updateData()});this.onItemClick=callback(this,function(B,A){this.day=A.day;if((this.month!=A.month)||(this.year!=A.year)){this.month=A.month;this.year=A.year;this.updateData()}else{this.updateControls()}this.notifyDateSelected.send(this,this.getFormattedDate())});this.onItemMouseOver=callback(this,function(B,A){A.addStyleName("CalendarMenuItem-highlight")});this.onItemMouseOut=callback(this,function(B,A){A.removeStyleName("CalendarMenuItem-highlight")})};core.ui.Calendar.currentYear=new Date().getFullYear();core.ui.Calendar.currentMonth=new Date().getMonth()+1;core.ui.Calendar.currentDay=new Date().getDate();core.ui.Calendar.FORMAT_TIMESTAMP="TIMESTAMP";core.ui.Calendar.FORMAT_DEFAULT="MM/DD/YYYY"}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Container");with(core.ui){core.ui.Container.superClass=core.ui.Window;core.ui.Container.constructor=function(){this.Container=function(A){arguments.callee.prototype.apply(this,[null,undefined,undefined,undefined,undefined,A])}}}ClassFactory.createPackage("core.url");ClassFactory.createClass(core.url,"Encoder");with(core.url){core.url.Encoder.constructor=function(){};core.url.encode=core.url.Encoder.encode=function(A){if(!defined(A)){return""}A=encodeURI(A);A=A.replace(/\+/g,"%2B");A=A.replace(/\#/g,"%23");A=A.replace(/\?/g,"%3F");A=A.replace(/&amp;/g,"%26");return A}}ClassFactory.createPackage("core.url");ClassFactory.createClass(core.url,"Parser");with(core.url){core.url.Parser.constructor=function(){};core.url.parse=core.url.Parser.parse=function(C){var E={scheme:"http",host:"",port:"",user:"",password:"",path:"/",query:"",fragment:""};var D=C.indexOf("://");if(D!=-1){E.scheme=C.slice(0,D);C=C.slice(D+3)}D=C.indexOf("/");if(D!=-1){var B=C.slice(0,D);C=C.slice(D);D=B.indexOf("@");if(D!=-1){var A=B.slice(0,D).split(":");E.user=A[0];E.password=(A[1])?A[1]:"";B=B.slice(D+1)}D=B.indexOf(":");if(D!=-1){E.port=parseInt(B.slice(D+1));B=B.slice(0,D)}E.host=B}D=C.indexOf("#");if(D!=-1){E.fragment=C.slice(D+1);C=C.slice(0,D)}D=C.indexOf("?");if(D!=-1){E.query=C.slice(D+1);C=C.slice(0,D)}E.path=C;return E}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"FileUpload");with(core.ui){core.ui.FileUpload.superClass=core.ui.ImageButton;core.ui.FileUpload.constructor=function(){this.path="";this.url="";this.form;this.text;this.input;this.iframe;this.notifyFileSelected=new Notification();this.notifyFileUploaded=new Notification();this.notifyUploadError=new Notification();this.upload=function(params){var arr=[];for(var name in params){arr.push(core.url.encode(name)+"="+core.url.encode(params[name]))}this.form.action=this.url;if(arr.length>0){this.form.action+=("?"+arr.join("&"))}this.form.submit()};this.clear=function(){this.form.reset()};this.isFileSelected=function(){return(this.path.length>0)};this.getFilePath=function(){return this.path};this.setUploadUrl=function(url){this.url=url};this.getUploadUrl=function(){return this.url};this.setText=function(text){this.text.innerHTML=text};this.getText=function(){return this.text.innerHTML};this.close=override(this.close,function(){this.getElement().removeChild(this.iframe);this.form.removeChild(this.input);this.getElement().removeChild(this.form);delete this.iframe;delete this.input;delete this.form;arguments.callee.prototype.apply(this,[])});this.setFocus=function(){};this.createElement=override(this.createElement,function(){var root=arguments.callee.prototype.apply(this,[]);this.text=document.createElement("div");this.text.style.position="absolute";this.text.style.left=this.text.style.top="0px";this.text.style.width=this.text.style.height="100%";this.text.style.zIndex=0;root.appendChild(this.text);var id=this.getId()+"_iframe";this.iframe=document.createElement("iframe");this.iframe.setAttribute("id",id);this.iframe.setAttribute("name",id);this.iframe.style.display="none";this.iframe.style.width=this.iframe.style.height="0px";this.iframe.style.margin=this.iframe.style.padding="0px";root.appendChild(this.iframe);Event.addListener(this.iframe,"load",this.onIframeLoad);this.form=document.createElement("form");this.form.target=this.iframe.name;this.form.method="POST";this.form.enctype=this.form.encoding="multipart/form-data";this.form.style.margin=this.form.style.padding="0px";root.appendChild(this.form);this.input=document.createElement("input");this.input.name=this.input.type="file";this.input.style.position="absolute";this.input.style.zIndex=1;this.input.style.opacity=0;this.input.style.MozOpacity=0;this.input.style.KhtmlOpacity=0;this.input.style.filter="progid:DXImageTransform.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<this.collection.length)};this.next=function(){if(!this.hasNext()){throw new Error("The iteration has no more elements")}else{return this.collection[this.index++]}};this.current=function(){return this.collection[this.index]}}}ClassFactory.createPackage("core.util");ClassFactory.createClass(core.util,"OrderedSet");with(core.util){core.util.OrderedSet.constructor=function(){this.elements=[];this.add=function(A){if(!this.contains(A)){this.elements.push(A)}};this.remove=function(A){var B=this.indexOf(A);if(B>=0){delete this.elements[B];this.elements.splice(B,1)}};this.clear=function(){while(this.elements.length>0){this.elements.pop()}};this.contains=function(A){return(-1!=this.indexOf(A))};this.indexOf=function(A){for(var B=0;B<this.elements.length;B++){if(this.elements[B]&&(A===this.elements[B])){return B}}return -1};this.size=function(){return this.elements.length};this.iterator=function(){return new Iterator(this.elements)};this.toArray=function(){return this.elements}}}ClassFactory.createPackage("core.util");ClassFactory.createClass(core.util,"Listeners");with(core.util){core.util.Listeners.superClass=core.util.OrderedSet;core.util.Listeners.constructor=function(){this.call=function(D,A){var B=this.iterator();while(B.hasNext()){var C=B.next();if("function"==typeof C[D]){C[D].apply(C,A)}}}}}ClassFactory.createPackage("common.util");ClassFactory.createClass(common.util,"DateUtils");with(common.util){common.util.DateUtils.constructor=function(){};common.util.DateUtils.formatInt=function(A){return(A>=0&&A<10?"0":"")+A};common.util.DateUtils.dateToInt=function(A){return(A.indexOf("0")==0)?parseInt(A.substr(A.indexOf("0")+1)):parseInt(A)};common.util.DateUtils.getMonth=function(A){if(!A){return false}var B=A.indexOf("/",0);var C=this.dateToInt(A.substring(0,B));if(B<0){B=A.indexOf("-",0);j=A.indexOf("-",B+1);C=this.dateToInt(A.substring(B+1,j))}return C};common.util.DateUtils.getYear=function(B){if(!B){return false}var C=B.indexOf("/",0);var A=B.indexOf("/",C+1);var D=this.dateToInt(B.substring(A+1));if(C<0){C=B.indexOf("-",0);A=B.indexOf("-",C+1);D=this.dateToInt(B.substring(0,C))}return D};common.util.DateUtils.getDay=function(C){if(!C){return false}var D=C.indexOf("/",0);var B=C.indexOf("/",D+1);var A=this.dateToInt(C.substring(D+1,B));if(D<0){D=C.indexOf("-",0);B=C.indexOf("-",D+1);A=this.dateToInt(C.substring(B+1))}return A};common.util.DateUtils.toServerDate=function(C,E){if(!C){return false}date=new Date(C);var B=this.formatInt(date.getDate());var G=this.formatInt(date.getMonth()+1);var D=date.getFullYear();var A=this.formatInt(date.getHours());var H=this.formatInt(date.getMinutes());var F="";E=defined(E)?E:false;if(E){F=D+"-"+G+"-"+B+" "+A+":"+min}else{F=D+"-"+G+"-"+B}return F};common.util.DateUtils.toClientDate=function(C,F){if(!C){return false}date=new Date(C);var B=this.formatInt(date.getDate());var G=this.formatInt(date.getMonth()+1);var E=date.getFullYear();var A=this.formatInt(date.getHours());var H=this.formatInt(date.getMinutes());var D="";F=defined(F)?F:false;if(F){D=G+"/"+B+"/"+E+" "+A+":"+H}else{D=G+"/"+B+"/"+E}return D};common.util.DateUtils.toMilliseconds=function(B){if(!B){return false}var C=new Date(this.getYear(B),this.getMonth(B)-1,this.getDay(B));var A=Date.parse(C.toString());return A};common.util.DateUtils.server2client=function(B){var A=this.toMilliseconds(B);return this.toClientDate(A)};common.util.DateUtils.client2server=function(B){var A=this.toMilliseconds(B);return this.toServerDate(A)};common.util.DateUtils.timestamp2millisec=function(A){if(!A){return null}return A*1000};common.util.DateUtils.getSeconds=function(A){return this.formatInt((A%60).toFixed())};common.util.DateUtils.getMinutes=function(A){return this.formatInt(parseInt(A/60))};common.util.DateUtils.exist=function(A){if(this.getMonth(A)>12){return false}else{if(this.getDay(A)>31){return false}else{if(this.toClientDate(this.toMilliseconds(A))!=A){return false}}}return true}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"Grid");with(editor.ui){editor.ui.Grid.superClass=core.ui.Window;editor.ui.Grid.constructor=function(){this.Grid=function(){arguments.callee.prototype.apply(this,[null,0,0,"100%","100%"]);this.setStyle("z-index",0);core.ui.Window.notifyResize.addListener(this.onUpdateLayout);core.ui.Window.notifyScroll.addListener(this.onUpdateLayout)};this.close=override(this.close,function(){core.ui.Window.notifyResize.removeListener(this.onUpdateLayout);core.ui.Window.notifyScroll.removeListener(this.onUpdateLayout);arguments.callee.prototype.apply(this,[])});this.onUpdateLayout=callback(this,function(){this.resize(core.ui.Window.getWidth(),core.ui.Window.getHeight())})};editor.ui.Grid.SIZE=10}ClassFactory.createPackage("core.util");ClassFactory.createClass(core.util,"ArrayList");with(core.util){core.util.ArrayList.constructor=function(){this.ArrayList=function(A){this.elements=A||[]};this.add=function(A){this.elements.push(A)};this.indexOf=function(A){for(var B=0;B<this.elements.length;B++){if(A===this.elements[B]){return B}}return -1};this.get=function(A){return this.elements[A]};this.size=function(){return this.elements.length};this.clear=function(){delete this.elements;this.elements=[]};this.iterator=function(){return new Iterator(this.elements)};this.toArray=function(){return this.elements}}}ClassFactory.createPackage("core.util");ClassFactory.createClass(core.util,"HashMap");with(core.util){core.util.HashMap.constructor=function(){this.HashMap=function(A){this.elements=A||{};this.elementCount=0};this.set=function(A,B){if(!this.hasKey(A)){this.elementCount++}this.elements[A]=B};this.get=function(A){return this.elements[A]};this.remove=function(A){if(this.hasKey(A)){delete this.elements[A];this.elementCount--}};this.hasKey=function(A){return defined(this.elements[A])};this.clear=function(){delete this.elements;this.elements={}};this.size=function(){return this.elementCount};this.getKeys=function(){var B=new OrderedSet();for(var A in this.elements){B.add(A)}return B};this.getValues=function(){var B=new ArrayList();for(var A in this.elements){B.add(this.elements[A])}return B};this.toObject=function(){return this.elements}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"AbstractSelection");with(editor.ui){editor.ui.AbstractSelection.superClass=core.ui.FocusWindow;editor.ui.AbstractSelection.constructor=function(){this.target;this.listeners=new core.util.Listeners();this.AbstractSelection=function(A){arguments.callee.prototype.apply(this,[]);this.target=A};this.setTarget=function(A){this.target=A};this.getTarget=function(){return this.target};this.addSelectionListener=function(A){this.listeners.add(A)};this.removeSelectionListener=function(A){this.listeners.remove(A)};this.select=function(){this.show();this.fireSelected()};this.unselect=function(){this.hide();this.fireUnselected()};this.isSelected=function(){return this.isVisible()};this.updateLayout=function(){};this.fireSelected=function(){this.listeners.call("onElementSelected",[this])};this.fireUnselected=function(){this.listeners.call("onElementUnselected",[this])}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"SelectionManager");with(editor.ui){editor.ui.SelectionManager.constructor=function(){this.selections=new core.util.HashMap();this.listeners=new core.util.Listeners();this.SelectionManager=function(){editor.Application.getInstance().addAppListener(this)};this.addSelectionListener=function(A){this.listeners.add(A)};this.removeSelectionListener=function(A){this.listeners.remove(A)};this.isSelected=function(A){return this.selections.hasKey(A.getId())};this.hasSelection=function(){return(this.selections.size()>0)};this.setSelection=function(A){this.clearSelection();return this.addSelection(A)};this.addSelection=function(B){if(!this.isSelected(B)){this.selections.set(B.getId(),B.createSelection());this.fireSelectionChange(B)}var A=this.selections.get(B.getId());A.select();return A};this.removeSelection=function(B){if(this.isSelected(B)){var A=this.getSelection(B);this.selections.remove(B.getId());if(A.isSelected()){A.unselect();this.fireSelectionChange(B)}}};this.getSelection=function(A){return this.selections.get(A.getId())};this.updateSelection=function(){for(var A=this.selections.getValues().iterator();A.hasNext();A.next()){A.current().select()}};this.clearSelection=function(D){if(D){this.elements=this.getSelectedElements()}for(var C=this.selections.getValues().iterator();C.hasNext();C.next()){var A=C.current();if(A.isSelected()){var B=A.getTarget();A.unselect();this.selections.remove(B.getId());this.fireSelectionChange(B)}}};this.restoreSelection=function(){if((this.elements&&(this.elements.constructor===core.util.ArrayList||defined(this.elements.constructor.isSubclassOf)&&this.elements.constructor.isSubclassOf(core.util.ArrayList)))){for(var A=this.elements.iterator();A.hasNext();A.next()){this.addSelection(A.current())}delete this.elements}};this.getSelectedElements=function(){var A=[];for(var B=this.selections.getValues().iterator();B.hasNext();B.next()){A.push(B.current().getTarget())}return new core.util.ArrayList(A)};this.handleMove=function(C,A,D){for(var E=this.selections.getValues().iterator();E.hasNext();E.next()){var B=E.current();if(B!==D){B.move(B.getX()+C,B.getY()+A)}}};this.fireSelectionChange=function(A){this.listeners.call("onElementSelectionChange",[this,A])};this.onAppClear=function(){this.clearSelection()};this.onAppModeChanged=function(B){for(var A=this.selections.getValues().iterator();A.hasNext();A.next()){A.current().setVisible(B.getMode()===editor.Application.MODE_EDIT)}}};editor.ui.SelectionManager.get=function(){if(!defined(this.instance)){this.instance=new SelectionManager()}return this.instance}}ClassFactory.createPackage("editor.commands");ClassFactory.createClass(editor.commands,"CommandHistory");with(editor.commands){editor.commands.CommandHistory.constructor=function(){this.commands=new core.util.ArrayList();this.listeners=new core.util.Listeners();this.CommandHistory=function(){this.commandIndex=-1;editor.Application.getInstance().addAppListener(this)};this.addHistoryListener=function(A){this.listeners.add(A)};this.removeHistoryListener=function(A){this.listeners.remove(A)};this.execute=function(A){this.commands.toArray().splice(this.commandIndex+1);A.execute();this.commands.add(A);if(++this.commandIndex>CommandHistory.MAX_SIZE-1){this.commands.toArray().shift()}this.fireChanged()};this.getUndoCommands=function(){return new core.util.ArrayList(this.commands.toArray().slice(0,this.commandIndex+1))};this.getRedoCommands=function(){return new core.util.ArrayList(this.commands.toArray().slice(this.commandIndex+1))};this.canUndo=function(){return(this.commandIndex>=0)};this.canRedo=function(){return(this.commandIndex<(this.commands.size()-1))};this.undo=function(){if(this.canUndo()){this.commands.get(this.commandIndex--).unexecute();this.fireChanged()}};this.redo=function(){if(this.canRedo()){this.commands.get(++this.commandIndex).execute();this.fireChanged()}};this.fireChanged=function(){this.listeners.call("onHistoryChanged",[this])};this.onAppClear=function(){this.commandIndex=-1;this.commands.clear();this.fireChanged()}};editor.commands.CommandHistory.get=function(){if(!defined(this.instance)){this.instance=new CommandHistory()}return this.instance};editor.commands.CommandHistory.MAX_SIZE=10}ClassFactory.createPackage("editor.commands");ClassFactory.createClass(editor.commands,"AbstractCommand");with(editor.commands){editor.commands.AbstractCommand.constructor=function(){this.AbstractCommand=function(B,A){this.target=B;this.name=A};this.setTarget=function(A){this.target=A};this.getTarget=function(){return this.target};this.getName=function(){return this.name};this.setName=function(A){this.name=A};this.execute=function(){};this.unexecute=function(){}}}ClassFactory.createPackage("editor.commands");ClassFactory.createClass(editor.commands,"RemoveObjectsGroupCommand");with(editor.commands){editor.commands.RemoveObjectsGroupCommand.superClass=editor.commands.AbstractCommand;editor.commands.RemoveObjectsGroupCommand.constructor=function(){}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"MultipleSelection");with(editor.ui){editor.ui.MultipleSelection.superClass=core.ui.Window;editor.ui.MultipleSelection.constructor=function(){this.startX;this.startY;this.ctrlPressed=false;this.selectionInProgress=false;this.keyEventsAttached=false;this.MultipleSelection=function(){arguments.callee.prototype.apply(this,[]);this.setStyle("position","absolute");this.setStyle("z-index",1024);this.resize(0,0);this.hide()};this.elementsIntersected=function(r1,r2){var left1=r1.getX();var left2=r2.getX();var min=left1>left2?left1:left2;var right1=r1.getX()+r1.getWidth();var right2=r2.getX()+r2.getWidth();var max=right1<right2?right1:right2;if(min>max){return false}var top1=r1.getY();var top2=r2.getY();min=top1>top2?top1:top2;var bottom1=r1.getY()+r1.getHeight();var bottom2=r2.getY()+r2.getHeight();max=bottom1<bottom2?bottom1:bottom2;return min<=max};this.deleteSelection=function(){with(editor.commands){CommandHistory.get().execute(new RemoveObjectsGroupCommand())}};this.collectSelectedObjects=function(){if((this.getWidth()>0)&&(this.getHeight()>0)){var i=editor.Application.getInstance().getCollection().iterator();while(i.hasNext()){var element=i.next();if(this.elementsIntersected(this,element)&&(element.getStyle("z-index")>0)){editor.ui.SelectionManager.get().addSelection(element).setFocus(true)}}}};this.onWorkspaceMouseMove=function(subject,event){if(!this.selectionInProgress){return }if(!this.isVisible()){this.show()}var x=event.getX();var y=event.getY();var width=this.startX-x;var height=this.startY-y;if(width>0){this.move(x,this.getY())}if(height>0){this.move(this.getX(),y)}this.resize(Math.abs(width),Math.abs(height))};this.onWorkspaceMouseUp=function(){this.hide();this.selectionInProgress=false;this.attachGlobalEvent("keydown");if(this.getWidth()>2||this.getHeight()>2){this.collectSelectedObjects()}this.resize(0,0)};this.onWorkspaceMouseDown=function(subject,event){this.selectionInProgress=true;this.detachGlobalEvent("keydown");this.startX=event.getX();this.startY=event.getY();this.move(this.startX,this.startY);this.show()};this.onkeydown=function(event){if(core.ui.Event.KEY_DELETE==event.keyCode){this.deleteSelection()}};this.close=override(this.close,function(){this.detachGlobalEvent("keydown");editor.Application.getInstance().getWorkspace().removeMouseListener(this);arguments.callee.prototype.apply(this,[])})}}ClassFactory.createPackage("editor");ClassFactory.createClass(editor,"Workspace");with(editor){editor.Workspace.constructor=function(){this.mouseListeners=new core.util.Listeners();this.addMouseListener=function(A){this.mouseListeners.add(A)};this.removeMouseListener=function(A){this.mouseListeners.remove(A)};this.init=function(){editor.Application.getInstance().addAppListener(this);this.grid=new editor.ui.Grid();this.selection=new editor.ui.MultipleSelection();this.map={"mouseup":"onWorkspaceMouseUp","mousedown":"onWorkspaceMouseDown","mousemove":"onWorkspaceMouseMove"};for(var A in this.map){core.ui.Event.addListener(document.documentElement,A,this.onDocumentMouseEvent)}};this.isGridVisible=function(){return this.grid.isVisible()};this.setGridVisible=function(A){this.grid.setVisible(A)};this.setTitle=function(A){window.document.title=A};this.getTitle=function(){return window.document.title};this.onAppModeChanged=function(A){if(editor.Application.MODE_PREVIEW===A.getMode()){editor.ui.VisibilityManager.hide(this.selection,this.grid)}else{editor.ui.VisibilityManager.restore(this.selection,this.grid)}};this.onDocumentMouseEvent=callback(this,function(A){A=core.ui.Event.improve(A);if("mousedown"==A.getType()){if((document.body!=A.target)&&(document.documentElement!=A.target)&&(this.grid.getElement()!=A.target)){return }}this.mouseListeners.call(this.map[A.getType()],[this,A])})}}ClassFactory.createPackage("editor");ClassFactory.createClass(editor,"SaveContext");with(editor){editor.SaveContext.superClass=core.util.HashMap;editor.SaveContext.constructor=function(){this.SaveContext=function(A){arguments.callee.prototype.apply(this,[]);this.url=A};this.setUrl=function(A){this.url=A};this.getUrl=function(){return this.url}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"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;B<C;B++){var A=new Window(this);A.getElement().style.styleFloat=A.getElement().style.cssFloat="left";A.setStyleName("ProgressBarItem");A.hide();this.items.push(A)}};this.getItemCount=function(){return this.items.length};this.next=function(){var A=(this.items.length>0)?((this.rangeMax-this.rangeMin)/this.items.length):1;this.setPos(this.pos+A)};this.setPos=function(C){var B=Math.ceil((this.items.length-1)*C/(this.rangeMax-this.rangeMin));if(B>=0&&B<this.items.length){for(var A=this.current;A>=B;A--){this.items[A].hide()}for(var A=this.current;A<=B;A++){this.items[A].show()}this.current=B}else{if(0==this.items.length){}}this.pos=C};this.getPos=function(){return this.pos}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"LoadingDialog");with(editor.ui){editor.ui.LoadingDialog.superClass=core.ui.Dialog;editor.ui.LoadingDialog.constructor=function(){this.progressBar;this.LoadingDialog=function(A){arguments.callee.prototype.apply(this,[A]);this.progressBar=new core.ui.ProgressBar(this);this.progressBar.setItemCount(20)}}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Image");with(core.ui){core.ui.Image.superClass=core.ui.Window;core.ui.Image.constructor=function(){this.source;this.Image=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.setStyle("display","block")};this.setSource=function(A){this.getElement().src=this.source=A};this.getSource=function(){return this.source};this.isLoaded=function(){return this.getElement().complete};this.createElement=function(){var A=document.createElement("img");A.ondragstart=new Function("return false");return A}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"MenuButton");with(editor.ui){editor.ui.MenuButton.superClass=core.ui.ImageButton;editor.ui.MenuButton.constructor=function(){this.icon;this.text;this.MenuButton=function(B,A,E,C,D){this.ImageButton(B,A,E,C,D);this.icon=new core.ui.Image(this);this.text=new core.ui.Static(this);this.icon.hide()};this.setText=function(A){this.text.setText(A)};this.getText=function(){return this.text.getText()};this.setIcon=function(A){this.icon.setSource(A);this.icon.show()}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"SplitButton");with(editor.ui){editor.ui.SplitButton.superClass=core.ui.SplitWindow;editor.ui.SplitButton.constructor=function(){this.leftButton;this.rightButton;this.popupMenu;this.defaultValue;this.imageList;this.state;this.notifyDefaultAction=new core.ui.Notification();this.notifyPopup=new core.ui.Notification();this.SplitButton=function(B,A,E,C,D){this.SplitWindow(B,A,E,C,D);this.leftButton=new editor.ui.MenuButton(this);this.leftButton.addStyleName("SplitButtonLeft");this.leftButton.oncommand=this.onLeftButtonClick;this.rightButton=new core.ui.ImageButton(this);this.rightButton.addStyleName("SplitButtonRight");this.rightButton.oncommand=this.onRightButtonClick;this.setState(core.ui.ImageButton.STATE_NORMAL);this.setImageList("images/SplitButton/splitbutton.gif");this.rightButton.onmousedown=this.leftButton.onmousedown=this.onButtonMouseDown;this.rightButton.onmouseout=this.leftButton.onmouseout=this.onButtonMouseOut;this.rightButton.onmouseover=this.leftButton.onmouseover=this.rightButton.onmouseup=this.leftButton.onmouseup=this.onButtonMouseOver;this.addPane(this.leftButton,core.ui.SplitWindow.SPLIT_LEFT);this.addPane(this.rightButton,core.ui.SplitWindow.SPLIT_RIGHT)};this.setImages=function(E,A,F,H,C,B,G,D){this.leftButton.setImages(E,F,C,G);this.rightButton.setImages(A,H,B,D)};this.setImageList=override(this.setImageList,function(A){if(!defined(this.imageList)){this.imageList=new window.Image()}this.imageList.src=A;this.leftButton.imageList=this.rightButton.imageList=this.imageList;this.leftButton.setImage(A);this.leftButton.setStyle("background-position",-(this.getWidth()*this.state)+"px top");this.rightButton.setImage(A);this.rightButton.setStyle("background-position",-(this.getWidth()*this.state+this.leftButton.getWidth())+"px top")});this.setEnabled=override(this.setEnabled,function(A){arguments.callee.prototype.apply(this,[A]);this.setState(A?core.ui.ImageButton.STATE_NORMAL:core.ui.ImageButton.STATE_DISABLED)});this.setState=function(A){this.getElement().setAttribute("state",A);if(defined(this.imageList)){this.leftButton.setStyle("background-position",-(this.getWidth()*A)+"px top");this.rightButton.setStyle("background-position",-(this.getWidth()*A+this.leftButton.getWidth())+"px top")}else{if(this.rightButton.images[A].src.length>0&&this.leftButton.images[A].src.length>0){this.leftButton.setImage(this.leftButton.images[A].src);this.rightButton.setImage(this.rightButton.images[A].src)}}this.state=A};this.setDefaultValue=function(A){this.defaultValue=A};this.getDefaultValue=function(){return this.defaultValue};this.setIcon=function(A){this.leftButton.setIcon(A)};this.setText=function(A){this.leftButton.setText(A)};this.setPopupMenu=function(A){this.popupMenu=A};this.onRightButtonClick=callback(this,function(){if(defined(this.popupMenu)){if(this.popupMenu.isPopup()){this.popupMenu.endPopup()}else{this.popupMenu.doPopupNear(this);this.notifyPopup.send(this)}}});this.onLeftButtonClick=callback(this,function(){if(this.popupMenu.isPopup()){this.popupMenu.endPopup()}this.notifyDefaultAction.send(this,this.defaultValue)});this.onButtonMouseDown=callback(this,function(A){this.setState(core.ui.ImageButton.STATE_PRESSED);this.activate();A.stop();return false});this.onButtonMouseOver=callback(this,function(A){this.setState(core.ui.ImageButton.STATE_HOVER);A.stop()});this.onButtonMouseOut=callback(this,function(A){this.setState(core.ui.ImageButton.STATE_NORMAL);A.stop()})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"Shortcut");with(editor.ui){editor.ui.Shortcut.constructor=function(){this.listeners=new core.util.Listeners();this.modifiers=0;this.key;this.Shortcut=function(A){this.combination=A;var D=A.split("+");for(var C=0;C<D.length;C++){var B=D[C].toUpperCase();if(defined(Shortcut.ctrlFlags[B])){this.modifiers|=Shortcut.ctrlFlags[B]}else{this.key=B}}};this.addShortcutListener=function(A){this.listeners.add(A)};this.removeShortcutListener=function(A){this.listeners.remove(A)};this.getKeyCombination=function(){return this.combination};this.getKeyChar=function(){return this.key};this.getKeyCode=function(){if(!defined(this.key)){return undefined}return defined(Shortcut.keymap[this.key])?Shortcut.keymap[this.key]:this.key.charCodeAt(0)};this.getModifiers=function(){return this.modifiers};this.activate=function(){this.fireActivated()};this.fireActivated=function(){this.listeners.call("onShortcutActivated",[this])}};editor.ui.Shortcut.get=function(A){if(!this.initialized){this.init();this.initialized=true}if(!this.instances.hasKey(A)){this.instances.set(A,new Shortcut(A))}return this.instances.get(A)};editor.ui.Shortcut.init=function(){if(document.all){core.ui.Event.addListener(document,"keydown",this.handleEvent)}else{core.ui.Event.addListener(document,"keypress",this.handleEvent)}};editor.ui.Shortcut.handleEvent=function(C){C=core.ui.Event.improve(C);var E=String.fromCharCode(document.all?C.keyCode:C.charCode).toUpperCase();for(var B=Shortcut.instances.getValues().iterator();B.hasNext();B.next()){var D=B.current();var A=D.getModifiers();if(((E===D.getKeyChar().toUpperCase())||(C.keyCode==D.getKeyCode()))&&(C.ctrlKey===((A&Shortcut.CTRL_MASK)!=0))&&(C.shiftKey===((A&Shortcut.SHIFT_MASK)!=0))&&(C.altKey===((A&Shortcut.ALT_MASK)!=0))){D.activate();C.cancel();C.stop()}}};editor.ui.Shortcut.instances=new core.util.HashMap();editor.ui.Shortcut.CTRL_MASK=1;editor.ui.Shortcut.ALT_MASK=2;editor.ui.Shortcut.SHIFT_MASK=4;editor.ui.Shortcut.ctrlFlags={"CTRL":Shortcut.CTRL_MASK,"ALT":Shortcut.ALT_MASK,"SHIFT":Shortcut.SHIFT_MASK};editor.ui.Shortcut.keymap={"BACKSPACE":8,"BSP":8,"BACK":8,"TAB":9,"ENTER":13,"ENT":13,"PAUSE":19,"ESCAPE":27,"ESC":27,"PAGE UP":33,"PGUP":33,"PAGE DOWN":34,"PGDN":34,"END":35,"HOME":36,"LEFT":37,"UP":38,"RIGHT":39,"DOWN":40,"INSERT":45,"INS":45,"DELETE":46,"DEL":46,"F1":112,"F2":113,"F3":114,"F4":115,"F5":116,"F6":117,"F7":118,"F8":119,"F9":120,"F10":121,"F11":122,"F12":123,"/":191,"\\":220}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"PopupMenu");with(editor.ui){editor.ui.PopupMenu.superClass=core.ui.Menu;editor.ui.PopupMenu.constructor=function(){this.createItem=function(D,C,B){var A=new core.ui.ImageButton(this);A.setText(D);if(this.isSubMenu()){A.setImageList("images/PopupMenu/subitem.gif");A.setStyleId("popup-submenu-item")}else{A.setImageList("images/PopupMenu/item.gif");A.setStyleId("popup-menu-item")}A.data=B;A.callback=C;A.oncommand=this.onItemClick;return this.addItem(A)};this.createSubMenu=function(D,C){if(!C){C=PopupMenu}if(D){var B=new core.ui.ImageButton(this);B.setText(D);B.setToolTip("Expand submenu");B.setImageList("images/PopupMenu/expand.gif");B.oncommand=this.onSubMenuClick}var A=new C(this);A.endPopup=this.onSubmenuEndPopup;A.submenuFlag=true;if(D){A.setStyle("display","none");B.menu=A}return A};this.isSubMenu=function(){return this.submenuFlag};this.onItemClick=callback(this,function(B,C,A){if(A.callback){A.callback(A.data)}});this.onSubMenuClick=callback(this,function(B,C,A){if("none"==A.menu.getStyle("display")){A.menu.setStyle("display","block");A.setImageList("images/PopupMenu/collapse.gif");A.setToolTip("Collapse submenu")}else{A.menu.setStyle("display","none");A.setImageList("images/PopupMenu/expand.gif");A.setToolTip("Expand submenu")}});this.onSubmenuEndPopup=callback(this,function(){this.endPopup()})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"RangeMenu");with(editor.ui){editor.ui.RangeMenu.superClass=editor.ui.PopupMenu;editor.ui.RangeMenu.constructor=function(){this.createItem=override(this.createItem,function(text,callback,data){var item=arguments.callee.prototype.apply(this,[text,callback,data]);item.onmouseover=this.onItemMouseOver;item.onmouseout=this.onItemMouseOut;return item});this.isSubMenu=function(){return true};this.onItemMouseOver=callback(this,function(event,target){var hover=true;var items=new core.util.ArrayList(this.items);for(var i=items.iterator();i.hasNext();i.next()){var item=i.current();with(core.ui){item.setState(hover?ImageButton.STATE_HOVER:ImageButton.STATE_NORMAL)}if(item==target){hover=false}}event.stop()});this.onItemMouseOut=callback(this,function(event){event.stop()})}}ClassFactory.createPackage("editor.commands");ClassFactory.createClass(editor.commands,"UndoMenu");with(editor.commands){editor.commands.UndoMenu.superClass=editor.ui.RangeMenu;editor.commands.UndoMenu.constructor=function(){this.UndoMenu=function(A){arguments.callee.prototype.apply(this,[A]);this.createItems();var B=CommandHistory.get();B.addHistoryListener(this);this.updateControls(B)};this.createItem=override(this.createItem,function(A){var B=arguments.callee.prototype.apply(this,["",this.onItemCommand,A]);B.setToolTip((A==0)?"Undo last change":("Undo last "+(A+1)+" changes"));B.setStyle("display","none");return B});this.updateControls=function(E){var D=E.getUndoCommands();var B=D.size();for(var A=0;A<this.getItemCount();A++){var C=this.getItem(A);if(A<B){C.setText(D.get(B-A-1).getName());C.setStyle("display","")}else{C.setStyle("display","none")}}};this.createItems=function(){for(var A=0;A<CommandHistory.MAX_SIZE;A++){this.createItem(A)}};this.onHistoryChanged=function(A){this.updateControls(A)};this.onItemCommand=callback(this,function(C){var B=CommandHistory.get();for(var A=0;A<=C;A++){B.undo()}this.endPopup()})}}ClassFactory.createPackage("editor.commands");ClassFactory.createClass(editor.commands,"RedoMenu");with(editor.commands){editor.commands.RedoMenu.superClass=editor.commands.UndoMenu;editor.commands.RedoMenu.constructor=function(){this.createItem=override(this.createItem,function(A){var B=arguments.callee.prototype.apply(this,[A]);B.setToolTip((A==0)?"Redo last change":("Redo last "+(A+1)+" changes"));return B});this.updateControls=function(E){var D=E.getRedoCommands();var B=D.size();for(var A=0;A<this.getItemCount();A++){var C=this.getItem(A);if(A<B){C.setText(D.get(A).getName());C.setStyle("display","")}else{C.setStyle("display","none")}}};this.onItemCommand=callback(this,function(C){var B=CommandHistory.get();for(var A=0;A<=C;A++){B.redo()}this.endPopup()})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"WorkspacePanel");with(editor.ui){editor.ui.WorkspacePanel.superClass=core.ui.Window;editor.ui.WorkspacePanel.constructor=function(){this.WorkspacePanel=function(parent){arguments.callee.prototype.apply(this,[parent]);var app=editor.Application.getInstance();with(core.ui){this.samplesButton=new ImageButton(this);this.samplesButton.setStyle("position","absolute");this.samplesButton.addStyleName("SamplesButton");this.samplesButton.setImageList("images/WorkspacePanel/samples.gif");this.samplesButton.setText("Load sample");this.samplesButton.setToolTip("Show samples menu");this.samplesButton.oncommand=this.onSamplesButtonClick;this.saveButton=new ImageButton(this);this.saveButton.setStyle("position","absolute");this.saveButton.addStyleName("SaveButton");this.saveButton.setImageList("images/WorkspacePanel/save.gif");this.saveButton.setText("Save page");this.saveButton.setToolTip("Save changes");this.saveButton.oncommand=this.onSaveButtonClick;this.previewButton=new ImageButton(this);this.previewButton.setStyle("position","absolute");this.previewButton.addStyleName("PreviewButton");this.previewButton.setImageList("images/WorkspacePanel/preview.gif");this.previewButton.setText("Preview");this.previewButton.setToolTip("Switch to preview mode");this.previewButton.oncommand=this.onPreviewButtonClick;this.clearButton=new ImageButton(this);this.clearButton.setStyle("position","absolute");this.clearButton.addStyleName("ClearButton");this.clearButton.setImageList("images/WorkspacePanel/clear.gif");this.clearButton.setToolTip("Clear page");this.clearButton.oncommand=this.onClearButtonClick;this.exitButton=new core.ui.ImageButton(this);this.exitButton.setStyle("position","absolute");this.exitButton.setStyleName("ExitButton");this.exitButton.setImageList("images/WorkspacePanel/exit.gif");this.exitButton.setToolTip("Exit editor");this.exitButton.oncommand=this.onExitButtonClick;this.undoButton=new SplitButton(this);this.undoButton.setStyle("position","absolute");this.undoButton.addStyleName("UndoButton");this.undoButton.setImageList("images/WorkspacePanel/undo.gif");this.undoButton.setToolTip("Undo");this.undoButton.notifyDefaultAction.addListener(this.onUndoButtonClick);this.undoButton.setPopupMenu(app.factory.createMenuWithFrame(editor.commands.UndoMenu));this.redoButton=new SplitButton(this);this.redoButton.setStyle("position","absolute");this.redoButton.addStyleName("RedoButton");this.redoButton.setImageList("images/WorkspacePanel/redo.gif");this.redoButton.setToolTip("Redo");this.redoButton.notifyDefaultAction.addListener(this.onRedoButtonClick);this.redoButton.setPopupMenu(app.factory.createMenuWithFrame(editor.commands.RedoMenu));this.editButton=new ImageButton();this.editButton.addStyleName("EditModeButton");this.editButton.setImages("images/WorkspacePanel/back-normal.png","images/WorkspacePanel/back-hover.png","images/WorkspacePanel/back-pressed.png");this.editButton.setText("Back to edit mode");this.editButton.setToolTip("Go back to edit mode");this.editButton.oncommand=this.onEditModeButtonClick;this.editButton.hide()}app.addAppListener(this);Shortcut.get("Ctrl+S").addShortcutListener(this);Shortcut.get("Ctrl+Z").addShortcutListener(this);Shortcut.get("Ctrl+Y").addShortcutListener(this);editor.commands.CommandHistory.get().addHistoryListener(this);this.updateControls()};this.getPreviewButton=function(){return this.previewButton};this.getEditButton=function(){return this.editButton};this.getSaveButton=function(){return this.saveButton};this.onHistoryChanged=function(){this.updateControls()};this.updateControls=function(){this.undoButton.setEnabled(editor.commands.CommandHistory.get().canUndo());this.redoButton.setEnabled(editor.commands.CommandHistory.get().canRedo());this.saveButton.setEnabled(!this.saving);this.saveButton.setText(this.saving?"Saving...":"Save page")};this.save=function(){var app=editor.Application.getInstance();if(!app.config.get("registration.complete")){app.factory.getRegistrationDialog().doModal()}else{app.save()}};this.onAppInitComplete=function(app){this.save()};this.onAppSaving=function(){this.saving=true;this.updateControls()};this.onAppSaved=function(){this.saving=false;this.updateControls()};this.onShortcutActivated=function(s){switch(s.getKeyCombination()){case"Ctrl+S":this.save();break;case"Ctrl+Z":editor.commands.CommandHistory.get().undo();break;case"Ctrl+Y":editor.commands.CommandHistory.get().redo();break}};this.onSaveButtonClick=callback(this,function(){this.save()});this.onClearButtonClick=callback(this,function(){if(confirm("This will delete all page content. Do you want to continue?")){editor.Application.getInstance().clear()}});this.onSamplesButtonClick=callback(this,function(){var dialog=editor.Application.getInstance().factory.getTemplatesDialog();dialog.getContentWindow().getMenu().notifyTemplateSelected.addListener(this.onTemplateSelected);dialog.center();dialog.doModal()});this.onExitButtonClick=callback(this,function(){try{window.location.href="SelectWebsite"}catch(e){console.error(e)}});this.onTemplateSelected=callback(this,function(sender,template){var app=editor.Application.getInstance();if((app.getCollection().getElementCount()>1)&&!confirm("The existing data won't be saved. Would you like to continue?")){return }app.loadTemplate(template);var dialog=app.factory.getTemplatesDialog();dialog.getContentWindow().getMenu().notifyTemplateSelected.removeListener(this.onTemplateSelected);dialog.endModal()});this.onPreviewButtonClick=callback(this,function(){editor.Application.getInstance().switchMode(editor.Application.MODE_PREVIEW);this.editButton.move(core.ui.Window.getWidth()-this.editButton.getWidth()-100,core.ui.Window.getHeight()-this.editButton.getHeight()-100);this.editButton.activate();this.editButton.show()});this.onEditModeButtonClick=callback(this,function(){editor.Application.getInstance().switchMode(editor.Application.MODE_EDIT);this.editButton.hide()});this.onUndoButtonClick=callback(this,function(){editor.commands.CommandHistory.get().undo()});this.onRedoButtonClick=callback(this,function(){editor.commands.CommandHistory.get().redo()})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"LoadingMessage");with(editor.ui){editor.ui.LoadingMessage.constructor=function(){};editor.ui.LoadingMessage.icons={};editor.ui.LoadingMessage.texts={};editor.ui.LoadingMessage.showIcon=function(B,C){if(!defined(C)){C="images/loading.gif"}if(!defined(this.icons[B.getId()])){this.icons[B.getId()]=new core.ui.Image(B);this.icons[B.getId()].setStyle("position","absolute")}var A=this.icons[B.getId()];A.setSource(C);A.center();A.show()};editor.ui.LoadingMessage.showText=function(B,C){if(!defined(C)){C="Loading..."}if(!defined(this.texts[B.getId()])){this.texts[B.getId()]=new core.ui.Static(B);this.texts[B.getId()].setStyle("position","absolute")}var A=this.texts[B.getId()];A.setText(C);A.center();A.show()};editor.ui.LoadingMessage.hideMessage=function(A){if(defined(this.icons[A.getId()])){this.icons[A.getId()].hide()}if(defined(this.texts[A.getId()])){this.texts[A.getId()].hide()}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"ImageLibrary");with(editor.ui){editor.ui.ImageLibrary.superClass=core.ui.Dialog;editor.ui.ImageLibrary.constructor=function(){this.categories;this.images;this.closeButton;this.selectedItem;this.preloadImages={};this.thumbnailSources={};this.imagesCounter=0;this.notifyImageSelected=new core.ui.Notification();this.ImageLibrary=function(parent){this.Dialog(parent);with(core.ui){var splitter=new SplitWindow(this,0,0,"100%","100%");this.categories=new ScrollWindow(splitter);this.categories.setContentWindow(new Menu(this.categories));this.categories.addStyleName("Categories");this.images=new ScrollWindow(splitter);this.images.setContentWindow(new Menu(this.images));this.images.addStyleName("Images");var buttons=new Window(splitter);buttons.addStyleName("ButtonsPane");this.closeButton=new ImageButton(buttons);this.closeButton.addStyleName("CloseButton");this.closeButton.setImageList("images/ImageLibrary/apply.gif");this.closeButton.setToolTip("Close library dialog");this.closeButton.setText("Close");this.closeButton.oncommand=parent.onCloseButtonClick;splitter.addPane(buttons,SplitWindow.SPLIT_BOTTOM);splitter.addPane(this.categories,SplitWindow.SPLIT_LEFT);splitter.addPane(this.images)}this.loadCategories()};this.loadCategories=function(){this.loadedCategories=false;LoadingMessage.showText(this);core.ajax.sendRequest(theApp.getUserCommand("ajax.EnumerateImages"),this.onLoadCategories)};this.addCategoryItem=function(category,icon){var item=new MenuButton(this.categories.getContentWindow());item.category=category;item.setText(category);item.setIcon(icon);item.setToolTip('Select images in category "'+category+'"');item.setImageList("images/ImageLibrary/category.gif");item.oncommand=this.onCategoryClick;this.categories.getContentWindow().addItem(item)};this.onLoadCategories=callback(this,function(response){try{if("OK"==response.status){this.addCategoryItem("My images","images/ImageLibrary/my-images.png");var path=response.path;for(var i=0;i<response.categories.length;i++){var c=response.categories[i];this.addCategoryItem(c,path+"/"+c+"/"+c+".png")}this.categories.reset();this.selectCategoryItem(this.categories.getContentWindow().getItem(0));this.loadedCategories=true}else{if(defined(response.message)){throw new Error("Error while loading image categories. Server response is: "+response.message)}else{throw new Error("Unspecified error while loading image categories. See server logs for details.")}}}catch(e){alert("Sorry, the error occurs while loading image categories from server.\n\nError details:"+e.message)}LoadingMessage.hideMessage(this)});this.loadImages=function(c){this.images.getContentWindow().removeItems();LoadingMessage.showText(this);core.ajax.sendRequest(theApp.getUserCommand("ajax.EnumerateImages"),this.onLoadImages,{"category":c})};this.onLoadImages=callback(this,function(response){try{if("OK"==response.status){var path=response.path;for(var i=0;i<response.images.length;i++){var item=new MenuButton(this.images.getContentWindow());item.path=path;item.image=response.images[i];var img=new core.ui.Image();img.removeStyleName("Image");this.preloadImages[i]=img;img.place=item;img.onload=this.onThumbnailLoaded;this.thumbnailSources[i]=core.url.encode(path+"/"+item.image)+"?size="+item.icon.getWidth()+"x"+item.icon.getHeight();item.onmousedown=callback(this,function(event){event.stop()});item.setToolTip("Select this image");item.setImageList("images/ImageLibrary/frame.gif");item.oncommand=this.onImageClick;this.images.getContentWindow().addItem(item)}this.images.reset()}else{if(response.message){throw new Error("Failed to load images. Response message is: "+response.message)}else{throw new Error("Unspecified error while loading images from server. See server logs for details.")}}}catch(e){alert("Sorry, the error occurs while loading images from server.\n\nError details:"+e.message)}setTimeout(this.initNextPicture,0);LoadingMessage.hideMessage(this)});this.selectCategoryItem=function(item){this.imagesCounter=0;for(var v in this.preloadImages){delete this.preloadImages[v]}for(var v in this.thumbnailSources){delete this.thumbnailSources[v]}if(defined(this.selectedItem)){if(item==this.selectedItem){if(item.getText()=="My images"){this.loadImages(item.getText())}return }this.selectedItem.setImageList("images/ImageLibrary/category.gif")}this.loadImages(item.getText());item.setImageList("images/ImageLibrary/category-active-2.gif");this.selectedItem=item};this.initNextPicture=callback(this,function(){var img=this.preloadImages[this.imagesCounter];if(defined(img)){if(img.getSource()){return }img.setSource(this.thumbnailSources[this.imagesCounter])}if(defined(this.preloadImages[this.imagesCounter+1])){this.imagesCounter++}});this.onThumbnailLoaded=callback(this,function(event,targetWindow,currentWindow){var owner=currentWindow.place;var width=currentWindow.getWidth();var height=currentWindow.getHeight();try{owner.hide();owner.setIcon(currentWindow.getSource());owner.icon.resize(width,height);owner.icon.center();owner.show()}catch(e){}setTimeout(this.initNextPicture,0)});this.onCategoryClick=callback(this,function(event,target,item){this.selectCategoryItem(item)});this.onImageClick=callback(this,function(event,target,item){this.notifyImageSelected.send(this,item.path+"/"+item.image)});this.refreshMyImages=callback(this,function(){var myImagesItem=this.categories.getContentWindow().getItem(0);if(this.selectedItem==myImagesItem&&this.loadedCategories){this.selectCategoryItem(myImagesItem)}})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"UrlDialog");with(editor.ui){editor.ui.UrlDialog.superClass=core.ui.Dialog;editor.ui.UrlDialog.constructor=function(){this.controlGroupWindow;this.schemesList;this.editUrl;this.buttonsGroup;this.cancelButton;this.okButton;this.notifySetUrl=new core.ui.Notification();this.notifyCancel=new core.ui.Notification();this.UrlDialog=function(C,B,H,F,G){this.Dialog(C,B,H,F,G);this.controlGroupWindow=new core.ui.Window(this);this.controlGroupWindow.setStyleId("url-dialog-ctrl-group");var E=new core.ui.Static(this.controlGroupWindow);E.setStyle("position","absolute");E.setStyleId("url-dialog-static-type");E.setText("Type:");this.schemesList=new core.ui.ComboBox(this.controlGroupWindow);this.schemesList.setStyle("position","absolute");this.schemesList.setStyleId("url-dialog-list-schemes");this.schemesList.addItem("other","");this.schemesList.setToolTip("Select the url scheme");this.schemesList.notifyValueChanged.addListener(this.onSchemeValueChanged);var A=["file","ftp","gopher","http","https","mailto","news","telnet","wais"];for(var D=0;D<A.length;D++){this.schemesList.addItem(A[D]+"://",A[D],("http"==A[D])?true:false)}var E=new core.ui.Static(this.controlGroupWindow);E.setStyle("position","absolute");E.setStyleId("url-dialog-static-url");E.setText("URL:");this.editUrl=new core.ui.Edit(this.controlGroupWindow);this.editUrl.setStyle("position","absolute");this.editUrl.setStyleId("url-dialog-edit-url");this.editUrl.setText("http://");this.editUrl.setToolTip("Enter the URL");this.buttonsGroup=new core.ui.Window(this);this.buttonsGroup.setStyleId("url-dialog-btn-group");this.okButton=new core.ui.ImageButton(this.buttonsGroup);this.okButton.setStyleId("url-dialog-button-ok");this.okButton.setText("OK");this.okButton.setToolTip("Use this URL");this.okButton.setImageList("images/UrlDialog/button.gif");this.okButton.oncommand=this.onOkButtonClick;this.cancelButton=new core.ui.ImageButton(this.buttonsGroup);this.cancelButton.setStyleId("url-dialog-button-cancel");this.cancelButton.setText("Cancel");this.cancelButton.setToolTip("Close this dialog");this.cancelButton.setImageList("images/UrlDialog/button.gif");this.cancelButton.oncommand=this.onCancelButtonClick};this.setUrl=function(A){var B="http";if(!A.match(/^([a-zA-Z]+):\/\//)){A=B+"://"+A}else{B=RegExp.$1}this.editUrl.setText(A);this.schemesList.setValue(B)};this.reset=function(){this.schemesList.setValue("http");this.editUrl.setText("http://")};this.onOkButtonClick=callback(this,function(){this.notifySetUrl.send(this,this.editUrl.getText())});this.onCancelButtonClick=callback(this,function(){this.notifyCancel.send(this)});this.onSchemeValueChanged=callback(this,function(B,C){if(C){var A=this.editUrl.getText();if(A.match(/^[a-zA-Z]+:\/\/(.*)$/)){this.editUrl.setText(C+"://"+RegExp.$1)}else{this.editUrl.setText(C+"://"+A)}}})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"Toolbox");with(editor.ui){editor.ui.Toolbox.superClass=core.ui.Window;editor.ui.Toolbox.constructor=function(){this.showGrid;this.Toolbox=function(A){arguments.callee.prototype.apply(this,[A]);this.showGrid=new core.ui.CheckBox(this);this.showGrid.setStyle("position","absolute");this.showGrid.setText("Show grid");this.showGrid.onclick=this.showGrid.label.onclick=this.onCheckboxClick;editor.Application.getInstance().addAppListener(this)};this.updateControls=function(){var A=editor.Application.getInstance().getWorkspace();this.showGrid.setChecked(A.isGridVisible())};this.getShowGridControl=function(){return this.showGrid};this.onAppPageLoaded=function(){this.updateControls()};this.onCheckboxClick=callback(this,function(){var A=editor.Application.getInstance().getWorkspace();A.setGridVisible(!A.isGridVisible())})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"ImagePreview");with(editor.ui){editor.ui.ImagePreview.superClass=core.ui.Window;editor.ui.ImagePreview.constructor=function(){this.image;this.loadingWindow;this.loaded=false;this.zoom;this.notifyImageLoaded=new core.ui.Notification();this.ImagePreview=function(B,A,E,C,D){this.Window(B,A,E,C,D);this.loadingWindow=new core.ui.Static(this);this.loadingWindow.setStyle("position","absolute");this.loadingWindow.center();this.loadingWindow.hide();this.image=new window.Image();this.image.onload=this.onImageLoaded;this.reset()};this.setImage=function(A){this.loaded=false;if(A&&("none"!==A)){this.showAnimation();if(1!=this.zoom){A+=((-1!==A.indexOf("?"))?"&":"?");A+="zoom="+Math.ceil(this.zoom*100)}this.image.src=A}};this.setPosition=function(A,B){this.setStyle("background-position",A+" "+B);this.setStyle("background-position-x",A);this.setStyle("background-position-y",B)};this.getPositionX=function(){return this.getStyle("background-position-x")};this.getPositionY=function(){return this.getStyle("background-position-y")};this.setRepeat=function(A){this.setStyle("background-repeat",A)};this.getRepeat=function(){return this.getStyle("background-repeat")};this.setZoom=function(A){this.zoom=A};this.reset=function(){this.loaded=false;this.loadingWindow.hide();this.setStyle("background-image","none");this.setPosition("center","center");this.setRepeat("no-repeat");this.resetZoom()};this.isImageLoaded=function(){return this.loaded};this.showAnimation=function(){this.loaded=false;this.setStyle("background-image","none");this.loadingWindow.setStyle("background","url(images/loading.gif) no-repeat center center");this.loadingWindow.center();this.loadingWindow.show()};this.resetZoom=function(){this.zoom=(this.getWidth()/core.ui.Window.getWidth())};this.onImageLoaded=callback(this,function(){this.loaded=true;this.loadingWindow.hide();this.setStyle("background-image",'url("'+this.image.src+'")');this.notifyImageLoaded.send(this)})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"ImageDialog");with(editor.ui){editor.ui.ImageDialog.superClass=core.ui.Dialog;editor.ui.ImageDialog.constructor=function(){this.previewWindow;this.fileUpload;this.libButton;this.urlButton;this.cancelButton;this.applyButton;this.selectedImage;this.notifyImageApplied=new core.ui.Notification();this.notifyCancelled=new core.ui.Notification();this.ImageDialog=function(B,A,E,C,D){this.Dialog(B,A,E,C,D);this.previewWindow=new ImagePreview(this);this.previewWindow.notifyImageLoaded.addListener(this.onPreviewLoaded);this.cancelButton=new core.ui.ImageButton(this);this.cancelButton.setStyleId("image-dialog-button-cancel");this.cancelButton.setImageList("images/ImageDialog/apply.gif");this.cancelButton.setText("Cancel");this.cancelButton.setToolTip("Close without changes");this.cancelButton.oncommand=this.onCancelButtonClick;this.applyButton=new core.ui.ImageButton(this);this.applyButton.setStyleId("image-dialog-button-apply");this.applyButton.setImageList("images/ImageDialog/apply.gif");this.applyButton.setText("OK");this.applyButton.setToolTip("Close and change the image");this.applyButton.oncommand=this.onApplyButtonClick;this.fileUpload=new core.ui.FileUpload(this);this.fileUpload.setUploadUrl(theApp.getUserCommand("ajax.UploadImage"));this.fileUpload.setText("Upload");this.fileUpload.setToolTip("Upload image");this.fileUpload.setImageList("images/ImageDialog/browse.gif");this.fileUpload.notifyFileSelected.addListener(this.onFileSelected);this.fileUpload.notifyFileUploaded.addListener(this.onFileUploaded);this.fileUpload.notifyUploadError.addListener(this.onFileError);this.urlButton=new core.ui.ImageButton(this);this.urlButton.setStyleId("image-dialog-button-url");this.urlButton.setText("Load URL");this.urlButton.setToolTip("Load image from url");this.urlButton.setImageList("images/ImageDialog/url.gif");this.urlButton.oncommand=this.onUrlButtonClick;this.libButton=new core.ui.ImageButton(this);this.libButton.setStyleId("image-dialog-button-lib");this.libButton.setImageList("images/ImageDialog/lib.gif");this.libButton.setText("My images & library");this.libButton.setToolTip("Load image from library");this.libButton.oncommand=this.onLibButtonClick;this.updateControls()};this.setImage=function(A){this.selectedImage=A;this.previewWindow.setImage(A)};this.reset=function(){this.previewWindow.reset();this.fileUpload.clear();theApp.factory.getUrlDialog().getContentWindow().reset();this.updateControls()};this.updateControls=function(){this.applyButton.setEnabled(this.previewWindow.isImageLoaded());this.applyButton.setState(core.ui.ImageButton.STATE_NORMAL);this.applyButton.setStyle("opacity",this.previewWindow.isImageLoaded()?100:75)};this.centerObject=function(A){A.move(core.ui.Window.getWidth()-(document.body.clientWidth+A.getWidth())/2,core.ui.Window.getHeight()-(document.body.clientHeight+A.getHeight())/2)};this.onLibButtonClick=callback(this,function(){var A=theApp.factory.getImageLibrary();A.getContentWindow().notifyImageSelected.addListener(this.onLibImageSelected,true);this.centerObject(A);A.doModal();A.getContentWindow().refreshMyImages()});this.onUrlButtonClick=callback(this,function(){var A=theApp.factory.getUrlDialog();A.setTitle("Image URL");A.getContentWindow().notifySetUrl.addListener(this.onSetImageUrl,true);A.getContentWindow().notifyCancel.addListener(this.onUrlButtonCancelClick,true);this.centerObject(A);A.doModal()});this.onApplyButtonClick=callback(this,function(){this.notifyImageApplied.send(this,this.selectedImage)});this.onCancelButtonClick=callback(this,function(){this.notifyCancelled.send(this)});this.onSetImageUrl=callback(this,function(B,A){core.ajax.sendRequest(theApp.getUserCommand("ajax.CopyImage"),this.onImageCopy,{"url":A});theApp.factory.getUrlDialog().endModal()});this.onImageCopy=callback(this,function(A){try{if("OK"==A.status){this.selectedImage=A.src;this.previewWindow.setImage(A.src)}else{if(A.message){window.alert(A.message)}else{throw new Error("Image is not copied. The response is: "+A)}}}catch(B){alert("Sorry, the error occurs while copying the image.\n\nError details: "+B.message)}});this.onUrlButtonCancelClick=callback(this,function(){theApp.factory.getUrlDialog().endModal()});this.onFileSelected=callback(this,function(){this.previewWindow.showAnimation();this.fileUpload.upload();this.updateControls()});this.onFileUploaded=callback(this,function(A,B){this.selectedImage=B.src;this.previewWindow.setImage(B.src)});this.onFileError=callback(this,function(){this.previewWindow.reset();this.updateControls();alert("Sorry, the file you uploaded is not a valid image.")});this.onLibImageSelected=callback(this,function(B,A){this.selectedImage=A;this.previewWindow.setImage(A);theApp.factory.getImageLibrary().endModal()});this.onPreviewLoaded=callback(this,function(){this.updateControls()})}}ClassFactory.createPackage("core.util");ClassFactory.createClass(core.util,"Color");with(core.util){core.util.Color.constructor=function(){this.hex;this.Color=function(A){switch(typeof A){case"string":if(A.match(/^rgb\((\d+)[^\d]+(\d+)[^\d]+(\d+)\)$/i)){this.fromRgb(parseInt(RegExp.$1),parseInt(RegExp.$2),parseInt(RegExp.$3))}else{if(A.match(/^\#{0,1}([a-f0-9]+)$/i)){this.fromHex(RegExp.$1)}else{this.fromString(A)}}break;case"number":break}};this.fromRgb=function(C,B,A){this.hex=Color.rgb2Hex(C,B,A)};this.fromHex=function(A){this.hex=A.toLowerCase()};this.fromString=function(A){A=A.toLowerCase();if(defined(Color.map[A])){this.hex=Color.map[A];return true}return false};this.toString=function(){return this.hex.toString()}};core.util.Color.dec2Hex=function(C){var B="0123456789abcdef";var A=B.substr(C&15,1);while(C>15){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;C<ColorMenu.colors.length;C++){this.createItem(ColorMenu.colors[C])}this.colorEditor=new core.ui.Edit(this);this.colorEditor.getElement().maxLength=6;this.colorEditor.setStyle("text-transform","uppercase");this.colorEditor.onkeyup=this.onEditColor;this.selectedColor=new core.ui.Static(this);this.selectedColor.setStyleId("color-menu-selected-color");this.selectedColor.setToolTip(this.getColor());this.okButton=new core.ui.ImageButton(this);this.okButton.setImageList("images/ColorMenu/set.gif");this.okButton.setText("Set");this.okButton.oncommand=this.onSetButtonClick};this.createItem=function(A){var B=new core.ui.MenuItem(this);B.setStyle("background-color",A);B.onclick=this.onItemClick;B.setToolTip(A);B.color=A;return this.addItem(B)};this.setText=function(A){this.menuTitle.setText(A)};this.getText=function(){return this.menuTitle.getText()};this.getTranspColor=function(){return this.transpColor.color};this.setColor=function(A){if(A.match(/rgb\((\d+)[^\d]+(\d+)[^\d]+(\d+)/i)){A=core.util.Color.rgb2Hex(parseInt(RegExp.$1),parseInt(RegExp.$2),parseInt(RegExp.$3))}else{if(A.match(/\#[a-f0-9]+/i)){A=A.substr(1)}}this.color=A;this.colorEditor.setText((A.match(/^[a-f0-9]+$/i))?A:"");if("transparent"==A){this.selectedColor.setToolTip("Transparent");this.selectedColor.setStyle("background-image","url(images/ColorMenu/transparent.gif)")}else{this.selectedColor.setToolTip(A);this.selectedColor.setStyle("background-image","none")}try{this.selectedColor.setStyle("background-color",A)}catch(B){}};this.getColor=function(){return this.color};this.onItemClick=callback(this,function(C,A){var B=A;this.setColor(B.color);this.notifyColorSelected.send(this,this.color)});this.onSetButtonClick=callback(this,function(){this.setColor(this.colorEditor.getText());this.notifyColorApplied.send(this,this.color);this.endPopup()});this.onEditColor=callback(this,function(D,A){var B=A.getText();if(B.match(/rgb\((\d+)[^\d]+(\d+)[^\d]+(\d+)/i)){B=core.util.Color.rgb2Hex(parseInt(RegExp.$1),parseInt(RegExp.$2),parseInt(RegExp.$3))}else{if(B.match(/\#[A-Fa-f0-9]+/i)){B=B.substr(1)}}try{this.selectedColor.setStyle("background-color",B)}catch(C){}})};editor.ui.ColorMenu.colors=["FFFFFF","FFCCCC","FFCC99","FFFF99","FFFFCC","99FF99","99FFFF","CCFFFF","CCCCFF","FFCCFF","CCCCCC","FF6666","FF9966","FFFF66","FFFF33","66FF99","33FFFF","66FFFF","9999FF","FF99FF","C0C0C0","FF0000","FF9900","FFCC66","FFFF00","33FF33","66CCCC","33CCFF","6666CC","CC66CC","999999","CC0000","FF6600","FFCC33","FFCC00","33CC00","00CCCC","3366FF","6633FF","CC33CC","666666","990000","CC6600","CC9933","999900","009900","339999","3333FF","6600CC","993399","333333","660000","993300","996633","666600","006600","336666","000099","333399","663366","000000","330000","663300","663333","333300","003300","003333","000066","330099","330033"]}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"BorderDialog");with(editor.ui){editor.ui.BorderDialog.superClass=core.ui.Dialog;editor.ui.BorderDialog.constructor=function(){this.mainSplitWindow;this.toolsSplitWindow;this.previewWindow;this.toolsWindow;this.commandButtonsWindow;this.okButton;this.cancelButton;this.preview;this.colorMenu;this.selectionColor;this.selectionWidth;this.selectionStyle;this.notifyApplied=new core.ui.Notification();this.notifyCancelled=new core.ui.Notification();this.styles=["None","Dotted","Dashed","Solid","Double","Groove","Ridge","Inset","Outset"];this.widths={"0pt":"0 pt","0.25pt":"0,25 pt","0.5pt":"0,5 pt","0.75pt":"0,75 pt","1pt":"1 pt","1.5pt":"1,5 pt","2.25pt":"2,25 pt","3pt":"3 pt","4.5pt":"4,5 pt","6pt":"6 pt","9pt":"9 pt"};this.BorderDialog=function(C,A,G,E,F){this.Dialog(C,A,G,E,F);this.mainSplitWindow=new core.ui.SplitWindow(this);this.commandButtonsWindow=new core.ui.Window(this.mainSplitWindow);this.commandButtonsWindow.setStyleId("border-dialog-command-buttons-window");this.previewWindow=new core.ui.Window(this.mainSplitWindow);this.previewWindow.setStyleId("border-dialog-preview-window");this.preview=new core.ui.Window(this.previewWindow);this.preview.setStyleId("border-dialog-preview-target");this.preview.center();this.toolsSplitWindow=new core.ui.SplitWindow(this.mainSplitWindow);this.toolsSplitWindow.setStyleId("border-dialog-tools-splitwindow");this.toolsWindow=new PopupMenu(this.toolsSplitWindow);this.toolsWindow.setStyleId("border-dialog-menu-tools");this.colorMenu=this.toolsWindow.createSubMenu(null,ColorMenu);this.colorMenu.setText("Border color");this.colorMenu.transpColor.setStyle("display","none");this.colorMenu.notifyColorApplied.addListener(this.onColorSelected);this.colorMenu.notifyColorSelected.addListener(this.onColorSelected);var B=this.toolsWindow.createSubMenu();var D=new core.ui.Static(B);D.setStyleId("border-dialog-menu-title");D.setText("Border width");for(var E in this.widths){B.createItem(this.widths[E],this.onSelectWidth,E)}this.cancelButton=new core.ui.ImageButton(this.commandButtonsWindow);this.cancelButton.setStyleId("border-dialog-button-cancel");this.cancelButton.setImageList("images/BorderDialog/apply.gif");this.cancelButton.setText("Cancel");this.cancelButton.setToolTip("Close without changes");this.cancelButton.oncommand=this.onCancelButtonClick;this.okButton=new core.ui.ImageButton(this.commandButtonsWindow);this.okButton.setStyleId("border-dialog-button-ok");this.okButton.setImageList("images/BorderDialog/apply.gif");this.okButton.setText("Ok");this.okButton.setToolTip("Close and change the border");this.okButton.oncommand=this.onOkButtonClick;this.mainSplitWindow.addPane(this.commandButtonsWindow,core.ui.SplitWindow.SPLIT_BOTTOM);this.mainSplitWindow.addPane(this.previewWindow,core.ui.SplitWindow.SPLIT_LEFT);this.mainSplitWindow.addPane(this.toolsSplitWindow,core.ui.SplitWindow.SPLIT_RIGHT);this.toolsSplitWindow.addPane(this.createStylesPanel(),core.ui.SplitWindow.SPLIT_LEFT);this.toolsSplitWindow.addPane(this.toolsWindow,core.ui.SplitWindow.SPLIT_TOP);this.setBorderParameters("1px","solid","000000")};this.createStylesPanel=function(){var A=new core.ui.Window(this.toolsSplitWindow);A.setStyleId("border-dialog-styles-panel");for(var C=0;C<this.styles.length;C++){var B=new MenuButton(A);B.setImageList("images/BorderDialog/style-button.gif");B.setToolTip(this.styles[C]+" border style");B.oncommand=this.onStyleButtonClick;var D=new core.ui.Window(B);D.setStyleId("border-dialog-styles-button-hole");D.setStyle("border-width","4px");D.setStyle("border-style",this.styles[C]);D.setStyle("border-color","#217aaa");B.setText(this.styles[C])}return A};this.reset=function(){this.setBorderParameters("1px","solid","000000")};this.setBorderParameters=function(C,B,A){this.preview.setStyle("border-width",this.selectionWidth=C);this.preview.setStyle("border-style",this.selectionStyle=B);this.preview.setStyle("border-color",this.selectionColor=A);this.colorMenu.setColor(A)};this.onOkButtonClick=callback(this,function(){this.notifyApplied.send(this,this.selectionWidth,this.selectionStyle,this.selectionColor)});this.onCancelButtonClick=callback(this,function(){this.notifyCancelled.send(this)});this.onStyleButtonClick=callback(this,function(C,A,B){this.preview.setStyle("border-style",this.selectionStyle=B.getText())});this.onSelectWidth=callback(this,function(A){this.preview.setStyle("border-width",this.selectionWidth=A)});this.onColorSelected=callback(this,function(B,A){this.preview.setStyle("border-color",this.selectionColor=A)})}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Marquee");with(core.ui){core.ui.Marquee.superClass=core.ui.CompositeWindow;core.ui.Marquee.constructor=function(){this.text;this.loop=0;this.scrollAmount=6;this.scrollDelay=85;this.currentLoop=0;this.timerId=null;this.Marquee=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.updateLayout();this.start()};this.setText=function(A){this.text.innerHTML=A};this.getText=function(){return this.text.innerHTML};this.setLoop=function(A){this.loop=A};this.getLoop=function(){return this.loop};this.setScrollAmount=function(A){this.scrollAmount=A};this.getScrollAmount=function(){return this.scrollAmount};this.setScrollDelay=function(A){this.scrollDelay=A};this.getScrollDelay=function(){return this.scrollDelay};this.start=function(){this.stop();this.currentLoop=0;this.text.style.left=this.getWidth()+"px";this.timerId=window.setTimeout(this.onTimer,this.scrollDelay)};this.stop=function(){window.clearTimeout(this.timerId);this.timerId=null};this.isStarted=function(){return(null!==this.timerId)};this.close=override(this.close,function(){if(this.isStarted()){this.stop()}arguments.callee.prototype.apply(this,[])});this.updateLayout=function(){this.text.style.height=this.text.style.lineHeight=this.getHeight()+"px"};this.createElement=override(this.createElement,function(){var A=arguments.callee.prototype.apply(this,[]);this.text=document.createElement("div");this.text.style.position="absolute";this.text.style.whiteSpace="nowrap";A.appendChild(this.text);return A});this.onTimer=callback(this,function(){this.text.style.left=(this.text.offsetLeft-this.scrollAmount)+"px";if(this.text.offsetLeft+this.text.offsetWidth<=0){this.currentLoop++;if((this.loop>0)&&(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;C<A.length;C++){var G=this.getWizard().getPane(A[C]);for(var B=0;B<G.scenes.length;B++){if(G.scenes[B] instanceof editor.plugins.tribute.Scene){var E=new core.ui.Window(this.items.getContentWindow());E.setStyleName("SubtitlesItem");E.scene=G.scenes[B];E.preview=new editor.ui.ImageFrame(E);E.preview.setImage(E.scene.getImage(),true);var D=new core.ui.Static(E);D.addStyleName("FieldTitle");D.setText("Subtitle text:");E.textArea=new core.ui.TextArea(E);E.textArea.setTabIndex(++F);E.textArea.setText(E.scene.getSubtitles().getText());core.ui.quirks.TextSelection.allowSelection(E.getElement());this.items.getContentWindow().addItem(E)}}this.items.reset()}};this.reset=function(){this.items.getContentWindow().removeItems()};this.setActive=function(B){if(B){this.getWizard().addWizardListener(this);this.reset();this.createSubtitles();var A=this.items.getContentWindow().getItem(0);A.textArea.setFocus(true)}else{this.getWizard().removeWizardListener(this)}};this.onWizardBack=function(A){for(var B=0;B<this.items.getContentWindow().getItemCount();B++){var C=this.items.getContentWindow().getItem(B);C.scene.getSubtitles().setText(C.textArea.getText())}}}}ClassFactory.createPackage("editor.plugins.tribute.wizard");ClassFactory.createClass(editor.plugins.tribute.wizard,"TributeVideoMusicPane");with(editor.plugins.tribute.wizard){editor.plugins.tribute.wizard.TributeVideoMusicPane.superClass=editor.ui.wizard.WizardPane;editor.plugins.tribute.wizard.TributeVideoMusicPane.constructor=function(){this.sounds=[];this.TributeVideoMusicPane=function(wizard){arguments.callee.prototype.apply(this,[wizard,TributeVideoMusicPane]);this.setPrevPaneId(MaturePhotosPane);this.setNextPaneId(TributeVideoSubtitlesPane);this.setTitle("Background music");this.setText("Upload background music.<p><b>Note:</b> only <b>mp3</b> 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;i<count;i++){var upload=new editor.ui.MusicUpload(this.items.getContentWindow());upload.soundIndex=this.items.getContentWindow().getItemCount();upload.notifyUploaded.addListener(this.onMusicUploaded);upload.notifyUploadFailed.addListener(this.onMusicUploadFailed);upload.notifyMusicStopped.addListener(this.onMusicStopped);this.items.getContentWindow().addItem(upload)}this.createAddButton();this.items.reset();this.items.getVerticalScroll().setPosition(100);this.items.updateLayout()};this.getNextPaneId=override(this.getNextPaneId,function(){var paneIds=[ChildhoodPhotosPane,TeenagePhotosPane,AdultPhotosPane,MaturePhotosPane];for(var i=0;i<paneIds.length;i++){var pane=this.getWizard().getPane(paneIds[i]);if(pane.scenes.length>0){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;i<this.items.getContentWindow().getItemCount();i++){var musicUpload=this.items.getContentWindow().getItem(i);if(musicUpload.started||musicUpload.paused){musicUpload.stop()}}};this.onWizardNext=function(wizard){this.stopSound();if(!defined(wizard.getNextPane())){wizard.addPane(new TributeVideoSubtitlesPane(wizard))}};this.onWizardBack=function(){this.stopSound()};this.onMusicUploaded=callback(this,function(sender,path,title,artist,duration){with(editor.plugins.tribute){if(!defined(this.sounds[sender.soundIndex])){this.sounds[sender.soundIndex]=new Sound()}}var sound=this.sounds[sender.soundIndex];sound.setFile(path);sound.setTitle(title);sound.setDuration(duration)});this.onMusicUploadFailed=callback(this,function(sender){delete this.sounds[sender.soundIndex]});this.onMusicStopped=callback(this,function(){})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"MusicUpload");with(editor.ui){editor.ui.MusicUpload.superClass=core.ui.Window;editor.ui.MusicUpload.constructor=function(){this.icon;this.playButton;this.stopButton;this.fileUpload;this.trackWindow;this.marquee;this.info={path:"",name:"",title:"",artist:"",duration:0};this.paused=false;this.started=false;this.uploaded=false;this.notifyUploaded=new core.ui.Notification();this.notifyUploadFailed=new core.ui.Notification();this.notifyMusicComplete=new core.ui.Notification();this.notifyMusicStarted=new core.ui.Notification();this.notifyMusicStopped=new core.ui.Notification();this.notifyMusicPaused=new core.ui.Notification();this.MusicUpload=function(B,A,E,C,D){this.Window(B,A,E,C,D);this.icon=new core.ui.Image(this);this.icon.addStyleName("Icon");this.icon.setStyle("position","absolute");this.trackWindow=new core.ui.Static(this);this.trackWindow.addStyleName("TrackWindow");this.trackWindow.setStyle("background-image","url(images/MusicUpload/placeholder-disabled.png)");this.trackWindow.setStyle("position","absolute");this.track=new core.ui.Marquee(this.trackWindow);this.track.setStyle("position","absolute");this.track.setScrollDelay(200);this.track.stop();this.playButton=new core.ui.ImageButton(this);this.playButton.addStyleName("PlayButton");this.playButton.setStyle("position","absolute");this.playButton.setToolTip("Start");this.playButton.oncommand=this.onPlayButtonCommand;this.stopButton=new core.ui.ImageButton(this);this.stopButton.addStyleName("StopButton");this.stopButton.setStyle("position","absolute");this.stopButton.setToolTip("Stop");this.stopButton.oncommand=this.onStopButtonCommand;this.fileUpload=new core.ui.FileUpload(this);this.fileUpload.setText("Upload");this.fileUpload.setToolTip("Upload audio");this.fileUpload.setUploadUrl(theApp.getUserCommand("ajax.UploadAudio"));this.fileUpload.setImages("images/MusicUpload/browse-normal.png","images/MusicUpload/browse-hover.png","images/MusicUpload/browse-pressed.png");this.fileUpload.notifyFileSelected.addListener(this.onFileSelected);this.fileUpload.notifyFileUploaded.addListener(this.onFileUploaded);this.fileUpload.notifyUploadError.addListener(this.onUploadError);this.updateControls()};this.updateControls=function(){if(this.uploaded){this.icon.setSource("images/MusicUpload/icon-normal.png");this.playButton.enable();if(this.started){this.playButton.setImages("images/MusicUpload/pause-normal.png","images/MusicUpload/pause-hover.png","images/MusicUpload/pause-pressed.png");this.playButton.setToolTip("Pause");this.stopButton.enable()}else{this.playButton.setImages("images/MusicUpload/play-normal.png","images/MusicUpload/play-hover.png","images/MusicUpload/play-pressed.png","images/MusicUpload/play-disabled.png");this.playButton.setToolTip("Start");this.stopButton.setEnabled(this.paused?true:false)}}else{this.icon.setSource("images/MusicUpload/icon-disabled.png");this.playButton.setImages("images/MusicUpload/play-normal.png","images/MusicUpload/play-hover.png","images/MusicUpload/play-pressed.png","images/MusicUpload/play-disabled.png");this.stopButton.setImages("images/MusicUpload/stop-normal.png","images/MusicUpload/stop-hover.png","images/MusicUpload/stop-pressed.png","images/MusicUpload/stop-disabled.png");this.playButton.disable();this.stopButton.disable()}};this.isUploaded=function(){return this.uploaded};this.start=function(){if(this.paused){editor.MusicPlayer.start();this.paused=false}else{editor.MusicPlayer.load(this.info.path,this.onSoundLoaded,this.onSoundComplete)}this.started=true;this.updateControls()};this.stop=function(){editor.MusicPlayer.stop();this.started=false;this.paused=false;this.updateControls()};this.pause=function(){editor.MusicPlayer.pause();this.started=false;this.paused=true;this.updateControls()};this.close=override(this.close,function(){if(this.started){this.stop()}this.fileUpload.notifyFileSelected.removeListener(this.onFileSelected);this.fileUpload.notifyFileUploaded.removeListener(this.onFileUploaded);this.fileUpload.notifyUploadError.removeListener(this.onUploadError);arguments.callee.prototype.apply(this,[])});this.getFileUpload=function(){return this.fileUpload};this.getPlayButton=function(){return this.playButton};this.getStopButton=function(){return this.stopButton};this.onFileSelected=callback(this,function(A,B){if(this.started){this.stop()}this.trackWindow.setStyle("background-image","url(images/MusicUpload/placeholder-normal.png)");this.track.setStyle("background","url(images/loading.gif) no-repeat center center");this.track.setText("");this.fileUpload.upload()});this.onFileUploaded=callback(this,function(B,E){this.uploaded=true;this.info.path=E.path;this.info.name=E.name;if(E.title.length>0){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('<input type="radio" name="'+A+'">')}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;A<B.sounds.length;A++){var D=B.sounds[A];this.addItem(D.path,D.duration,D.name,D.artist,D.title)}this.notifyLoaded.send(this)}else{if(defined(B.message)){throw new Error("Failed to get list of sounds. Response message is: "+B.message)}else{throw new Error("Unspecified error occurs while getting list of sounds.")}}}catch(C){alert("Sorry, the error occurs while getting list of sounds from server. Error details:"+C.message)}LoadingMessage.hideMessage(this)});this.onItemSelected=callback(this,function(C,A,B){if(A!==B){this.notifyItemSelected.send(this,B.path,B.duration,B.name,B.artist,B.title)}})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"MusicDialog");with(editor.ui){editor.ui.MusicDialog.superClass=core.ui.Dialog;editor.ui.MusicDialog.constructor=function(){this.list;this.upload;this.okButton;this.cancelButton;this.notifySelected=new core.ui.Notification();this.notifyCancel=new core.ui.Notification();this.MusicDialog=function(parent){this.Dialog(parent);with(core.ui){var splitter=new SplitWindow(this,0,0,"100%","100%");this.upload=new MusicUpload(splitter);this.upload.notifyUploaded.addListener(this.onSoundUploaded);this.list=new ScrollWindow(splitter);this.list.addStyleName("MusicListArea");this.list.setContentWindow(new MusicList(this.list));this.list.getContentWindow().notifyItemSelected.addListener(this.onSoundSelected);this.list.getContentWindow().notifyLoaded.addListener(this.onSoundLoaded);var buttons=new Window(splitter);buttons.setStyleName("ButtonsPane");this.cancelButton=new ImageButton(buttons);this.cancelButton.addStyleName("CancelButton");this.cancelButton.setImageList("images/MusicDialog/cancel.gif");this.cancelButton.setToolTip("Close without changes");this.cancelButton.setText("Cancel");this.cancelButton.oncommand=this.onCancelButtonClick;this.okButton=new ImageButton(buttons);this.okButton.addStyleName("OkButton");this.okButton.setImageList("images/MusicDialog/ok.gif");this.okButton.setToolTip("Select music");this.okButton.setText("OK");this.okButton.oncommand=this.onOkButtonClick;splitter.addPane(this.upload,SplitWindow.SPLIT_TOP);splitter.addPane(this.list,SplitWindow.SPLIT_TOP);splitter.addPane(buttons);this.updateControls()}};this.updateControls=function(){this.okButton.setEnabled(this.upload.isUploaded());this.okButton.setStyle("opacity",this.upload.isUploaded()?100:45)};this.onSoundLoaded=callback(this,function(){this.list.reset()});this.onSoundUploaded=callback(this,function(){this.list.getContentWindow().refresh();this.list.reset();this.updateControls()});this.onSoundSelected=callback(this,function(sender,path,duration,file,artist,title){this.upload.info={"path":path,"name":file,"title":title,"artist":artist,"duration":duration};var name=(artist&&title)?artist+" - "+title:file;var min=common.util.DateUtils.getMinutes(duration);var sec=common.util.DateUtils.getSeconds(duration);name+=" ("+min+":"+sec+")";this.upload.stop();this.upload.uploaded=true;this.upload.track.setStyle("background-image","none");this.upload.track.setText(name);this.upload.track.setToolTip(name);this.upload.track.start();this.upload.trackWindow.setStyle("background-image","url(images/MusicUpload/placeholder-normal.png)");this.upload.updateControls();this.updateControls()});this.onOkButtonClick=callback(this,function(){this.upload.stop();var info=this.upload.info;this.notifySelected.send(this,info.path,info.duration,info.file,info.artist,info.title)});this.onCancelButtonClick=callback(this,function(){this.upload.stop();this.notifyCancel.send(this)})}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"TooltipController");with(editor.ui){editor.ui.TooltipController.constructor=function(){};editor.ui.TooltipController.showBalloonTip=function(D,F,C,B,E){var A=this.getBalloon();A.setOwner(D);A.setStyle("width","");A.setText(F);A.setStyle("width",(E)?"300px":"200px");A.setPosition(defined(C)?C:core.ui.Balloon.TOP);A.setTimeout(defined(B)?B:10);if(E){A.addStyleName(A.getStyleName()+"-wide")}else{A.removeStyleName(A.getStyleName()+"-wide")}A.show();return A};editor.ui.TooltipController.hideBalloonTip=function(A){if(!defined(this.balloon)||!this.balloon.isVisible()||this.balloon.isClosed()){return }if(defined(A)&&(this.balloon.getOwner()!=A)){return }this.balloon.hide()};editor.ui.TooltipController.getBalloon=function(){if(!defined(this.balloon)){this.balloon=new editor.ui.Balloon();editor.Application.getInstance().addAppListener(this)}return this.balloon};editor.ui.TooltipController.onAppClear=function(){this.hideBalloonTip()};editor.ui.TooltipController.onAppModeChanged=function(A){if(A.getMode()===editor.Application.MODE_PREVIEW){this.hideBalloonTip()}}}ClassFactory.createPackage("core.util.validation");ClassFactory.createClass(core.util.validation,"AbstractValidator");with(core.util.validation){core.util.validation.AbstractValidator.constructor=function(){this.target;this.AbstractValidator=function(A){this.target=A};this.setTarget=function(A){this.target=A};this.getTarget=function(){return this.target};this.validate=function(){}}}ClassFactory.createPackage("core.util.validation");ClassFactory.createClass(core.util.validation,"ValidationError");with(core.util.validation){core.util.validation.ValidationError.constructor=function(){this.validator;this.message;this.ValidationError=function(A,B){this.validator=A;this.message=B};this.getMessage=function(){return this.message};this.getValidator=function(){return this.validator}}}ClassFactory.createPackage("core.util.validation");ClassFactory.createClass(core.util.validation,"NonEmptyValidator");with(core.util.validation){core.util.validation.NonEmptyValidator.superClass=core.util.validation.AbstractValidator;core.util.validation.NonEmptyValidator.constructor=function(){this.validate=function(){if(0==this.getTarget().getText().length){throw new ValidationError(this,"The field should not be empty.")}}}}ClassFactory.createPackage("core.util.validation");ClassFactory.createClass(core.util.validation,"PhoneValidator");with(core.util.validation){core.util.validation.PhoneValidator.superClass=core.util.validation.NonEmptyValidator;core.util.validation.PhoneValidator.constructor=function(){this.validate=override(this.validate,function(){arguments.callee.prototype.apply(this,[]);var A=this.getTarget().getText();if(!A.match(/^\+?[\d\(][\d\s-]*(\(\d+\))?[\d\s-]*/)||A.match(/[a-zA-Z]/)){throw new ValidationError(this,"The phone number is invalid.")}})}}ClassFactory.createPackage("core.util.validation");ClassFactory.createClass(core.util.validation,"EmailValidator");with(core.util.validation){core.util.validation.EmailValidator.superClass=core.util.validation.NonEmptyValidator;core.util.validation.EmailValidator.constructor=function(){this.validate=override(this.validate,function(){arguments.callee.prototype.apply(this,[]);var A=this.getTarget().getText();if(!A.match(/^[\w!#\$%\/\?\|\^\{\}`~&'\+-=]+(\.[\w!#\$%\/\?\|\^\{\}`~&'\+-=]+)*@[\w-]+(\.[\w-]+)+$/)){throw new ValidationError(this,"The email address is invalid.")}})}}ClassFactory.createPackage("core.util.validation");ClassFactory.createClass(core.util.validation,"ZipCodeValidator");with(core.util.validation){core.util.validation.ZipCodeValidator.superClass=core.util.validation.NonEmptyValidator;core.util.validation.ZipCodeValidator.constructor=function(){this.validate=override(this.validate,function(){arguments.callee.prototype.apply(this,[])})}}ClassFactory.createPackage("core.util.validation");ClassFactory.createClass(core.util.validation,"ValidationTarget");with(core.util.validation){core.util.validation.ValidationTarget.constructor=function(){this.field;this.ValidationTarget=function(A){this.field=A};this.getField=function(){return this.field};this.getText=function(){return this.field.toString()}}}ClassFactory.createPackage("core.util.validation");ClassFactory.createClass(core.util.validation,"TextField");with(core.util.validation){core.util.validation.TextField.superClass=core.util.validation.ValidationTarget;core.util.validation.TextField.constructor=function(){this.getText=function(){return this.field.getText()}}}ClassFactory.createPackage("core.util.validation");ClassFactory.createClass(core.util.validation,"ListField");with(core.util.validation){core.util.validation.ListField.superClass=core.util.validation.ValidationTarget;core.util.validation.ListField.constructor=function(){this.getText=function(){var A=this.field.getValue();return(A)?A.toString():""}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"RegistrationFormValidator");with(editor.ui){editor.ui.RegistrationFormValidator.superClass=core.util.validation.AbstractValidator;editor.ui.RegistrationFormValidator.constructor=function(){this.RegistrationFormValidator=function(form){arguments.callee.prototype.apply(this,[form]);with(core.util.validation){this.firstName=new NonEmptyValidator(new TextField(form.firstName));this.lastName=new NonEmptyValidator(new TextField(form.lastName));this.address=new NonEmptyValidator(new TextField(form.address));this.cityName=new NonEmptyValidator(new TextField(form.city));this.stateName=new NonEmptyValidator(new ListField(form.state));this.zipCode=new ZipCodeValidator(new TextField(form.zip));this.phoneNumber=new PhoneValidator(new TextField(form.phone));this.info=new NonEmptyValidator(new ListField(form.info));this.other=new NonEmptyValidator(new TextField(form.other))}};this.validate=function(){var form=this.getTarget();this.firstName.validate();this.lastName.validate();this.address.validate();this.cityName.validate();this.stateName.validate();this.zipCode.validate();this.phoneNumber.validate();this.info.validate();if("other"==form.info.getValue()){this.other.validate()}}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"RegistrationDialog");with(editor.ui){editor.ui.RegistrationDialog.superClass=core.ui.Dialog;editor.ui.RegistrationDialog.constructor=function(){this.saving=false;this.RegistrationDialog=function(parent){arguments.callee.prototype.apply(this,[parent]);with(core.ui){this.splitter=new SplitWindow(this);this.splitter.addPane(this.createButtons(this.splitter),SplitWindow.SPLIT_BOTTOM);this.splitter.addPane(this.createMainPane(this.splitter),SplitWindow.SPLIT_TOP);this.validator=new RegistrationFormValidator(this);this.updateControls()}};this.doModal=override(this.doModal,function(){arguments.callee.prototype.apply(this,[]);this.firstName.setFocus(true)});this.validate=function(){try{this.validator.validate();return true}catch(e){TooltipController.showBalloonTip(e.getValidator().getTarget().getField(),e.getMessage(),core.ui.Balloon.RIGHT);return false}};this.updateControls=function(){if("other"==this.info.getValue()){this.other.setVisible(true);this.other.setFocus(true)}else{this.other.setVisible(false)}this.saveButton.setText(this.saving?"Saving...":"OK");this.saveButton.setEnabled(!this.saving);this.splitter.updateLayout()};this.createButtons=function(splitter){with(core.ui){var pane=new Window(splitter);pane.setStyleName("Buttons");this.closeButton=this.createCloseButton(pane);this.saveButton=this.createSaveButton(pane);return pane}};this.createMainPane=function(splitter){var pane=new core.ui.Window(splitter);pane.setStyleName("MainPane");var title=new core.ui.Static(pane);title.addStyleName("Title");title.setText("Fill this form to complete registration");this.createRegistrationGroup(pane);return pane};this.createRegistrationGroup=function(pane){var group=new core.ui.Window(pane);group.setStyleName("RegistrationFieldsGroup");group.setStyle("position","absolute");this.firstName=this.createFirstNameField(group);this.lastName=this.createLastNameField(group);this.address=this.createAddressField(group);this.city=this.createCityField(group);this.state=this.createStateField(group);this.zip=this.createZipField(group);this.phone=this.createPhoneField(group);this.info=this.createInfoField(group);this.other=this.createOtherField(group);return group};this.createFirstNameField=function(pane){var title=new core.ui.Static(pane);title.addStyleName("FirstNameTitle");title.setStyle("position","absolute");title.setText("First name:");var field=new core.ui.Edit(pane);field.addStyleName("FirstNameField");field.setStyle("position","absolute");field.setTabIndex(1);return field};this.createLastNameField=function(pane){var title=new core.ui.Static(pane);title.addStyleName("LastNameTitle");title.setStyle("position","absolute");title.setText("Last name:");var field=new core.ui.Edit(pane);field.addStyleName("LastNameField");field.setStyle("position","absolute");field.setTabIndex(2);return field};this.createAddressField=function(pane){var title=new core.ui.Static(pane);title.addStyleName("AddressTitle");title.setStyle("position","absolute");title.setText("Street address:");var field=new core.ui.Edit(pane);field.addStyleName("AddressField");field.setStyle("position","absolute");field.setTabIndex(3);return field};this.createCityField=function(pane){var title=new core.ui.Static(pane);title.addStyleName("CityTitle");title.setStyle("position","absolute");title.setText("City:");var field=new core.ui.Edit(pane);field.addStyleName("CityField");field.setStyle("position","absolute");field.setTabIndex(4);return field};this.createStateField=function(pane){var app=editor.Application.getInstance();var title=new core.ui.Static(pane);title.addStyleName("StateTitle");title.setStyle("position","absolute");title.setText("State:");var list=new core.ui.ComboBox(pane);list.addStyleName("StateField");list.setStyle("position","absolute");list.setEditable(false);var states=app.config.get("registration.states",{});list.addItem("(Select please)","",true);for(var st in states){list.addItem(states[st],st)}return list};this.createZipField=function(pane){var title=new core.ui.Static(pane);title.addStyleName("ZipTitle");title.setStyle("position","absolute");title.setText("Zip/Postal Code:");var field=new core.ui.Edit(pane);field.addStyleName("ZipField");field.setStyle("position","absolute");field.setTabIndex(6);return field};this.createPhoneField=function(pane){var title=new core.ui.Static(pane);title.addStyleName("PhoneTitle");title.setStyle("position","absolute");title.setText("Phone:");var field=new core.ui.Edit(pane);field.addStyleName("PhoneField");field.setStyle("position","absolute");field.setTabIndex(7);return field};this.createInfoField=function(pane){var app=editor.Application.getInstance();var title=new core.ui.Static(pane);title.addStyleName("InfoTitle");title.setStyle("position","absolute");title.setText("How did you hear about "+app.config.get("app.name","us")+"?");var list=new core.ui.ComboBox(pane);list.addStyleName("InfoField");list.setStyle("position","absolute");list.setEditable(false);list.addItem("(Select please)","",true);list.addItem("From friends","friends");list.addItem("From advertising","advertising");list.addItem("Other","other");list.notifyValueChanged.addListener(this.onUpdateControls);return list};this.createOtherField=function(pane){var field=new core.ui.Edit(pane);field.addStyleName("OtherField");field.setStyle("position","absolute");field.setTabIndex(9);return field};this.createSaveButton=function(pane){var button=new core.ui.ImageButton(pane);button.addStyleName("SaveButton");button.setImageList("images/SaveDialog/button.gif");button.setText("OK");button.setTabIndex(13);button.oncommand=this.onSaveButtonClick;return button};this.createCloseButton=function(pane){var button=new core.ui.ImageButton(pane);button.addStyleName("CloseButton");button.setImageList("images/SaveDialog/button.gif");button.setText("Later");button.setTabIndex(14);button.oncommand=this.onCloseButtonClick;return button};this.endModal=override(this.endModal,function(){TooltipController.hideBalloonTip();arguments.callee.prototype.apply(this,[])});this.onUpdateControls=callback(this,function(){this.updateControls()});this.onCloseButtonClick=callback(this,function(){this.endModal()});this.onSaveButtonClick=callback(this,function(){if(this.validate()){var app=editor.Application.getInstance();app.addAppListener(this);app.save()}});this.onAppSaving=function(app,context){this.saving=true;this.updateControls();context.setUrl(app.getUserCommand("ajax.Registration"));context.set("account.firstName",this.firstName.getText());context.set("account.firstName",this.firstName.getText());context.set("account.lastName",this.lastName.getText());context.set("account.address",this.address.getText());context.set("account.city",this.city.getText());context.set("account.state",this.state.getValue());context.set("account.zip",this.zip.getText());context.set("account.phone",this.phone.getText());context.set("account.info",("other"!==this.info.getValue())?this.info.getValue():this.other.getText())};this.onAppSaved=function(app){app.removeAppListener(this);this.saving=false;this.updateControls();this.endModal()};this.onAppSavingError=function(app,message){app.removeAppListener(this);this.saving=false;this.updateControls();alert("Sorry, the error occurs while saving the page ("+message+")")}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"SingletonFactory");with(editor.ui){editor.ui.SingletonFactory.constructor=function(){this.instances={};this.getInstance=function(A){if(!defined(this.instances[A])){this.instances[A]=new A()}return this.instances[A]};this.instanceCreated=function(A){return(defined(this.instances[A]))}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"StateButton");with(editor.ui){editor.ui.StateButton.superClass=editor.ui.MenuButton;editor.ui.StateButton.constructor=function(){this.turned=false;this.StateButton=function(B,A,E,C,D){this.MenuButton(B,A,E,C,D)};this.turn=function(A){if(!this.isEnabled()||(A===this.turned)){return }if(defined(A)){this.turned=A?true:false}else{this.turned=!this.turned}this.setState(this.turned?core.ui.ImageButton.STATE_PRESSED:core.ui.ImageButton.STATE_NORMAL)};this.isTurned=function(){return(this.turned)?true:false}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"SealButton");with(editor.ui){editor.ui.SealButton.superClass=editor.ui.StateButton;editor.ui.SealButton.constructor=function(){this.pressed=false;this.notifier;this.SealButton=function(B,A,E,C,D){this.MenuButton(B,A,E,C,D);SealButton.notifyPress.addListener(this.onNeedUnseal)};this.onNeedUnseal=callback(this,function(A){if(this.pressed&&A!=this){this.pressed=false;if(this.getElement()){this.setState(core.ui.ImageButton.STATE_NORMAL)}}});this.onmousedown=function(A){this.setState(core.ui.ImageButton.STATE_PRESSED);this.setFocus(true);this.pressed=true;SealButton.notifyPress.send(this);this.activate();A.stop();return false};this.onmouseout=function(A){this.setState(this.pressed?core.ui.ImageButton.STATE_PRESSED:core.ui.ImageButton.STATE_NORMAL);A.stop()};this.onblur=function(){this.setState(this.pressed?core.ui.ImageButton.STATE_PRESSED:core.ui.ImageButton.STATE_NORMAL)};this.onmouseover=this.onmouseup=function(A){if(!this.pressed){this.setState(core.ui.ImageButton.STATE_HOVER)}A.stop()};this.onkeydown=function(C,B,A){if(Event.KEY_SPACE==C.keyCode){C.stop();this.setState(core.ui.ImageButton.STATE_PRESSED);this.pressed=true;SealButton.notifyPress.send(this)}else{if(Event.KEY_ENTER==C.keyCode){C.stop();if(defined(this.oncommand)){this.oncommand(C,B,A)}}}};this.onkeyup=function(C,B,A){if(Event.KEY_SPACE==C.keyCode){C.stop();if(defined(this.oncommand)){this.oncommand(C,B,A)}}}};editor.ui.SealButton.notifyPress=new core.ui.Notification()}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"TemplatesMenu");with(editor.ui){editor.ui.TemplatesMenu.superClass=core.ui.Menu;editor.ui.TemplatesMenu.constructor=function(){this.categories;this.templates;this.selectedItem;this.selectedTemplate;this.notifyCategorySelected=new core.ui.Notification();this.notifyTemplateSelected=new core.ui.Notification();this.TemplatesMenu=function(parent,x,y,width,height){this.Menu(parent,x,y,width,height);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.templates=new ScrollWindow(splitter);this.templates.setContentWindow(new Menu(this.templates));this.templates.addStyleName("Templates");splitter.addPane(this.categories,SplitWindow.SPLIT_LEFT);splitter.addPane(this.templates,SplitWindow.SPLIT_FILL)}this.loadCategories()};this.loadCategories=function(){LoadingMessage.showText(this);window.setTimeout(callback(this,function(){core.ajax.sendRequest("ajax.EnumerateTemplates",this.onLoadCategories)}),100)};this.onLoadCategories=callback(this,function(response){try{if("OK"==response.status){var path=response.path;for(var i=0;i<response.categories.length;i++){var item=new MenuButton(this.categories.getContentWindow());item.category=response.categories[i];item.setText(item.category);item.setIcon(path+"/"+item.category+"/"+item.category+".png");item.setImageList("images/TemplatesMenu/category.gif");item.oncommand=this.onCategoryItemClick;this.categories.getContentWindow().addItem(item);if(0==i){this.selectCategoryItem(item)}}this.categories.reset()}else{if(defined(response.message)){throw new Error("Error occurs while loading template categories from server. Response message is:"+response.message)}else{throw new Error("Unspecified error occurs while loading template categories from server. See server logs for details.")}}}catch(e){alert("Sorry, the error occurs while loading template categories from server.\n\nError details: "+e.message)}LoadingMessage.hideMessage(this)});this.loadTemplates=function(c){LoadingMessage.showText(this);this.templates.getContentWindow().removeItems();window.setTimeout(callback(this,function(){core.ajax.sendRequest("ajax.EnumerateTemplates",this.onLoadTemplates,{"category":c})}),100)};this.onLoadTemplates=callback(this,function(response){try{if("OK"==response.status){if((!defined(this.selectedItem.element))||(!this.selectedItem.element)){return }if(this.selectedItem.getText()!=response.category){return }var path=response.path;this.items=[];for(var i=0;i<response.templates.length;i++){var name=response.templates[i];var item=new SealButton(this.templates.getContentWindow());item.template={"name":name,"path":path+"/"+name+"/"+name+".html","thumbnail":path+"/"+name+"/"+name+".png","category":response.category};item.setStyle("position","absolute");var margin=editor.ui.TemplatesMenu.SEAL_BUTTON_MARGIN;if(i%2==0){item.move(margin,(item.getHeight()+margin)*i/2+margin)}else{item.move(item.getWidth()+2*margin,(item.getHeight()+margin)*((i-1)/2).toFixed()+margin)}item.oncommand=this.onItemClick;item.setText(item.template.name);item.setIcon(item.template.thumbnail);item.setImageList("images/TemplatesMenu/item.gif");this.templates.getContentWindow().addItem(item);this.items.push(item)}this.templates.reset()}else{if(response.message){throw new Error("Failed to load templates. Response message is: "+response.message)}else{throw new Error("Unspecified error occurs while loading templates.")}}}catch(e){alert("Sorry, the error occurs while loading templates from server.\n\nError details: "+e.message)}LoadingMessage.hideMessage(this)});this.selectCategoryItem=function(item){if((this.selectedItem&&(this.selectedItem.constructor===MenuButton||defined(this.selectedItem.constructor.isSubclassOf)&&this.selectedItem.constructor.isSubclassOf(MenuButton)))){if(item==this.selectedItem){return }this.selectedItem.setImageList("images/TemplatesMenu/category.gif")}item.setImageList("images/TemplatesMenu/category-active-2.gif");this.loadTemplates(item.getText());this.selectedItem=item};this.getCategoriesMenu=function(){return this.categories.getContentWindow()};this.getTemplatesMenu=function(){return this.templates.getContentWindow()};this.onItemClick=callback(this,function(event,target,item){window.setTimeout(callback(this,function(){this.selectedTemplate=item;this.notifyTemplateSelected.send(this,item.template.path);this.endPopup()}),1)});this.onCategoryItemClick=callback(this,function(event,target,item){this.notifyCategorySelected.send(this,item.getText());this.selectCategoryItem(item)})};editor.ui.TemplatesMenu.SEAL_BUTTON_MARGIN=5}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"TemplatesDialog");with(editor.ui){editor.ui.TemplatesDialog.superClass=core.ui.Dialog;editor.ui.TemplatesDialog.constructor=function(){this.TemplatesDialog=function(parent){arguments.callee.prototype.apply(this,[parent]);with(core.ui){var splitter=new SplitWindow(this,0,0,"100%","100%");this.menu=new TemplatesMenu(splitter);var buttons=new Window(splitter);buttons.addStyleName("ButtonsPane");this.closeButton=new ImageButton(buttons);this.closeButton.addStyleName("CloseButton");this.closeButton.setImageList("images/TemplatesDialog/close.gif");this.closeButton.setToolTip("Close dialog");this.closeButton.setText("Close");this.closeButton.oncommand=parent.onCloseButtonClick;splitter.addPane(buttons,SplitWindow.SPLIT_BOTTOM);splitter.addPane(this.menu)}};this.getMenu=function(){return this.menu}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"GuiFactory");with(editor.ui){editor.ui.GuiFactory.superClass=editor.ui.SingletonFactory;editor.ui.GuiFactory.constructor=function(){this.createDialogWithFrame=function(C,B){if(!defined(this.instances[C])){var A=new DialogFrame();A.setTitle(defined(B)?B:"");A.setContentWindow(new C(A));A.addCloseListener({onFrameClose:function(D){D.endModal()}});this.instances[C]=A}return this.instances[C]};this.createPanelWithFrame=function(A,C){if(!defined(this.instances[A])){var B=new PanelFrame();B.setTitle(defined(C)?C:"");B.setContentWindow(new A(B));this.instances[A]=B}return this.instances[A]};this.createMenuWithFrame=function(B){if(!defined(this.instances[B])){var A=new PopupMenuFrame();A.setContentWindow(new B(A));this.instances[B]=A}return this.instances[B]};this.getBorderDialog=function(){return this.createDialogWithFrame(BorderDialog,"Border style")};this.getMusicDialog=function(){return this.createDialogWithFrame(MusicDialog,"Select music")};this.getLoadingDialog=function(){var A=this.createDialogWithFrame(LoadingDialog,"Loading...");A.closeButton.hide();return A};this.getWorkspacePanel=function(){return this.createPanelWithFrame(WorkspacePanel,"Workspace")};this.getToolboxPanel=function(){return this.createPanelWithFrame(Toolbox,"Toolbox")};this.getImageLibrary=function(){return this.createDialogWithFrame(ImageLibrary,"Image library")};this.getUrlDialog=function(){return this.createDialogWithFrame(UrlDialog)};this.getImageDialog=function(){return this.createDialogWithFrame(ImageDialog,"Load image")};this.getRegistrationDialog=function(){return this.createDialogWithFrame(RegistrationDialog,"Complete registration")};this.getTemplatesDialog=function(){return this.createDialogWithFrame(TemplatesDialog,"Load sample page")};this.getColorMenu=function(){return this.createMenuWithFrame(ColorMenu)};this.getCalendar=function(){return this.createMenuWithFrame(core.ui.Calendar)}}}ClassFactory.createPackage("editor.ui");ClassFactory.createClass(editor.ui,"VisibilityManager");with(editor.ui){editor.ui.VisibilityManager.constructor=function(){};editor.ui.VisibilityManager.visibility={};editor.ui.VisibilityManager.hide=function(){for(var A=0;A<arguments.length;A++){var B=arguments[A];if((B&&(B.constructor===core.ui.Window||defined(B.constructor.isSubclassOf)&&B.constructor.isSubclassOf(core.ui.Window)))){this.visibility[B.getId()]=B.isVisible();B.hide()}}};editor.ui.VisibilityManager.restore=function(){for(var A=0;A<arguments.length;A++){var B=arguments[A];if((B&&(B.constructor===core.ui.Window||defined(B.constructor.isSubclassOf)&&B.constructor.isSubclassOf(core.ui.Window)))){if(defined(this.visibility[B.getId()])){B.setVisible(this.visibility[B.getId()])}}}}}ClassFactory.createPackage("editor.elements");ClassFactory.createClass(editor.elements,"Session");with(editor.elements){editor.elements.Session.constructor=function(){this.flags={};this.counter=0;this.setModified=function(A,B){if(B){if(!this.isModified(A)){this.flags[A.getId()]|=Session.FLAG_MODIFIED;this.counter++}}else{if(this.isModified(A)){this.flags[A.getId()]&=~Session.FLAG_MODIFIED;this.flags[A.getId()]|=Session.FLAG_UNMODIFIED;this.counter--}}};this.isModified=function(A){return(this.flags[A.getId()]&Session.FLAG_MODIFIED)};this.hasModifications=function(){return(this.counter>0)};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;H<L.childNodes.length;H++){var D=L.childNodes.item(H);if((1==D.nodeType)&&defined(D.className)){try{var A=D.getAttribute("package");var M=A+"."+D.className;var J=ClassFactory.getClassByName(M);var G=D.cloneNode(true);document.body.appendChild(G);this.add(new J(G))}catch(K){console.warn("Failed creating new element: "+D.className);console.warn(K.message)}}}if(L.className){var C=L.className.split(" ");for(var F=new core.util.Iterator(C);F.hasNext();F.next()){this.settings.set(F.current(),true)}}E.plugins.background.loadBackgroundStyle(L.style.backgroundColor+" "+L.style.backgroundImage+" "+L.style.backgroundPosition+" "+L.style.backgroundRepeat);this.update(E.getMode()===editor.Application.MODE_EDIT)};this.setOption=function(B,C){var A=this.settings.get(B);this.settings.set(B,C);this.fireSettingsChanged(B,C,A)};this.getOption=function(A){return this.settings.get(A)};this.removeOption=function(A){var B=this.settings.get(A);this.settings.remove(A);this.fireSettingsRemoved(A,B)};this.isModified=function(){return this.session.hasModifications()};this.add=function(B,A,D,C){this.elements.push(B);B.setIndex(this.elements.length-1);if(C){if(defined(A)&&defined(D)){B.move(A-B.getWidth()/2,D-B.getHeight()/2)}else{B.center()}}this.fireElementAdded(B);return B};this.insert=function(B,A,D,C){this.add(B,A,D);if(defined(C)&&(C>0)){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;A<this.elements.length;A++){var B=this.elements[A];if(B.isOverlappable()){this.elements[C.getIndex()]=B;B.setIndex(C.getIndex());this.elements[A]=C;C.setIndex(A);document.body.replaceChild(C.getElement(),B.getElement());document.body.insertBefore(B.getElement(),C.getElement());B.fireChanged();if(this.isOverlap(B,C)){if(defined(E)&&(E!=null)){if(!(--E>0)){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<this.elements.length;B++){if(this.elements[B].isOverlappable()&&this.isOverlap(A,this.elements[B])){C++}}return C};this.renderHtml=function(){var D="";for(var C=this.iterator();C.hasNext();C.next()){var B=C.current();var A=B.getHtmlTag();if(null!==A){this.fireRenderElement(B,A);D+=A.toString()}}return D};this.excludeElement=function(A){if(!A.isDeleted()){this.fireElementRemoved(A);if(A.getElement()){document.body.removeChild(A.getElement())}this.elements.splice(A.getIndex(),1);this.updateIndexes();A.setDeleted(true)}};this.isOverlap=function(B,A){return((B.getX()+B.getWidth()>=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;A<this.elements.length;A++){this.elements[A].setIndex(A)}};this.update=function(B){for(var A=this.iterator();A.hasNext();A.next()){A.current().setEnabled(B)}};this.fireElementAdded=function(A){this.listeners.call("onCollectionElementAdded",[this,A])};this.fireElementRemoved=function(A){this.listeners.call("onCollectionElementRemoved",[this,A])};this.fireRenderElement=function(B,A){this.listeners.call("onCollectionRenderElement",[this,B,A])};this.fireSettingsChanged=function(B,C,A){this.listeners.call("onCollectionSettingsChanged",[this,B,C,A])};this.fireSettingsRemoved=function(A,B){this.listeners.call("onCollectionSettingsRemoved",[this,A,B])};this.onAppSaving=function(B,A){A.set("page.content",this.renderHtml());A.set("page.settings",this.settings.toString())};this.onAppClose=function(){if(this.isModified()){throw new Error("The website is not saved!")}};this.onAppModeChanged=function(A){this.update(A.getMode()===editor.Application.MODE_EDIT)};this.onAppSaved=function(){this.session.clear()}}}ClassFactory.createPackage("editor");ClassFactory.createClass(editor,"Application");with(editor){editor.Application.constructor=function(){this.plugins={};this.mode=Application.MODE_EDIT;this.Application=function(){this.listeners=new core.util.Listeners();this.config=new core.app.Config()};this.init=function(id){this.factory=new editor.ui.GuiFactory();this.collection=new editor.elements.Collection();this.workspace=new Workspace();this.loadConfig(id);this.loadPlugins();this.deferredInit()};this.save=function(){this.workspace.setTitle(this.config.get("page.personName")+"'s page (Saving...)");var context=new SaveContext(this.getUserCommand("ajax.SavePage"));this.fireSaving(context);core.ajax.sendRequest(context.getUrl(),this.onSaveResponse,context.toObject())};this.close=function(){try{this.fireClose()}catch(e){return e.message}};this.clear=function(){this.fireClear();this.factory.getToolboxPanel().getContentWindow().updateControls();this.collection.removeAll()};this.loadTemplate=function(template){this.config.set("page.template",template);this.loadFromUrl("ajax.Template?pageId="+this.config.get("id")+"&name="+template)};this.loadPage=function(pageId){this.loadFromUrl("ajax.PageContent?pageId="+pageId)};this.switchPanel=function(panel){if(this.currentPanel!=panel){if(panel){if(this.currentPanel){panel.move(this.currentPanel.getX(),this.currentPanel.getY());this.currentPanel.hide()}else{var workspace=this.factory.getWorkspacePanel();panel.move(workspace.getX()+workspace.getWidth(),workspace.getY())}}else{if(this.currentPanel){this.currentPanel.hide()}}this.currentPanel=panel;if(this.currentPanel){this.currentPanel.show()}}};this.switchMode=function(mode){this.mode=mode;if(editor.Application.MODE_PREVIEW==mode){core.ui.quirks.TextSelection.allowSelection(window.document.body);editor.ui.VisibilityManager.hide(this.factory.getWorkspacePanel(),this.factory.getToolboxPanel(),this.currentPanel)}else{core.ui.quirks.TextSelection.preventSelection(window.document.body);editor.ui.VisibilityManager.restore(this.factory.getWorkspacePanel(),this.factory.getToolboxPanel(),this.currentPanel)}this.fireModeChanged()};this.getConfig=function(){return this.config};this.getMode=function(){return this.mode};this.getCollection=function(){return this.collection};this.getGuiFactory=function(){return this.factory};this.getWorkspace=function(){return this.workspace};this.getSession=function(){return this.session};this.getCurrentPanel=function(){return this.currentPanel};this.addAppListener=function(listener){this.listeners.add(listener)};this.removeAppListener=function(listener){this.listeners.remove(listener)};this.loadConfig=function(id){if(this.config.load("ajax.Config?pageId="+id)){this.config.set("id",id);with(common.util.DateUtils){this.config.set("page.birthDate",toMilliseconds(this.config.get("page.birthDate")));this.config.set("page.deathDate",toMilliseconds(this.config.get("page.deathDate")));this.config.set("page.savedTime",timestamp2millisec(this.config.get("page.savedTime")));this.fireConfigured()}}else{console.error("Cannot load configuration.")}};this.loadPlugins=function(){var plugins=this.config.get("editor.plugins",{});for(var name in plugins){try{var clazz=ClassFactory.getClassByName(plugins[name]);this.plugins[name]=new clazz()}catch(e){console.error("Failed to load plugins: %s (%s)",name,e.message)}}};this.loadFromUrl=function(url){this.fireClear();this.switchPanel(null);this.collection.removeAll();try{var html=HTTPFileLoader.loadFile(url);this.collection.loadHtml(html);this.firePageLoaded(url)}catch(e){this.fireLoadingError(url,e.message)}};this.fireInitComplete=function(){this.listeners.call("onAppInitComplete",[this])};this.fireClear=function(){this.listeners.call("onAppClear",[this])};this.fireClose=function(){this.listeners.call("onAppClose",[this])};this.fireConfigured=function(){this.listeners.call("onAppConfigured",[this])};this.fireModeChanged=function(){this.listeners.call("onAppModeChanged",[this])};this.firePageLoaded=function(url){this.listeners.call("onAppPageLoaded",[this,url])};this.fireLoadingError=function(url,message){this.listeners.call("onAppLoadingError",[this,url,message])};this.fireSaving=function(context){this.listeners.call("onAppSaving",[this,context])};this.fireSaved=function(){this.listeners.call("onAppSaved",[this])};this.fireSaveError=function(message){this.listeners.call("onAppSaveError",[this,message])};this.onSaveResponse=callback(this,function(response){if("OK"==response.status){if(defined(response.registered)){this.config.set("registration.complete",true)}var time=common.util.DateUtils.timestamp2millisec(response.savedTime);this.config.set("page.savedTime",time);this.fireSaved();this.workspace.setTitle(this.config.get("page.personName")+"'s website (last saved on "+common.util.DateUtils.toClientDate(time,true)+")")}else{this.fireSaveError(response.message)}});this.getUserCommand=function(cmd){return cmd+"?pageId="+this.config.get("page.id")};this.deferredInit=callback(this,function(){switch(this.initStep){case undefined:var time=this.config.get("page.savedTime")?"last saved on "+common.util.DateUtils.toClientDate(this.config.get("page.savedTime"),true):"Unsaved";this.workspace.setTitle(this.config.get("page.personName")+"'s website ("+time+")");core.ui.quirks.TextSelection.preventSelection(window.document.body);this.initStep=0;case 0:var loading=this.factory.getLoadingDialog();loading.center();loading.doModal();break;case 1:this.factory.getWorkspacePanel().move(0,0);break;case 2:var toolbox=this.factory.getToolboxPanel();toolbox.move(document.body.clientWidth-toolbox.getWidth(),0);break;case 3:this.workspace.init();break;case 4:this.factory.getWorkspacePanel().show();this.factory.getToolboxPanel().show();break;default:if(this.config.get("editor.firstRun")){this.loadTemplate(this.config.get("page.template"))}else{this.loadPage(this.config.get("page.id"))}this.factory.getLoadingDialog().endModal();this.fireInitComplete();if(this.config.get("editor.firstRun")){this.save()}return }var totalSteps=6;var progressBar=this.factory.getLoadingDialog().getContentWindow().progressBar;progressBar.setPos(++this.initStep/totalSteps*100);window.setTimeout(this.deferredInit,1)})};editor.Application.getInstance=function(){if(!defined(this.instance)){this.instance=new Application()}return this.instance};editor.Application.MODE_EDIT=1;editor.Application.MODE_PREVIEW=2}ClassFactory.createPackage("editor.ui.wizard");ClassFactory.createClass(editor.ui.wizard,"WizardDialog");with(editor.ui.wizard){editor.ui.wizard.WizardDialog.superClass=core.ui.Dialog;editor.ui.wizard.WizardDialog.constructor=function(){this.panes={};this.paneCount=0;this.listeners=new core.util.Listeners();this.WizardDialog=function(parent){arguments.callee.prototype.apply(this,[parent]);with(core.ui){var splitter=new SplitWindow(this,0,0,"100%","100%");this.description=new Static(splitter);this.description.addStyleName("Description");var titlePane=new Window(splitter);titlePane.addStyleName("TitlePane");this.title=new Static(titlePane);this.title.addStyleName("Title");this.contentPane=new Window(splitter);this.contentPane.addStyleName("ContentPane");var buttonsPane=new Window(splitter);buttonsPane.addStyleName("ButtonsPane");this.cancelButton=new ImageButton(buttonsPane);this.cancelButton.addStyleName("CancelButton");this.cancelButton.setImageList("images/Wizard/button.gif");this.cancelButton.setText("Cancel");this.cancelButton.setToolTip("Cancel dialog");this.cancelButton.oncommand=this.onCancelClick;this.cancelButton.setTabIndex(2);this.nextButton=new ImageButton(buttonsPane);this.nextButton.addStyleName("NextButton");this.nextButton.setImageList("images/Wizard/next.gif");this.nextButton.setText("Next");this.nextButton.setTabIndex(1);this.nextButton.oncommand=this.onNextClick;this.backButton=new ImageButton(buttonsPane);this.backButton.addStyleName("BackButton");this.backButton.setImageList("images/Wizard/next.gif");this.backButton.setText("Back");this.backButton.setToolTip("Back to the previous step");this.backButton.setTabIndex(3);this.backButton.oncommand=this.onBackClick;this.skipBox=new CheckBox(buttonsPane);this.skipBox.setText("Skip this wizard");this.skipBox.onclick=this.onSkipClick;splitter.addPane(this.description,SplitWindow.SPLIT_RIGHT);splitter.addPane(titlePane,SplitWindow.SPLIT_TOP);splitter.addPane(this.contentPane,SplitWindow.SPLIT_TOP);splitter.addPane(buttonsPane,SplitWindow.SPLIT_FILL)}};this.addWizardListener=function(listener){this.listeners.add(listener)};this.removeWizardListener=function(listener){this.listeners.remove(listener)};this.reset=function(){for(var id in this.panes){this.panes[id].reset()}this.updateControls()};this.getContentPane=function(){return this.contentPane};this.getDescriptionPane=function(){return this.description};this.updateControls=function(){if(this.currentPane.getNextPaneId()&&!(this.currentPane.canSkip()&&this.skipBox.isChecked())){this.nextButton.setText("Next");this.nextButton.setToolTip("Go to the next step")}else{this.nextButton.setText("Finish");this.nextButton.setToolTip("Finish dialog")}this.backButton.setVisible(null!==this.currentPane.getPrevPaneId());this.skipBox.setVisible(this.currentPane.canSkip())};this.setCurrentPane=function(id){if((this.currentPane&&(this.currentPane.constructor===WizardPane||defined(this.currentPane.constructor.isSubclassOf)&&this.currentPane.constructor.isSubclassOf(WizardPane)))){this.currentPane.setActive(false);this.currentPane.hide()}this.currentPane=this.panes[id];this.title.setText(this.currentPane.getTitle());this.description.setText(this.currentPane.getText());this.currentPane.show();this.currentPane.setActive(true);this.updateControls()};this.getCurrentPane=function(){return this.currentPane};this.setPane=function(id,pane){return this.panes[id]=pane};this.getPane=function(id){return(defined(this.panes[id]))?this.panes[id]:undefined};this.getNextPane=function(){return(this.hasPanes())?this.getPane(this.getCurrentPane().getNextPaneId()):undefined};this.getPrevPane=function(){return(this.hasPanes())?this.getPane(this.getCurrentPane().getPrevPaneId()):undefined};this.addPane=function(pane){this.setPane(pane.getPaneId(),pane);pane.setStyle("position","absolute");pane.setStyle("width","100%");pane.setStyle("height","100%");pane.hide();this.paneCount++};this.removePane=function(pane){delete this.panes[pane.getPaneId()];pane.close();this.paneCount--};this.hasPanes=function(){return(this.paneCount>0)};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;B<this.menu.getItemCount();B++){if(this.menu.getItem(B).isUploaded()){A=true}}if(!A){editor.ui.TooltipController.showBalloonTip(this.menu.getItem(0).getFileUpload(),"Please upload at least 1 photo.",core.ui.Balloon.LEFT)}return A};this.onImageUploaded=callback(this,function(){editor.ui.TooltipController.showBalloonTip(this.getWizard().getNextButton(),"After you uploaded 4 - 5 photos click this button.")})}}ClassFactory.createPackage("core.ui");ClassFactory.createClass(core.ui,"Link");with(core.ui){core.ui.Link.superClass=core.ui.Window;core.ui.Link.constructor=function(){this.Link=function(B,A,E,C,D){arguments.callee.prototype.apply(this,[B,A,E,C,D]);this.setStyle("display","block");this.setTarget(Link.TARGET_SELF);this.setHref("#")};this.setHref=function(A){this.getElement().href=A};this.getHref=function(){return this.getElement().href};this.setTarget=function(A){this.getElement().target=A};this.getTarget=function(){return this.getElement().target};this.createElement=function(){return document.createElement("a")}};core.ui.Link.TARGET_BLANK="_blank";core.ui.Link.TARGET_PARENT="_parent";core.ui.Link.TARGET_SELF="_self";core.ui.Link.TARGET_TOP="_top"}ClassFactory.createPackage("core.util");ClassFactory.createClass(core.util,"Timer");with(core.util){core.util.Timer.constructor=function(){this.listeners=new Listeners();this.Timer=function(A){this.interval=A};this.addTimerListener=function(A){this.listeners.add(A)};this.removeTimerListener=function(A){this.listeners.remove(A)};this.getInterval=function(){return this.interval};this.fireTimer=function(){this.listeners.call("onTimer",[this])};this.fireStarted=function(){this.listeners.call("onTimerStarted",[this])};this.fireStopped=function(){this.listeners.call("onTimerStopped",[this])};this.start=function(){this.fireStarted();this.timerId=window.setTimeout(this.onTimeout,this.interval)};this.stop=function(){if(defined(this.timerId)){window.clearTimeout(this.timerId);delete this.timerId;this.fireStopped()}};this.onTimeout=callback(this,function(){this.fireTimer();if(defined(this.timerId)){window.clearTimeout(this.timerId);this.timerId=window.setTimeout(this.onTimeout,this.interval)}})}}ClassFactory.createPackage("editor.plugins.wizard");ClassFactory.createClass(editor.plugins.wizard,"TextBlockPane");with(editor.plugins.wizard){editor.plugins.wizard.TextBlockPane.superClass=editor.ui.wizard.WizardPane;editor.plugins.wizard.TextBlockPane.constructor=function(){this.getFieldText=function(){if((this.field&&(this.field.constructor===core.ui.Window||defined(this.field.constructor.isSubclassOf)&&this.field.constructor.isSubclassOf(core.ui.Window)))){return this.field.getText()}else{return this.fieldText||""}};this.setFieldText=function(text){this.fieldText=text};this.setLabel=function(labelText){this.labelText=labelText};this.setMaxLength=function(maxLength){this.maxLength=maxLength};this.setExampleText=function(text){this.exampleText=text};this.setScreenshotUrl=function(url){this.screenshotUrl=url};this.setDimensions=function(width,height){this.sectionWidth=width;this.sectionHeight=height};this.setPosition=function(x,y){this.sectionLeft=x;this.sectionTop=y};this.init=function(){with(core.ui){var s1=new Static(this);s1.setStyle("position","absolute");s1.addStyleName("TextBlockTitle");s1.setText(this.labelText);var s2=new Static(this);s2.setStyle("position","absolute");s2.addStyleName("TextBlockTitle");s2.setText(this.labelText);this.field=new TextArea(this);this.field.setStyle("position","absolute");this.field.setStyle("overflow","auto");this.field.setStyle("padding-right","0px");this.field.addStyleName("TextBlockField");this.field.setTabIndex(4);this.field.setText(this.fieldText||"");this.field.onkeyup=this.field.onchange=this.onFieldChange;core.ui.Event.addListener(this.field.getElement(),"oninput",this.onFieldChange);core.ui.Event.addListener(window.document,"onselectionchange",this.onFieldChange);var s3=new Static(this);s3.setStyle("position","absolute");s3.addStyleName("MaxLengthDescr");s3.setText("Recommended length:");this.maxLengthLabel=new Static(this);this.maxLengthLabel.setStyle("position","absolute");this.maxLengthLabel.addStyleName("MaxLengthLabel");this.maxLengthLabel.setText(this.maxLength);var s4=new Static(this);s4.setStyle("position","absolute");s4.addStyleName("CurLengthDescr");s4.setText("Current text length:");this.curLengthLabel=new Static(this);this.curLengthLabel.setStyle("position","absolute");this.curLengthLabel.addStyleName("CurLengthLabel");this.curLengthLabel.setText(0);this.updateControls()}};this.updateControls=function(){var length=this.getFieldText().length;if(length>this.maxLength){this.curLengthLabel.setText('<span style="color: #ff0000">'+length+"</span>")}else{this.curLengthLabel.setText(length)}};this.setText=override(this.setText,function(text){text+=' <a href="javascript:void(0)" onclick="core.ui.Window.forId(\''+this.getId()+"').onExampleClick(this)\">See example</a><br /><img onload=\"core.ui.Window.forId('"+this.getId()+'\').onScreenshotLoaded(this)" src="'+this.screenshotUrl+'?size=150x1000" style="margin-left: -10px; margin-top: 10px; margin-bottom: 10px; border: 1px solid #AECAF0"/>';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.<br />Please do <b>not</b> 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;H<G.menu.getItemCount();H++){var I=G.menu.getItem(H);if(I.isUploaded()){A.push(I.getFileName())}}}var F={"email":K,"personName":Q.getPersonName(),"siteName":J.getSiteName(),"birthDate":C||"","deathDate":M||"","template":N||"","images":A};var L=B.iterator();while(L.hasNext()){var D=L.next();if((D&&(D.constructor===TextBlockPane||defined(D.constructor.isSubclassOf)&&D.constructor.isSubclassOf(TextBlockPane)))){F[D.getPaneId()]=D.getFieldText()}}core.ajax.sendRequest("ajax.CreateWebsite",this.onWebsiteCreated,F)};this.onWebsiteCreated=callback(this,function(A){if("OK"==A.status){window.location="Editor?pageId="+A.pageId}else{window.alert("Sorry, the unexpected error occurs: "+A.message)}})}}ClassFactory.createPackage("common");ClassFactory.createClass(common,"PopupMenuItem");with(common){common.PopupMenuItem.superClass=core.ui.MenuItem;common.PopupMenuItem.constructor=function(){this.PopupMenuItem=function(A,B,C){arguments.callee.prototype.apply(this,[A]);this.setStyle("overflow-y","visible");this.link=new core.ui.Link(this);this.link.setHref(B);this.link.setText(C)};this.getLink=function(){return this.link};this.onmouseover=function(){this.addStyleName(this.getStyleName()+"-hover")};this.onmouseout=function(){this.removeStyleName(this.getStyleName()+"-hover")}}}ClassFactory.createPackage("common");ClassFactory.createClass(common,"PageMenu");with(common){common.PageMenu.superClass=core.ui.Menu;common.PageMenu.constructor=function(){this.update=function(B,A){this.removeItems();this.addItem(new PopupMenuItem(this,"Editor?pageId="+B,"Edit this website"));this.addItem(new PopupMenuItem(this,"EditPersonData?pageId="+B,"Edit person data"));this.addItem(new PopupMenuItem(this,"MakePrivate?pageId="+B,(A?"Make it public":"Make it private")));this.addItem(new PopupMenuItem(this,"DeleteWebsite?pageId="+B,"Delete this website"));this.getItem(0).getLink().setStyle("font-weight","bold");this.getItem(3).onclick=this.onDeleteItemClick};this.onDeleteItemClick=callback(this,function(A){if(!confirm("Delete this website?")){this.endPopup();A.cancel()}})};common.PageMenu.getMenu=function(B,A){if(!defined(this.instance)){this.instance=new PageMenu()}this.instance.update(B,A);return this.instance}}ClassFactory.createPackage("common");ClassFactory.createClass(common,"Ticker");with(common){common.Ticker.constructor=function(){this.direction=Ticker.DIRECTION_LEFT;this.scrollType=Ticker.SCROLL_AUTO;this.started=false;this.quickShift=false;this.timeoutId=null;this.Ticker=function(){this.scrollType=document.getElementById("ticker").className;this.container=document.getElementById("container");this.stripe=document.getElementById("stripe");this.ticker=document.getElementById("ticker");this.offsetWidth=this.container.offsetWidth;this.scrollWidth=this.container.scrollWidth;this.stripeWidth=this.stripe.offsetWidth;with(window.document){getElementById("leftArrow").onmouseover=this.onLeftMouseOver;getElementById("leftArrow").onmouseout=this.onLeftMouseOut;getElementById("rightArrow").onmouseover=this.onRightMouseOver;getElementById("rightArrow").onmouseout=this.onRightMouseOut;this.ticker.onmouseover=this.onMiddleMouseOver;this.ticker.onmouseout=this.onMiddleMouseOut}if(this.isAutoScroll()){this.start()}};this.start=function(){this.started=true;this.timeoutId=window.setTimeout(this.onShift,0)};this.stop=function(){this.started=false;window.clearTimeout(this.timeoutId)};this.isStarted=function(){return this.started};this.setDirection=function(direction){this.direction=direction};this.getDirection=function(){return this.direction};this.setQuickShift=function(quick){this.quickShift=quick};this.isQuickShift=function(){return this.quickShift};this.isAutoScroll=function(){return(Ticker.SCROLL_AUTO==this.scrollType)};this.onShift=callback(this,function(){if(this.scrollWidth<=this.offsetWidth){return }var offset=(this.isQuickShift()?6:1)*this.direction;var left=this.ticker.offsetLeft+offset;if(left+2*this.stripeWidth<this.offsetWidth){this.ticker.style.left=(left+this.stripeWidth)+"px"}else{if(left>0){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"}
