Function.prototype.method=function (name,func){this.prototype[name]=func;return this;};Function.method('inherits',function (parent){var d=0,p=(this.prototype=new parent());this.method('uber',function (name){var f,r,t=d,v=parent.prototype;if(t){while(t){v=v.constructor.prototype;t-=1;}f=v[name];}else{f=p[name];if(f==this[name]){f=v[name];}}d+=1;r=f.apply(this,Array.prototype.slice.apply(arguments,[1]));d-=1;return r;});return this;});function isAlien(a){return isObject(a)&& typeof a.constructor!='function';}function isArray(a){return isObject(a)&&a.constructor==Array;}function isBoolean(a){return  typeof a=='boolean';}function isEmpty(o){var i,v;if(isObject(o)){for(i in o){v=o[i];if(isUndefined(v)&&isFunction(v)){return false;}}}return true;}function isFunction(a){return  typeof a=='function';}function isNull(a){return  typeof a=='object'&&!a;}function isNumber(a){return  typeof a=='number'&&isFinite(a);}function isObject(a){return (a&& typeof a=='object')||isFunction(a);}function isString(a){return  typeof a=='string';}function isUndefined(a){return  typeof a=='undefined';}String.method('trim',function (){return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/,"$1");});Array.method('copy',function (){return this.slice(0,this.length);}).method('remove',function (oRemove){var aNew=[];for(var i=0;i<this.length;++i){if(this[i]!=oRemove)aNew.push(this[i]);}if(this.length>aNew.length){for(var i=0;i<aNew.length;++i){this[i]=aNew[i];}this.length=aNew.length;}}).method('contains',function (oObj){for(var i in this){if(this[i]==oObj)return true;}return false;});var UA=function (){var sNameSpaceURI="http://www.w3.org/1999/xhtml";var sUA=navigator.userAgent.toLowerCase();var oReturn={bIsWebKit:sUA.indexOf("applewebkit")>-1,bIsSafari:sUA.indexOf("safari")>-1,bIsKonq:navigator.product!=null&&navigator.product.toLowerCase().indexOf("konqueror")>-1,bIsOpera:window.opera!=null,bIsXML:document.contentType!=null&&document.contentType.indexOf("xml")>-1,bHasTransparencySupport:true,bUseDOM:true,nFlashVersion:null,nOperaVersion:null,nGeckoBuildDate:null,nWebKitVersion:null};oReturn.bIsKHTML=oReturn.bIsWebKit||oReturn.bIsKonq;oReturn.bIsGecko=!oReturn.bIsWebKit&&navigator.product!=null&&navigator.product.toLowerCase()=="gecko";if(oReturn.bIsGecko){oReturn.nGeckoBuildDate=new Number(sUA.match(/.*gecko\/(\d{8}).*/)[1])};oReturn.bIsIE=sUA.indexOf("msie")>-1&&!oReturn.bIsOpera&&!oReturn.bIsKHTML&&!oReturn.bIsGecko;oReturn.bIsIEMac=oReturn.bIsIE&&sUA.match(/.*mac.*/)!=null;if(oReturn.bIsOpera){oReturn.nOperaVersion=new Number(sUA.match(/.*opera(\s|\/)(\d+\.\d+)/)[2])};if(oReturn.bIsIE||(oReturn.bIsOpera&&oReturn.nOperaVersion<7.6)){oReturn.bUseDOM=false};if(oReturn.bIsWebKit){oReturn.nWebKitVersion=new Number(sUA.match(/.*applewebkit\/(\d+).*/)[1])};if(window.hasFlash&&(!oReturn.bIsIE||oReturn.bIsIEMac)){var flashDescription=(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description;oReturn.nFlashVersion=parseInt(flashDescription.charAt(flashDescription.indexOf(".")-1));};if(sUA.match(/.*(windows|mac).*/)==null||oReturn.bIsIEMac||oReturn.bIsKonq||(oReturn.bIsOpera&&oReturn.nOperaVersion<7.6)||(oReturn.bIsSafari&&oReturn.nFlashVersion<7)||(!oReturn.bIsSafari&&oReturn.bIsWebKit&&oReturn.nWebKitVersion<124)||(oReturn.bIsGecko&&oReturn.nGeckoBuildDate<20020523)){oReturn.bHasTransparencySupport=false;};if(!oReturn.bIsIEMac&&!oReturn.bIsGecko&&document.createElementNS){try{document.createElementNS(sNameSpaceURI,"i").innerHTML="";}catch(e){oReturn.bIsXML=true;};};return oReturn;}();function __getInitialSettingsMain(){var s=new Object;s.packagePath=ENKI_PATH+'main/';s.imgPath=s.packagePath+'layout/img/';s.stylePath=s.packagePath+'layout/css/';s.styleSheets=[s.stylePath+'default.css'];s.buttonCSSClassActive='activeButton';s.buttonCSSClassInActive='inactiveButton';s.buttonDimension=new Dimension();s.buttonDimension.setBorder('2px');s.buttonPointer='default';s.textfieldCSSClass='textinput';s.textfieldDimension=new Dimension(100,23);s.textfieldDimension.setBorder('2px');s.linkClass='a';s.dropselectCSSClass='dropselect';s.dropselectDisabledCSSClass='dropselect_disabled';s.dropselectSelectCSSClass='select';s.dropselectDimension=new Dimension();s.dropselectDimension.setBorder('1px');s.dropselectDropDimension=new Dimension(15,'100%');s.dropselectDropDimension.setRight(0).setTop(0).setBorder('1px');s.dropselectDropImg='select/droparrow.png';s.dropselectDropCSS='dropzone';s.dropselectDropCSSHover='dropselect_hover';s.dropselectDropCSSClick='dropselect_click';s.dropselectEmptyChar='-';s.dropselectDropDownClass='dropdown';s.dropselectDropDownDimension=new Dimension();s.dropselectDropDownDimension.setBorder('1px');s.dropselectDropDownSelectedClass='selected';s.tagClass='tag';s.tagList=[];s.tagList['b']={'sId':'b','sElementType':'span','sClass':'bold','sType':'bi','validInput':function (sInput){return sInput==this.sId;},'modElement':function (oElement){return oElement;}};s.tagList['i']={'sId':'i','sElementType':'span','sClass':'italic','sType':'bi','validInput':function (sInput){return sInput==this.sId;},'modElement':function (oElement){return oElement;}};s.tagList['color']={'sId':'color','sElementType':'span','sClass':'color','sType':'bi','validInput':function (sInput,bEnd){if(bEnd)return sInput==this.sId;return /^=([a-z]+|#[a-z0-9]{6}|#[a-z0-9]{3})$/i.test(sInput.substring(5,sInput.length));},'modElement':function (oElement,sInput){oElement.style.color=/^=([a-z]+|#[a-z0-9]{6}|#[a-z0-9]{3})$/i.exec(sInput.substring(5,sInput.length))[1];return oElement;}};s.tagList['img']={'sId':'img','sElementType':'img','sClass':'img','sType':'mono','validInput':function (sInput){return /^(=| )([a-z]{3,5}:\/\/)?([a-z0-9.-]*\.[a-z]{2,5})(:\d{2,5})?(\/\S*)?$/i.test(sInput.substring(3,sInput.length));},'modElement':function (oElement,sInput){var aInput=/^(=| )([a-z]{3,5}:\/\/)?([a-z0-9.-]*\.[a-z]{2,5})(:\d{2,5})?(\/\S*)?$/i.exec(sInput.substring(3,sInput.length));oElement.src=(aInput[2]?aInput[2]:'http://')+aInput[3]+(aInput[4]?aInput[4]:'')+(aInput[5]?aInput[5]:'');return oElement;}};return s;}function ActionEvent(){this.oEvent=null;this.gSource=null;this.sType='';this.sCategory='';this.ActionEvent.apply(this,arguments);}ActionEvent.method('ActionEvent',function (oEvent){this.oEvent=oEvent;}).method('setSource',function (gSource){this.gSource=gSource;return this;}).method('setType',function (sType){this.sType=sType;return this;}).method('setCategory',function (sCategory){this.sCategory=sCategory;return this;}).method('getSource',function (){return this.gSource;}).method('getType',function (){return this.sType;}).method('getCategory',function (){return this.sCategory;});function Point(){this.nX=0;this.nY=0;this.nZ=null;this.Point.apply(this,arguments);}Point.method('Point',function (nX,nY,nZ){this.nX=nX;this.nY=nY;this.nZ=nZ;}).method('x',function (nX){if(nX)this.nX=nX;return this.nX;}).method('y',function (nY){if(nY)this.nY=nY;return this.nY;}).method('z',function (nZ){if(nZ)this.nZ=nZ;return this.nZ;}).method('addX',function (nX){if(nX)this.nX+=nX;return this.nX;}).method('addY',function (nY){if(nY)this.nY+=nY;return this.nY;}).method('addZ',function (nZ){if(nZ)this.nZ+=nZ;return this.nZ;}).method('subX',function (nX){if(nX)this.nX-=nX;return this.nX;}).method('subY',function (nY){if(nY)this.nY-=nY;return this.nY;}).method('subY',function (nZ){if(nZ)this.nZ-=nZ;return this.nZ;}).method('add',function (pAdd){if(this.nX&&pAdd.nX)this.nX+=pAdd.nX;if(this.nY&&pAdd.nY)this.nY+=pAdd.nY;if(this.nZ&&pAdd.nZ)this.nZ+=pAdd.nZ;return this;}).method('sub',function (pSub){if(this.nX&&pSub.nX)this.nX+=pSub.nX;if(this.nY&&pSub.nY)this.nY+=pSub.nY;if(this.nZ&&pSub.nZ)this.nZ+=pSub.nZ;return this;}).method('copy',function (){var ret=new Point();ret.x=this.x;ret.y=this.y;ret.z=this.z;return ret;});function Dimension(){this.aBounds=[];this.aMaxBounds=[];this.aMinBounds=[];this.nWidth=null;this.nWidthPer=null;this.nMaxWidth=null;this.nMaxWidthPer=null;this.nMinWidth=null;this.nMinWidthPer=null;this.nHeight=null;this.nHeightPer=null;this.nMaxHeight=null;this.nMaxHeightPer=null;this.nMinHeight=null;this.nMinHeightPer=null;this.nLayer=null;this.sPosition=null;this.oBorder=null;this.oOuterspace=null;this.oInnerspace=null;this.bExcludeBorder=false;this.bIncludeSpaces=true;this.bCollapse=true;this.gOwner=null;this.pAbsolutePosition;this.Dimension.apply(this,arguments);}Dimension.method('Dimension',function (mWidth,mHeight,nLayer){this.setWidth(mWidth).setHeight(mHeight).setLayer(nLayer).setPosition('absolute');}).method('applyCSS',function (){if(!this.getOwner().getTopElement().style)return;this.applySpaces();var bSetPosition=false;if(isNumber(this.getTop())){this.getOwner().getTopElement().style.top=this.getTop(false,this.bIncludeSpaces)+'px';bSetPosition=true;}else this.getOwner().getTopElement().style.top=null;if(isNumber(this.getRight())){this.getOwner().getTopElement().style.right=this.getRight(false,this.bIncludeSpaces)+'px';bSetPosition=true;}else this.getOwner().getTopElement().style.right=null;if(isNumber(this.getBottom())){this.getOwner().getTopElement().style.bottom=this.getBottom(false,this.bIncludeSpaces)+'px';bSetPosition=true;}else this.getOwner().getTopElement().style.bottom=null;if(isNumber(this.getLeft())){this.getOwner().getTopElement().style.left=this.getLeft(false,this.bIncludeSpaces)+'px';bSetPosition=true;}else this.getOwner().getTopElement().style.left=null;if(isNumber(this.getWidth())){this.getOwner().getTopElement().style.width=this.getWidth(false,this.bIncludeSpaces)+'px';bSetPosition=true;}else if(isNumber(this.nWidthPer)){this.getOwner().getTopElement().style.width=this.nWidthPer+'%';bSetPosition=true;}else this.getOwner().getTopElement().style.width=null;if(isNumber(this.getHeight())){this.getOwner().getTopElement().style.height=this.getHeight(false,this.bIncludeSpaces)+'px';bSetPosition=true;}else if(isNumber(this.nHeightPer)){this.getOwner().getTopElement().style.height=this.nHeightPer+'%';bSetPosition=true;}else this.getOwner().getTopElement().style.height=null;if(isNumber(this.nLayer))this.getOwner().getTopElement().style.zIndex=this.nLayer;else this.getOwner().getTopElement().style.zIndex=null;if(bSetPosition)this.getOwner().getTopElement().style.position=this.sPosition;else this.getOwner().getTopElement().style.position='static';}).method('setTop',function (nTop,sSelect,bIncludeSpace){if(bIncludeSpace)var aCorrections=this.getSpaceCorrections();else{var aCorrections=[];for(var i=0;i<6;++i)aCorrections[i]=0;}if(!sSelect||(sSelect&&sSelect=='normal'))this.aBounds[0]=nTop-aCorrections[0];else if(sSelect=='max')this.aMaxBounds[0]=nTop-aCorrections[0];else if(sSelect=='min')this.aMinBounds[0]=nTop-aCorrections[0];this.pAbsolutePosition=null;return this;}).method('setRight',function (nRight,sSelect,bIncludeSpace){if(bIncludeSpace)var aCorrections=this.getSpaceCorrections();else{var aCorrections=[];for(var i=0;i<6;++i)aCorrections[i]=0;}if(!sSelect||(sSelect&&sSelect=='normal'))this.aBounds[1]=nRight-aCorrections[1];else if(sSelect=='max')this.aMaxBounds[1]=nRight-aCorrections[1];else if(sSelect=='min')this.aMinBounds[1]=nRight-aCorrections[1];this.pAbsolutePosition=null;return this;}).method('setBottom',function (nBottom,sSelect,bIncludeSpace){if(bIncludeSpace)var aCorrections=this.getSpaceCorrections();else{var aCorrections=[];for(var i=0;i<6;++i)aCorrections[i]=0;}if(!sSelect||sSelect=='normal')this.aBounds[2]=nBottom-aCorrections[2];else if(sSelect=='max')this.aMaxBounds[2]=nBottom-aCorrections[2];else if(sSelect=='min')this.aMinBounds[2]=nBottom-aCorrections[2];this.pAbsolutePosition=null;return this;}).method('setLeft',function (nLeft,sSelect,bIncludeSpace){if(bIncludeSpace)var aCorrections=this.getSpaceCorrections();else{var aCorrections=[];for(var i=0;i<6;++i)aCorrections[i]=0;}if(!sSelect||sSelect=='normal')this.aBounds[3]=nLeft-aCorrections[3];else if(sSelect=='max')this.aMaxBounds[3]=nLeft-aCorrections[3];else if(sSelect=='min')this.aMinBounds[3]=nLeft-aCorrections[3];this.pAbsolutePosition=null;return this;}).method('setWidth',function (mWidth,sSelect,bIncludeSpace){if(bIncludeSpace)var aCorrections=this.getSpaceCorrections();else{var aCorrections=[];for(var i=0;i<6;++i)aCorrections[i]=0;}var regPercent=/(\d+)%/;var nWidth=null;if(isString(mWidth)&&mWidth.trim().match(regPercent)){var aResult=regPercent.exec(mWidth);if(!sSelect||(sSelect&&sSelect=='normal')){this.nWidthPer=parseInt(aResult[1]);this.nWidth=null;}else if(sSelect=='max'){this.nMaxWidthPer=parseInt(aResult[1]);this.nMaxWidth=null;}else if(sSelect=='min'){this.nMinWidthPer=parseInt(aResult[1]);this.nMinWidth=null;}}else{if(mWidth){nWidth=parseInt(mWidth);if(!sSelect||sSelect=='normal'){this.nWidth=nWidth-aCorrections[4];this.nWidthPer=null;}else if(sSelect=='max'){this.nMaxWidth=nWidth-aCorrections[4];this.nMaxWidthPer=null;}else if(sSelect=='min'){this.nMinWidth=nWidth-aCorrections[4];this.nMinWidthPer=null;}}else{if(!sSelect||sSelect=='normal'){this.nWidth=null;this.nWidthPer=null;}else if(sSelect=='max'){this.nMaxWidth=null;this.nMaxWidthPer=null;}else if(sSelect=='min'){this.nMinWidth=null;this.nMinWidthPer=null;}}}this.pAbsolutePosition=null;return this;}).method('setHeight',function (mHeight,sSelect,bIncludeSpace){if(bIncludeSpace)var aCorrections=this.getSpaceCorrections();else{var aCorrections=[];for(var i=0;i<6;++i)aCorrections[i]=0;}var regPercent=/(\d+)%/;var nHeight=null;if(isString(mHeight)&&mHeight.trim().match(regPercent)){var aResult=regPercent.exec(mHeight);if(!sSelect||(sSelect&&sSelect=='normal')){this.nHeightPer=parseInt(aResult[1]);this.nHeight=null;}else if(sSelect=='max'){this.nMaxHeightPer=parseInt(aResult[1]);this.nMaxHeight=null;}else if(sSelect=='min'){this.nMinHeightPer=parseInt(aResult[1]);this.nMinHeight=null;}}else{if(mHeight){nHeight=parseInt(mHeight);if(!sSelect||sSelect=='normal'){this.nHeight=nHeight-aCorrections[4];this.nHeightPer=null;}else if(sSelect=='max'){this.nMaxHeight=nHeight-aCorrections[4];this.nMaxHeightPer=null;}else if(sSelect=='min'){this.nMinHeight=nHeight-aCorrections[4];this.nMinHeightPer=null;}}else{if(!sSelect||sSelect=='normal'){this.nHeight=null;this.nHeightPer=null;}else if(sSelect=='max'){this.nMaxHeight=null;this.nMaxHeightPer=null;}else if(sSelect=='min'){this.nMinHeight=null;this.nMinHeightPer=null;}}}this.pAbsolutePosition=null;return this;}).method('setLayer',function (nLayer){this.nLayer=nLayer;return this;}).method('setPosition',function (sPosition){this.sPosition=sPosition;return this;}).method('setBorder',function (oBorder){if(oBorder&&!(oBorder instanceof Border)){oBorder=new Border(oBorder);}this.oBorder=oBorder;this.pAbsolutePosition=null;return this;}).method('setOuterspace',function (oOuterspace){if(!(oOuterspace instanceof Outerspace)){oOuterspace=new Outerspace(oOuterspace);}this.oOuterspace=oOuterspace;this.pAbsolutePosition=null;return this;}).method('setInnerspace',function (oInnerspace){if(!(oInnerspace instanceof Innerspace)){oInnerspace=new Innerspace(oInnerspace);}this.oInnerspace=oInnerspace;this.pAbsolutePosition=null;return this;}).method('setOwner',function (gComponent){this.gOwner=gComponent;this.pAbsolutePosition=null;return this;}).method('setIncludeSpaces',function (bInclude){this.bIncludeSpaces=bInclude;return this;}).method('getTop',function (sSelect,bIncludeSpace){if(bIncludeSpace)var aCorrections=this.getSpaceCorrections();else{var aCorrections=[];for(var i=0;i<6;++i)aCorrections[i]=0;}if((!sSelect||sSelect=='normal')&&isNumber(this.aBounds[0]))return this.aBounds[0]+aCorrections[0];if(sSelect&&sSelect=='max'&&isNumber(this.aMaxBounds[0]))return this.aMaxBounds[0]+aCorrections[0];if(sSelect&&sSelect=='min'&&isNumber(this.aMinBounds[0]))return this.aMinBounds[0]+aCorrections[0];return null;}).method('getRight',function (sSelect,bIncludeSpace){if(bIncludeSpace)var aCorrections=this.getSpaceCorrections();else{var aCorrections=[];for(var i=0;i<6;++i)aCorrections[i]=0;}if((!sSelect||sSelect=='normal')&&isNumber(this.aBounds[1]))return this.aBounds[1]+aCorrections[1];if(sSelect&&sSelect=='max'&&isNumber(this.aMaxBounds[1]))return this.aMaxBounds[1]+aCorrections[1];if(sSelect&&sSelect=='min'&&isNumber(this.aMinBounds[1]))return this.aMinBounds[1]+aCorrections[1];return null;}).method('getBottom',function (sSelect,bIncludeSpace){if(bIncludeSpace)var aCorrections=this.getSpaceCorrections();else{var aCorrections=[];for(var i=0;i<6;++i)aCorrections[i]=0;}if((!sSelect||sSelect=='normal')&&isNumber(this.aBounds[2]))return this.aBounds[2]+aCorrections[2];if(sSelect&&sSelect=='max'&&isNumber(this.aMaxBounds[2]))return this.aMaxBounds[2]+aCorrections[2];if(sSelect&&sSelect=='min'&&isNumber(this.aMinBounds[2]))return this.aMinBounds[2]+aCorrections[2];return null;}).method('getLeft',function (sSelect,bIncludeSpace){if(bIncludeSpace)var aCorrections=this.getSpaceCorrections();else{var aCorrections=[];for(var i=0;i<6;++i)aCorrections[i]=0;}if((!sSelect||sSelect=='normal')&&isNumber(this.aBounds[3]))return this.aBounds[3]+aCorrections[3];if(sSelect&&sSelect=='max'&&isNumber(this.aMaxBounds[3]))return this.aMaxBounds[3]+aCorrections[3];if(sSelect&&sSelect=='min'&&isNumber(this.aMinBounds[3]))return this.aMinBounds[3]+aCorrections[3];return null;}).method('getWidth',function (sSelect,bIncludeSpace){if(bIncludeSpace)var aCorrections=this.getSpaceCorrections();else{var aCorrections=[];for(var i=0;i<6;++i)aCorrections[i]=0;}if(!sSelect||sSelect=='normal'){if(isNumber(this.nWidthPer)&&this.gOwner&&this.gOwner.getParent()&&this.gOwner.getParent().getDimension(true)&&this.gOwner.getParent().getDimension().getWidth()){nPer=Math.round(this.gOwner.getParent().getDimension().getWidth(false,true)*(this.nWidthPer/100))+aCorrections[4];if(isNumber(this.nMinWidth)&&this.nMinWidth>nPer)return this.nMinWidth+aCorrections[4];if(isNumber(this.nMaxWidth)&&this.nMaxWidth<nPer)return this.nMaxWidth+aCorrections[4];return nPer;}if(isNumber(this.nWidth))return this.nWidth+aCorrections[4];}if(sSelect&&sSelect=='max'){if(isNumber(this.nMaxWidthPer)&&this.gOwner&&this.gOwner.getParent()&&this.gOwner.getParent().getDimension(true)&&this.gOwner.getParent().getDimension().getWidth()){nPer=Math.round(this.gOwner.getParent().getDimension().getWidth(false,true)*(this.nMaxWidthPer/100))+aCorrections[4];if(isNumber(this.nMinWidth)&&this.nMinWidth>nPer)return this.nMinWidth+aCorrections[4];if(isNumber(this.nMaxWidth)&&this.nMaxWidth<nPer)return this.nMaxWidth+aCorrections[4];return nPer;}if(isNumber(this.nMaxWidth))return this.nMaxWidth+aCorrections[4];}if(sSelect&&sSelect=='min'){if(isNumber(this.nMinWidthPer)&&this.gOwner&&this.gOwner.getParent()&&this.gOwner.getParent().getDimension(true)&&this.gOwner.getParent().getDimension().getWidth()){nPer=Math.round(this.gOwner.getParent().getDimension().getWidth(false,true)*(this.nMinWidthPer/100))+aCorrections[4];if(isNumber(this.nMinWidth)&&this.nMinWidth>nPer)return this.nMinWidth+aCorrections[4];if(isNumber(this.nMaxWidth)&&this.nMaxWidth<nPer)return this.nMaxWidth+aCorrections[4];return nPer;}if(isNumber(this.nMinWidth))return this.nMinWidth+aCorrections[4];}if((!sSelect||sSelect=='normal')&&isNumber(this.aBounds[1])&&isNumber(this.aBounds[3]))return this.aBounds[1]-this.aBounds[3]+aCorrections[4];if(sSelect&&sSelect=='max'&&isNumber(this.aMaxBounds[1])&&isNumber(this.aMinBounds[3]))return this.aMaxBounds[1]-this.aMinBounds[3]+aCorrections[4];if(sSelect&&sSelect=='min'&&isNumber(this.aMinBounds[1])&&isNumber(this.aMaxBounds[3]))return this.aMinBounds[1]-this.aMaxBounds[3]+aCorrections[4];return null;}).method('getHeight',function (sSelect,bIncludeSpace){if(bIncludeSpace)var aCorrections=this.getSpaceCorrections();else{var aCorrections=[];for(var i=0;i<6;++i)aCorrections[i]=0;}if(!sSelect||sSelect=='normal'){if(isNumber(this.nHeightPer)&&this.gOwner&&this.gOwner.getParent()&&this.gOwner.getParent().getDimension(true)&&this.gOwner.getParent().getDimension().getHeight()){nPer=Math.round(this.gOwner.getParent().getDimension().getHeight(false,true)*(this.nHeightPer/100))+aCorrections[5];if(isNumber(this.nMinHeight)&&this.nMinHeight>nPer)return this.nMinHeight;if(isNumber(this.nMaxHeight)&&this.nMaxHeight<nPer)return this.nMaxHeight;return nPer;}if(isNumber(this.nHeight))return this.nHeight+aCorrections[5];}if(sSelect&&sSelect=='max'){if(isNumber(this.nMaxHeightPer)&&this.gOwner&&this.gOwner.getParent()&&this.gOwner.getParent().getDimension(true)&&this.gOwner.getParent().getDimension().getHeight()){nPer=Math.round(this.gOwner.getParent().getDimension().getHeight(false,true)*(this.nMaxHeightPer/100))+aCorrections[5];if(isNumber(this.nMinHeight)&&this.nMinHeight>nPer)return this.nMinHeight;if(isNumber(this.nMaxHeight)&&this.nMaxHeight<nPer)return this.nMaxHeight;return nPer;}if(isNumber(this.nMaxHeight))return this.nMaxHeight+aCorrections[5];}if(sSelect&&sSelect=='min'){if(isNumber(this.nMaxHeightPer)&&this.gOwner&&this.gOwner.getParent()&&this.gOwner.getParent().getDimension(true)&&this.gOwner.getParent().getDimension().getHeight()){nPer=Math.round(this.gOwner.getParent().getDimension().getHeight(false,true)*(this.nMinHeightPer/100))+aCorrections[5];if(isNumber(this.nMinHeight)&&this.nMinHeight>nPer)return this.nMinHeight;if(isNumber(this.nMaxHeight)&&this.nMaxHeight<nPer)return this.nMaxHeight;return nPer;}if(isNumber(this.nMinHeight))return this.nMinHeight+aCorrections[5];}if((!sSelect||sSelect=='normal')&&isNumber(this.aBounds[2])&&isNumber(this.aBounds[0]))return this.aBounds[2]-this.aBounds[0]+aCorrections[5];if(sSelect&&sSelect=='max'&&isNumber(this.aMaxBounds[2])&&isNumber(this.aMinBounds[0]))return this.aMaxBounds[2]-this.aMinBounds[0]+aCorrections[5];if(sSelect&&sSelect=='min'&&isNumber(this.aMinBounds[2])&&isNumber(this.aMaxBounds[0]))return this.aMinBounds[2]-this.aMaxBounds[0]+aCorrections[5];return null;}).method('getLayer',function (){return this.nLayer;}).method('getPosition',function (){return this.sPosition;}).method('getBorder',function (){return this.oBorder;}).method('getOuterspace',function (){return this.oOuterspace;}).method('getInnerspace',function (){return this.oInnerspace;}).method('getOwner',function (){return this.gOwner;}).method('getAbsolutePosition',function (){if(this.pAbsolutePosition)return this.pAbsolutePosition;if(this.getOwner()&&this.getOwner()==oWebpage.getRoot())return new Point(0,0);if(this.getOwner()&&this.getOwner().getParent()&&this.getOwner().getParent().getDimension()){var oDim=this.getOwner().getParent().getDimension();var pPar=oDim.getAbsolutePosition();if(!pPar)return null;var pCorrection=new Point(0,0);if(oDim.getOuterspace()&&isNumber(oDim.getOuterspace().getWidth('top')))pCorrection.addY(oDim.getOuterspace().getWidth('top'));if(oDim.getBorder()&&isNumber(oDim.getBorder().getWidth('top')))pCorrection.addY(oDim.getBorder().getWidth('top'));if(oDim.getOuterspace()&&isNumber(oDim.getOuterspace().getWidth('left')))pCorrection.addX(oDim.getOuterspace().getWidth('left'));if(oDim.getBorder()&&isNumber(oDim.getBorder().getWidth('left')))pCorrection.addX(oDim.getBorder().getWidth('left'));var nTop=0,nLeft=0;var pPos=new Point(0,0);if(!isNumber(this.getTop())){if(isNumber(this.getBottom())&&isNumber(oDim.getHeight())&&isNumber(this.getHeight()))pPos.y(oDim.getHeight(false,true)-this.getHeight()-this.getBottom());else return null;}else pPos.y(this.getTop());if(!isNumber(this.getLeft())){if(isNumber(this.getRight())&&isNumber(oDim.getWidth())&&isNumber(this.getWidth()))pPos.x(oDim.getWidth(false,true)-this.getWidth()-this.getRight());else return null;}else pPos.x(this.getLeft());pPos.add(pCorrection).add(pPar);return (this.pAbsolutePosition=pPos);}}).method('applySpaces',function (){if(this.oBorder)this.oBorder.useCSSOn(this.getOwner().getTopElement());if(this.oOuterspace)this.oOuterspace.useCSSOn(this.getOwner().getTopElement());if(this.oInnerspace)this.oInnerspace.useCSSOn(this.getOwner().getTopElement());}).method('getSpaceCorrections',function (){var aCorrections=[];for(var i=0;i<6;++i)aCorrections[i]=0;if(this.oBorder){if(!this.bExcludeBorders){if(isNumber(this.oBorder.aWidth[1]))aCorrections[4]-=this.oBorder.aWidth[1];if(isNumber(this.oBorder.aWidth[3]))aCorrections[4]-=this.oBorder.aWidth[3];if(isNumber(this.oBorder.aWidth[0]))aCorrections[5]-=this.oBorder.aWidth[0];if(isNumber(this.oBorder.aWidth[2]))aCorrections[5]-=this.oBorder.aWidth[2];}}if(this.oOuterspace){if(!this.bExcludeBorders){if(isNumber(this.oOuterspace.aWidth[1]))aCorrections[4]-=this.oOuterspace.aWidth[1];if(isNumber(this.oOuterspace.aWidth[3]))aCorrections[4]-=this.oOuterspace.aWidth[3];if(isNumber(this.oOuterspace.aWidth[0]))aCorrections[5]-=this.oOuterspace.aWidth[0];if(isNumber(this.oOuterspace.aWidth[2]))aCorrections[5]-=this.oOuterspace.aWidth[2];}}if(this.oInnerspace){if(!this.bExcludeBorders){if(isNumber(this.oInnerspace.aWidth[1]))aCorrections[4]-=this.oInnerspace.aWidth[1];if(isNumber(this.oInnerspace.aWidth[3]))aCorrections[4]-=this.oInnerspace.aWidth[3];if(isNumber(this.oInnerspace.aWidth[0]))aCorrections[5]-=this.oInnerspace.aWidth[0];if(isNumber(this.oInnerspace.aWidth[2]))aCorrections[5]-=this.oInnerspace.aWidth[2];}}return aCorrections;}).method('getInnerspaceCorrections',function (){var aCorrections=[];for(var i=0;i<6;++i)aCorrections[i]=0;if(this.oInnerspace){if(!this.bExcludeBorders){if(isNumber(this.oInnerspace.aWidth[0]))aCorrections[0]+=this.oInnerspace.aWidth[0];if(isNumber(this.oInnerspace.aWidth[1]))aCorrections[1]+=this.oInnerspace.aWidth[1];if(isNumber(this.oInnerspace.aWidth[2]))aCorrections[2]+=this.oInnerspace.aWidth[2];if(isNumber(this.oInnerspace.aWidth[3]))aCorrections[3]+=this.oInnerspace.aWidth[3];if(isNumber(this.oInnerspace.aWidth[1]))aCorrections[4]-=this.oInnerspace.aWidth[1];if(isNumber(this.oInnerspace.aWidth[3]))aCorrections[4]-=this.oInnerspace.aWidth[3];if(isNumber(this.oInnerspace.aWidth[0]))aCorrections[5]-=this.oInnerspace.aWidth[0];if(isNumber(this.oInnerspace.aWidth[2]))aCorrections[5]-=this.oInnerspace.aWidth[2];}}return aCorrections;}).method('copy',function (){var ret=new Dimension();ret.aBounds=this.aBounds.copy();ret.aMaxBounds=this.aMaxBounds.copy();ret.aMinBounds=this.aMinBounds.copy();ret.nWidth=this.nWidth;ret.nWidthPer=this.nWidthPer;ret.nMaxWidth=this.nMaxWidth;ret.nMaxWidthPer=this.nMaxWidthPer;ret.nMinWidth=this.nMinWidth;ret.nMinWidthPer=this.nMinWidthPer;ret.nHeight=this.nHeight;ret.nHeightPer=this.nHeightPer;ret.nMaxHeight=this.nMaxHeight;ret.nMaxHeightPer=this.nMaxHeightPer;ret.nMinHeight=this.nMinHeight;ret.nMinHeightPer=this.nMinHeightPer;ret.nLayer=this.nLayer;ret.sPosition=this.sPosition;if(this.oBorder)ret.oBorder=this.oBorder.copy();if(this.oOuterspace)ret.oOuterspace=this.oOuterspace.copy();if(this.oInnerspace)ret.oInnerspace=this.oInnerspace.copy();ret.gOwner=this.gOwner;return ret;});function Space(){this.aWidth=[];this.Space.apply(this,arguments);}Space.method('Space',function (){}).method('setWidth',function (mWidth,sSide){mWidth=String(mWidth);this.setCSSProperty(mWidth.replace(/px/g,''),this.aWidth,sSide);for(var i=0;i<4;++i){this.aWidth[i]=parseInt(this.aWidth[i]);}return this;}).method('getWidth',function (mSide){if(mSide=='top'||mSide==0)return this.aWidth[0];if(mSide=='right'||mSide==1)return this.aWidth[1];if(mSide=='bottom'||mSide==2)return this.aWidth[2];if(mSide=='left'||mSide==3)return this.aWidth[3];}).method('setCSSProperty',function (sProperty,aProperty,sSide){if(!sSide){var regStyle=/^(\S+)$/;if(sProperty.trim().match(regStyle)){var aResults=regStyle.exec(sProperty.trim());for(var i=0;i<5;++i){aProperty[i]=aResults[1];}}regStyle=/^(.+) (.+)$/;if(sProperty.trim().match(regStyle)){var aResults=regStyle.exec(sProperty.trim());aProperty[0]=aResults[1];aProperty[1]=aResults[2];aProperty[2]=aResults[1];aProperty[3]=aResults[2];}regStyle=/^(.+) (.+) (.+)$/;if(sProperty.trim().match(regStyle)){var aResults=regStyle.exec(sProperty.trim());aProperty[0]=aResults[1];aProperty[1]=aResults[2];aProperty[2]=aResults[3];aProperty[3]=aResults[2];}regStyle=/^(.+) (.+) (.+) (.+)$/;if(sProperty.trim().match(regStyle)){var aResults=regStyle.exec(sProperty.trim());aProperty[0]=aResults[1];aProperty[1]=aResults[2];aProperty[2]=aResults[3];aProperty[3]=aResults[4];}}else if(sSide=='top'||sSide=='0'){aProperty[0]=sProperty;}else if(sSide=='right'||sSide=='1'){aProperty[1]=sProperty;}else if(sSide=='bottom'||sSide=='2'){aProperty[2]=sProperty;}else if(sSide=='left'||sSide=='3'){aProperty[3]=sProperty;}return this;}).method('copyValues',function (oOrig){this.aWidth=oOrig.aWidth.copy();return this;}).method('copy',function (){var ret=new Space();return ret.copyValues(this);});function Innerspace(){this.temp=Space;this.temp();this.temp=null;this.Innerspace.apply(this,arguments);}Innerspace.inherits(Space);Innerspace.method('Innerspace',function (sWidth){if(sWidth)this.setWidth(sWidth);}).method('useCSSOn',function (oElement){if(isNumber(this.aWidth[0]))oElement.style.paddingTop=this.aWidth[0]+'px';else oElement.style.paddingTop=null;if(isNumber(this.aWidth[1]))oElement.style.paddingRight=this.aWidth[1]+'px';else oElement.style.paddingRight=null;if(isNumber(this.aWidth[2]))oElement.style.paddingBottom=this.aWidth[2]+'px';else oElement.style.paddingBottom=null;if(isNumber(this.aWidth[3]))oElement.style.paddingLeft=this.aWidth[3]+'px';else oElement.style.paddingLeft=null;return this;}).method('copy',function (){var ret=new Innerspace();return ret.copyValues(this);});function Outerspace(){this.temp=Space;this.temp();this.temp=null;this.Outerspace.apply(this,arguments);}Outerspace.inherits(Space);Outerspace.method('Outerspace',function (sWidth){if(sWidth)this.setWidth(sWidth);}).method('useCSSOn',function (oElement){if(isNumber(this.aWidth[0]))oElement.style.marginTop=this.aWidth[0]+'px';else oElement.style.marginTop=null;if(isNumber(this.aWidth[1]))oElement.style.marginRight=this.aWidth[1]+'px';else oElement.style.marginRight=null;if(isNumber(this.aWidth[2]))oElement.style.marginBottom=this.aWidth[2]+'px';else oElement.style.marginBottom=null;if(isNumber(this.aWidth[3]))oElement.style.marginLeft=this.aWidth[3]+'px';else oElement.style.marginLeft=null;return this;}).method('copy',function (){var ret=new Outerspace();return ret.copyValues(this);});function Border(){this.temp=Space;this.temp();this.temp=null;this.aCSSStyle=[];this.aCSSColor=[];this.bStylized=false;this.aIcon=[];this.Border.apply(this,arguments);}Border.inherits(Space);Border.method('Border',function (sBorderStyle){this.setCSSBorder(sBorderStyle);}).method('setCSSBorder',function (sBorderStyle){var regStyle=/^(\d+)px\s*(\w*)\s*(\w*)$/;if(isString(sBorderStyle)&&sBorderStyle.match(regStyle)){var aResults=regStyle.exec(sBorderStyle);for(var i=0;i<5;++i){this.aWidth[i]=parseInt(aResults[1]);this.aCSSStyle[i]=aResults[2];this.aCSSColor[i]=aResults[3];}}return this;}).method('setCSSColor',function (sColor,sSide){this.setCSSProperty(sColor,this.aCSSColor,sSide);return this;}).method('setCSSStyle',function (sStyle,sSide){this.setCSSProperty(sStyle,this.aCSSColor,sSide);}).method('useCSSOn',function (oElement){if(isNumber(this.aWidth[0]))oElement.style.borderTopWidth=this.aWidth[0]+'px';else oElement.style.borderTopWidth=null;if(isNumber(this.aWidth[1]))oElement.style.borderRightWidth=this.aWidth[1]+'px';else oElement.style.borderRightWidth=null;if(isNumber(this.aWidth[2]))oElement.style.borderBottomWidth=this.aWidth[2]+'px';else oElement.style.borderBottomWidth=null;if(isNumber(this.aWidth[3]))oElement.style.borderLeftWidth=this.aWidth[3]+'px';else oElement.style.borderLeftWidth=null;oElement.style.borderTopStyle=this.aCSSStyle[0];oElement.style.borderRightStyle=this.aCSSStyle[1];oElement.style.borderBottomStyle=this.aCSSStyle[2];oElement.style.borderLeftStyle=this.aCSSStyle[3];oElement.style.borderTopColor=this.aCSSColor[0];oElement.style.borderRightColor=this.aCSSColor[1];oElement.style.borderBottomColor=this.aCSSColor[2];oElement.style.borderLeftColor=this.aCSSColor[3];return this;}).method('copyValues',function (oOrig){this.uber('copyValues',oOrig);this.aCSSStyle=oOrig.aCSSStyle.copy();this.aCSSColor=oOrig.aCSSColor.copy();this.bStylized=oOrig.bStylized;this.aIcon=oOrig.aIcon.copy();return this;}).method('copy',function (){var ret=new Border();return ret.copyValues(this);});function GComponent(){this.oTopElement=null;this.oBottomElement=null;this.aChildren=[];this.oDimension=null;this.oTempDimension=null;this.aMouseListener=[];this.aKeyListener=[];this.aChangeListener=[];this.aClickActions=[];this.gParent=null;this.aCursor=['auto',false,false];this.aOverflow=['visible',false,false];this.sCSSClass='';this.sCSSHover='';this.sCSSClick='';var self=this;this.alDraw=function (){return self._alDraw.apply(self,arguments);};this.resetDrawTree=function (){return self._resetDrawTree.apply(self,arguments);};this.eventClick=function (){return self._eventClick.apply(self,arguments);};this.eventMouseDown=function (){return self._eventMouseDown.apply(self,arguments);};this.eventMouseUp=function (){self._eventMouseUp.apply(self,arguments);};this.eventMouseOver=function (){self._eventMouseOver.apply(self,arguments);};this.eventMouseMove=function (){self._eventMouseMove.apply(self,arguments);};this.eventMouseOut=function (){self._eventMouseOut.apply(self,arguments);};this.eventKeyDown=function (){return self._eventKeyDown.apply(self,arguments);};this.eventKeyPress=function (){return self._eventKeyPress.apply(self,arguments);};this.eventKeyUp=function (){return self._eventKeyUp.apply(self,arguments);};this.eventChange=function (){return self._eventChange.apply(self,arguments);};this.applyCSSHover=function (){return self._applyCSSHover.apply(self,arguments);};this.applyCSSClick=function (){return self._applyCSSClick.apply(self,arguments);};}GComponent.method('append',function (){for(var i=0;i<arguments.length;++i){this.aChildren.push(arguments[i]);arguments[i].setParent(this);}return this;}).method('remove',function (){for(var i=0;i<arguments.length;++i){this.aChildren.remove(arguments[i]);arguments[i].removeParent();}return this;}).method('removeAll',function (){this.aChildren=[];return this;}).method('draw',function (bIsNotRoot){if(bIsNotRoot&&this.getDimension(true,true))this.getDimension(true,true).applyCSS();this.applyCursor();this.applyCSSClass();this.applyOverflow();while(this.getBottomElement().hasChildNodes()){this.getBottomElement().removeChild(this.getBottomElement().firstChild);}for(var i=0;i<this.aChildren.length;++i){this.getBottomElement().appendChild(this.aChildren[i].getTopElement());this.aChildren[i].draw(true);}if(!bIsNotRoot)setTimeout(this.resetDrawTree,0);}).method('_alDraw',function (){this.draw();}).method('_resetDrawTree',function (){this.resetBottomUp(true);this.resetTopDown();}).method('resetBottomUp',function (bIsRoot){for(var i=0;i<this.aChildren.length;++i){this.aChildren[i].resetBottomUp();}if(!bIsRoot){this.setDimension(null,true);this.calculateBottom();}}).method('resetTopDown',function (){this.calculateTop();this.getDimension().applyCSS();for(var i=0;i<this.aChildren.length;++i){this.aChildren[i].resetTopDown();}}).method('calculateBottom',function (nRetry){if(!nRetry)nRetry=0;if(this.getDimension(true,true))this.setDimension(this.getDimension(true,true).copy(),true);else{this.setDimension(new Dimension(),true);}var nWidth=this.getTopElement().offsetWidth,bChange=false;if(isNumber(this.getDimension().getWidth('max',true))&&this.getDimension().getWidth('max',true)<nWidth){nWidth=this.getDimension().getWidth('max',true);bChange=true;}if(isNumber(this.getDimension().getWidth('min',true))&&this.getDimension().getWidth('min',true)>nWidth){nWidth=this.getDimension().getWidth('min',true);bChange=true;}this.getDimension().setWidth(nWidth,false,true);if(bChange&&nRetry<3){this.getDimension().applyCSS();this.calculateBottom(++nRetry);}var nHeight=this.getTopElement().offsetHeight,bChange=false;if(isNumber(this.getDimension().getHeight('max',true))&&this.getDimension().getHeight('max',true)<nHeight){nHeight=this.getDimension().getHeight('max',true);bChange=true;}if(isNumber(this.getDimension().getHeight('min',true))&&this.getDimension().getHeight('min',true)>nHeight){nHeight=this.getDimension().getHeight('min',true);bChange=true;}this.getDimension().setHeight(nHeight,false,true);if(bChange&&nRetry<3){this.getDimension().applyCSS();this.calculateBottom(++nRetry);}}).method('calculateTop',function (){for(var i=0;i<this.aChildren.length;++i){if(this.aChildren[i].getDimension(true,true)){if(this.aChildren[i].getDimension(true,true).getWidth()&&this.aChildren[i].getDimension(true,true).getWidth()!=this.aChildren[i].getDimension(true).getWidth())this.aChildren[i].getDimension(true).setWidth(this.aChildren[i].getDimension(true,true).getWidth());if(this.aChildren[i].getDimension(true,true).getHeight()&&this.aChildren[i].getDimension(true,true).getHeight()!=this.aChildren[i].getDimension(true).getHeight())this.aChildren[i].getDimension(true).setHeight(this.aChildren[i].getDimension(true,true).getHeight());}}}).method('getTopElement',function (){return this.oTopElement;}).method('getBottomElement',function (){return this.oBottomElement;}).method('setTopElement',function (oElement){this.oTopElement=oElement;return this;}).method('setBottomElement',function (oElement){this.oBottomElement=oElement;return this;}).method('setDimension',function (oDimension,bIsTempDimension){if(oDimension)oDimension.setOwner(this);if(bIsTempDimension)this.oTempDimension=oDimension;else this.oDimension=oDimension;return this;}).method('setCSSClass',function (sClass){this.sCSSClass=sClass;return this;}).method('setCursor',function (sCursor,bInheritable,bNotUserSet){this.aCursor[0]=sCursor;if(bInheritable){for(var i=0;i<this.aChildren.length;++i){if(!this.aChildren[i].aCursor[2]){this.aChildren[i].setCursor(sCursor,true,true);}}this.aCursor[1]=true;}else this.aCursor[1]=false;if(bNotUserSet)this.aCursor[2]=false;else this.aCursor[2]=true;return this;}).method('setOverflow',function (sOverflow,bInheritable,bNotUserSet){this.aOverflow[0]=sOverflow;if(bInheritable){for(var i=0;i<this.aChildren.length;++i){if(!this.aChildren[i].aOverflow[2]){this.aChildren[i].setOverflow(sOverflow,true,true);}}this.aOverflow[1]=true;}else this.aOverflow[1]=false;if(bNotUserSet)this.aOverflow[2]=false;else this.aOverflow[2]=true;return this;}).method('setParent',function (gComponent){this.gParent=gComponent;if(!this.aCursor[2]&&this.gParent.getCursor(true))this.setCursor(this.gParent.getCursor(),true,true);if(!this.aOverflow[2]&&this.gParent.getOverflow(true))this.setOverflow(this.gParent.getOverflow(),true,true);return this;}).method('removeParent',function (){this.gParent=null;}).method('getParent',function (){return this.gParent;}).method('getDimension',function (bForceNoCreation,bForceNormal){if(!bForceNoCreation&&((!bForceNormal&&!this.oTempDimension&&!this.oDimension)||(bForceNormal&&!this.oDimension)))this.setDimension(new Dimension());return (!bForceNormal&&this.oTempDimension?this.oTempDimension:this.oDimension);}).method('getOverflow',function (bOnlyInherit){if(bOnlyInherit&&!this.aOverflow[1])return null;return this.aOverflow[0];}).method('getCursor',function (bOnlyInherit){if(bOnlyInherit&&!this.aCursor[1])return null;return this.aCursor[0];}).method('getCSSClass',function (){return this.sCSSClass;}).method('addMouseListener',function (fAction){this.getTopElement().onclick=this.eventClick;this.getTopElement().onmousedown=this.eventMouseDown;this.getTopElement().onmouseup=this.eventMouseUp;this.getTopElement().onmouseover=this.eventMouseOver;this.getTopElement().onmousemove=this.eventMouseMove;this.getTopElement().onmouseout=this.eventMouseOut;this.aMouseListener.push(fAction);return this;}).method('removeMouseListener',function (fAction){this.aMouseListener.remove(fAction);if(this.aMouseListener.length==0){this.getTopElement().onclick=null;this.getTopElement().onmousedown=null;this.getTopElement().onmouseup=null;this.getTopElement().onmouseover=null;this.getTopElement().onmousemove=null;this.getTopElement().onmouseout=null;}return this;}).method('addKeyListener',function (fAction){this.getTopElement().onkeydown=this.eventKeyDown;this.getTopElement().onkeypress=this.eventKeyPress;this.getTopElement().onkeyup=this.eventKeyUp;this.aKeyListener.push(fAction);return this;}).method('removeKeyListener',function (fAction){this.aKeyListener.remove(fAction);if(this.aKeyListener.length==0){this.getTopElement().onkeypress=null;this.getTopElement().onkeyup=null;this.getTopElement().onkeydown=null;}return this;}).method('addChangeListener',function (fAction){this.getTopElement().onchange=this.eventChange;this.aChangeListener.push(fAction);return this;}).method('removeChangeListener',function (fAction){this.aChangeListener.remove(fAction);if(this.aChangeListener.length==0)this.getTopElement().onchange=null;return this;}).method('addClickAction',function (fAction){var fNew=function (oEvent){if(oEvent.getType()!='click')return;fAction(oEvent)};this.addMouseListener(fNew);this.aClickActions.push([fNew,fAction]);this.setCursor('pointer');return this;}).method('removeClickAction',function (fAction){var aNewAction=[];for(var i=0;i<this.aClickActions.length;++i){if(this.aClickActions[i][1]!=fAction)aNewAction=this.aClickActions[i];else this.aMouseListener.remove(this.aClickActions[i][0]);}if(this.getCursor()=='pointer')this.setCursor('auto');return this;}).method('setCSSHover',function (sClass){if(!sClass||sClass==''){this.removeMouseListener(this.applyCSSHover);this.sCSSHover='';}else{this.addMouseListener(this.applyCSSHover);this.sCSSHover=sClass;}return this;}).method('setCSSClick',function (sClass){if(!sClass||sClass==''){this.removeMouseListener(this.applyCSSClick);this.sCSSClick='';}else{this.addMouseListener(this.applyCSSClick);this.sCSSClick=sClass;}return this;}).method('createElement',function (sType,aAttributes,aValues,sText,elmTarget){var elm=document.createElement(sType);if(!aAttributes)return elm;for(var i=0;i<aAttributes.length;i++){switch(aAttributes[i].toLowerCase()){case "colspan":elm.colSpan=aValues[i];break;case "rowspan":elm.rowSpan=aValues[i];break;case "class":case "classname":elm.className=aValues[i];break;default:var att=document.createAttribute(aAttributes[i]);att.nodeValue=aValues[i];elm.setAttributeNode(att);break;}}if(sText&&sText!=''){var elmText=document.createTextNode(sText);elm.appendChild(elmText);}if(elmTarget){elmTarget.appendChild(elm);}return elm;}).method('_eventClick',function (oEvent){var oActionEvent=new ActionEvent(oEvent);oActionEvent.setSource(this);oActionEvent.setType('click');oActionEvent.setCategory('mouse');oActionEvent.pClientPos=new Point(oEvent.clientX,oEvent.clientY);return this.sendEvent(this.aMouseListener,oActionEvent);}).method('_eventMouseDown',function (oEvent){var oActionEvent=new ActionEvent(oEvent);oActionEvent.setSource(this);oActionEvent.setType('mouseDown');oActionEvent.setCategory('mouse');oActionEvent.pClientPos=new Point(oEvent.clientX,oEvent.clientY);return this.sendEvent(this.aMouseListener,oActionEvent);}).method('_eventMouseUp',function (oEvent){var oActionEvent=new ActionEvent(oEvent);oActionEvent.setSource(this);oActionEvent.setType('mouseUp');oActionEvent.setCategory('mouse');oActionEvent.pClientPos=new Point(oEvent.clientX,oEvent.clientY);return this.sendEvent(this.aMouseListener,oActionEvent);}).method('_eventMouseOver',function (oEvent){var oActionEvent=new ActionEvent(oEvent);oActionEvent.setSource(this);oActionEvent.setType('mouseOver');oActionEvent.setCategory('mouse');oActionEvent.pClientPos=new Point(oEvent.clientX,oEvent.clientY);return this.sendEvent(this.aMouseListener,oActionEvent);}).method('_eventMouseMove',function (oEvent){var oActionEvent=new ActionEvent(oEvent);oActionEvent.setSource(this);oActionEvent.setType('mouseMove');oActionEvent.setCategory('mouse');oActionEvent.pClientPos=new Point(oEvent.clientX,oEvent.clientY);return this.sendEvent(this.aMouseListener,oActionEvent);}).method('_eventMouseOut',function (oEvent){var oActionEvent=new ActionEvent(oEvent);oActionEvent.setSource(this);oActionEvent.setType('mouseOut');oActionEvent.setCategory('mouse');oActionEvent.pClientPos=new Point(oEvent.clientX,oEvent.clientY);return this.sendEvent(this.aMouseListener,oActionEvent);}).method('_eventKeyDown',function (oEvent){var oActionEvent=new ActionEvent(oEvent);oActionEvent.setSource(this);oActionEvent.setType('keyDown');oActionEvent.setCategory('key');oActionEvent.nKeyCode=oEvent.which;oActionEvent.sKeyTyped=String.fromCharCode(oEvent.which);return this.sendEvent(this.aKeyListener,oActionEvent);}).method('_eventKeyPress',function (oEvent){var oActionEvent=new ActionEvent(oEvent);oActionEvent.setSource(this);oActionEvent.setType('keyPress');oActionEvent.setCategory('key');oActionEvent.nKeyCode=oEvent.which;oActionEvent.sKeyTyped=String.fromCharCode(oEvent.which);return this.sendEvent(this.aKeyListener,oActionEvent);}).method('_eventKeyUp',function (oEvent){var oActionEvent=new ActionEvent(oEvent);oActionEvent.setSource(this);oActionEvent.setType('keyUp');oActionEvent.setCategory('key');oActionEvent.nKeyCode=oEvent.which;oActionEvent.sKeyTyped=String.fromCharCode(oEvent.which);return this.sendEvent(this.aKeyListener,oActionEvent);}).method('_eventChange',function (oEvent){var oActionEvent=new ActionEvent(oEvent);oActionEvent.setSource(this);oActionEvent.setType('change');return this.sendEvent(this.aChangeListener,oActionEvent);}).method('sendEvent',function (aListener,oEvent){for(var i=0;i<aListener.length;++i){if(aListener[i](oEvent)===false)return false;}return true;}).method('applyCursor',function (){if(!this.getTopElement().style)return;var sCursor=this.getCursor();if(!(sCursor.toLowerCase().indexOf('url')+1))this.getTopElement().style.cursor=sCursor.toLowerCase();else this.getTopElement().style.cursor=sCursor;}).method('applyCSSClass',function (){var sCSSClass=this.getCSSClass();try{this.getTopElement().className=sCSSClass;}catch(e){}}).method('applyOverflow',function (){if(!this.getTopElement().style)return;var sOverflow=this.getOverflow();this.getBottomElement().style.overflow=sOverflow;}).method('_applyCSSHover',function (oEvent){if(oEvent.getSource()==this&&oEvent.getType()=='mouseOver'){this.getTopElement().className=this.sCSSHover;}if(oEvent.getSource()==this&&oEvent.getType()=='mouseOut'){this.applyCSSClass();}}).method('_applyCSSClick',function (oEvent){if(oEvent.getSource()==this&&oEvent.getType()=='mouseDown'){this.getTopElement().className=this.sCSSClick;}if(oEvent.getSource()==this&&oEvent.getType()=='mouseUp'){this.applyCSSClass();}});function GLabel(){this.temp=GComponent;this.temp();this.temp=null;this.sText;this.GLabel.apply(this,arguments);}GLabel.inherits(GComponent);GLabel.method('GLabel',function (sText){this.sText=sText;this.setBottomElement(this.createElement('span'));this.setTopElement(this.getBottomElement());}).method('setText',function (sText){this.sText=sText;return this;}).method('getText',function (){return this.sText;}).method('draw',function (bIsNotRoot){this.uber('draw',bIsNotRoot);this.getBottomElement().appendChild(document.createTextNode(this.sText));}).method('copy',function (){return new GLabel(this.getText());});function GRichLabel(){this.temp=GComponent;this.temp();this.temp=null;this.sText;this.bChange;this.oRichTree;this.oTagTree;this.GRichLabel.apply(this,arguments);}GRichLabel.inherits(GComponent);GRichLabel.method('GRichLabel',function (sText){this.setText(sText);this.setBottomElement(this.createElement('span'));this.setTopElement(this.getBottomElement());}).method('setText',function (sText){if(this.sText!=sText){this.sText=sText;this.bChange=true;}return this;}).method('getText',function (){return this.sText;}).method('getTree',function (){if(this.bChange){this.oTagTree=this.buildTagTree();this.oRichTree=this.buildRichTree(this.oTagTree);}return this.oRichTree;}).method('appendBreakText',function (oElm,sText){var nInd=0,sText=sText.replace(/\r\n/g,'\n').replace(/\r/g,'\n'),nNext=sText.indexOf('\n',nInd);while(nNext>-1){oElm.appendChild(document.createTextNode(sText.substring(nInd,nNext)));oElm.appendChild(document.createElement('br'));nInd=nNext+1;nNext=sText.indexOf('\n',nInd);}oElm.appendChild(document.createTextNode(sText.substring(nInd,sText.length)));return oElm;}).method('buildRichTree',function (oTag){var oElm=this.createElement(oTag.oType.sElementType);if(oTag.oType.sType!='mono'){var nInd=oTag.getStart()[1]+1;for(var i=0;i<oTag.getChildren().length;++i){this.appendBreakText(oElm,this.sText.substring(nInd,oTag.getChildren()[i].getStart()[0]));oElm.appendChild(this.buildRichTree(oTag.getChildren()[i]));nInd=oTag.getChildren()[i].getEnd()[1]+1;}this.appendBreakText(oElm,this.sText.substring(nInd,oTag.getEnd()[0]));}oElm.className=oTag.oType.sClass;return oTag.oType.modElement(oElm,oTag.sInput);}).method('buildTagTree',function (){var aStack=[];var nInd=0;var oRoot=new RichTag({'sId':'','oType':{'sElementType':'span','sClass':oWebpage.getSetting('tagClass'),'modElement':function (oElement){return oElement;}},'sInput':'','nOpen':-1,'nClose':-1}),aTemp=[],oTag,oStackTag,aTempChildren=[],bEnd;oRoot.finalize({'nOpen':this.sText.length,'nClose':this.sText.length});var oPar=oRoot;while(true){oTag=this.findNextTag(nInd);if(!oTag)break;if(oTag.sType=='end'){bEnd=false;while(aStack.length>0){oLastTag=aStack.pop();if(oTag.sId==oLastTag.sId){oLastTag.finalize(oTag);oPar=oLastTag.getParent();for(var i=0;i<aTempChildren.length;++i)oTag.addChild(aTempChildren[i]);bEnd=true;break;}aTemp.push(oLastTag);oLastTag.getParent().removeChild(oLastTag);for(var i=0;i<oLastTag.aChildren.length;++i)aTempChildren.push(oLastTag.aChildren[i]);}if(aStack.length==0&&!bEnd){while(aTemp.length>0){oLastTag=aTemp.pop();aStack.push(oLastTag);oLastTag.getParent().addChild(oLastTag);oPar=oLastTag;}}aTempChildren=[];aTemp=[];}else if(oTag.sType=='start'){oPar=new RichTag(oTag,oPar);aStack.push(oPar);}else if(oTag.sType=='mono'){oLastTag=new RichTag(oTag,oPar);oLastTag.finalize(oTag);}nInd=oTag.nClose;}if(aStack.length>0){for(var i=0;i<aStack.length;++i){aStack[i].getParent().removeChild(aStack[i]);for(var j=0;j<aStack[i].aChildren.length;++j)aStack[i].getParent().addChild(aStack[i].aChildren[j]);}}return oRoot;}).method('getTagProperties',function (sInput){var aTagList=oWebpage.getSetting('tagList');var bEnd=sInput.trim().charAt(0)=='/';var sInput=bEnd?sInput.trim().substring(1,sInput.length):sInput.trim();var rTagName=/^([a-z0-9]+)/i;if(!rTagName.test(sInput))return null;var sTagName=rTagName.exec(sInput)[1];if(!isObject(aTagList[sTagName])||!aTagList[sTagName].validInput(sInput,bEnd)||(bEnd&&aTagList[sTagName].sType=='mono'))return null;return {'sId':sTagName,'oType':aTagList[sTagName],'sInput':sInput,'sType':aTagList[sTagName].sType=='mono'?'mono':(bEnd?'end':'start')};}).method('findNextTag',function (nStart){var nOpen,nClose,oTag;while(true){nOpen=this.sText.indexOf('[',nStart);if(nOpen==-1)return null;nClose=this.sText.indexOf(']',nOpen);if(nClose==-1)return null;oTag=this.getTagProperties(this.sText.substring(nOpen+1,nClose));if(oTag){oTag.nOpen=nOpen;oTag.nClose=nClose;return oTag;}nStart=nOpen+1;}}).method('draw',function (bIsNotRoot){this.uber('draw',bIsNotRoot);this.getBottomElement().appendChild(this.getTree());}).method('copy',function (){});function RichTag(){this.sId;this.oType;this.sInput;this.aStart=[];this.aEnd=[];this.oPar;this.aChildren=[];this.RichTag.apply(this,arguments);}RichTag.method('RichTag',function (oSource,oPar){this.oType=oSource.oType;this.setStart(oSource.nOpen,oSource.nClose);this.sId=oSource.sId;this.sInput=oSource.sInput;if(oPar)oPar.addChild(this);}).method('setStart',function (nOpen,nClose){this.aStart[0]=nOpen;this.aStart[1]=nClose;return this;}).method('getStart',function (){return this.aStart;}).method('setEnd',function (nOpen,nClose){this.aEnd[0]=nOpen;this.aEnd[1]=nClose;}).method('getEnd',function (){return this.aEnd;}).method('finalize',function (oSource){this.setEnd(oSource.nOpen,oSource.nClose);return this;}).method('addChild',function (oChild){this.aChildren.push(oChild);oChild.setParent(this);return this;}).method('removeChild',function (oChild){this.aChildren.remove(oChild);return this;}).method('getChildren',function (){return this.aChildren;}).method('setParent',function (oPar){this.oPar=oPar;return this;}).method('getParent',function (){return this.oPar;});function GLink(){this.temp=GComponent;this.temp();this.temp=null;this.sText;this.sReference;this.sTarget;this.GLink.apply(this,arguments);}GLink.inherits(GComponent);GLink.method('GLink',function (sText,sReference,sTarget){this.setText(sText);this.setReference(sReference);this.setTarget(sTarget);this.setBottomElement(this.createElement('a',['href','target'],['','']));this.setTopElement(this.getBottomElement());this.setCSSClass(oWebpage.getSetting('linkClass')).setCursor('pointer');}).method('setText',function (sText){this.sText=sText;return this;}).method('setReference',function (sReference){if(!sReference||sReference.trim()=='')this.sReference='javascript:void(0)';else this.sReference=sReference;return this;}).method('setTarget',function (sTarget){if(!sTarget||sTarget.trim()=='')this.sTarget='';else if(sTarget=='new')this.sTarget='_blank';else this.sTarget=sTarget;return this;}).method('getTarget',function (){return this.sTarget;}).method('getReference',function (){return this.sReference;}).method('getText',function (){return this.sText;}).method('draw',function (bIsNotRoot){this.uber('draw',bIsNotRoot);this.getBottomElement().appendChild(document.createTextNode(this.sText));this.getBottomElement().href=this.sReference;this.getBottomElement().target=this.sTarget;}).method('copy',function (){return new GLink(this.getText(),this.getReference(),this.getTarget());});function GIcon(){this.temp=GComponent;this.temp();this.temp=null;this.sSource='';this.GIcon.apply(this,arguments);}GIcon.inherits(GComponent);GIcon.method('GIcon',function (sSource,bIgnoreSettingsPath){this.sSource=(bIgnoreSettingsPath?'':oWebpage.getSetting('imgPath'))+sSource;this.setBottomElement(this.createElement('img',['src'],[this.sSource]));this.setTopElement(this.getBottomElement());}).method('setSource',function (sSource,bIgnoreSettingsPath){this.sSource=(bIgnoreSettingsPath?'':oWebpage.getSetting('imgpath'))+sSource;this.getBottomElement().src=this.sSource;return this;});function GButton(){this.temp=GComponent;this.temp();this.temp=null;this.bKeepState=false;this.bActive=false;this.sText='';this.gIcon=null;var self=this;this.actionPerformed=function (){return self._actionPerformed.apply(self,arguments);};this.GButton.apply(this,arguments);}GButton.inherits(GComponent);GButton.method('GButton',function (sText){this.setBottomElement(this.createElement('span'));this.setTopElement(this.getBottomElement());this.setCSSClass('inactiveButton');this.addMouseListener(this.actionPerformed);this.setDimension(oWebpage.getSetting('buttonDimension'));this.setCursor(oWebpage.getSetting('buttonPointer'),true);if(sText)this.setText(sText);}).method('setActive',function (bActive){this.setCSSClass((bActive?'':'in')+'activeButton');this.bActive=bActive;return this;}).method('setKeepState',function (bKeepState){this.bKeepState=bKeepState;if(!bKeepState&&this.bActive)this.setActive(false);return this;}).method('setText',function (sText){this.sText=sText;return this;}).method('setEnabled',function (bEnabled){return this;}).method('setIcon',function (mIcon){if(mIcon instanceof GIcon)this.gIcon=mIcon;else this.gIcon=new GIcon(arguments[0],arguments[1]);this.append(this.gIcon);return this;}).method('_actionPerformed',function (oActionEvent){if(this.bKeepState&&oActionEvent.getType()=='click'&&oActionEvent.getSource()==this)this.setActive(!this.bActive);if(!this.bKeepState&&oActionEvent.getType()=='mouseDown'&&oActionEvent.getSource()==this){this.setActive(true);}if(!this.bKeepState&&oActionEvent.getType()=='mouseUp'&&oActionEvent.getSource()==this){this.setActive(false);this.eventClick(oActionEvent);}setTimeout(this.alDraw,0);}).method('draw',function (bIsNotRoot){this.uber('draw',bIsNotRoot);this.getBottomElement().appendChild(document.createTextNode(this.sText));});function GTextField(){this.temp=GComponent;this.temp();this.temp=null;this.sContent='';this.regFormat=null;this.sValue='';this.fEnterAction=null;var self=this;this.actionPerformed=function (){return self._actionPerformed.apply(self,arguments);};this.GTextField.apply(this,arguments);}GTextField.inherits(GComponent);GTextField.method('GTextField',function (){this.setBottomElement(this.createElement('input',['type'],['text']));this.setTopElement(this.getBottomElement());this.addKeyListener(this.actionPerformed);this.setDimension(oWebpage.getSetting('textfieldDimension'));this.setCSSClass(oWebpage.getSetting('textfieldCSSClass'));this.setCursor('text');}).method('setValue',function (sValue){this.sValue=sValue;return this;}).method('getValue',function (){return this.sValue;}).method('checkFormat',function (){if(!this.getBottomElement().value.match(this.regFormat)){this.getBottomElement().value=this.sValue;}}).method('setFormat',function (regFormat){this.regFormat=regFormat;return this;}).method('setEnabled',function (bEnabled){}).method('_actionPerformed',function (oActionEvent){if(oActionEvent.getType()=='keyUp'&&oActionEvent.getSource()==this){if(this.regFormat){this.checkFormat();}this.sValue=this.getBottomElement().value;}}).method('setEnterAction',function (fAction){this.removeKeyListener(this.fEnterAction);var self=this;this.fEnterAction=function (oEvent){if(oEvent.getSource()==self&&oEvent.getType()=='keyPress'&&oEvent.nKeyCode==13){fAction();}};this.addKeyListener(this.fEnterAction);return this;}).method('draw',function (bIsNotRoot){this.uber('draw',bIsNotRoot);this.getBottomElement().value=this.sValue;});function GWebpage(){if(oWebpage)return oWebpage;else oWebpage=this;this.temp=GComponent;this.temp();this.temp=null;this.gRoot;this.oSettings;this.oClient;this.gTempTopLayer;this.aScrollListener=[];this.aResizeListener=[];this.aStyleSheets=[];this.sTitle='';this.nTopLayer=0;var self=this;this.eventScroll=function (){return self._eventScroll.apply(self,arguments);};this.eventResize=function (){return self._eventResize.apply(self,arguments);};this.adjustSize=function (){return self._adjustSize.apply(self,arguments);};this.adjustSizeDelay=function (){return self._adjustSizeDelay.apply(self,arguments);};this.draw=function (){return self._draw.apply(self,arguments);};this.GWebpage.apply(this,arguments);}GWebpage.inherits(GComponent);GWebpage.method('GWebpage',function (gPageLayout,sTitle){this.setBottomElement(document.getElementsByTagName('body')[0]);this.setTopElement(document);this.setRoot(gPageLayout);this.setTitle(sTitle);this.addResizeListener(this.adjustSize);this.oSettings=new Object();this.oClient=UA;this.nTopLayer=5000;}).method('start',function (){this.setBottomElement(document.getElementsByTagName('body')[0]);this.setTopElement(document);return this;}).method('getClientDimension',function (){var oDimension=new Dimension(self.innerWidth-1,self.innerHeight-1);oDimension.setLeft(0).setTop(0);return oDimension;}).method('getClient',function (){return this.oClient;}).method('setRoot',function (gRoot,bTransfer){if(!gRoot)return this;var gOld=this.gRoot;this.gRoot=gRoot;this.gRoot.setDimension(this.getClientDimension());this.append(this.gRoot);if(gOld){if(bTransfer)this.gRoot.aChildren=gOld.aChildren;this.remove(gRoot);}return this;}).method('_adjustSize',function (){this.getRoot().setDimension(this.getClientDimension());this.draw();}).method('calculateBottom',function (){this.getRoot().setDimension(this.getClientDimension());this.uber('calculateBottom');}).method('setTitle',function (sTitle){this.sTitle=sTitle;return this;}).method('addStyleSheet',function (sStyleSheet){this.aStyleSheets.push(this.createElement('link',['rel','type','href'],['stylesheet','text/css',sStyleSheet],'',document.getElementsByTagName('head')[0]));return this;}).method('addEnkiPackage',function (sName,oSettings){this.oSettings[sName]=oSettings;if(this.getSetting('styleSheets',sName)){var aStyles=this.getSetting('styleSheets',sName);for(var i=0;i<aStyles.length;++i){this.addStyleSheet(aStyles[i]);}}return this;}).method('getSetting',function (sName,sPackage){if(!sPackage)sPackage='main';return this.oSettings[sPackage][sName];}).method('getPackageSetting',function (sPackage){return this.oSettings[sPackage];}).method('setTempTop',function (gTempTop){if(this.gTempTopLayer)return;this.gTempTopLayer=gTempTop;gTempTop.getDimension().setLayer(this.nTopLayer++);this.getRoot().append(gTempTop).getBottomElement().appendChild(gTempTop.getTopElement());gTempTop.draw();return this;}).method('removeTempTop',function (gTempTop){if(this.gTempTopLayer==gTempTop){this.getRoot().remove(gTempTop).getBottomElement().removeChild(gTempTop.getTopElement());this.gTempTopLayer=null;}return this;}).method('getTitle',function (){return this.sTitle;}).method('getRoot',function (){return this.gRoot;}).method('_draw',function (){if(this.gTempTopLayer)this.removeTempTop(this.gTempTopLayer);this.uber('draw');if(this.sTitle)setTimeout(function (){document.title=oWebpage.getTitle();},0);}).method('addScrollListener',function (fPointer){window.onscroll=this.eventScroll;this.aScrollListener.push(fPointer);return this;}).method('addResizeListener',function (fPointer){window.onresize=this.eventResize;this.aResizeListener.push(fPointer);return this;}).method('_eventScroll',function (oEvent){var oActionEvent=new ActionEvent(oEvent);oActionEvent.setSource(this);oActionEvent.setType('scroll');for(var i=0;i<this.aScrollListener.length;++i){this.aScrollListener[i](oActionEvent);}}).method('_eventResize',function (oEvent){var oActionEvent=new ActionEvent(oEvent);oActionEvent.setSource(this);oActionEvent.setType('resize');for(var i=0;i<this.aResizeListener.length;++i){this.aResizeListener[i](oActionEvent);}});function GSelect(){this.temp=GComponent;this.temp();this.temp=null;this.aEntries=[];this.aSelectListener=[];this.bMulti=false;this.bEnabled=true;this.gLastSelect=null;var self=this;this.eventSelect=function (){return self._eventSelect.apply(self,arguments);};this.actionPerformed=function (){return self._actionPerformed.apply(self,arguments);};this.GSelect.apply(this,arguments);}GSelect.inherits(GComponent);GSelect.method('GSelect',function (){}).method('setEnabled',function (bEnabled){this.bEnabled=bEnabled;return this;}).method('setMulti',function (bMulti){this.bMulti=bMulti;this.setSelected(this.getSelected());return this;}).method('setSelected',function (aSelected){if(!this.bMulti)aSelected=[aSelected[0]];for(var i=0;i<this.aEntries.length;++i){if(aSelected.contains(this.aEntries[i])){this.aEntries[i].setSelected(true);this.setLastSelected(this.aEntries[i]);}else this.aEntries[i].setSelected(false);}return this;}).method('setLastSelected',function (gEntry){this.gLastSelected=gEntry;return this;}).method('addEntry',function (gEntry){this.aEntries.push(gEntry);gEntry.addSelectListener(this.actionPerformed);return this;}).method('addSelectListener',function (fAction){this.aSelectListener.push(fAction);return this;}).method('getValue',function (){var gSelected=this.getSelected()[0];if(!gSelected)return null;return gSelected.getValue();}).method('isEnabled',function (){return this.bEnabled;}).method('isMulti',function (){return this.bMulti;}).method('getSelected',function (){var aRet=[];if(this.gLastSelected)aRet.push(this.gLastSelected);for(var i=0;i<this.aEntries.length;++i){if(this.aEntries[i].isSelected()&&this.aEntries[i]!=this.gLastSelected)aRet.push(aEntries[i]);}return aRet;}).method('removeEntry',function (gEntry){this.aEntries.remove(gEntry);if(this.gLastSelected==gEntry)this.setLastSelected(null);return this;}).method('removeSelectListener',function (fAction){this.aSelectListener.remove(fAction);return this;}).method('_actionPerformed',function (oEvent){if(oEvent.getType()=='select'&&this.aEntries.contains(oEvent.getSource())){if(oEvent.bSelected){var aPrev=[];if(this.bMulti)aPrev=this.getSelected();aPrev.push(oEvent.getSource());this.setSelected(aPrev);}else if(this.gLastSelected==oEvent.getSource()){this.setLastSelected(null);}this.eventSelect();}}).method('_eventSelect',function (oEvent){var oActionEvent=new ActionEvent();oActionEvent.gSelected=oEvent.getSource();oActionEvent.bSelected=oEvent.bSelected;oActionEvent.setSource(this);oActionEvent.setType('select');this.sendEvent(this.aSelectListener,oActionEvent);});function GSelectEntry(){this.temp=GComponent;this.temp();this.temp=null;this.aSelectListener=[];this.bSelected=false;this.bEnabled=true;this.mValue=null;this.gText=null;var self=this;this.eventSelect=function (){return self._eventSelect.apply(self,arguments);};this.GSelectEntry.apply(this,arguments);}GSelectEntry.inherits(GComponent);GSelectEntry.method('GSelectEntry',function (mValue,mText,bNotEnabled){this.setTopElement(this.createElement('span'));this.setBottomElement(this.getTopElement());this.setText(mText);this.setValue(mValue);this.setEnabled(!bNotEnabled);}).method('setEnabled',function (bEnabled){this.bEnabled=bEnabled;return this;}).method('setSelected',function (bSelected,bFireEvent){this.bSelected=bSelected;if(bFireEvent)this.eventSelect();return this;}).method('setValue',function (mValue){this.mValue=mValue;if(!this.gText&&(isString(mValue)||isNumber(mValue)))this.setText(new GLabel(mValue));return this;}).method('setText',function (mText){if(isString(mText))this.gText=new GLabel(mText);else if(mText)this.gText=mText;else this.gText=null;if(this.gText)this.removeAll().append(this.gText);return this;}).method('addSelectListener',function (fAction){this.aSelectListener.push(fAction);return this;}).method('isEnabled',function (){return this.bEnabled;}).method('isSelected',function (){return this.bSelected;}).method('getValue',function (){return this.mValue;}).method('getText',function (){return this.gText;}).method('removeSelectListener',function (fAction){this.aSelectListener.remove(fAction);return this;}).method('_eventSelect',function (){var oActionEvent=new ActionEvent();oActionEvent.bSelected=this.isSelected();oActionEvent.gSelected=this;oActionEvent.setSource(this);oActionEvent.setType('select');this.sendEvent(this.aSelectListener,oActionEvent);});function GSelectDrop(){this.temp=GSelect;this.temp();this.temp=null;this.bInSelectState=false;this.bAutoPreselect=true;this.gDropZone;this.gDropArrow;this.gLabel;this.gDropdown;this.gDropDownLayer;this.gDropDownBox;this.gSelect;var self=this;this.actionPerformed=function (){return self._actionPerformed.apply(self,arguments);};this.GSelectDrop.apply(this,arguments);}GSelectDrop.inherits(GSelect);GSelectDrop.method('GSelectDrop',function (){var s=oWebpage;this.setTopElement(this.createElement('span'));this.setBottomElement(this.getTopElement());this.setCSSClass(s.getSetting('dropselectCSSClass')).setCursor('default',true).setCSSHover(s.getSetting('dropselectDropCSSHover')).setCSSClick(s.getSetting('dropselectDropCSSClick')).setOverflow('hidden',true);this.gDropZone=new GCenterContainer();this.gDropArrow=new GIcon(s.getSetting('dropselectDropImg'));this.gDropZone.setDimension(s.getSetting('dropselectDropDimension')).setCSSClass(s.getSetting('dropselectDropCSS')).append(this.gDropArrow);this.gLabel=new GLabel(s.getSetting('dropselectEmptyChar'));this.gSelect=new GContainer();this.gSelect.append(this.gLabel,this.gDropZone).setCSSClass(s.getSetting('dropselectSelectCSSClass')).setDimension(s.getSetting('dropselectDimension')).addMouseListener(this.actionPerformed).getDimension().setLeft(0).setTop(0);this.append(this.gSelect);this.gDropDownLayer=new GContainer();this.gDropDownBox=new GContainer();this.gDropDownBox.setCSSClass(s.getSetting('dropselectCSSClass')).setOverflow('hidden',true).setCursor('default',true);this.gDropDown=new GRowContainer();this.gDropDown.setAlign('Y').setCSSClass(s.getSetting('dropselectDropDownClass')).setDimension(s.getSetting('dropselectDropDownDimension')).setStretch(true);this.gDropDownLayer.append(this.gDropDownBox.append(this.gDropDown));}).method('setMulti',function (){}).method('addEntry',function (gEntry){if(this.aEntries.length==0&&this.bAutoPreselect)this.setLabel(gEntry.getText());return this.uber('addEntry',gEntry);}).method('setLastSelected',function (gEntry){if(gEntry)this.setLabel(gEntry.getText());return this.uber('setLastSelected',gEntry);}).method('setEnabled',function (bEnabled){if(!bEnabled){this.setCSSClass(oWebpage.getSetting('dropselectDisabledCSSClass')).setCSSHover().setCSSClick().gSelect.removeMouseListener(this.actionPerformed);}else{this.setCSSClass(oWebpage.getSetting('dropselectCSSClass')).setCSSHover(oWebpage.getSetting('dropselectDropCSSHover')).setCSSClick(oWebpage.getSetting('dropselectDropCSSClick')).gSelect.addMouseListener(this.actionPerformed);}return this.uber('setEnabled',bEnabled);}).method('setAutoPreselect',function (bPreselect){this.bAutoPreselect=bPreselect;if(!bPreselect&&!this.gLastSelected)this.setLabel(new GLabel(oWebpage.getSetting('dropselectEmptyChar')));return this;}).method('setInSelectState',function (bState){this.bInSelectState=bState;return this;}).method('setLabel',function (gLabel){this.gLabel=gLabel.copy();this.gSelect.removeAll().append(this.gLabel,this.gDropZone);return this;}).method('isInSelectState',function (){return this.bInSelectState;}).method('getValue',function (){if(this.gLastSelected)return this.uber('getValue');if(this.bAutoPreselect&&this.aEntries[0])return this.aEntries[0].getValue();return null;}).method('maximize',function (){this.gDropDown.removeAll();this.gDropDownLayer.addMouseListener(this.actionPerformed).getDimension().setLeft(0).setTop(0).setWidth('100%').setHeight('100%');var pPos=this.gSelect.getDimension().getAbsolutePosition();this.gDropDown.getDimension().setWidth(this.gSelect.getDimension().getWidth());this.gDropDownBox.getDimension().setTop(pPos.x()+this.gSelect.getDimension().getHeight()).setLeft(pPos.y());for(var i=0;i<this.aEntries.length;++i){this.gDropDown.append(this.aEntries[i]);this.aEntries[i].addMouseListener(this.actionPerformed);if(this.gLastSelected==this.aEntries[i])this.aEntries[i].setCSSClass(oWebpage.getSetting('dropselectDropDownSelectedClass'));else this.aEntries[i].setCSSClass('');}oWebpage.setTempTop(this.gDropDownLayer);}).method('minimize',function (){this.gDropDown.removeAll();for(var i=0;i<this.aEntries.length;++i){this.aEntries[i].removeMouseListener(this.actionPerformed);}oWebpage.removeTempTop(this.gDropDownLayer);}).method('_actionPerformed',function (oEvent){if(!this.isInSelectState()&&oEvent.getSource()==this.gSelect&&oEvent.getType()=='click'){this.maximize();this.setInSelectState(true);}else if(this.isInSelectState()&&oEvent.getType()=='click'&&this.aEntries.contains(oEvent.getSource())){oEvent.getSource().setSelected(true,true);this.minimize();this.setInSelectState(false);this.gSelect.draw();}else if(this.isInSelectState()&&oEvent.getType()=='click'&&(oEvent.getSource()==this.gSelect||oEvent.getSource()==this.gDropDownLayer)){this.minimize();this.setInSelectState(false);}if(oEvent.getType()=='select'&&this.aEntries.contains(oEvent.getSource())){if(oEvent.bSelected){var aPrev=[];if(this.bMulti)aPrev=this.getSelected();aPrev.push(oEvent.getSource());this.setSelected(aPrev);}else if(this.gLastSelected==oEvent.getSource){this.setLastSelected(null);}this.eventSelect(oEvent);}}).method('draw',function (bIsNotRoot){this.uber('draw',bIsNotRoot);if(!this.getDimension().getWidth()||!this.getDimension().getHeight()){nWidth=0;nHeight=0;for(var i=0;i<this.aEntries.length;++i){this.aEntries[i].draw(true);this.getBottomElement().appendChild(this.aEntries[i].getTopElement());if(this.aEntries[i].getTopElement().offsetWidth>nWidth)nWidth=this.aEntries[i].getTopElement().offsetWidth;if(this.aEntries[i].getTopElement().offsetHeight>nHeight)nHeight=this.aEntries[i].getTopElement().offsetHeight;this.getBottomElement().removeChild(this.aEntries[i].getTopElement());}if(!this.getDimension().getWidth())this.gSelect.getDimension().setWidth(nWidth+this.gDropZone.getDimension().getWidth(),false,true);else this.gSelect.getDimension().setWidth(this.getDimension().getWidth());if(!this.getDimension().getHeight())this.gSelect.getDimension().setHeight(nHeight,false,true);else this.gSelect.getDimension().setHeight(this.getDimension().getHeight());}else this.gSelect.getDimension().setWidth(this.getDimension().getWidth()).setHeight(this.getDimension().getHeight());}).method('calculateBottom',function (){if(this.getDimension(true,true))this.setDimension(this.getDimension(true,true).copy(),true);else this.setDimension(new Dimension(),true);if(!this.getDimension().getWidth())this.getDimension().setWidth(this.gSelect.getDimension().getWidth(),false,true);if(!this.getDimension().getHeight())this.getDimension().setHeight(this.gSelect.getDimension().getHeight(),false,true);this.getDimension().applyCSS();});function GContainer(){this.temp=GComponent;this.temp();this.temp=null;this.bStretch=false;this.bXAlign=true;this.bRespectBoundaries=true;this.GContainer.apply(this,arguments);}GContainer.inherits(GComponent);GContainer.method('GContainer',function (){this.setBottomElement(this.createElement('span'));this.setTopElement(this.getBottomElement());this.setOverflow('auto',false,true);}).method('setAlign',function (sAlign){if(sAlign&&sAlign=='Y'){this.bXAlign=false;}else this.bXAlign=true;return this;}).method('getAlign',function (){if(this.bXAlign)return 'X';else return 'Y';}).method('setStretch',function (bStretch){this.bStretch=bStretch;return this;}).method('getStretch',function (){return this.bStretch;}).method('calculateBottom',function (){if(this.getDimension(true,true))this.setDimension(this.getDimension(true,true).copy(),true);else this.setDimension(new Dimension(),true);var nHeight=0,nWidth=0,nFreeWidth=0,nFreeHeight=0;if(!this.getDimension().getWidth()){for(var i=0;i<this.aChildren.length;++i){if(isNumber(this.aChildren[i].getDimension().getLeft())&&(this.aChildren[i].getDimension().getLeft()+this.aChildren[i].getDimension().getWidth())>nFreeWidth){nFreeWidth=this.aChildren[i].getDimension().getLeft()+this.aChildren[i].getDimension().getWidth();}else if(isNumber(this.aChildren[i].getDimension().getRight())&&(this.aChildren[i].getDimension().getRight()+this.aChildren[i].getDimension().getWidth())>nFreeWidth){nFreeWidth=this.aChildren[i].getDimension().getRight()+this.aChildren[i].getDimension().getWidth();}else{if(!this.bXAlign&&this.aChildren[i].getDimension().getWidth()>nWidth){nWidth=this.aChildren[i].getDimension().getWidth();}if(this.bXAlign){nWidth+=this.aChildren[i].getDimension().getWidth();}}}if(nFreeWidth>nWidth)nWidth=nFreeWidth;if(isNumber(this.getDimension().getWidth('max',true))&&this.getDimension().getWidth('max',true)<nWidth)nWidth=this.getDimension().getWidth('max',true);if(isNumber(this.getDimension().getWidth('min',true))&&this.getDimension().getWidth('min',true)>nWidth)nWidth=this.getDimension().getWidth('min',true);this.getDimension().setWidth(nWidth,false,true);}if(!this.getDimension().getHeight()){for(var i=0;i<this.aChildren.length;++i){if(isNumber(this.aChildren[i].getDimension().getTop())&&(this.aChildren[i].getDimension().getTop()+this.aChildren[i].getDimension().getHeight())>nFreeHeight){nFreeHeight=this.aChildren[i].getDimension().getTop()+this.aChildren[i].getDimension().getHeight();}else if(isNumber(this.aChildren[i].getDimension().getBottom())&&(this.aChildren[i].getDimension().getBottom()+this.aChildren[i].getDimension().getHeight())>nFreeHeight){nFreeHeight=this.aChildren[i].getDimension().getBottom()+this.aChildren[i].getDimension().getHeight();}else{if(this.bXAlign&&this.aChildren[i].getDimension().getHeight()>nHeight){nHeight=this.aChildren[i].getDimension().getHeight();}if(!this.bXAlign){nHeight+=this.aChildren[i].getDimension().getHeight();}}}if(nFreeHeight>nHeight)nHeight=nFreeHeight;if(isNumber(this.getDimension().getHeight('max',true))&&this.getDimension().getHeight('max',true)<nHeight)nHeight=this.getDimension().getHeight('max',true);if(isNumber(this.getDimension().getHeight('min',true))&&this.getDimension().getHeight('min',true)>nHeight)nHeight=this.getDimension().getHeight('min',true);this.getDimension().setHeight(nHeight,false,true);}this.getDimension().applyCSS();});function GTable(){this.temp=GContainer;this.temp();this.temp=null;this.aContent=[];this.nRows=0;this.nCols=0;this.nCellPadding=0;this.aFreeChildren=[];this.GTable.apply(this,arguments);}GTable.inherits(GContainer);GTable.method('GTable',function (){}).method('insertRow',function (aContent,nPosition){if(aContent.length>this.nCols)this.nCols=aContent.length;if(!isNumber(nPosition))nPosition=this.nRows;++this.nRows;for(var i=this.nRows-1;i>nPosition;--i){this.aContent[i]=this.aContent[i-1];}this.aContent[nPosition]=aContent;for(var i=0;i<aContent.length;++i){if(aContent[i])this.uber('append',aContent[i]);}return this;}).method('removeRow',function (nPosition){--this.nRows;for(var i=0;i<this.aContent[nPosition].length;++i){if(this.aContent[nPosition][i])this.uber('remove',this.aContent[nPosition][i]);}for(var i=nPosition;i<this.nRows;++i){this.aContent[i]=this.aContent[i+1];}return this;}).method('append',function (){for(var i=0;i<arguments.length;++i){this.aFreeChildren.push(arguments[i]);this.uber('append',arguments[i]);}return this;}).method('setCellPadding',function (nPadding){this.nCellPadding=nPadding;return this;}).method('getRowCount',function (){return this.nRows;}).method('calculateBottom',function (){if(this.getDimension(true,true))this.setDimension(this.getDimension(true,true).copy(),true);else this.setDimension(new Dimension(),true);var nHeight=0,nWidth=0,nFreeWidth=0,nFreeHeight=0;if(!this.getDimension().getWidth()){for(var i=0;i<this.aFreeChildren.length;++i){if(isNumber(this.aFreeChildren[i].getDimension().getLeft())&&(this.aFreeChildren[i].getDimension().getLeft()+this.aFreeChildren[i].getDimension().getWidth())>nFreeWidth){nFreeWidth=this.aFreeChildren[i].getDimension().getLeft()+this.aFreeChildren[i].getDimension().getWidth();}else if(isNumber(this.aFreeChildren[i].getDimension().getRight())&&(this.aFreeChildren[i].getDimension().getRight()+this.aFreeChildren[i].getDimension().getWidth())>nFreeWidth){nFreeWidth=this.aFreeChildren[i].getDimension().getRight()+this.aFreeChildren[i].getDimension().getWidth();}}var aColWidth=[];for(var i=0;i<this.nRows;++i){for(var j=0;j<this.nCols;++j){if(this.aContent[i][j]&&(!aColWidth[j]||this.aContent[i][j].getDimension().getWidth()>aColWidth[j]))aColWidth[j]=this.aContent[i][j].getDimension().getWidth();}}for(var i=0;i<aColWidth.length;++i)nWidth+=aColWidth[i]+this.nCellPadding;nWidth-=this.nCellPadding;if(nFreeWidth>nWidth)nWidth=nFreeWidth;if(isNumber(this.getDimension().getWidth('max',true))&&this.getDimension().getWidth('max',true)<nWidth)nWidth=this.getDimension().getWidth('max',true);if(isNumber(this.getDimension().getWidth('min',true))&&this.getDimension().getWidth('min',true)>nWidth)nWidth=this.getDimension().getWidth('min',true);this.getDimension().setWidth(nWidth,false,true);}if(!this.getDimension().getHeight()){for(var i=0;i<this.aFreeChildren.length;++i){if(isNumber(this.aFreeChildren[i].getDimension().getTop())&&(this.aFreeChildren[i].getDimension().getTop()+this.aFreeChildren[i].getDimension().getHeight())>nFreeHeight){nFreeHeight=this.aFreeChildren[i].getDimension().getTop()+this.aFreeChildren[i].getDimension().getHeight();}else if(isNumber(this.aFreeChildren[i].getDimension().getBottom())&&(this.aFreeChildren[i].getDimension().getBottom()+this.aFreeChildren[i].getDimension().getHeight())>nFreeHeight){nFreeHeight=this.aFreeChildren[i].getDimension().getBottom()+this.aFreeChildren[i].getDimension().getHeight();}}var aRowHeight=[];for(var i=0;i<this.nRows;++i){for(var j=0;j<this.nCols;++j){if(this.aContent[i][j]&&(!aRowHeight[i]||this.aContent[i][j].getDimension().getHeight()>aRowHeight[i]))aRowHeight[i]=this.aContent[i][j].getDimension().getHeight();}}for(var i=0;i<aRowHeight.length;++i)nHeight+=aRowHeight[i]+this.nCellPadding;nHeight-=this.nCellPadding;if(nFreeHeight>nHeight)nHeight=nFreeHeight;if(isNumber(this.getDimension().getHeight('max',true))&&this.getDimension().getHeight('max',true)<nHeight)nHeight=this.getDimension().getHeight('max',true);if(isNumber(this.getDimension().getHeight('min',true))&&this.getDimension().getHeight('min',true)>nHeight)nHeight=this.getDimension().getHeight('min',true);this.getDimension().setHeight(nHeight,false,true);}this.getDimension().applyCSS();}).method('calculateTop',function (){this.uber('calculateTop');var nWidth=this.getDimension().getWidth(false,true);var nHeight=this.getDimension().getHeight(false,true);var aCorrect=this.getDimension().getInnerspaceCorrections();var nTop=aCorrect[0];var nLeft=aCorrect[3];var nIndent=0;var aRowHeight=[],aColWidth=[],aRowTop=[],aColLeft=[];for(var i=0;i<this.nRows;++i){for(var j=0;j<this.nCols;++j){if(this.aContent[i][j]&&(!aColWidth[j]||this.aContent[i][j].getDimension().getWidth()>aColWidth[j]))aColWidth[j]=this.aContent[i][j].getDimension().getWidth();}}for(var i=0;i<this.nRows;++i){for(var j=0;j<this.nCols;++j){if(this.aContent[i][j]&&(!aRowHeight[i]||this.aContent[i][j].getDimension().getHeight()>aRowHeight[i]))aRowHeight[i]=this.aContent[i][j].getDimension().getHeight();}}for(var i=0;i<this.nRows;++i){aRowTop[i]=i>0?aRowTop[i-1]+aRowHeight[i-1]+this.nCellPadding:0;for(var j=0;j<this.nCols;++j){if(!isNumber(aColLeft[j]))aColLeft[j]=j>0?aColLeft[j-1]+aColWidth[j-1]+this.nCellPadding:0;if(!this.aContent[i][j])continue;var oDim=this.aContent[i][j].getDimension().copy();if(this.bStretch)oDim.setWidth(aColWidth[j]).setHeight(aRowHeight[i]);if(this.bStretch&&this.bRespectBoundaries){if(this.aContent[i][j].getDimension().getWidth('max')&&this.aContent[i][j].getDimension().getWidth('max')<nStretchWidth)oDim.setWidth(this.aContent[i][j].getDimension().getWidth('max'));if(this.aContent[i][j].getDimension().getHeight('max')&&this.aContent[i][j].getDimension().getHeight('max')<nStretchHeight)oDim.setHeight(this.aContent[i][j].getDimension().getHeight('max'));}oDim.setLeft(aColLeft[j]).setTop(aRowTop[i]);this.aContent[i][j].setDimension(oDim,true);}}});function GCenterContainer(){this.temp=GContainer;this.temp();this.temp=null;this.GCenterContainer.apply(this,arguments);}GCenterContainer.inherits(GContainer);GCenterContainer.method('GCenterContainer',function (){}).method('calculateTop',function (){this.uber('calculateTop');var nWidth=this.getDimension().getWidth(false,true);var nHeight=this.getDimension().getHeight(false,true);var aCorrect=this.getDimension().getInnerspaceCorrections();var nTop=aCorrect[0];var nLeft=aCorrect[3];var nIndent=0;if(this.bStretch){if(this.bXAlign){var nStretchWidth=nWidth/this.aChildren.length;for(var i=0;i<this.aChildren.length&&this.bRespectBoundaries;++i){if(this.aChildren[i].getDimension(true)&&this.aChildren[i].getDimension().getWidth('max')&&this.aChildren[i].getDimension().getWidth('max')<nStretchWidth)nStretchWidth=nStretchWidth+((nStretchWidth-this.aChildren[i].getDimension().getWidth('max'))/(this.aChildren.length-1));if(this.aChildren[i].getDimension(true)&&this.aChildren[i].getDimension().getWidth('min')&&this.aChildren[i].getDimension().getWidth('min')>nStretchWidth)nStretchWidth=nStretchWidth-((this.aChildren[i].getDimension().getWidth('min')-nStretchWidth)/(this.aChildren.length-1));}var nStretchHeight=nHeight;}if(!this.bXAlign){var nStretchHeight=nHeight/this.aChildren.length;for(var i=0;i<this.aChildren.length&&this.bRespectBoundaries;++i){if(this.aChildren[i].getDimension(true)&&this.aChildren[i].getDimension().getHeight('max')&&this.aChildren[i].getDimension().getHeight('max')<nStretchHeight)nStretchHeight=nStretchHeight+((nStretchHeight-this.aChildren[i].getDimension().getHeight('max'))/(this.aChildren.length-1));if(this.aChildren[i].getDimension(true)&&this.aChildren[i].getDimension().getHeight('min')&&this.aChildren[i].getDimension().getHeight('min')>nStretchHeight)nStretchHeight=nStretchHeight-((this.aChildren[i].getDimension().getHeight('min')-nStretchHeight)/(this.aChildren.length-1));}var nStretchWidth=nWidth;}}else{var nTotal=0;for(var i=0;i<this.aChildren.length;++i){if(this.bXAlign&&!isNumber(this.aChildren[i].getDimension().getLeft())&&!isNumber(this.aChildren[i].getDimension().getRight())){nTotal+=this.aChildren[i].getDimension().getWidth();}if(!this.bXAlign&&!isNumber(this.aChildren[i].getDimension().getTop())&&!isNumber(this.aChildren[i].getDimension().getBottom())){nTotal+=this.aChildren[i].getDimension().getHeight();}}nIndent=((this.bXAlign?nWidth:nHeight)-nTotal)/2;if(nIndent<0)nIndent=0;}for(var i=0;i<this.aChildren.length;++i){var oDim=this.aChildren[i].getDimension().copy();if(this.bStretch)oDim.setWidth(nStretchWidth).setHeight(nStretchHeight);if(this.bStretch&&this.bRespectBoundaries){if(this.aChildren[i].getDimension().getWidth('max')&&this.aChildren[i].getDimension().getWidth('max')<nStretchWidth)oDim.setWidth(this.aChildren[i].getDimension().getWidth('max'));if(this.aChildren[i].getDimension().getWidth('min')&&this.aChildren[i].getDimension().getWidth('min')>nStretchWidth)oDim.setWidth(this.aChildren[i].getDimension().getWidth('min'));if(this.aChildren[i].getDimension().getHeight('max')&&this.aChildren[i].getDimension().getHeight('max')<nStretchHeight)oDim.setHeight(this.aChildren[i].getDimension().getHeight('max'));if(this.aChildren[i].getDimension().getHeight('min')&&this.aChildren[i].getDimension().getHeight('min')>nStretchHeight)oDim.setHeight(this.aChildren[i].getDimension().getHeight('min'));}if(this.bXAlign&&!isNumber(oDim.getLeft())&&!isNumber(oDim.getRight())){oDim.setLeft(nLeft+nIndent);nIndent+=oDim.getWidth();}if(this.bXAlign&&!isNumber(oDim.getTop())&&!isNumber(oDim.getBottom())){var nCTop=nTop+(nHeight-oDim.getHeight())/2;oDim.setTop(nCTop>0?nCTop:0);}if(!this.bXAlign&&!isNumber(oDim.getTop())&&!isNumber(oDim.getBottom())){oDim.setTop(nTop+nIndent);nIndent+=oDim.getHeight();}if(!this.bXAlign&&!isNumber(oDim.getLeft())&&!isNumber(oDim.getRight())){var nCLeft=nLeft+(nWidth-oDim.getWidth())/2;oDim.setLeft(nCLeft>0?nCLeft:0);}this.aChildren[i].setDimension(oDim,true);}});function GRowContainer(){this.temp=GContainer;this.temp();this.temp=null;this.GRowContainer.apply(this,arguments);}GRowContainer.inherits(GContainer);GRowContainer.method('GRowContainer',function (){}).method('calculateTop',function (){this.uber('calculateTop');var nWidth=this.getDimension().getWidth(false,true);var nHeight=this.getDimension().getHeight(false,true);var aCorrect=this.getDimension().getInnerspaceCorrections();var nTop=aCorrect[0];var nLeft=aCorrect[3];var nIndent=0;if(this.bStretch){if(this.bXAlign){var nStretchWidth=nWidth/this.aChildren.length;for(var i=0;i<this.aChildren.length&&this.bRespectBoundaries;++i){if(this.aChildren[i].getDimension(true)&&this.aChildren[i].getDimension().getWidth('max')&&this.aChildren[i].getDimension().getWidth('max')<nStretchWidth)nStretchWidth=nStretchWidth+((nStretchWidth-this.aChildren[i].getDimension().getWidth('max'))/(this.aChildren.length-1));if(this.aChildren[i].getDimension(true)&&this.aChildren[i].getDimension().getWidth('min')&&this.aChildren[i].getDimension().getWidth('min')>nStretchWidth)nStretchWidth=nStretchWidth-((this.aChildren[i].getDimension().getWidth('min')-nStretchWidth)/(this.aChildren.length-1));}var nStretchHeight=nHeight;}if(!this.bXAlign){var nStretchHeight=nHeight/this.aChildren.length;for(var i=0;i<this.aChildren.length&&this.bRespectBoundaries;++i){if(this.aChildren[i].getDimension(true)&&this.aChildren[i].getDimension().getHeight('max')&&this.aChildren[i].getDimension().getHeight('max')<nStretchHeight)nStretchHeight=nStretchHeight+((nStretchHeight-this.aChildren[i].getDimension().getHeight('max'))/(this.aChildren.length-1));if(this.aChildren[i].getDimension(true)&&this.aChildren[i].getDimension().getHeight('min')&&this.aChildren[i].getDimension().getHeight('min')>nStretchHeight)nStretchHeight=nStretchHeight-((this.aChildren[i].getDimension().getHeight('min')-nStretchHeight)/(this.aChildren.length-1));}var nStretchWidth=nWidth;}}for(var i=0;i<this.aChildren.length;++i){var oDim=this.aChildren[i].getDimension().copy();if(this.bStretch)oDim.setWidth(nStretchWidth).setHeight(nStretchHeight);if(this.bStretch&&this.bRespectBoundaries){if(this.aChildren[i].getDimension().getWidth('max')&&this.aChildren[i].getDimension().getWidth('max')<nStretchWidth)oDim.setWidth(this.aChildren[i].getDimension().getWidth('max'));if(this.aChildren[i].getDimension().getWidth('min')&&this.aChildren[i].getDimension().getWidth('min')>nStretchWidth)oDim.setWidth(this.aChildren[i].getDimension().getWidth('min'));if(this.aChildren[i].getDimension().getHeight('max')&&this.aChildren[i].getDimension().getHeight('max')<nStretchHeight)oDim.setHeight(this.aChildren[i].getDimension().getHeight('max'));if(this.aChildren[i].getDimension().getHeight('min')&&this.aChildren[i].getDimension().getHeight('min')>nStretchHeight)oDim.setHeight(this.aChildren[i].getDimension().getHeight('min'));}if(this.bXAlign&&!isNumber(oDim.getLeft())&&!isNumber(oDim.getRight())){oDim.setLeft(nLeft+nIndent);nIndent+=oDim.getWidth();}if(this.bXAlign&&!isNumber(oDim.getTop())&&!isNumber(oDim.getBottom())){oDim.setTop(nTop);}if(!this.bXAlign&&!isNumber(oDim.getTop())&&!isNumber(oDim.getBottom())){oDim.setTop(nIndent);nIndent+=oDim.getHeight();}if(!this.bXAlign&&!isNumber(oDim.getLeft())&&!isNumber(oDim.getRight())){oDim.setLeft(nLeft);}this.aChildren[i].setDimension(oDim,true);}});function GDistributeContainer(){this.temp=GContainer;this.temp();this.temp=null;this.GDistributeContainer.apply(this,arguments);}GDistributeContainer.inherits(GContainer);GDistributeContainer.method('GDistributeContainer',function (){}).method('calculateTop',function (){this.uber('calculateTop');var nWidth=this.getDimension().getWidth(false,true);var nHeight=this.getDimension().getHeight(false,true);var aCorrect=this.getDimension().getInnerspaceCorrections();var nTop=aCorrect[0];var nLeft=aCorrect[3];var nIndent=0;var nAverageWidth=0;var nAverageHeight=0;var nFreeChildren=0;var nTotal=0;for(var i=0;i<this.aChildren.length;++i){if(this.bXAlign){if(!isNumber(this.aChildren[i].getDimension().getLeft())&&!isNumber(this.aChildren[i].getDimension().getRight()))nTotal+=this.aChildren[i].getDimension().getWidth();else ++nFreeChildren;}if(!this.bXAlign){if(!isNumber(this.aChildren[i].getDimension().getTop())&&!isNumber(this.aChildren[i].getDimension().getBottom()))nTotal+=this.aChildren[i].getDimension().getHeight();else ++nFreeChildren;}}var aResized=[];var bChanged=true;if(this.bXAlign&&nTotal<=nWidth){var nAverageWidth=nWidth/(this.aChildren.length-nFreeChildren);while(bChanged){bChanged=false;for(var i=0;i<this.aChildren.length;++i){if(!aResized.contains(this.aChildren[i])&&!isNumber(this.aChildren[i].getDimension().getLeft())&&!isNumber(this.aChildren[i].getDimension().getRight())&&this.aChildren[i].getDimension().getWidth()>nAverageWidth){nAverageWidth=nAverageWidth-((this.aChildren[i].getDimension().getWidth()-nAverageWidth)/(this.aChildren.length-1-nFreeChildren));aResized.push(this.aChildren[i]);bChanged=true;break;}}}var nAverageHeight=nHeight;}if(this.bXAlign&&nTotal<=nHeight){var nAverageHeight=nHeight/(this.aChildren.length-nFreeChildren);while(bChanged){bChanged=false;for(var i=0;i<this.aChildren.length;++i){if(!aResized.contains(this.aChildren[i])&&!isNumber(this.aChildren[i].getDimension().getTop())&&!isNumber(this.aChildren[i].getDimension().getBottom())&&this.aChildren[i].getDimension().getHeight()>nAverageHeight){nAverageHeight=nAverageHeight-((this.aChildren[i].getDimension().getHeight()-nAverageHeight)/(this.aChildren.length-1-nFreeChildren));aResized.push(this.aChildren[i]);bChanged=true;break;}}}var nAverageWidth=nWidth;}for(var i=0;i<this.aChildren.length;++i){var oDim=this.aChildren[i].getDimension().copy();if(this.bXAlign&&!isNumber(oDim.getLeft())&&!isNumber(oDim.getRight())){if(oDim.getWidth()>nAverageWidth){oDim.setLeft(nLeft+nIndent);nIndent+=oDim.getWidth();}else{oDim.setLeft(nLeft+nIndent+((nAverageWidth-oDim.getWidth())/2));nIndent+=nAverageWidth;}}if(this.bXAlign&&!isNumber(oDim.getTop())&&!isNumber(oDim.getBottom())){var nCTop=nTop+(nHeight-oDim.getHeight())/2;oDim.setTop(nCTop>0?nCTop:0);}if(!this.bXAlign&&!isNumber(oDim.getTop())&&!isNumber(oDim.getBottom())){if(oDim.getHeight()>nAverageHeight){oDim.setTop(nTop+nIndent);nIndent+=oDim.getHeight();}else{oDim.setTop(nTop+nIndent+((nAverageHeight-oDim.getHeight())/2));nIndent+=nAverageHeight;}}if(!this.bXAlign&&!isNumber(oDim.getLeft())&&!isNumber(oDim.getRight())){var nCLeft=nLeft+(nWidth-oDim.getWidth())/2;oDim.setLeft(nCLeft>0?nCLeft:0);}this.aChildren[i].setDimension(oDim,true);}});if(document.all&&!window.opera){if(isFunction(GWebpage.prototype.getClientDimension)){GWebpage.method('getClientDimension',function (btest){var nWidth,nHeight;if(self.innerHeight){nWidth=self.innerWidth;nHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){nWidth=document.documentElement.clientWidth;nHeight=document.documentElement.clientHeight;}else if(document.body){nWidth=document.body.clientWidth;nHeight=document.body.clientHeight;}var oDim=new Dimension(nWidth,nHeight);oDim.setLeft(0).setTop(0);return oDim;});}if(isFunction(GWebpage.prototype._adjustSize)){GWebpage.method('_adjustSize',function (){if(this.adjustingSize)return;this.adjustingSize=this.getClientDimension();setTimeout(this.adjustSizeDelay,10);}).method('_adjustSizeDelay',function (){if(this.adjustingSize){var cDim=this.getClientDimension();this.gRoot.setDimension(cDim);this.draw();if(this.adjustingSize.getWidth()==cDim.getWidth()&&this.adjustingSize.getHeight()==cDim.getHeight()){this.adjustingSize=null;return;}this.adjustingSize=cDim;setTimeout(this.adjustSizeDelay,10);}});}if(isFunction(GComponent)){GComponent.method('_eventKeyDown',function (oEvent){if(!oEvent)oEvent=window.event;if(!oEvent.which)nKeyCode=oEvent.keyCode;else nKeyCode=oEvent.which;var oActionEvent=new ActionEvent(oEvent);oActionEvent.setSource(this);oActionEvent.setType('keyDown');oActionEvent.setCategory('key');oActionEvent.nKeyCode=nKeyCode;oActionEvent.sKeyTyped=String.fromCharCode(nKeyCode);this.sendEvent(this.aKeyListener,oActionEvent);}).method('_eventKeyPress',function (oEvent){if(!oEvent)oEvent=window.event;if(!oEvent.which)nKeyCode=oEvent.keyCode;else nKeyCode=oEvent.which;var oActionEvent=new ActionEvent(oEvent);oActionEvent.setSource(this);oActionEvent.setType('keyPress');oActionEvent.setCategory('key');oActionEvent.nKeyCode=nKeyCode;oActionEvent.sKeyTyped=String.fromCharCode(nKeyCode);this.sendEvent(this.aKeyListener,oActionEvent);}).method('_eventKeyUp',function (oEvent){if(!oEvent)oEvent=window.event;if(!oEvent.which)nKeyCode=oEvent.keyCode;else nKeyCode=oEvent.which;var oActionEvent=new ActionEvent(oEvent);oActionEvent.setSource(this);oActionEvent.setType('keyUp');oActionEvent.setCategory('key');oActionEvent.nKeyCode=nKeyCode;oActionEvent.sKeyTyped=String.fromCharCode(nKeyCode);this.sendEvent(this.aKeyListener,oActionEvent);}).method('_eventClick',function (oEvent){if(!oEvent)oEvent=window.event;var oActionEvent=new ActionEvent(oEvent);oActionEvent.setSource(this);oActionEvent.setType('click');oActionEvent.setCategory('mouse');oActionEvent.pClientPos=new Point(oEvent.clientX?oEvent.clientX:oEvent.pageX,oEvent.clientY?oEvent.clientY:oEvent.pageY);return this.sendEvent(this.aMouseListener,oActionEvent);}).method('_eventMouseDown',function (oEvent){if(!oEvent)oEvent=window.event;var oActionEvent=new ActionEvent(oEvent);oActionEvent.setSource(this);oActionEvent.setType('mouseDown');oActionEvent.setCategory('mouse');oActionEvent.pClientPos=new Point(oEvent.clientX?oEvent.clientX:oEvent.pageX,oEvent.clientY?oEvent.clientY:oEvent.pageY);return this.sendEvent(this.aMouseListener,oActionEvent);}).method('_eventMouseUp',function (oEvent){if(!oEvent)oEvent=window.event;var oActionEvent=new ActionEvent(oEvent);oActionEvent.setSource(this);oActionEvent.setType('mouseUp');oActionEvent.setCategory('mouse');oActionEvent.pClientPos=new Point(oEvent.clientX?oEvent.clientX:oEvent.pageX,oEvent.clientY?oEvent.clientY:oEvent.pageY);return this.sendEvent(this.aMouseListener,oActionEvent);}).method('_eventMouseOver',function (oEvent){if(!oEvent)oEvent=window.event;var oActionEvent=new ActionEvent(oEvent);oActionEvent.setSource(this);oActionEvent.setType('mouseOver');oActionEvent.setCategory('mouse');oActionEvent.pClientPos=new Point(oEvent.clientX?oEvent.clientX:oEvent.pageX,oEvent.clientY?oEvent.clientY:oEvent.pageY);return this.sendEvent(this.aMouseListener,oActionEvent);}).method('_eventMouseMove',function (oEvent){if(!oEvent)oEvent=window.event;var oActionEvent=new ActionEvent(oEvent);oActionEvent.setSource(this);oActionEvent.setType('mouseMove');oActionEvent.setCategory('mouse');oActionEvent.pClientPos=new Point(oEvent.clientX?oEvent.clientX:oEvent.pageX,oEvent.clientY?oEvent.clientY:oEvent.pageY);return this.sendEvent(this.aMouseListener,oActionEvent);}).method('_eventMouseOut',function (oEvent){if(!oEvent)oEvent=window.event;var oActionEvent=new ActionEvent(oEvent);oActionEvent.setSource(this);oActionEvent.setType('mouseOut');oActionEvent.setCategory('mouse');oActionEvent.pClientPos=new Point(oEvent.clientX?oEvent.clientX:oEvent.pageX,oEvent.clientY?oEvent.clientY:oEvent.pageY);return this.sendEvent(this.aMouseListener,oActionEvent);});}if(isFunction(GTextField)){GTextField.method('draw',function (bIsNotRoot){if(this.getDimension(true)&&this.getDimension().getHeight())this.getDimension().setHeight(this.getDimension().getHeight()-6);if(this.getDimension(true)&&this.getDimension().getWidth())this.getDimension().setWidth(this.getDimension().getWidth()-6);this.uber('draw',bIsNotRoot);this.getBottomElement().value=this.sValue;});}}if(document.all&&window.opera){GButton.method('actionPerformed',function (oActionEvent){if(this.bKeepState&&oActionEvent.getType()=='click'&&oActionEvent.getSource()==this){this.setActive(!this.bActive);}});Array.method('contains',function (oObj){for(var i=0;i<this.length;++i){if(this[i]==oObj)return true;}return false;});}if(!(navigator.userAgent.toLowerCase().indexOf('compatible')+1)&&parseInt(navigator.userAgent.toLowerCase().charAt(8))==5){if(isFunction(GWebpage.prototype._adjustSize)){GWebpage.method('_adjustSize',function (){this.gRoot.setDimension(this.getClientDimension());while(this.getBottomElement().hasChildNodes())this.getBottomElement().removeChild(this.getBottomElement().firstChild);setTimeout(this.draw,1);});}if(isFunction(GTextField)){GTextField.method('draw',function (bIsNotRoot){if(this.getDimension(true)&&this.getDimension().getHeight())this.getDimension().setHeight(this.getDimension().getHeight()-7);if(this.getDimension(true)&&this.getDimension().getWidth())this.getDimension().setWidth(this.getDimension().getWidth()-4);this.uber('draw',bIsNotRoot);this.getBottomElement().value=this.sValue;});}if(isFunction(GLabel)){GLabel.method('calculateBottom',function (nRetry){if(!nRetry)nRetry=0;if(this.getDimension(true,true))this.setDimension(this.getDimension(true,true).copy(),true);else{this.setDimension(new Dimension(),true);this.getTopElement().style.height=null;this.getTopElement().style.width=null;}var nWidth=this.getTopElement().offsetWidth,bChange=false;if(isNumber(this.getDimension().getWidth('max',true))&&this.getDimension().getWidth('max',true)<nWidth){nWidth=this.getDimension().getWidth('max',true);bChange=true;}if(isNumber(this.getDimension().getWidth('min',true))&&this.getDimension().getWidth('min',true)>nWidth){nWidth=this.getDimension().getWidth('min',true);bChange=true;}this.getDimension().setWidth(nWidth,false,true);if(bChange&&nRetry<3){this.getDimension().applyCSS();this.calculateBottom(++nRetry);}var nHeight=this.getTopElement().offsetHeight+(isNumber(this.getDimension().getHeight())?0:1),bChange=false;if(isNumber(this.getDimension().getHeight('max',true))&&this.getDimension().getHeight('max',true)<nHeight){nHeight=this.getDimension().getHeight('max',true);bChange=true;}if(isNumber(this.getDimension().getHeight('min',true))&&this.getDimension().getHeight('min',true)>nHeight){nHeight=this.getDimension().getHeight('min',true);bChange=true;}this.getDimension().setHeight(nHeight,false,true);if(bChange&&nRetry<3){this.getDimension().applyCSS();this.calculateBottom(++nRetry);}});}}if(!isFunction(Function.apply)){Function.method('apply',function (o,a){var r,x='____apply';if(!isObject(o)){o={};}o[x]=this;switch((a&&a.length)||0){case 0:r=o[x]();break;case 1:r=o[x](a[0]);break;case 2:r=o[x](a[0],a[1]);break;case 3:r=o[x](a[0],a[1],a[2]);break;case 4:r=o[x](a[0],a[1],a[2],a[3]);break;case 5:r=o[x](a[0],a[1],a[2],a[3],a[4]);break;case 6:r=o[x](a[0],a[1],a[2],a[3],a[4],a[5]);break;default:alert('Too many arguments to apply.');}delete o[x];return r;});}if(!isFunction(Array.prototype.pop)){Array.method('pop',function (){return this.splice(this.length-1,1)[0];});}if(!isFunction(Array.prototype.push)){Array.method('push',function (){this.splice.apply(this,[this.length,0].concat(Array.prototype.slice.apply(arguments)));return this.length;});}if(!isFunction(Array.prototype.shift)){Array.method('shift',function (){return this.splice(0,1)[0];});}if(!isFunction(Array.prototype.splice)){Array.method('splice',function (s,d){var max=Math.max,min=Math.min,a=[],e,i=max(arguments.length-2,0),k=0,l=this.length,n,v,x;s=s||0;if(s<0){s+=l;}s=max(min(s,l),0);d=max(min(isNumber(d)?d:l,l-s),0);v=i-d;n=l+v;while(k<d){e=this[s+k];if(!isUndefined(e)){a[k]=e;}k+=1;}x=l-s-d;if(v<0){k=s+i;while(x){this[k]=this[k-v];k+=1;x-=1;}this.length=n;}else if(v>0){k=1;while(x){this[n-k]=this[l-k];k+=1;x-=1;}}for(k=0;k<i;++k){this[s+k]=arguments[k+2];}return a;});}if(!isFunction(Array.prototype.unshift)){Array.method('unshift',function (){this.splice.apply(this,[0,0].concat(Array.prototype.slice.apply(arguments)));return this.length;});}var oWebpage=new GWebpage();oWebpage.addEnkiPackage('main',__getInitialSettingsMain());