aw.js
上传用户:q2283699q
上传日期:2022-05-17
资源大小:10704k
文件大小:130k
- /*****************************************************************
- ActiveWidgets 2.0.2 Standard Edition
- Copyright (C) 2003-2007 ActiveWidgets Ltd. All Rights Reserved.
- http://www.activewidgets.com/
- WARNING: This software program is protected by copyright law
- and international treaties. Unauthorized reproduction or
- distribution of this program, or any portion of it, may result
- in severe civil and criminal penalties, and will be prosecuted
- to the maximum extent possible under the law.
- *****************************************************************/
- if(!window.AW){var AW=function(a,b){return AW.dispatch(a,b)};AW.version=202;AW.toString=function(){return "ActiveWidgets 2.0.2"}}if(!AW.System){AW.System={}}if(!AW.HTML){AW.HTML={}}if(!AW.Templates){AW.Templates={}}if(!AW.Scroll){AW.Scroll={}}if(!AW.Panels){AW.Panels={}}if(!AW.Formats){AW.Formats={}}if(!AW.HTTP){AW.HTTP={}}if(!AW.CSV){AW.CSV={}}if(!AW.XML){AW.XML={}}if(!AW.UI){AW.UI={}}if(!AW.Grid){AW.Grid={}}if(!AW.Tree){AW.Tree={}}if(!AW.UI.Controllers){AW.UI.Controllers={}}if(!AW.Grid.Controllers){AW.Grid.Controllers={}}
- (function(){AW.all={id:0};AW.docs=[document];AW.log=function(level,arg){try{var i,s="";for(i=0;i<arg.length;i++){s+=arg[i]+" "}window.status=s}catch(error){window.status=error.message}};AW.debug=function(){AW.log("debug",arguments)};AW.info=function(){AW.log("info",arguments)};AW.warn=function(){AW.log("warn",arguments)};AW.error=function(){AW.log("error",arguments)};AW.fatal=function(){AW.log("fatal",arguments)};AW.forEach=function(array,handler){var i,custom={};for(i in array){if(!custom[i]){handler(i,array[i])}}};AW.element=function(id){var i,e,docs=AW.docs;for(i=0;i<docs.length;i++){e=docs[i].getElementById(id);if(e){return e}}};AW.object=function(id){var parts=id.split("-");var tag=parts[0];var obj=AW.all[tag];var target=obj;for(var i=1;i<parts.length;i++){if(obj["_"+parts[i]+"Content"]){for(var j=i;j<parts.length;j++){target=target.getContent(parts[j])}break}else if(parts[i+1] && parts[i+1].match(/^(d+)$/)){if(parts[i+2] && parts[i+2].match(/^(d+)$/)){if(parts[i+3] && parts[i+3].match(/^(d+)$/)){obj=obj.getTemplate(parts[i],parts[i+1],parts[i+2],parts[i+3]);i+=3}else{obj=obj.getTemplate(parts[i],parts[i+1],parts[i+2]);i+=2}}else{obj=obj.getTemplate(parts[i],parts[i+1]);i+=1}}else{obj=obj.getTemplate(parts[i])}target=obj}return target};var events={"DOMFocusIn":"focus"};AW.dispatch=function(element,event){var type="_on"+(events[event.type] || event.type)+"Event";var target=AW.object(element.id);var obj=target;while(obj._parent){obj=obj._parent}return target[type].call(obj,event)};AW.paint=function(element){if(element.$paint || !element.offsetWidth){return "inherit"}element.$paint=true;var obj=AW.object(element.id);while(obj && obj._parent){obj=obj._parent}if(obj && obj.raiseEvent){obj.raiseEvent("paint")}window.setTimeout(function(){element.style.removeExpression("visibility");element=null},0);return "inherit"};AW.camelCase=function(){var i,s=arguments[0];for(i=1;i<arguments.length;i++){s+=arguments[i].substr(0,1).toUpperCase()+arguments[i].substr(1)}return s};AW.textPattern=/("|&|<|>)/gm;AW.textTable={""":""","&":"&","<":"<",">":">"};AW.textReplace=function(c){return AW.textTable[c] || ""};AW.htmlPattern=/("|&|<|>|<[^<>]*>)/gm;AW.htmlTable={""":""","&":"&","<":"<",">":">"};AW.htmlReplace=function(e){return AW.htmlTable[e] || ""};AW.valueToText=function(v){return v?String(v).replace(AW.textPattern,AW.textReplace):""};AW.textToValue=function(t){return t?String(t).replace(AW.htmlPattern,AW.htmlReplace):""}})();
- (function(){AW.browser="";if(document.recalc){AW.browser="ie"}else if(window.__defineGetter__){AW.browser="gecko"}else if(window.opera){AW.browser="opera"}else if(navigator.userAgent.match("Safari")){AW.browser="safari"}if(AW.browser){AW[AW.browser]=true}AW.os="";if(!navigator.userAgent.match("Windows")){AW.unix=true}if(navigator.userAgent.match("Mac OS")){AW.os="mac"}if(navigator.userAgent.match("Linux")){AW.os="linux"}AW.strict=(document.compatMode && document.compatMode.match("CSS"))|| AW.browser=="safari";var htmlc=" aw-all";if(AW.strict){htmlc+=" aw-strict"}if(AW.browser){htmlc+=" aw-"+AW.browser}if(AW.unix){htmlc+=" aw-unix"}if(AW.os){htmlc+=" aw-"+AW.os}if(AW.ie){if(typeof(window.XMLHttpRequest)=="object"){AW.ie7=true;htmlc+=" aw-ie7"}else{AW.ie6=true;htmlc+=" aw-ie6"}}if(AW.gecko){if(typeof(document.inputEncoding)=="string"){AW.ff15=true;htmlc+=" aw-ff15"}else{AW.ff1=true;htmlc+=" aw-ff1"}}AW._htmlClasses=htmlc;if(AW.strict){AW.dx=8;AW.dy=4}else{AW.dx=0;AW.dy=0}})();
- (function(){if(AW.ie){try{document.execCommand("BackgroundImageCache",false,true)}catch(err){}AW.attachEvent=function(element,name,handler){return element.attachEvent(name,handler)};AW.detachEvent=function(element,name,handler){return element.detachEvent(name,handler)};AW.srcElement=function(event){if(event){return event.srcElement}};AW.toElement=function(event){if(event){return event.toElement}};AW.setReturnValue=function(event,value){if(event){event.returnValue=value}};AW.setCapture=function(element){return element.setCapture()};AW.releaseCapture=function(element){return element.releaseCapture()};AW.addRule=function(stylesheet,selector,rule){return stylesheet.addRule(selector,rule)};AW.getRules=function(stylesheet){return stylesheet.rules};AW.setOuterHTML=function(element,html){element.outerHTML=html};AW.createXMLHttpRequest=function(){try{return new ActiveXObject("MSXML2.XMLHTTP")}catch(err){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(err){}try{return new XMLHttpRequest}catch(err){}};AW.getLeft=function(element){return element.getBoundingClientRect().left};AW.getTop=function(element){return element.getBoundingClientRect().top}}})();
- (function(){if(AW.gecko){var capture;AW.attachEvent=function(target,name,handler){if(capture){handler[name]=function(event){return handler.call(target,event)};window.addEventListener(name.replace(/^on/,""),handler[name],true)}else{target.addEventListener(name.replace(/^on/,""),handler,false)}};AW.detachEvent=function(target,name,handler){if(capture){window.removeEventListener(name.replace(/^on/,""),handler[name],true);handler[name]=null}else{target.removeEventListener(name.replace(/^on/,""),handler,false)}};AW.srcElement=function(event){try{return(event.target && event.target.nodeType==3)?event.target.parentNode:event.target}catch(e){return event.target}};AW.toElement=function(event){try{return(event.relatedTarget && event.relatedTarget.nodeType==3)?event.relatedTarget.parentNode:event.relatedTarget}catch(e){return event.relatedTarget}};AW.setReturnValue=function(event,value){if(event && event.preventDefault && !value){event.preventDefault()}};AW.setCapture=function(element){capture=element};AW.releaseCapture=function(element){capture=null};AW.addRule=function(stylesheet,selector,rule){var i=stylesheet.cssRules.length;stylesheet.insertRule(selector+"{"+rule+"}",i);stylesheet.cssRules[i].style.cssText=rule};AW.getRules=function(stylesheet){return stylesheet.cssRules};AW.setOuterHTML=function(element,html){var range=element.ownerDocument.createRange();range.setStartBefore(element);var fragment=range.createContextualFragment(html);element.parentNode.replaceChild(fragment,element)};AW.createXMLHttpRequest=function(){return new XMLHttpRequest};AW.getLeft=function(element){var doc=document.getBoxObjectFor(document.body);return document.getBoxObjectFor(element).screenX - doc.screenX+doc.x};AW.getTop=function(element){var doc=document.getBoxObjectFor(document.body);return document.getBoxObjectFor(element).screenY - doc.screenY+doc.y}}})();
- AW.System.Object=function(){};AW.System.Object.subclass=function(){var create=function(cls){cls.created=true;if(cls.superclass && !cls.superclass.created){create(cls.superclass)}cls.create()};var constructor=function(a,b,c){if(constructor.defer){return}if(!constructor.created){create(constructor)}if(this.init){this.init(a,b,c)}};for(var i in this){constructor[i]=this[i]}this.defer=true;constructor.prototype=new this();this.defer=false;constructor.prototype.constructor=constructor;constructor.superclass=this;constructor.created=false;return constructor};AW.System.Object.handle=function(error){throw(error);};AW.System.Object.create=function(){var obj=this.prototype;obj.clone=function(){if(this._clone.prototype!==this){this._clone=function(){this.init()};this._clone.prototype=this}return new this._clone()};obj._clone=function(){};obj.init=function(){};obj.handle=function(error){throw(error);};obj.setTimeout=function(handler,delay){var self=this;var wrapper=function(){handler.call(self)};return window.setTimeout(wrapper,delay?delay:0)};obj.timeout=obj.setTimeout;obj.toString=function(){return ""}};AW.System.Object.create();
- AW.System.Model=AW.System.Object.subclass();AW.System.Model.create=function(){var obj=this.prototype;var join=function(){var i,s=arguments[0];for(i=1;i<arguments.length;i++){s+=arguments[i].substr(0,1).toUpperCase()+arguments[i].substr(1)}return s};obj.defineProperty=function(name,value){var _getProperty=join("get",name);var _setProperty=join("set",name);var _property="_"+name;var getProperty=function(){return this[_property]};this[_setProperty]=function(value){if(typeof value=="function"){this[_getProperty]=value}else{this[_getProperty]=getProperty;this[_property]=value}};this[_setProperty](value)};var get={};var set={};obj.getProperty=function(name,a,b,c){if(!get[name]){get[name]=join("get",name)}return this[get[name]](a,b,c)};obj.setProperty=function(name,value,a,b,c){if(!set[name]){set[name]=join("set",name)}return this[set[name]](value,a,b,c)};obj.isReady=function(){return true}};
- AW.System.Format=AW.System.Object.subclass();AW.System.Format.create=function(){var obj=this.prototype;obj.valueToText=function(value){return value};obj.dataToValue=function(data){return data};obj.dataToText=function(data){var value=this.dataToValue(data);return this.valueToText(value)};obj.setErrorText=function(text){this._textError=text};obj.setErrorValue=function(value){this._valueError=value};obj.setErrorText("#ERR");obj.setErrorValue(NaN);obj.textToValue=function(text){return text};obj.textToData=function(text){return text};obj.valueToData=function(value){return value};obj.comparator=function(values,greater,less,equal,error){return function(i,j){try{var a=values[i];var b=values[j];if(a > b){return greater}if(a < b){return less}return equal(i,j)}catch(e){return error(i,j,e)}}}};
- AW.System.HTML=AW.System.Object.subclass();AW.System.HTML.create=function(){var obj=this.prototype;obj.setTag=function(tag){this._tag=tag;this._outerHTML=""};obj.getTag=function(){return this._tag};obj._tag="span";obj.init=function(){if(this.$owner){return}if(this._parent){return}this._id="aw"+AW.all.id++;AW.all[this._id]=this};obj.getId=function(){return this._id};obj._id="";obj.setId=function(id){this._id=id;AW.all[this._id]=this};obj.element=function(){var i,docs=AW.docs,id=this.getId(),e;for(i=0;i<docs.length;i++){e=docs[i].getElementById(id);if(e){return e}}};obj.getClass=function(name){var param="_"+name+"Class";var value=this[param];return typeof(value)=="function"?value.call(this):value};obj.setClass=function(name,value){var element=this.element();if(element){var v=(typeof(value)=="function")?value.call(this):value;var s=v || v===0 || v===false?" aw-"+name+"-"+v+" ":" ";element.className=element.className.replace(new RegExp("(aw-"+name+"-\w* *| *$)","g"),"")+s}var param="_"+name+"Class";if(this[param]==null){this._classes+=" "+name}this[param]=value;resetHTMLCache(this)};function resetHTMLCache(obj){obj._outerHTML="";while(obj._parent){obj=obj._parent;obj._innerHTML="";obj._outerHTML=""}if(obj.lock){obj.lock()}}obj.refreshClasses=function(){var element=this.element();if(!element){return}var s="",classes=this._classes.split(" ");for(var i=1;i<classes.length;i++){var name=classes[i];var value=this["_"+name+"Class"];if(typeof(value)=="function"){value=value.call(this)}if(value || value===0 || value===false){s+="aw-"+name+"-"+value+" "}}element.className=s};obj._classes="";obj.getStyle=function(name){var param="_"+name+"Style";var value=this[param];return typeof(value)=="function"?value.call(this):value};obj.setStyle=function(name,value){var element=this.element();if(element){if(!styleNames[name]){styleNames[name]=AW.camelCase.apply(AW,name.split("-"))}var v=(typeof(value)=="function")?value.call(this):value;element.style[styleNames[name]]=v}var param="_"+name+"Style";if(this[param]==null){this._styles+=" "+name}this[param]=value;resetHTMLCache(this)};obj._styles="";var styleNames={};obj.getAttribute=function(name){try{var param="_"+name+"Attribute";var value=this[param];return typeof(value)=="function"?value.call(this):value}catch(error){this.handle(error)}};obj.setAttribute=function(name,value){try{var element=this.element();if(element){var v=(typeof(value)=="function")?value.call(this):value;element[name]=v}var param="_"+name+"Attribute";if(typeof this[param]=="undefined"){this._attributes+=" "+name}if(specialAttributes[name] &&(typeof value=="function")){this[param]=function(){return value.call(this)?true:null}}else{this[param]=value}resetHTMLCache(this)}catch(error){this.handle(error)}};obj._attributes="";var specialAttributes={checked:true,disabled:true,hidefocus:true,readonly:true};obj.getEvent=function(name){try{var param="_"+name+"Event";var value=this[param];return value}catch(error){this.handle(error)}};obj.setEvent=function(name,value){try{var param="_"+name+"Event";if(this[param]==null){this._events+=" "+name}this[param]=value;resetHTMLCache(this)}catch(error){this.handle(error)}};obj._events="";obj.getContent=function(name){try{var split=name.match(/^(w+)W(.+)$/);if(split){var ref=this.getContent(split[1]);return ref.getContent(split[2])}else{var param="_"+name+"Content";var value=this[param];if((typeof value=="object")&&(value._parent !=this)){value=value.clone();value._parent=this;this[param]=value}if(value && typeof value=="object" && !value.defineModel){value._id=this._id+"-"+name}return value}}catch(error){this.handle(error)}};obj.setContent=function(name,value){try{if(arguments.length==1){this._content="";if(typeof name=="object"){for(var i in name){if(typeof(i)=="string"){this.setContent(i,name[i])}}}else{this.setContent("html",name)}}else{var split=name.match(/^(w+)W(.+)$/);if(split){var ref=this.getContent(split[1]);ref.setContent(split[2],value)}else{var param="_"+name+"Content";if(this[param]==null){this._content+=" "+name}if(value && typeof value=="object"){value._parent=this;if(!value.defineModel){value._id=this._id+"-"+name}}this[param]=value;this._innerHTML="";resetHTMLCache(this)}}}catch(error){this.handle(error)}};obj._content="";var getParamStr=function(i){return "{#"+i+"}"};var getControlFunc=function(v){return function(){return v}};obj.innerHTML=function(){try{if(this._innerHTML){return this._innerHTML}this._innerParamLength=0;var i,j,name,value,param1,param2,html,item,s="";var content=this._content.split(" ");for(i=1;i<content.length;i++){name=content[i];value=this["_"+name+"Content"];if(typeof(value)=="function"){param=getParamStr(this._innerParamLength++);this[param]=value;s+=param}else if(typeof(value)=="object" && value.defineModel){param=getParamStr(this._innerParamLength++);this[param]=getControlFunc(value);s+=param}else if(typeof(value)=="object"){item=value;html=item.outerHTML().replace(/{id}/g,"{id}-"+name);for(j=item._outerParamLength-1;j>=0;j--){param1=getParamStr(j);param2=getParamStr(this._innerParamLength+j);if(param1 !=param2){html=html.replace(param1,param2)}this[param2]=item[param1]}this._innerParamLength+=item._outerParamLength;s+=html}else{s+=value}}this._innerHTML=s;return s}catch(error){this.handle(error)}};obj.outerHTML=function(){try{if(this._outerHTML){return this._outerHTML}var innerHTML=this.innerHTML();this._outerParamLength=this._innerParamLength;if(!this._tag){return innerHTML}var i,tmp,name,value,param;var html="<"+this._tag+" id="{id}"";tmp="";var classes=this._classes.split(" ");for(i=1;i<classes.length;i++){name=classes[i];value=this["_"+name+"Class"];if(typeof(value)=="function"){param=getParamStr(this._outerParamLength++);this[param]=value;value=param}if(value || value===0 || value===false){tmp+="aw-"+name+"-"+value+" "}}if(tmp){html+=" class=""+tmp+"""}tmp="";var styles=this._styles.split(" ");for(i=1;i<styles.length;i++){name=styles[i];value=this["_"+name+"Style"];if(typeof(value)=="function"){param=getParamStr(this._outerParamLength++);this[param]=value;value=param}tmp+=name+":"+value+";"}if(tmp){html+=" style=""+tmp+"""}tmp="";var attributes=this._attributes.split(" ");for(i=1;i<attributes.length;i++){name=attributes[i];value=this["_"+name+"Attribute"];if(typeof(value)=="function"){param=getParamStr(this._outerParamLength++);this[param]=value;value=param}else if(specialAttributes[name] && !value){value=null}if(value !==null){tmp+=" "+name+"=""+value+"""}}html+=tmp;tmp="";var events=this._events.split(" ");for(i=1;i<events.length;i++){name=events[i];value=this["_"+name+"Event"];if(typeof(value)=="function"){value="AW(this,event)"}tmp+=" "+name+"=""+value+"""}html+=tmp;html+=">"+innerHTML+"</"+this._tag+">";this._outerHTML=html;return html}catch(error){this.handle(error)}};obj.toString=function(){try{var i,s=this._outerHTML;if(!s){s=this.outerHTML()}s=s.replace(id_pattern,this._id);var max=this._outerParamLength;if(param_cache.length < max){for(i=param_cache.length;i<max;i++){param_cache[i]=getParamStr(i)}}for(i=0;i<max;i++){var param=param_cache[i];var value=this[param]();if(value===null){value="";param=specialParams[i];if(!param){param=getSpecialParamStr(i)}}s=s.replace(param,value)}return s}catch(error){this.handle(error)}};var id_pattern=/{id}/g;var param_cache=[];var specialParams=[];function getSpecialParamStr(i){return(specialParams[i]=new RegExp("[\w\x2D]*=?:?\x22?\{#"+i+"\}[;\x22]?"))}obj.refresh=function(){try{var element=this.element();if(element){try{var focus=AW.element(AW._focus)}catch(err){}AW.setOuterHTML(element,this.toString());try{if(focus !==AW.element(AW._focus)){AW.element(AW._focus).focus()}}catch(err){}}}catch(error){this.handle(error)}};obj.setSize=function(width,height){if(typeof(width)!="undefined"){this.setStyle("width",width - AW.dx+"px")}if(typeof(height)!="undefined"){this.setStyle("height",height - AW.dy+"px")}};obj.setPosition=function(left,top){this.setStyle("position","absolute");if(typeof(left)!="undefined"){this.setStyle("left",left+"px")}if(typeof(top)!="undefined"){this.setStyle("top",top+"px")}};var errors={101:"non-supported doctype",102:"non-supported browser",103:"non-supported browser"};function hte(i){return function(){return "AW Error:<a href="http://www.activewidgets.com/error."+i+"/">"+errors[i]+"</a>"}}if(AW.safari){obj.toString=hte(102)}if(AW.opera){obj.toString=hte(103)}};
- AW.System.Template=AW.System.HTML.subclass();AW.System.Template.create=function(){var obj=this.prototype;obj.lock=function(){if(!this.$owner){return}this.$owner[AW.camelCase("set",this.$name,"template")](this,this.$0,this.$1,this.$2)};obj.getTemplate=function(name){var i,args=[],get=AW.camelCase("get",name,"template");for(i=1;i<arguments.length;i++){args[i-1]=arguments[i]}return this[get].apply(this,args)};obj.setTemplate=function(name,template,index){var set=AW.camelCase("set",name,"template");this[set](template,index)};obj.raiseEvent=function(name,source,a,b,c){if(typeof source=="undefined"){source=this;a=this.$0;b=this.$1;c=this.$2}var handler=this[name];if(typeof(handler)=="function"){var r=handler.call(this,source,a,b,c);if(r){return r}}if(this.$owner && this.$owner.raiseEvent){return this.$owner.raiseEvent(name,source,a,b,c)}};obj.action=function(name,source,a,b,c){this.raiseEvent(AW.camelCase("on",name),source,a,b,c)};obj.mapTemplate=function(source,target){var get=AW.camelCase("get",source,"template");if(typeof(target)=="function"){this[get]=target}else{var u,m=AW.camelCase("get",target,"template");this[get]=function(a,b,c){if(a===u){return this.$owner[m](this.$0,this.$1,this.$2)}if(b===u){return this.$owner[m](a,this.$0,this.$1)}if(c===u){return this.$owner[m](a,b,this.$0)}return this.$owner[m](a,b,c)}}this.lock()};obj.mapModel=function(source,target,target2){var get=AW.camelCase("get",source,"property");var set=AW.camelCase("set",source,"property");if(typeof(target)=="function"){this[get]=target;if(typeof(target2)=="function"){this[set]=target2}else{this[set]=function(){}}}else{var _get=AW.camelCase("get",target,"property");var _set=AW.camelCase("set",target,"property");var u;this[get]=function(p,a,b,c){if(a===u){return this.$owner[_get](p,this.$0,this.$1,this.$2)}if(b===u){return this.$owner[_get](p,a,this.$0,this.$1)}if(c===u){return this.$owner[_get](p,a,b,this.$0)}return this.$owner[_get](p,a,b,c)};this[set]=function(p,v,a,b,c){if(a===u){return this.$owner[_set](p,v,this.$0,this.$1,this.$2)}if(b===u){return this.$owner[_set](p,v,a,this.$0,this.$1)}if(c===u){return this.$owner[_set](p,v,a,b,this.$0)}return this.$owner[_set](p,v,a,b,c)}}this.lock()}};
- AW.System.Control=AW.System.HTML.subclass();AW.System.Control.create=function(){AW.System.Template.create.call(this);var obj=this.prototype;var templates=AW.System.Template.prototype;obj.setTag("span");obj.setClass("system","control");obj.setAttribute("aw","control");obj.setAttribute("tabIndex","-1");obj.setAttribute("hideFocus","true");obj.setEvent("oncontextmenu","return false");obj.setEvent("onselectstart","return false");obj.clear=function(){};obj.mapTemplate=function(){};obj.mapModel=function(){};obj.getModel=function(name){var getModel=AW.camelCase("get",name,"model");return this[getModel]()};obj.setModel=function(name,model){var setModel=AW.camelCase("set",name,"model");return this[setModel](model)};obj.defineModel=function(m,z){var ext="_"+m+"Model";var defineProperty=AW.camelCase("define",m,"property");var getProperty=AW.camelCase("get",m,"property");var setProperty=AW.camelCase("set",m,"property");var getModel=AW.camelCase("get",m,"model");var setModel=AW.camelCase("set",m,"model");var clearModel=AW.camelCase("clear",m,"model");var getInt={};var setInt={};var getExt={};var setExt={};var changing={};var changed={};var error={};var undef;this[defineProperty]=function(p,v,arrayValue){var _p="_"+AW.camelCase(m,p);var _p1=_p+"1";var _p2=_p+"2";var _p3=_p+"3";var _x2=_p+"2x";var get=(getInt[p]=AW.camelCase("get",m,p));var set=(setInt[p]=AW.camelCase("set",m,p));var $get=(getExt[p]=AW.camelCase("get",p));var $set=(setExt[p]=AW.camelCase("set",p));var _changing=(changing[p]=AW.camelCase("on",m,p,"changing"));var _changed=(changed[p]=AW.camelCase("on",m,p,"changed"));var _error=(error[p]=AW.camelCase("on",m,p,"error"));this[get]=function(a,b,c){if(this[ext] && this[ext][$get]){return this[ext][$get](a,b,c)}var r;if(c !==undef && this[_p3] && this[_p3][c] && this[_p3][c][b] && this[_p3][c][b][a] !==undef){r=this[_p3][c][b][a]}else if(b !==undef &&(!this[_x2] || !this[_x2][a] || this[_x2][a][b])&& this[_p2] && this[_p2][b] && this[_p2][b][a] !==undef){r=this[_p2][b][a]}else if(a !==undef && this[_p1] && this[_p1][a] !==undef){r=this[_p1][a]}else{r=this[_p]}return(typeof(r)=="function")?r.call(this,a,b,c):r};function isArray(a){return a && typeof(a)=="object" && !a.constructor.subclass && !arrayValue}var setProp=function(v,a,b,c){var i;if(isArray(v)){for(i in v){if(typeof(v[i])=="function"){continue}if(isArray(v[i])){this[_p2]=v;delete this[_p3];delete this[_x2];return}break}if(a !==undef){if(!this[_p2]){this[_p2]={}}this[_p2][a]=v;delete this[_p3]}else{this[_p1]=v;delete this[_p2];delete this[_p3];delete this[_x2]}return}if(c !==undef){if(!this[_p3]){this[_p3]={}}if(!this[_p3][c]){this[_p3][c]={}}if(!this[_p3][c][b]){this[_p3][c][b]={}}this[_p3][c][b][a]=v}else if(b !==undef){if(!this[_p2]){this[_p2]={}}if(!this[_p2][b]){this[_p2][b]={}}this[_p2][b][a]=v;if(this[_x2] && this[_x2][a]){this[_x2][a][b]=true}}else if(a !==undef){if(!this[_p1]){this[_p1]={$owner:this}}else if(this[_p1].$owner !=this){var r=this[_p1];this[_p1]={};for(i in r){this[_p1][i]=r[i]}this[_p1].$owner=this}this[_p1][a]=v;if(this[_p2]){if(!this[_x2]){this[_x2]={}}this[_x2][a]={}}}else{this[_p]=v;delete this[_p1];delete this[_p2];delete this[_p3];delete this[_x2]}};this[set]=function(v,a,b,c){if(this[ext] && this[ext][$set]){return this[ext][$set](v,a,b,c)}var r=this.raiseEvent(_changing,v,a,b,c);if(r){this.raiseEvent(_error,r,a,b,c);return false}setProp.call(this,v,a,b,c);this.raiseEvent(_changed,v,a,b,c);return true};setProp.call(this,v);var clearPrevious=this[clearModel];this[clearModel]=function(){delete this[_x2];delete this[_p3];delete this[_p2];delete this[_p1];delete this[_p];clearPrevious.call(this);setProp.call(this,v)}};this[getProperty]=function(p,a,b,c){try{if(this[ext] && this[ext][getExt[p]]){return this[ext][getExt[p]](a,b,c)}return this[getInt[p]](a,b,c)}catch(error){return this.handle(error)}};this[setProperty]=function(p,v,a,b,c){try{if(this[ext] && this[ext][setExt[p]]){return this[ext][setExt[p]](v,a,b,c)}return this[setInt[p]](v,a,b,c)}catch(error){return this.handle(error)}};templates[getProperty]=function(p,a,b,c){if(a===undef){return this.$owner[getProperty](p,this.$0,this.$1,this.$2)}if(b===undef){return this.$owner[getProperty](p,a,this.$0,this.$1)}if(c===undef){return this.$owner[getProperty](p,a,b,this.$0)}return this.$owner[getProperty](p,a,b,c)};templates[setProperty]=function(p,v,a,b,c){if(a===undef){return this.$owner[setProperty](p,v,this.$0,this.$1,this.$2)}if(b===undef){return this.$owner[setProperty](p,v,a,this.$0,this.$1)}if(c===undef){return this.$owner[setProperty](p,v,a,b,this.$0)}return this.$owner[setProperty](p,v,a,b,c)};this[getModel]=function(){return this[ext]};this[setModel]=function(model){this[ext]=model;if(model){model.$owner=this}};this[clearModel]=function(){if(this[ext] && this[ext].$owner){delete this[ext].$owner}delete this[ext]};var clear=this.clear;this.clear=function(){clear.call(this);this[clearModel]()};var i,zz={};for(i in z){if(!zz[i]){this[defineProperty](i,z[i])}}};obj.defineTemplate=function(name,template){var ref="_"+name+"Template";var ref1=ref+"1",ref2=ref+"2",ref3=ref+"3";var get=AW.camelCase("get",name,"template");var set=AW.camelCase("set",name,"template");var name1="-"+name;var name2="-"+name+"-";var undef;this[get]=function(a,b,c){if(typeof(this[ref])=="function"){return this[ref](a,b,c)}var r,id,clone;if(a===undef){id=this._id+name1;r=this[ref]}else if(b===undef){id=this._id+name2+a;r=this[ref1] && this[ref1][a];if(!r){r=this[ref];clone=true}}else if(c===undef){id=this._id+name2+a+"-"+b;r=this[ref2] && this[ref2][a] && this[ref2][a][b];if(!r){r=(this[ref1] && this[ref1][a])|| this[ref];clone=true}}else{id=this._id+name2+a+"-"+b+"-"+c;r=this[ref3] && this[ref3][a] && this[ref3][a][b] && this[ref3][a][b][c];if(!r){r=(this[ref2] && this[ref2][a] && this[ref2][a][b])||(this[ref1] && this[ref1][a])|| this[ref];clone=true}}if((this.$clone)&&(clone || r.$owner !=this)){r=r.clone()}r.$owner=this;r.$0=a;r.$1=b;r.$2=c;r._id=id;return r};templates[get]=function(a,b,c){if(a===undef){return this.$owner[get](this.$0,this.$1,this.$2)}if(b===undef){return this.$owner[get](a,this.$0,this.$1)}if(c===undef){return this.$owner[get](a,b,this.$0)}return this.$owner[get](a,b,c)};this[set]=function(template,a,b,c){var previous;if(a===undef){previous=this[ref];this[ref]=template}else if(b===undef){if(!this[ref1]){this[ref1]={}}previous=this[ref1][a];this[ref1][a]=template}else if(c===undef){if(!this[ref2]){this[ref2]={}}if(!this[ref2][a]){this[ref2][a]={}}previous=this[ref2][a][b];this[ref2][a][b]=template}else{if(!this[ref3]){this[ref3]={}}if(!this[ref3][a]){this[ref3][a]={}}if(!this[ref3][a][b]){this[ref3][a][b]={}}previous=this[ref3][a][b][c];this[ref3][a][b][c]=template}if(template){template.$name=name;template.$0=a;template.$1=b;template.$2=c;if(template.$owner !=this && template !=previous){template.$owner=this;this.raiseEvent(AW.camelCase("on",name,"templateChanged"),template,a,b,c)}}};this[set](template)};obj.$clone=true;function controlValue(){var text=this.getControlText();var format=this.getControlFormat();return format?format.textToValue(text):text}obj.defineModel("tab",{index:0});obj.defineModel("control",{text:"",image:"",link:"",value:controlValue,format:"",tooltip:"",state:"",visible:true,disabled:false});obj.setControlSize=obj.setSize;obj.setControlPosition=obj.setPosition;obj.onControlVisibleChanged=function(value){this.setClass("visible",value)};obj.focus=function(){};obj.setController=function(name,controller){var i,n="_"+name+"Controller";this[n]=controller;for(i=0;i<this._controllers.length;i++){if(this._controllers[i]==n){return}}this._controllers=this._controllers.concat();this._controllers.push(n)};obj._controllers=[];obj.raiseEvent=function(name,source,a,b,c){var i,r;var handler=this[name];if(typeof(handler)=="function"){r=handler.call(this,source,a,b,c);if(r){return r}}for(i=0;i<this._controllers.length;i++){handler=this[this._controllers[i]]?this[this._controllers[i]][name]:null;if(typeof(handler)=="function"){r=handler.call(this,source,a,b,c);if(r){return r}}else if(typeof(handler)=="string" && handler !=name){r=this.raiseEvent(handler,source,a,b,c);if(r){return r}}}};obj.action=function(name,source,a,b,c){this.raiseEvent(AW.camelCase("on",name),source,a,b,c)};var keyNames={8:"Backspace",9:"Tab",13:"Enter",27:"Escape",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12"};obj.setEvent("onkeydown",function(event){var key=keyNames[event.keyCode];if(event.keyCode >=48 && event.keyCode <=90){key=String.fromCharCode(event.keyCode)}if(key){if(event.shiftKey){key="Shift"+key}if(event.altKey){key="Alt"+key}if(event.ctrlKey){key="Ctrl"+key}this.raiseEvent("onKey"+key,event)}});obj.setEvent("onkeypress",function(event){if((AW.ie || event.charCode)&& !(event.altKey || event.ctrlKey)){this.raiseEvent("onKeyPress",event)}});var targets={};function raiseControlEvent(name,element,event,attr){if(attr){name=AW.camelCase("on",element.getAttribute(attr),name)}var a=((element.id.match(/-*d*-*d*-*d+$/)|| ["-"])+"").split("-");var target=AW.object(element.id);if(target && target.raiseEvent){return target.raiseEvent(name,event,a[1],a[2],a[3])}}function handleMouse(e,event){try{if(AW.ignoreMouse){return}var i,h,x,y,z,t={};while(e){if(e.getAttribute &&(e.getAttribute("aw")||e.getAttribute("awx"))){t[e.id]=true}e=e.parentNode}for(i in targets){if(!t[i]){e=AW.element(i);if(e && e.getAttribute("aw")){raiseControlEvent("mouseOut",e,event,"aw");if(e.getAttribute("aw")=="row" && e.id.match(/(.+-d+-)d+/)){y=RegExp.$1;for(x=0;x<3;x++){z=AW.element(y+x);if(z){z.className=z.className.replace(/ aw-mouse(over|down)-row/g,"")}}}else if(e.getAttribute("aw")!="control"){e.className=e.className.replace(/ aw-mouse(over|down)-w+/g,"")}}if(e && e.getAttribute("awx")){e.className=e.className.replace(/ aw-mouse(over|down)-w+/g,"")}}}for(i in t){if(!targets[i]){e=AW.element(i);if(e && e.getAttribute("aw")){raiseControlEvent("mouseOver",e,event,"aw");if(e.getAttribute("aw")=="row" && e.id.match(/(.+-d+-)d+/)){y=RegExp.$1;for(x=0;x<3;x++){z=AW.element(y+x);if(z){z.className+=" aw-mouseover-row"}}}else if(e.getAttribute("aw")!="control"){e.className+=" aw-mouseover-"+e.getAttribute("aw").toLowerCase();if(AW.ie){h=e.offsetHeight}}}if(e && e.getAttribute("awx")){e.className+=" aw-mouseover-"+e.getAttribute("awx").toLowerCase()}}}targets=t;e=null}catch(error){}}var mouseDownId="";var handlers={onmousemove:function(event){handleMouse(AW.srcElement(event),event)},onmouseover:function(event){handleMouse(AW.srcElement(event),event)},onmouseout:function(event){handleMouse(AW.toElement(event),event)},onmousedown:function(event){try{var e=AW.srcElement(event);var x=false;var s="MouseDown";if(event.shiftKey){s="Shift"+s}if(event.altKey){s="Alt"+s}if(event.ctrlKey){s="Ctrl"+s}while(e){if(e.getAttribute && e.getAttribute("aw")){raiseControlEvent(s,e,event,"aw");e=AW.element(e.id);x=true;if(e.getAttribute("aw")!="control"){e.className+=" aw-mousedown-"+e.getAttribute("aw").toLowerCase()}}if(e.getAttribute && e.getAttribute("awx")){e.className+=" aw-mousedown-"+e.getAttribute("awx").toLowerCase()}e=e.parentNode}e=null;if(x &&(AW.srcElement(event)!==AW.element(AW.srcElement(event).id))){mouseDownId=AW.srcElement(event).id}}catch(x){}},onmouseup:function(event){try{var e=AW.srcElement(event);var s="MouseUp";if(event.shiftKey){s="Shift"+s}if(event.altKey){s="Alt"+s}if(event.ctrlKey){s="Ctrl"+s}while(e){if(e.getAttribute && e.getAttribute("aw")){raiseControlEvent(s,e,event,"aw");e=AW.element(e.id);if(e.getAttribute("aw")!="control"){e.className=e.className.replace(/ aw-mousedown-w+/g,"")}}if(e.getAttribute && e.getAttribute("awx")){e.className=e.className.replace(/ aw-mousedown-w+/g,"")}e=e.parentNode}e=null;var clickEvent;if(mouseDownId &&(mouseDownId==AW.srcElement(event).id)){if(AW.ie){clickEvent=document.createEventObject(event);event.srcElement.fireEvent("onclick",clickEvent)}else{clickEvent=document.createEvent("MouseEvents");clickEvent.initMouseEvent("click",true,true,event.view,1,event.screenX,event.screenY,event.clientX,event.clientY,event.ctrlKey,event.altKey,event.shiftKey,event.metaKey,event.button,null);event.target.dispatchEvent(clickEvent)}}clickEvent=null}catch(x){}},onclick:function(event){try{var e=AW.srcElement(event);var s="Clicked";if(event.shiftKey){s="Shift"+s}if(event.altKey){s="Alt"+s}if(event.ctrlKey){s="Ctrl"+s}while(e){if(e.getAttribute && e.getAttribute("aw")){raiseControlEvent(s,e,event,"aw");e=AW.element(e.id)}e=e.parentNode}e=null}catch(x){}},ondblclick:function(event){try{var e=AW.srcElement(event);var s="DoubleClicked";if(event.shiftKey){s="Shift"+s}if(event.altKey){s="Alt"+s}if(event.ctrlKey){s="Ctrl"+s}while(e){if(e.getAttribute && e.getAttribute("aw")){raiseControlEvent(s,e,event,"aw");e=AW.element(e.id)}e=e.parentNode}e=null}catch(x){}},onbeforeactivate:function(event){try{var e=AW.srcElement(event);while(e){if(e.getAttribute && e.getAttribute("aw")=="control" && !AW.object(e.id).$active){if(raiseControlEvent("onControlActivating",e,event)){AW.setReturnValue(event,false)}e=AW.element(e.id)}e=e.parentNode}e=null}catch(x){}},onbeforedeactivate:function(event){try{var e=AW.srcElement(event);while(e){if(e.getAttribute && e.getAttribute("aw")=="control" && !e.contains(event.toElement)){if(raiseControlEvent("onControlDeactivating",e,event)){AW.setReturnValue(event,false)}e=AW.element(e.id)}e=e.parentNode}e=null}catch(x){}},onactivate:function(event){try{var e=AW.srcElement(event);AW._focus=e.id;while(e){if(e.getAttribute && e.getAttribute("aw")=="control" && !AW.object(e.id).$active){AW.object(e.id).$active=true;raiseControlEvent("onControlActivated",e,event);e=AW.element(e.id)}e=e.parentNode}e=null}catch(x){}},ondeactivate:function(event){try{var e=AW.srcElement(event);while(e){if(e.getAttribute && e.getAttribute("aw")=="control" && !e.contains(event.toElement)){AW.object(e.id).$active=false;raiseControlEvent("onControlDeactivated",e,event);e=AW.element(e.id)}e=e.parentNode}e=null}catch(x){}}};var activeElements={};function focusemu(event){try{if(AW.lockFocus){return}var e=event.target,a={};AW._focus=e.id;while(e){if(e.getAttribute && e.getAttribute("aw")=="control" && !e.getAttribute("disabled")){a[e.id]=true}e=e.parentNode}function raiseEvents(a1,a2,name,state){var i,e,x={};for(i in a1){if(!a2[i] && !x[i]){e=AW.element(i);if(e && e.getAttribute("aw")=="control"){if(state !==undefined){AW.object(i).$active=state}raiseControlEvent(name,e,event);e=AW.element(e.id)}}}}raiseEvents(activeElements,a,"onControlDeactivating");raiseEvents(a,activeElements,"onControlActivating");raiseEvents(activeElements,a,"onControlDeactivated",false);raiseEvents(a,activeElements,"onControlActivated",true);activeElements=a}catch(x){}}function mousewheelemu(event){try{var e=event.target;while(e){if(e.getAttribute && e.getAttribute("onDOMMouseScroll")){return AW(e,event)}e=e.parentNode}e=null}catch(x){}}obj.$active=false;AW.register=function(win){if(win !=window){win.AW=AW;AW.docs.push(win.document)}var target=AW.ie?win.document.getElementsByTagName("html")[0]:win.document;AW.forEach(handlers,function(name,handler){AW.attachEvent(target,name,handler)});if(!AW.ie){target.addEventListener("focus",focusemu,true);target.addEventListener("DOMMouseScroll",mousewheelemu,true)}function unregister(){AW.unregister(win);AW.detachEvent(win,"onunload",unregister);win=null}AW.attachEvent(win,"onunload",unregister)};AW.unregister=function(win){var target=AW.ie?win.document.getElementsByTagName("html")[0]:win.document;AW.forEach(handlers,function(name,handler){AW.detachEvent(target,name,handler)});if(!AW.ie){target.removeEventListener("focus",focusemu,true);target.removeEventListener("DOMMouseScroll",mousewheelemu,true)}if(win !=window){var i,docs=AW.docs;for(i=0;i<docs.length;i++){if(docs[i]==win.document){docs.splice(i,1);return}}win.AW=null}};AW.register(window)};
- AW.Formats.String=AW.System.Format.subclass();AW.Formats.String.create=function(){var obj=this.prototype;obj.valueToText=function(data){return data?String(data).replace(AW.textPattern,AW.textReplace):""};obj.textToValue=function(text){return text?String(text).replace(AW.htmlPattern,AW.htmlReplace):""};obj.dataToText=obj.valueToText;obj.textToData=obj.textToValue;if("".localeCompare){obj.comparator=function(values,greater,less,equal,error){return function(i,j){try{return greater *(""+values[i]).localeCompare(values[j])|| equal(i,j)}catch(e){return error(i,j,e)}}}}};
- AW.Formats.Number=AW.System.Format.subclass();AW.Formats.Number.create=function(){var obj=this.prototype;obj.dataToValue=function(v){return Number((""+v).replace(numPattern,""))};obj.textToValue=function(v){return Number((""+v).replace(numPattern,""))};var numPattern=/[^0-9.-+]+/gm;var noFormat=function(value){return ""+value};var doFormat=function(value){var abs=(value<0)?-value:value;var rounded=value.toFixed(this._decimals);if(abs<1000){return rounded.replace(this.p1,this.r1)}if(abs<1000000){return rounded.replace(this.p2,this.r2)}if(abs<1000000000){return rounded.replace(this.p3,this.r3)}return rounded.replace(this.p4,this.r4)};obj.setTextFormat=function(format){var pattern=/^([^0#]*)([0#]*)([ .,]?)([0#]|[0#]{3})([.,])([0#]*)([^0#]*)$/;var f=format.replace(/$/g,"$$$$").match(pattern);if(!f){this.valueToText=function(value){return ""+value};this.dataToText=function(value){return ""+value};return}this.valueToText=doFormat;this.dataToText=function(v){return doFormat.call(this,Number((""+v).replace(numPattern,"")))};var rs=f[1];var rg=f[3];var rd=f[5];var re=f[7];this._decimals=f[6].length;var ps="^(-?\d+)",pm="(\d{3})",pe="\.(\d{"+this._decimals+"})$";if(!this._decimals){pe="($)";rd=""}this.p1=new RegExp(ps+pe);this.p2=new RegExp(ps+pm+pe);this.p3=new RegExp(ps+pm+pm+pe);this.p4=new RegExp(ps+pm+pm+pm+pe);this.r1=rs+"$1"+rd+"$2"+re;this.r2=rs+"$1"+rg+"$2"+rd+"$3"+re;this.r3=rs+"$1"+rg+"$2"+rg+"$3"+rd+"$4"+re;this.r4=rs+"$1"+rg+"$2"+rg+"$3"+rg+"$4"+rd+"$5"+re};obj.setTextFormat("")};
- AW.Formats.Date=AW.System.Format.subclass();AW.Formats.Date.create=function(){var obj=this.prototype;obj.date=new Date();var shortMonths=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var longMonths=["January","February","March","April","May","June","July","August","September","October","November","December"];var shortWeekdays=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];var longWeekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];if(!obj.shortMonths){obj.shortMonths=shortMonths}if(!obj.longMonths){obj.longMonths=longMonths}if(!obj.shortWeekdays){obj.shortWeekdays=shortWeekdays}if(!obj.longWeekdays){obj.longWeekdays=longWeekdays}obj.digits=[];for(var i=0;i<100;i++){obj.digits[i]=i<10?"0"+i:""+i}var tokens={"hh":"this.digits[this.date.getUTCHours()]","h":"this.date.getUTCHours()",":mm":"':'+this.digits[this.date.getUTCMinutes()]","mm:":"this.digits[this.date.getUTCMinutes()]+':'","ss":"this.digits[this.date.getUTCSeconds()]","tt":"(this.date.getUTCHours()>11?'PM':'AM')","dddd":"this.longWeekdays[this.date.getUTCDay()]","ddd":"this.shortWeekdays[this.date.getUTCDay()]","dd":"this.digits[this.date.getUTCDate()]","d":"this.date.getUTCDate()","mmmm":"this.longMonths[this.date.getUTCMonth()]","mmm":"this.shortMonths[this.date.getUTCMonth()]","mm":"this.digits[this.date.getUTCMonth()+1]","m":"(this.date.getUTCMonth()+1)","yyyy":"this.date.getUTCFullYear()","yy":"this.digits[this.date.getUTCFullYear()%100]"};var tokens12={},match="";for(i in tokens){if(typeof(i)=="string"){tokens12[i]=tokens[i];match+="|"+i}}tokens12.hh="this.digits[1+(this.date.getUTCHours()+11)%12]";tokens12.h="(1+(this.date.getUTCHours()+11)%12)";var re=new RegExp(match.replace("|","(")+")","gi");var reverse={"hh":["(\d{1,2})","a[3]=",";"],"h":["(\d{1,2})","a[3]=",";"],":mm":[":(\d{1,2})","a[4]=",";"],"mm:":["(\d{1,2}):","a[4]=",";"],"ss":["(\d{1,2})","a[5]=",";"],"tt":["(AM|PM)","a[3]=","=='AM'?a[3]%12:a[3]%12+12;"],"dd":["(\d{1,2})","a[2]=",";"],"d":["(\d{1,2})","a[2]=",";"],"mmmm":["([^\s\x2c-\x2f\x5c;]+)","a[1]=this.rMonths[",".toLowerCase()];"],"mmm":["([^\s\x2c-\x2f\x5c;]+)","a[1]=this.rMonths[",".toLowerCase()];"],"mm":["(\d{1,2})","a[1]=Number(",")-1;"],"m":["(\d{1,2})","a[1]=Number(",")-1;"],"yyyy":["(\d{1,4})","a[0]=Number(",");if(a[0]<30){a[0]+=2000};"],"yy":["(\d{1,4})","a[0]=Number(",");if(a[0]<30){a[0]+=2000};"]};var delim=/[sx2c-x2fx5c;]+/g;obj.setTextFormat=function(format){format=format.replace(/am/pm/i,"tt");var tok=format.match("tt")?tokens12:tokens;var code=format.replace(re,function(i){return "'+"+tok[i.toLowerCase()]+"+'"});code="if(isNaN(value)||(value===this._valueError))return this._textError;"+"this.date.setTime(value+this._textTimezoneOffset);"+("return '"+code+"'").replace(/(''+|+'')/g,"");this.valueToText=new Function("value",code);var num=0;code="var a=[this._year,0,1];if(String(text).match(this._t2v)){n";function item(i){i=i.toLowerCase();if(reverse[i]){code+=reverse[i][1]+"RegExp.$"+(++num)+reverse[i][2];return reverse[i][0]}else{return "\w+"}}this._t2v=new RegExp(format.replace(delim,"[\s\x2c-\x2f\x5c;]+").replace(re,item));code+="n return Date.UTC.apply(this,a)- this._textTimezoneOffset}else{return this._valueError}";this.textToValue=new Function("text",code);this.rMonths={};for(var m=0;m<12;m++){this.rMonths[m+1]=m;this.rMonths[this.digits[m+1]]=m;this.rMonths[shortMonths[m].toLowerCase()]=m;this.rMonths[longMonths[m].toLowerCase()]=m;this.rMonths[this.shortMonths[m].toLowerCase()]=m;this.rMonths[this.longMonths[m].toLowerCase()]=m}this._year=(new Date).getUTCFullYear()};var xmlExpr=/(dddd)-(dd)-(dd)[T ]?(dd)?(:dd)?(:dd)?(.d+)?Z?([+-]dd)?:?(dd)?/;var xmlOut="$1/$2/$3 $4$5$6 GMT$8$9";var auto=function(data){var value=Date.parse(data+this._dataTimezoneCode);return isNaN(value)?this._valueError:value};var RFC822=function(data){var value=Date.parse(data);return isNaN(value)?this._valueError:value};var ISO8601=function(data){var value=Date.parse(data.replace(xmlExpr,xmlOut));return isNaN(value)?this._valueError:value};obj.setDataFormat=function(format){if(format=="RFC822" || format=="rfc822"){this.dataToValue=RFC822}else if(format=="ISO8601" || format=="iso8601" || format=="ISO8061"){this.dataToValue=ISO8601}else{this.dataToValue=auto}};obj.setTextTimezone=function(value){this._textTimezoneOffset=value};obj.setDataTimezone=function(value){if(!value){this._dataTimezoneCode=" GMT"}else{this._dataTimezoneCode=" GMT"+(value>0?"+":"-")+this.digits[Math.floor(Math.abs(value/3600000))]+this.digits[Math.abs(value/60000)%60]}};var localTimezone=- obj.date.getTimezoneOffset()* 60000;obj.setTextTimezone(localTimezone);obj.setDataTimezone(localTimezone);obj.setTextFormat("m/d/yyyy");obj.setDataFormat("default")};
- AW.Formats.HTML=AW.System.Format.subclass();AW.Formats.HTML.create=function(){var obj=this.prototype;obj.dataToValue=function(data){return data?data.replace(AW.htmlPattern,AW.htmlReplace):""};obj.dataToText=function(data){return data};obj.textToValue=obj.dataToValue;if("".localeCompare){obj.comparator=function(values,greater,less,equal,error){return function(i,j){try{return greater *(""+values[i]).localeCompare(values[j])|| equal(i,j)}catch(e){return error(i,j,e)}}}}};
- AW.HTML.define=function(name,tag,type){if(!tag){tag=name.toLowerCase()}AW.HTML[name]=AW.System.HTML.subclass();AW.HTML[name].create=function(){this.prototype.setTag(tag)}};(function(){var i,tags=["DIV","SPAN","IMG","INPUT","BUTTON","TEXTAREA","TABLE","TR","TD"];for(i=0;i<tags.length;i++){AW.HTML.define(tags[i])}})();
- AW.Templates.ImageText=AW.System.Template.subclass();AW.Templates.ImageText.create=function(){var obj=this.prototype;function _image(){return this.getControlProperty("image")|| "none"}function _text(){return this.getControlProperty("text")}function _tooltip(){return this.getControlProperty("tooltip")}var span=AW.HTML.SPAN;var image=new span;image.setClass("item","image");image.setClass("image",_image);var ruler=new span;ruler.setClass("item","ruler");var text=new span;text.setClass("item","text");text.setContent("html",_text);var box=new span;box.setClass("item","box");box.setContent("sign","");box.setContent("marker","");box.setContent("image",image);box.setContent("ruler",ruler);box.setContent("text",text);obj.setTag("span");obj.setClass("item","template");obj.setClass("templates","imagetext");obj.setAttribute("title",_tooltip);obj.setContent("box",box);if(AW.gecko){obj.setAttribute("tabIndex","-1")}var startEditIE=function(startText){var self=this;var item=self.getAttribute("aw");var originalText=self.getControlProperty("text");var text=originalText;var valid;var e=self.getContent("box/text").element();var x=self.element();if(!e || !x){return}var input=(e.tagName=="input")||(e.tagName=="INPUT");function raiseEvent(name){var text1=self.getControlProperty("text");var fullname=AW.camelCase("on",item,name);var result=self.raiseEvent(fullname,text,self.$0,self.$1,self.$2);var text2=self.getControlProperty("text");if(text2 !=text1){updateText(text2)}return result}if(raiseEvent("editStarting")){e=null;x=null;return}function nobubble(event){event.cancelBubble=true}function updateText(text){if(input){e.value=text}else{e.innerHTML=text}}function onpropertychange(event){var text1=self.getControlProperty("text");var text2=input?e.value:e.innerHTML.replace(/ /g," ");if(text2 !=text1){self.setControlProperty("text",text2)}var text3=self.getControlProperty("text");if(text3 !=text2){updateText(text3)}}function onkeydown(event){if(event.keyCode==27){if(input){e.value=originalText}else{e.innerHTML=originalText}event.returnValue=false;if(item=="control"){return}onbeforedeactivate(event);if(valid){ondeactivate(event)}return}if(event.keyCode==13){text=self.getControlProperty("text");if(item=="control"){if(raiseEvent("validating")){return}raiseEvent("validated");return}event.returnValue=false;event.cancelBubble=true;onbeforedeactivate(event);if(valid){ondeactivate(event)}return}var r;if(input){r=e.createTextRange()}else{r=document.body.createTextRange();r.moveToElementText(e)}var s=document.selection.createRange();if((event.keyCode==36 || event.keyCode==37)&& r.compareEndPoints("StartToStart",s)){event.cancelBubble=true;r=null;s=null;return}if((event.keyCode==35 || event.keyCode==39)&& r.compareEndPoints("EndToEnd",s)){event.cancelBubble=true;r=null;s=null;return}}function onbeforedeactivate(event){valid=false;text=self.getControlProperty("text");if(input && text !=e.value){text=e.value;self.setControlProperty("text",text)}if(!input && text !=e.innerHTML.replace(/ /g," ")){text=e.innerHTML.replace(/ /g," ");self.setControlProperty("text",text)}var text2=self.getControlProperty("text");if(text2 !=text){updateText(text2);text=text2}if(self.element().contains(event.toElement)){event.returnValue=false;return}if(raiseEvent("editEnding")){event.cancelBubble=true;event.returnValue=false;return}if(originalText==text){valid=true;return}if(raiseEvent("validating")){event.cancelBubble=true;event.returnValue=false;return}raiseEvent("validated");valid=true}function ondeactivate(event){text=self.getControlProperty("text");e.removeExpression("aw-value");e.detachEvent("onselectstart",nobubble);e.detachEvent("oncontextmenu",nobubble);x.detachEvent("onmousedown",nobubble);x.detachEvent("onmouseup",nobubble);x.detachEvent("onclick",nobubble);x.detachEvent("ondoubleclick",nobubble);e.detachEvent("onpropertychange",onpropertychange);e.detachEvent("onkeydown",onkeydown);e.detachEvent("onbeforedeactivate",onbeforedeactivate);e.detachEvent("ondeactivate",ondeactivate);document.selection.empty();if(!input){e.contentEditable=false}e.parentNode.scrollLeft=0;x.className=x.className.replace(" aw-edit-"+item,"");if(self.$owner){self.$owner.$edit=false}raiseEvent("editEnded");e=null;x=null}x.className=x.className.replace(/ aw-mousedown-w+/g,"")+" aw-edit-"+item;if(!input){e.contentEditable=true}e.attachEvent("onselectstart",nobubble);e.attachEvent("oncontextmenu",nobubble);if(input){e.select()}else{if(typeof(startText)=="string"){e.focus()}else{var r=document.body.createTextRange();r.moveToElementText(e);r.select();r=null}}e.setExpression("aw-value",input?"this.value":"this.innerHTML");x.attachEvent("onmousedown",nobubble);x.attachEvent("onmouseup",nobubble);x.attachEvent("onclick",nobubble);x.attachEvent("ondoubleclick",nobubble);e.attachEvent("onpropertychange",onpropertychange);e.attachEvent("onkeydown",onkeydown);e.attachEvent("onbeforedeactivate",onbeforedeactivate);e.attachEvent("ondeactivate",ondeactivate);if(self.$owner){self.$owner.$edit=true}raiseEvent("editStarted");if(typeof(startText)=="string"){e.innerHTML=startText}};var startEditGecko=function(startText){var self=this;var item=self.getAttribute("aw");var originalText=self.getControlProperty("text");var text=originalText;var e=self.getContent("box/text").element();var x=self.element();if(!e || !x){return}var input=(e.tagName=="input")||(e.tagName=="INPUT");var updateText=function(text){if(input){e.value=text}else{e.innerHTML=text}};function raiseEvent(name){var text1=self.getControlProperty("text");var fullname=AW.camelCase("on",item,name);var result=self.raiseEvent(fullname,text,self.$0,self.$1,self.$2);var text2=self.getControlProperty("text");if(text2 !=text1){updateText(text2)}return result}if(raiseEvent("editStarting")){e=null;x=null;return}updateText=function(text){e.value=text};function nobubble(event){event.stopPropagation()}function oninput(event){var text1=self.getControlProperty("text");var text2=e.value;if(text2 !=text1){self.setControlProperty("text",text2)}var text3=self.getControlProperty("text");if(text3 !=text2){updateText(text3)}text=text3}function onkeydown(event){if(event.keyCode==27){e.value=originalText;event.preventDefault();if(item=="control"){return}try{self.$owner.getContent("focus").element().focus();return}catch(err){}onfocus(event);return}if(event.keyCode==13){text=self.getControlProperty("text");if(item=="control"){insideFocus=true;if(raiseEvent("validating")){insideFocus=false;return}raiseEvent("validated");insideFocus=false;return}event.preventDefault();event.stopPropagation();try{self.$owner.getContent("focus").element().focus();return}catch(err){}onfocus(event);return}if((event.keyCode==36 || event.keyCode==37)&& e.selectionStart > 0){event.stopPropagation();return}if((event.keyCode==35 || event.keyCode==39)&& e.selectionStart < e.value.length){event.stopPropagation();return}}function cancelEvent(event){if(event.target !=document){event.preventDefault();event.stopPropagation()}}var insideFocus;function focusBack(event){event.preventDefault();event.stopPropagation();e.focus();window.removeEventListener("blur",cancelEvent,true);insideFocus=false}var inDocFocus;function docFocus(event){if(inDocFocus){return}inDocFocus=true;var e=document.createEvent("HTMLEvents");e.initEvent("focus",false,false);e.deferred=true;window.setTimeout(function(){if(inDocFocus){onfocus(e)}e=null})}function onfocus(event){if(event.type=="focus" && event.target==document && !event.deferred){return docFocus(event)}inDocFocus=false;if(insideFocus ||(event.type=="focus" && event.target==e)){return}insideFocus=true;window.addEventListener("blur",cancelEvent,true);function isInside(parent,child){try{var range=document.createRange();range.selectNode(parent);return child &&(range.compareNode(child)==3)}catch(err){return false}}if(event.type=="focus" &&(isInside(x,event.target)|| isInside(self.$popup,event.target))){return focusBack(event)}oninput(event);if(raiseEvent("editEnding")){return focusBack(event)}if(text !=originalText){if(raiseEvent("validating")){return focusBack(event)}raiseEvent("validated")}window.removeEventListener("blur",cancelEvent,true);insideFocus=false;e.removeEventListener("contextmenu",nobubble,false);x.removeEventListener("mousedown",nobubble,false);x.removeEventListener("mouseup",nobubble,false);x.removeEventListener("click",nobubble,false);x.removeEventListener("doubleclick",nobubble,false);e.removeEventListener("input",oninput,false);e.removeEventListener("keydown",onkeydown,false);window.removeEventListener("focus",onfocus,true);if(!input){node2.innerHTML=self.getControlProperty("text");e.parentNode.replaceChild(node2,e)}x.className=x.className.replace(" aw-edit-"+item,"");AW.lockFocus=false;if(self.$owner){self.$owner.$edit=false}raiseEvent("editEnded");e=null;x=null;node1=null;node2=null;if(event.type=="focus" && event.deferred){document.dispatchEvent(event)}}x.className=x.className.replace(/ aw-mousedown-w+/g,"")+" aw-edit-"+item;if(input){e.select()}else{var node1=document.createElement("input");node1.setAttribute("id",e.id);node1.setAttribute("type","text");node1.setAttribute("class",e.className);node1.setAttribute("autocomplete","off");node1.setAttribute("value",text);var node2=e.parentNode.replaceChild(node1,e);e=node1;e.select()}e.addEventListener("contextmenu",nobubble,false);x.addEventListener("mousedown",nobubble,false);x.addEventListener("mouseup",nobubble,false);x.addEventListener("click",nobubble,false);x.addEventListener("doubleclick",nobubble,false);e.addEventListener("input",oninput,false);e.addEventListener("keydown",onkeydown,false);window.addEventListener("focus",onfocus,true);AW.lockFocus=true;if(self.$owner){self.$owner.$edit=true}raiseEvent("editStarted");if(typeof(startText)=="string"){e.value=startText;oninput.call(self)}};if(AW.ie){obj.startEdit=startEditIE}if(!AW.ie){obj.startEdit=startEditGecko}};
- AW.Templates.Image=AW.Templates.ImageText.subclass();AW.Templates.Image.create=function(){var obj=this.prototype;obj.setClass("templates","image");var box=obj.getContent("box");if(!AW.gecko){box.setTag("")}box.setContent("text","");obj.startEdit=null};
- AW.Templates.Text=AW.Templates.ImageText.subclass();AW.Templates.Text.create=function(){var obj=this.prototype;obj.setClass("templates","text");var box=obj.getContent("box");if(!AW.gecko){box.setTag("")}box.setContent("image","")};
- AW.Templates.Link=AW.Templates.ImageText.subclass();AW.Templates.Link.create=function(){var obj=this.prototype;obj.setTag("a");obj.setClass("templates","link");obj.setAttribute("tabIndex","-1");obj.setAttribute("href",function(){return this.getControlProperty("link")|| null});var box=obj.getContent("box");if(!AW.gecko){box.setTag("")}obj.startEdit=null};
- AW.Templates.CheckBox=AW.Templates.ImageText.subclass();AW.Templates.CheckBox.create=function(){var obj=this.prototype;obj.setClass("value",function(){return this.getControlProperty("value")|| false});obj.setClass("toggle","checkbox");obj.setClass("templates","checkbox");obj.setAttribute("awx","toggle");var marker=new AW.HTML.SPAN;marker.setClass("item","marker");obj.setContent("box/marker",marker);obj.setEvent("onclick",function(){var value=this.getControlProperty("value");this.setControlProperty("value",!value)});obj.startEdit=null};AW.Templates.Checkbox=AW.Templates.CheckBox;
- AW.Templates.CheckedItem=AW.Templates.CheckBox.subclass();AW.Templates.CheckedItem.create=function(){var obj=this.prototype;obj.setClass("templates","checkeditem");obj.setClass("value",function(){return this.getStateProperty("selected")|| false});obj.setEvent("onclick",function(){var selected=this.getStateProperty("selected");this.setStateProperty("selected",!selected)})};
- AW.Templates.Radio=AW.Templates.CheckedItem.subclass();AW.Templates.Radio.create=function(){var obj=this.prototype;obj.setClass("toggle","radio");obj.setClass("templates","radio");obj.setEvent("onclick","")};
- AW.Templates.Popup=AW.System.Template.subclass();AW.Templates.Popup.create=function(){var obj=this.prototype;obj.setClass("popup","normal");obj.showPopup=function(){var popup=window.createPopup();this.$popup=popup;AW.$popup=this;var doc=popup.document;doc.open();if(AW.strict){doc.write("<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">")}doc.write("<html class="aw-popup-window aw-system-control "+AW._htmlClasses+""><head>");AW.register(doc.parentWindow);for(var i=0;i<document.styleSheets.length;i++){doc.write(document.styleSheets[i].owningElement.outerHTML)}doc.write("</head><body onselectstart="return false" oncontextmenu="return false">");doc.write(this.getPopupTemplate().toString());doc.write("</body></html>");doc.close();var ref=this.element();var left=0;var top=ref.offsetHeight;var width=ref.offsetWidth;var height=1;popup.show(left,top,width,height,ref);width=Math.max(doc.body.scrollWidth,width);height=Math.max(doc.body.scrollHeight+1,20);popup.show(left,top,width,height,ref);this.setTimeout(function(){try{width=Math.max(doc.body.scrollWidth,width);height=Math.max(doc.body.scrollHeight+1,20);if(popup.isOpen){popup.show(left,top,width,height,ref)}popup=null;ref=null}catch(err){}},500)};obj.hidePopup=function(){if(this.$popup && this.$popup.isOpen){this.$popup.hide()}if(this.$popup){this.$popup=null}if(AW.$popup){AW.$popup=null}};if(!AW.ie){obj.showPopup=function(){if(this.$popup){document.body.removeChild(this.$popup);this.$popup=null}var ref=this.element()?this.element():document.body;var left=AW.getLeft(ref);var top=AW.getTop(ref)+ref.offsetHeight;var popup=document.createElement("div");this.$popup=popup;AW.$popup=this;document.body.appendChild(popup);popup.className="aw-popup-window aw-system-control";popup.style.left=left+"px";popup.style.top=top+"px";popup.innerHTML=this.getPopupTemplate().toString()};obj.hidePopup=function(){if(this.$popup){this.setTimeout(function(){document.body.removeChild(this.$popup);this.$popup=null;AW.$popup=null})}};obj.onControlDeactivated=function(){this.hidePopup()}}};
- AW.Templates.Frame=AW.System.Template.subclass();AW.Templates.Frame.create=function(){var obj=this.prototype;obj.setClass("frame","template");obj.setClass("flow","vertical");obj.setClass("text","normal");var box=new AW.HTML.SPAN;box.setClass("frame","box");box.setClass("list","box");if(AW.ie && AW.strict){box.setStyle("width","expression(this.parentElement.offsetWidth-4)")}box.setContent("html",function(){return this.getLayoutTemplate()});obj.setContent("box",box)};
- AW.Templates.List=AW.System.Template.subclass();AW.Templates.List.create=function(){var obj=this.prototype;obj.setTag("span");obj.setClass("templates","list");obj.setContent("start","");obj.setContent("items",function(){var i,ii,a=[];var count=this.getViewProperty("count");var offset=this.getViewProperty("offset");var indices=this.getViewProperty("indices");var clone=this.$owner.$clone;this.$owner.$clone=false;for(i=0;i<count;i++){ii=indices?indices[i+offset]:i+offset;a[i]=this.getItemTemplate(ii).toString()}this.$owner.$clone=clone;return a.join("")});obj.setContent("end","")};
- AW.Templates.Input=AW.Templates.ImageText.subclass();AW.Templates.Input.create=function(){var obj=this.prototype;obj.setClass("templates","input");obj.setClass("input","box")};
- AW.Templates.Combo=AW.Templates.ImageText.subclass();AW.Templates.Combo.create=function(){AW.Templates.Popup.create.call(this);var obj=this.prototype;obj.setAttribute("awx","combo");obj.setClass("templates","combo");obj.setClass("combo","box");var button=new AW.HTML.TABLE;button.setClass("combo","button");button.setAttribute("cellspacing","0");button.setEvent("onclick",function(event){if(!this.$owner && !this.$active){return}if(this.$owner && !this.$owner.$active){return}if(this.$owner && this.$owner._cellTemplate && !this.$popup){this.lock();var combo=this;this.$owner.setController("popup",{onCellEditEnding:function(){try{if(AW.gecko && combo.$popup){var event=combo.raiseEvent.caller.caller.arguments[0];var range=document.createRange();range.selectNode(combo.$popup);return event.target &&(range.compareNode(event.target)==3)}}catch(err){}},onCellEditEnded:function(){combo.hidePopup();combo=null;this.setController("popup",{})}});this.raiseEvent("editCurrentCell",event)}this.showPopup();this.getContent("box/text").element().focus();this.getContent("box/text").element().parentNode.scrollTop=0});obj.setContent("box/sign",button);obj.setContent("box/sign/html","<tr class="aw-cb-1"><td></td></tr><tr class="aw-cb-2"><td> </td></tr><tr class="aw-cb-3"><td></td></tr>")};
- AW.Templates.Cell=AW.Templates.ImageText.subclass();AW.Templates.Cell.create=function(){var obj=this.prototype;obj.setClass("templates","cell");var box=obj.getContent("box");if(!AW.gecko){box.setTag("")}box.setContent("image","");box.setContent("ruler","");box.getContent("text").setTag("");obj.startEdit=null};AW.Templates.HTML=AW.Templates.Cell;
- AW.Scroll.Bars=AW.System.Template.subclass();AW.Scroll.Bars.create=function(){var obj=this.prototype;obj.setClass("scroll","bars");obj.setClass("scrollbars",function(){return this.getScrollProperty("bars")});var span=AW.HTML.SPAN;var box=new span;var spacer=new span;var content=new span;if(AW.gecko){box.setAttribute("tabIndex","-1");content.setAttribute("tabIndex","-1")}box.setClass("bars","box");spacer.setClass("bars","spacer");content.setClass("bars","content");spacer.setStyle("width",function(){return this.getScrollProperty("width")+"px"});spacer.setStyle("height",function(){return this.getScrollProperty("height")+"px"});obj.setContent("box",box);obj.setContent("box/spacer",spacer);obj.setContent("content",content);obj.setContent("content/html",function(){return this.getContentTemplate()});var serial=0;obj.setEvent("onresize",function(){var s=++serial;this.setTimeout(function(){if(s==serial){this.raiseEvent("adjustScrollBars")}})});box.setEvent("onscroll",function(){var e=this.getContent("box").element();var left=this.getScrollProperty("left");var top=this.getScrollProperty("top");if(e.scrollLeft !=left){this.setScrollProperty("left",e.scrollLeft)}if(e.scrollTop !=top){this.setScrollProperty("top",e.scrollTop)}e=null});function mousewheel(event){var top=this.getScrollProperty("top");top -=AW.ie?event.wheelDelta/2:event.detail *(-10);var e=this.element();if(e){var max=this.getScrollProperty("height")- e.offsetHeight;var bars=this.getScrollProperty("bars");max+=(bars=="horizontal" || bars=="both")?16:0;top=top > max?max:top}top=top < 0?0:top;this.setScrollProperty("top",top);AW.setReturnValue(event,false)}obj.setEvent(AW.ie?"onmousewheel":"onDOMMouseScroll",mousewheel)};
- AW.Panels.Horizontal=AW.System.Template.subclass();AW.Panels.Horizontal.create=function(){var obj=this.prototype;obj.setClass("hpanel","template");var span=AW.HTML.SPAN;var box=new span;var top=new span;var middle=new span;var bottom=new span;box.setClass("hpanel","box");top.setClass("hpanel","top");middle.setClass("hpanel","middle");bottom.setClass("hpanel","bottom");function height(i){return function(){return this.getPanelProperty("height",i)+"px"}}function visibility(i){return function(){return this.getPanelProperty("height",i)?"inherit":"hidden"}}top.setStyle("visibility",visibility(0));top.setStyle("height",height(0));bottom.setStyle("display",function(){return this.getPanelProperty("height",2)?null:"none"});bottom.setStyle("height",height(2));if(AW.ie){box.setStyle("padding-top",height(0));box.setStyle("padding-bottom",height(2))}else{middle.setStyle("top",height(0));middle.setStyle("bottom",height(2))}if(AW.ie && AW.strict){box.setStyle("height","expression(this.parentElement.clientHeight-this.firstChild.offsetHeight-this.lastChild.offsetHeight)")}function panel(i){return function(){return this.getPanelTemplate(i)}}top.setContent("html",panel(0));middle.setContent("html",panel(1));bottom.setContent("html",panel(2));box.setContent("top",top);box.setContent("middle",middle);box.setContent("bottom",bottom);obj.setContent("box",box)};
- AW.Panels.Vertical=AW.System.Template.subclass();AW.Panels.Vertical.create=function(){var obj=this.prototype;obj.setClass("vpanel","template");var span=AW.HTML.SPAN;var box=new span;var left=new span;var center=new span;var right=new span;box.setClass("vpanel","box");left.setClass("vpanel","left");center.setClass("vpanel","center");right.setClass("vpanel","right");left.setContent("html",function(){return this.getPanelTemplate(0)});center.setContent("html",function(){return this.getPanelTemplate(1)});right.setContent("html",function(){return this.getPanelTemplate(2)});box.setContent("left",left);box.setContent("center",center);box.setContent("right",right);obj.setContent("box",box)};
- AW.Panels.Grid=AW.System.Template.subclass();AW.Panels.Grid.create=function(){var obj=this.prototype;obj.setClass("gpanel","template");var span=AW.HTML.SPAN;var box=new span;var top=new span;var middle=new span;var bottom=new span;box.setClass("gpanel","box");top.setClass("gpanel","top");middle.setClass("gpanel","middle");bottom.setClass("gpanel","bottom");function height(i){return function(){return this.getPanelProperty("height",i)+"px"}}function width(i){return function(){return this.getPanelProperty("width",i)+"px"}}function visibility(i){return function(){return this.getPanelProperty("height",i)?"inherit":"hidden"}}top.setStyle("visibility",visibility(0));top.setStyle("height",height(0));bottom.setStyle("display",function(){return this.getPanelProperty("height",2)?null:"none"});bottom.setStyle("height",height(2));if(AW.ie){box.setStyle("padding-top",height(0));box.setStyle("padding-bottom",height(2))}if(!AW.ie){middle.setStyle("top",height(0));middle.setStyle("bottom",height(2))}if(AW.ie && AW.strict){box.setStyle("height","expression(this.parentElement.clientHeight-this.firstChild.offsetHeight-this.lastChild.offsetHeight)")}function panel(i,j){return function(){return this.getPanelTemplate(i,j)}}var i,rows=[top,middle,bottom];for(i=0;i<3;i++){var left=new span;var center=new span;var right=new span;left.setClass("gpanel","left");center.setClass("gpanel","center");right.setClass("gpanel","right");left.setContent("html",panel(i,0));center.setContent("html",panel(i,1));right.setContent("html",panel(i,2));if(AW.ie && AW.strict){rows[i].setStyle("width","expression(this.parentElement.clientWidth-this.firstChild.offsetWidth-this.lastChild.offsetWidth)")}rows[i].setContent("left",left);rows[i].setContent("center",center);rows[i].setContent("right",right)}box.setContent("top",top);box.setContent("middle",middle);box.setContent("bottom",bottom);obj.setContent("box",box)};
- AW.UI.Controllers.List={onItemTemplateChanged:function(item){item.setClass("list","item");item.setClass("items",function(){return this.getControlProperty("state")|| "normal"});item.setAttribute("aw","item");item.mapModel("control","item");item.mapModel("state","item")},onContentTemplateChanged:function(view){view.setClass("list","template")}};
- AW.UI.Controllers.Actions=(function(){function clicked(event,index){return index}function current(){return this.getCurrentItem()}function first(){var p=this.getViewOffset();var a=this.getViewIndices();return a?a[p]:p}function last(){var p=this.getViewOffset()+this.getViewCount()- 1;var a=this.getViewIndices();return a?a[p]:p}function next(){var i=this.getCurrentItem();var p=Math.min(this.getViewPosition(i)+1,this.getViewOffset()+this.getViewCount()- 1);var a=this.getViewIndices();return a?a[p]:p}function previous(){var i=this.getCurrentItem();var p=Math.max(this.getViewPosition(i)- 1,this.getViewOffset());var a=this.getViewIndices();return a?a[p]:p}function go(i){this.setCurrentItem(i)}function select(i){this.setSelectedItems([i]);this.setCurrentItem(i)}function toggle(i){this.setItemSelected(!this.getItemSelected(i),i);if(i !=this.getCurrentItem()){this.setCurrentItem(i)}}function f(action,item){return function(event,index){var i=item.call(this,event,index);AW.setReturnValue(event,false);if(event && event.type=="mousedown"){this.setTimeout(function(){if(this.$active){action.call(this,i)}})}else{if(this.$active){action.call(this,i)}}event=null}}return{gotoClickedItem:f(go,clicked),gotoPreviousItem:f(go,previous),gotoNextItem:f(go,next),gotoFirstItem:f(go,first),gotoLastItem:f(go,last),selectClickedItem:f(select,clicked),selectPreviousItem:f(select,previous),selectNextItem:f(select,next),selectFirstItem:f(select,first),selectLastItem:f(select,last),toggleClickedItem:f(toggle,clicked),toggleCurrentItem:f(toggle,current)}})();
- AW.UI.Controllers.Changes=(function(){function item(v,i){this.getItemTemplate(i).refresh()}function view(indices){var pos=[];for(var i=0;i<indices.length;i++){pos[indices[i]]=i}this.setViewPosition(pos);this.refresh()}function selection(mode){switch(mode){case "single":this.setController("selection",AW.UI.Controllers.Single);break;case "multi":this.setController("selection",AW.UI.Controllers.Multi);break}}return{onItemTextChanged:item,onItemImageChanged:item,onItemValueChanged:item,onItemLinkChanged:item,onItemTooltipChanged:item,onItemStateChanged:item,onViewIndicesChanged:view,onSelectionModeChanged:selection}})();