window.TBView={title:"",url:"",session:"",root:"",language:"",containerMapId:"TBViewMap",containerMapPrintId:"TBViewMapPrint",containerWorkspaces:"TBViewWorkspaces",containerNavigationId:"TBViewNavigation",stopMapLoading:false,openedWindows:[],LOADING:true,getUrl:function(){return this.url},setUrl:function(a){if(typeof a=="string"){this.url=a}},getTitle:function(){return this.title},setTitle:function(a){this.title=a;window.status=this.title},getSession:function(){return this.session},setSession:function(a){if(typeof a=="string"){this.session=a}},getRoot:function(){return this.root},setRoot:function(a){if(typeof a=="string"){this.root=a}},getLanguage:function(){return this.language},setLanguage:function(a){if(typeof a=="string"){this.language=a}},getContainerMapId:function(){return this.containerMapId},setContainerMapId:function(a){if(typeof a=="string"){this.containerMapId=a}},getContainerMapPrintId:function(){return this.containerMapPrintId},setContainerMapPrintId:function(a){if(typeof a=="string"){this.containerMapPrintId=a}},getContainerWorkspacesId:function(){return this.containerWorkspacesId},setContainerWorkspacesId:function(a){if(typeof a=="string"){this.Workspaces=a}},getContainerNavigationId:function(){return this.containerNavigationId},setContainerNavigationId:function(a){if(typeof a=="string"){this.containerNavigationId=a}},showLoading:function(){if(!this.LOADING){return}var d=this.Util.GetLayer("TBViewLoading");var b=document.getElementsByTagName("body")[0];if(d&&b){this.Util.SetStyle(b,"cursor","wait");this.Switch.SwitchLayer(d,1);var a=this.Client.getViewportSize();var e=parseInt(this.Util.GetWidth(d));var c=parseInt(this.Util.GetHeight(d));this.Util.SetStyle(d,"left",(a[0]/2-e/2)+"px");this.Util.SetStyle(d,"top",(a[1]/2-c/2+this.Client.getPageOffsetY())+"px");this.Util.SetStyle(d,"zIndex","99999")}},hideLoading:function(){var b=this.Util.GetLayer("TBViewLoading");var a=document.getElementsByTagName("body")[0];if(b&&a){this.Util.SetStyle(a,"cursor","auto");this.Switch.SwitchLayer(b,0)}},createExternLink:function(d,c){if(TBView.Map.isInitalized()){var f=TBView.Map.getScale();var b=TBView.Map.getCenter();var a="positionX="+b.lon+"&positionY="+b.lat+"&scale="+f+"&language="+TBView.getLanguage()+"&workspace="+TBView.Map.getWorkspace()+"&digitizeSet="+TBView.Map.getDigitizeSet()+"&dimensioningSet="+TBView.Map.getDimensioningSet();c=c.replace(/#POSITION#/g,a)}var e=window.open(d+"?"+c,"","dependent=no,toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=auto,resizable=yes,copyhistory=no,width=800,height=600");if(e){e.focus()}},createInternalLink:function(b,a){if(a!=""){b+="?"+a}this.showLoading();window.top.location.href=b},openDetail:function(e,b,d,c){var a="detail.php?type="+b+"&action="+d+"&title="+encodeURI(e)+"&"+c;this.openWindow(a,false,"DetailContent")},openReport:function(c,b){var a="report.php?type=reports&action="+c+"&"+b;this.openWindow(a,false,"ReportContent")},openExport:function(c,b){var a="export.php?action="+c+"&"+b;this.openWindow(a,false,"ExportContent")},openWindow:function(b,a,c){var c=(c)?c:"";var a=(a&&a==true)?"yes":"no";var f=window.open(b,c,"dependent=yes,toolbar="+a+",location="+a+",menubar="+a+",directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=800,height=600");try{if(f){f.focus()}}catch(d){}try{if(f){this.openedWindows.push(f)}}catch(d){}},closeOpenedWindows:function(){if(this.openedWindows){for(var a=0;a<this.openedWindows.length;a++){if(this.openedWindows[a]&&!this.openedWindows[a].closed){this.openedWindows[a].close()}}}},load:function(c,a,b){if(!this.Requests){return}if(this.Requests.isBusy()){window.setTimeout(function(){TBView.load(c,a,b)},10)}else{this.Requests.load(c,this.getRoot()+"load.php?"+this.getSession()+"&type="+a+TBView.Util.GetQueryGlue(b))}},send:function(d,a,c,b){if(!this.Requests){return}if(this.Requests.isBusy()){window.setTimeout(function(){TBView.send(d,a,c,b)},10)}else{this.Requests.send(d,this.getRoot()+"load.php",this.getSession()+"&type="+a+TBView.Util.GetQueryGlue(c),b)}},loadBox:function(d,c,b){if(this.Boxes&&this.Requests){var a=this.Boxes.getBox(d);if(a){a.show();this.load(a.getContentId(),"box","boxid="+d+"&action="+c+TBView.Util.GetQueryGlue(b))}}},sendBox:function(e,d,c,b){if(this.Boxes&&this.Requests){var a=this.Boxes.getBox(e);if(a){a.show();this.send(a.getContentId(),"box","boxid="+e+"&action="+d+TBView.Util.GetQueryGlue(c),b)}}},openBox:function(f,e,a,d,c){if(this.Boxes&&this.Requests){var b=this.Boxes.openBox(f,e,a,d,c);if(b){this.load(b.getContentId(),"box","boxid="+f+"&action="+d+TBView.Util.GetQueryGlue(c))}}},openWorkspace:function(c){var b=this.getRoot()+"index.php?"+this.getSession()+"&workspace="+c+"&language="+this.getLanguage();if(TBView.CONFIG_APPLICATION_WORKSPACESWITHPOSITION){var d=TBView.Map.getScale();var a=TBView.Map.getCenter();if(a){b+="&positionX="+a.lon+"&positionY="+a.lat}if(d){b+="&scale="+d}b+="&digitizeSet="+TBView.Map.getDigitizeSet()+"&dimensioningSet="+TBView.Map.getDimensioningSet()}this.go(b)},refreshNavigation:function(a){var a="action=navigation"+this.Util.getLinkGlue(a);this.load(this.ContainerNavigationId(),"general",a)},doDebug:function(b){var a=this.Util.GetObject("DEBUG");if(a){this.Util.SetContent(a,b)}},addDebug:function(f){var e=this.Util.GetObject("DEBUG");if(e){var a=this.Util.GetContent(e);var d="";if(typeof f=="object"){for(var c in f){var b=f[c];if(b!==undefined){d+=c+": "+b+"<br>\n"}}}else{d=f}this.doDebug(a+"<br>\n"+d)}},writeDebug:function(g){if(this.Requests){var f="";if(typeof g=="object"){for(var e in g){var d=g[e];if(d!==undefined){f+=e+": ";if(typeof d=="object"){for(var b in d){var c=d[b];if(c!==undefined){f+="\n- "+b+": "+c+"\n"}}}else{f+=d}f+="\n"}}}else{f=g}var a=this.getRoot()+"debug.php?"+this.getSession()+"&text="+encodeURIComponent(f);this.Requests.sendCustom(a,function(h){if(!TBView.Requests.isComplete()){return}TBView.Requests.reset()})}},alertDebug:function(d){var c="";if(typeof d=="object"){for(var b in d){var a=d[b];if(a!==undefined){c+=b+": "+a+"\n"}}}else{c=d}alert(c)},go:function(a){window.parent.location=a},initialize:function(){if(TBView.Map){TBView.Map.initialize()}if(TBView.Client.isMobile()){setTimeout(function(){TBView.initializeMobile()},250)}},initializeMobile:function(){if(!TBView.Client.isMobile()){return false}window.scrollTo(0,1)},destroy:function(){if(TBView.Boxes){TBView.Boxes.closeBoxes()}if(TBView.Requests){TBView.Requests.destroy()}if(TBView.Map){TBView.Map.destroy()}if(TBView.Formular){TBView.Formular.Favorites.deactivate();TBView.Formular.Redlining.deactivate();TBView.Formular.Selection.deactivate();TBView.Formular.Dimensioning.deactivate();TBView.Formular.LandRegister.destroy();TBView.Formular.Dialog.destroy();TBView.Formular.InvokeReport.destroy();TBView.Formular.MultipleSelection.destroy()}if(TBView.Cache){TBView.Cache.destroy()}},CLASS_NAME:"TBView"};TBView.Client={isIE:function(){if(document.all){return true}else{return false}},isNS6:function(){if(document.getElementById){return true}else{return false}},isNS4:function(){if(document.layers){return true}else{return false}},isMobile:function(){if(TBView.CONFIG_MOBILE){return true}else{return false}},GetBodyHeight:function(){var a=document.getElementsByTagName("body")[0];return TBView.Util.GetHeight(a)},GetBodyWidth:function(){var a=document.getElementsByTagName("body")[0];return TBView.Util.GetWidth(a)},getPageOffsetY:function(){var a=window.pageYOffset||document.body.scrollTop||0;return a},getPageSize:function(){var c,a;if(window.innerHeight&&window.scrollMaxY){c=window.innerWidth+window.scrollMaxX;a=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){c=document.body.scrollWidth;a=document.body.scrollHeight}else{c=document.body.offsetWidth;a=document.body.offsetHeight}}var b,d;if(self.innerHeight){if(document.documentElement.clientWidth){b=document.documentElement.clientWidth}else{b=self.innerWidth}d=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){b=document.documentElement.clientWidth;d=document.documentElement.clientHeight}else{if(document.body){b=document.body.clientWidth;d=document.body.clientHeight}}}if(a<d){pageHeight=d}else{pageHeight=a}if(c<b){pageWidth=c}else{pageWidth=b}return[pageWidth,pageHeight]},getViewportSize:function(){var a,b;if(self.innerHeight){if(document.documentElement.clientWidth){a=document.documentElement.clientWidth}else{a=self.innerWidth}b=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){a=document.documentElement.clientWidth;b=document.documentElement.clientHeight}else{if(document.body){a=document.body.clientWidth;b=document.body.clientHeight}}}return[a,b]},CLASS_NAME:"TBView.Client"};TBView.Cache={cachedObjects:[],set:function(a,b){this.cachedObjects[a.toLowerCase()]=b},add:function(a,b){if(!this.cachedObjects[a.toLowerCase()]){this.cachedObjects[a.toLowerCase()]=[]}this.cachedObjects[a.toLowerCase()].push(b)},addPoint:function(a,d,c,b){this.add(a,new TBView.Point(d,c,b))},get:function(a){return(this.cachedObjects[a.toLowerCase()])?this.cachedObjects[a.toLowerCase()]:null},del:function(a){this.cachedObjects[a.toLowerCase()]=null},destroy:function(){delete this.cachedObjects;this.cachedObjects=[]},CLASS_NAME:"TBView.Cache"};TBView.Class=function(){var c=function(){if(arguments&&arguments[0]!=TBView.Class.isPrototype){this.initialize.apply(this,arguments)}};var b={};var e;for(var d=0,a=arguments.length;d<a;++d){if(typeof arguments[d]=="function"){e=arguments[d].prototype}else{e=arguments[d]}TBView.Class.extend(b,e)}c.prototype=b;return c};TBView.Class.isPrototype=function(){};TBView.Class.create=function(){return function(){if(arguments&&arguments[0]!=TBView.Class.isPrototype){this.initialize.apply(this,arguments)}}};TBView.Class.extend=function(a,e){a=a||{};if(e){for(var d in e){var c=e[d];if(c!==undefined){a[d]=c}}var b=typeof window.Event=="function"&&e instanceof window.Event;if(!b&&e.hasOwnProperty&&e.hasOwnProperty("toString")){a.toString=e.toString}}return a};TBView.Class.setOptions=function(d,a){for(var c in a){var b=a[c];if(b!==undefined){d.options[c]=b}}};TBView.Class.inherit=function(){var d=arguments[0];var e=new d(TBView.Class.isPrototype);for(var c=1,a=arguments.length;c<a;c++){if(typeof arguments[c]=="function"){var b=arguments[c];arguments[c]=new b(TBView.Class.isPrototype)}OpenLayers.Util.extend(e,arguments[c])}return e};TBView.Util={isEmpty:function(a){if(a==null||typeof a=="undefined"||a==""){return true}else{return false}},isVisible:function(a){if(a!=null&&typeof a!="undefined"&&a!=""&&this.GetStyle(a,"display")!="none"){return true}else{return false}},stristr:function(b,a){if(this.isEmpty(b)){return false}b=b.toLowerCase();a=a.toLowerCase();if(b.indexOf(a)>-1){return true}else{return false}},intval:function(a){a=parseInt(a);if(isNaN(a)){return 0}else{return a}},stripHTML:function(a){a=a.replace("&nbsp;"," ");a=a.replace(/<(?:.|\s)*?>/gi,"");a=a.replace(/^s+/,"").replace(/s+$/,"");if(a==" "){a=""}return a},GetObjectName:function(a){if(typeof a!="object"||a===null){return""}if(a.CLASS_NAME&&a.CLASS_NAME!=""){return a.CLASS_NAME}return/(\w+)\(/.exec(a.constructor.toString())[1]},GetQueryGlue:function(a){if(this.isEmpty(a)||a.substr(0,1)=="&"){return a}else{return"&"+a}},GetObject:function(a){if(TBView.Client.isNS4()){return null}else{return document.getElementById(a)}},GetForm:function(a){if(document.forms[a]){return document.forms[a]}else{return null}},GetLink:function(a){if(TBView.Client.isNS4()){return document.anchors[a]}else{return document.getElementById(a)}},GetLayer:function(a){if(TBView.Client.isNS4()){return document.layers[a]}else{return document.getElementById(a)}},GetImage:function(a){if(document.images&&document.images[a]){return document.images[a]}else{return null}},SetImage:function(b,a){if(document.images&&document.images[b]){document.images[b].src=a}},GetAnchorX:function(b){if(TBView.Client.isNS4()){return b.x}else{var c=b.offsetLeft;while(b&&b.tagName!="BODY"){c+=b.offsetLeft;b=b.offsetParent}return c}},GetAnchorY:function(b){if(TBView.Client.isNS4()){return b.y}else{var c=b.offsetTop;while(b&&b.tagName!="BODY"){c+=b.offsetTop;b=b.offsetParent}return c}},SetStyle:function(obj,st,val){if(obj&&st!=""&&st!=undefined&&val!=undefined){if(TBView.Client.isNS4()){try{eval("obj."+st+'= "'+val+'"')}catch(error){}}else{try{eval("obj.style."+st+'= "'+val+'"')}catch(error){}}}},GetStyle:function(obj,st){if(obj&&st!=""&&st!=undefined){if(TBView.Client.isNS4()){return eval("obj."+st)}else{return eval("obj.style."+st)}}else{return null}},GetWidth:function(a){if(TBView.Client.isNS4()){return parseInt(a.width)}else{return parseInt(a.offsetWidth)}},GetHeight:function(a){if(TBView.Client.isNS4()){return parseInt(a.height)}else{return parseInt(a.offsetHeight)}},GetContent:function(a){if(a){return new String(a.innerHTML)}else{return""}},SetContent:function(b,a){if(b){b.innerHTML=a}},AddContent:function(b,a){if(b){b.innerHTML+=a}},GetX:function(a){if(TBView.Client.isNS4()){return parseInt(a.x)}else{var b=a.offsetLeft;while(a&&a.tagName!="BODY"){b+=a.offsetLeft;a=a.offsetParent}return parseInt(b)}},GetY:function(a){if(TBView.Client.isNS4()){return parseInt(a.y)}else{var b=a.offsetTop;while(a&&a.tagName!="BODY"){b+=a.offsetTop;a=a.offsetParent}return parseInt(b)}},GetParameterString:function(h){var g=[];for(var c in h){var e=h[c];if((e!=null)&&(typeof e!="function")){var b;if(typeof e=="object"&&e.constructor==Array){var f=[];for(var d=0,a=e.length;d<a;d++){f.push(encodeURIComponent(e[d]))}b=f.join(",")}else{b=encodeURIComponent(e)}g.push(encodeURIComponent(c)+"="+b)}}return g.join("&")},SetStyles:function(d,h){if(!d){return null}h=h.replace(/: /g,":");h=h.replace(/; /g,";");var e=h.split(";");for(var i=0;i<e.length;i++){var a=e[i];var b=a.split(":");if(b[0]&&b[1]&&b[0]!=""&&b[1]!=""){if(stristr(b[0],"-")){var c=b[0].split("-");var f=c[1].substr(0,1);var g=c[1].substr(1);b[0]=c[0]+f.toUpperCase()+g}this.SetStyle(d,b[0],b[1])}}},SetClass:function(b,a){if(!b){return null}b.className=a},SetOpacity:function(b,a){b.style.opacity=(a/100);b.style.MozOpacity=(a/100);b.style.KhtmlOpacity=(a/100);b.style.filter="alpha(opacity="+a+")"},ExecuteJavascript:function(object){var bSaf=(navigator.userAgent.indexOf("Safari")!=-1);var bOpera=(navigator.userAgent.indexOf("Opera")!=-1);var bMoz=(navigator.appName=="Netscape");var st=object.getElementsByTagName("script");var strExec;for(var i=0;i<st.length;i++){if(bSaf){strExec=st[i].innerHTML}else{if(bOpera){strExec=st[i].text}else{if(bMoz){strExec=st[i].textContent}else{strExec=st[i].text}}}try{eval(strExec)}catch(e){}}return},CreateText:function(a){return document.createTextNode(a)},CreateElement:function(a,b,c){var f=document.createElement(a);for(var e in b){var d=b[e];if(d!==undefined){f[e]=d}}for(var e in c){var d=c[e];if(d!==undefined){f.style[e]=d}}return f},CreateDiv:function(b,a){return this.CreateElement("DIV",{id:b,name:b,className:a},{})},CreateImg:function(g,e,d,a,f,c,b){return this.CreateElement("IMG",{id:g,name:g,border:0,src:((e!="")?(TBView.getRoot()+"layout/images/"+e):""),width:d,height:a,align:f,hspace:c,vspace:b},{})},CLASS_NAME:"TBView.Util"};TBView.Formular={isChecked:function(b){var a=TBView.Util.GetObject(b);if(a!=null){if(a.checked==true){return true}else{return false}}},doAssignSelect:function(c,d){for(var b=0;b<c.length;b++){if(c.options[b].selected==true){var a=new Option(c.options[b].text,c.options[b].value);d.options[d.length]=a;c.options[b].selected=false;c.options[b]=null;b--}}},doSelectAll:function(d,a){var c=document.forms[d];var e=c.elements[a];if(e){for(var b=0;b<e.length;b++){if(e.options[b]){e.options[b].selected=true}}}},doSelectByText:function(d,a,f,g){var c=document.forms[d];var e=c.elements[a];var g=(TBView.Util.isEmpty(g))?false:g;if(e){for(var b=0;b<e.length;b++){if(e.options[b]&&!g&&e.options[b].text.substr(0,f.length).toLowerCase()==f.toLowerCase()){e.options[b].selected=true}else{if(e.options[b]&&g&&e.options[b].text.substr(0,f.length).toLowerCase()!=f.toLowerCase()){e.options[b].selected=true}}}}},setField:function(d,a,c){var b=document.forms[d];var e=b.elements[a];if(e){e.value=c}},subtractField:function(e,a,c,h){var b=document.forms[e];var g=b.elements[a];if(g){c=isNaN(parseInt(c))?0:parseInt(c);h=isNaN(parseInt(h))?0:parseInt(h);var d=isNaN(parseInt(g.value))?0:parseInt(g.value);var f=d-c;g.value=(f<h&&h!=0)?(f-h):f}},summateField:function(f,b,d,a){var c=document.forms[f];var h=c.elements[b];if(h){d=isNaN(parseInt(d))?0:parseInt(d);a=isNaN(parseInt(a))?0:parseInt(a);var e=isNaN(parseInt(h.value))?0:parseInt(h.value);var g=e+d;h.value=(g>a&&a!=0)?(g-a):g}},CLASS_NAME:"TBView.Formular"};TBView.Formular.Filter={bindClass:"FieldFilterInput",activeList:null,initialize:function(){var b=document.getElementsByTagName("input");for(var a=0;a<b.length;a++){if(!b[a].list&&b[a].className==this.bindClass){b[a].list=new TBView.Formular.Filter.List(b[a])}}},getFilter:function(b){var c=document.getElementsByTagName("input");for(var a=0;a<c.length;a++){if(c[a].list&&c[a].list.filterKey==b&&c[a].className==this.bindClass){return c[a].list}}return null},openList:function(a){var b=this.getFilter(a);if(b){b.update()}},hideList:function(a){var b=this.getFilter(a);if(b){b.hide()}},setListValue:function(a,c,d){var b=this.getFilter(a);if(b){b.filterElement.value=d;b.fieldElement.value=c}},CLASS_NAME:"TBView.Formular.Filter"};TBView.Formular.Filter.List={};TBView.Formular.Filter.List=TBView.Class({filterElement:null,fieldElement:null,listElement:null,filterKey:"",filterType:"",filterAction:"",filterQuery:"",displayOnFocus:true,withBlurTimer:true,blurTimerId:null,blurTimer:750,loadTimerId:null,loadTimer:300,filterTextLength:6,checkTextLength:true,lastFilterText:null,boxCurrentPosition:0,boxCurrentSelectedObject:null,listClosed:true,overList:false,initialize:function(b){this.filterElement=b;this.filterKey=this.filterElement.getAttribute("filterKey",0);this.filterType=this.filterElement.getAttribute("filterType",0);this.filterAction=this.filterElement.getAttribute("filterAction",0);this.filterQuery=this.filterElement.getAttribute("filterQuery",0);this.listElement=TBView.Util.GetLayer("box"+this.filterKey+"List");this.fieldElement=this.filterElement.parentNode.getElementsByTagName("input")[1];if(this.filterElement&&this.listElement){var a=this;TBView.Events.addEvent(this.filterElement,"focus",function(){if(a.displayOnFocus){a.update()}});TBView.Events.addEvent(this.filterElement,"click",function(){a.update()});TBView.Events.addEvent(this.filterElement,"blur",function(){if(a.withBlurTimer){a.blurTimerId=setTimeout(function(){a.hide()},a.blurTimer)}else{a.hide();a.withBlurTimer=true}});TBView.Events.addEvent(this.filterElement,"mouseover",function(c){if(!a.isClosed()){a.show()}});TBView.Events.addEvent(this.filterElement,"keypress",function(c){return TBView.Events.clearEnterEvents(c)});TBView.Events.addEvent(this.filterElement,"keyup",function(c){a.update(c)});TBView.Events.addEvent(this.filterElement,"input",function(c){a.update(c)});TBView.Events.addEvent(this.listElement,"mouseover",function(c){TBView.Formular.Filter.activeList=a;a.overList=true;a.show()});TBView.Events.addEvent(this.listElement,"mouseout",function(){a.overList=false;if(a.withBlurTimer){a.blurTimerId=setTimeout(function(){a.hide()},a.blurTimer)}else{a.hide();a.withBlurTimer=true}});this.filterElement.setAttribute("autocomplete","off")}},isClosed:function(){return this.listClosed},isOverList:function(){return this.overList},cancelBlur:function(){window.clearTimeout(this.blurTimerId);this.blurTimerId=null;this.withBlurTimer=true},cancelLoad:function(){window.clearTimeout(this.loadTimerId);this.loadTimerId=null},hide:function(){if(this.isOverList()){return}this.listClosed=true;TBView.Switch.SwitchLayer(this.listElement,0)},show:function(){this.cancelBlur();TBView.Formular.Filter.activeList=this;if(this.isClosed()){TBView.Switch.SwitchLayer(this.listElement,1);this.listClosed=false}},update:function(d){if(!d){d=window.event}TBView.Formular.Filter.activeList=this;var c=(d)?(d.keyCode||d.charCode||""):"";if(c=="38"){delete this.boxCurrentSelectedObject;this.boxCurrentSelectedObject==null;this.boxCurrentPosition--;if(this.boxCurrentPosition<1){this.boxCurrentPosition=1}this.showListPosition()}else{if(c=="40"){delete this.boxCurrentSelectedObject;this.boxCurrentSelectedObject==null;this.boxCurrentPosition++;this.showListPosition()}else{if(c=="13"){this.setListFiltervalue();TBView.Events.clearEvents(d);return false}else{if(c=="27"){this.overList=false;this.hide();return false}else{if(c=="37"){return false}else{if(c=="39"){return false}else{if(c=="16"){return false}else{if(c=="17"){return false}else{if(c=="35"){return false}else{if(c=="36"){return false}}}}}}}}}}var f=this.filterElement.value.substr(0,this.filterTextLength);this.show();if(this.lastFilterText!=f){this.lastFilterText=f;this.boxCurrentPosition=0;delete this.boxCurrentSelectedObject;this.boxCurrentSelectedObject=null;this.cancelLoad();var b=this;this.loadTimerId=setTimeout(function(){b.load()},b.loadTimer)}var a=this.filterElement.value;this.filterElement.value="";this.filterElement.value=a;return true},load:function(){var b=this.filterElement.value.substr(0,this.filterTextLength);var a="key="+this.filterKey+"&action="+this.filterAction+"&text="+b;if(!TBView.Util.isEmpty(this.filterQuery)){a+="&"+this.filterQuery}TBView.load(this.listElement.id,this.filterType,a)},setListFiltervalue:function(){if(this.boxCurrentSelectedObject!=null){var d=this.boxCurrentSelectedObject.getAttribute("filterValue",0);var c=TBView.Util.GetContent(this.boxCurrentSelectedObject);var a=parseInt(TBView.Util.GetWidth(this.filterElement))/8;c=(c.length>a)?c.substr(0,a)+"...":c}else{var d="";var c=""}if(d=="all"){this.filterElement.value="";this.fieldElement.value="";this.boxCurrentPosition=0;delete this.boxCurrentSelectedObject;this.boxCurrentSelectedObject=null;this.update(null)}else{if(d!=""){this.filterElement.value=c.charEntities();this.fieldElement.value=d}this.overList=false;try{if(this.filterElement&&this.filterElement.blur){this.filterElement.blur()}}catch(b){}this.hide()}},showListPosition:function(){var a=this.listElement.getElementsByTagName("div");var b=0;var e=null;for(var d=0;d<a.length;d++){var c=a[d];if(TBView.Util.stristr(c.className,"Active")){c.className=c.className.replace("Active","")}if(c.getAttribute("filterValue",0)!=null&&c.getAttribute("filterValue",0)!=""){e=c;b=parseInt(e.getAttribute("filterPosition"));if(b==this.boxCurrentPosition){this.boxCurrentSelectedObject=e;this.boxCurrentSelectedObject.className+="Active"}}}if(e&&b<this.boxCurrentPosition){this.boxCurrentSelectedObject=e;this.boxCurrentSelectedObject.className+="Active";this.boxCurrentPosition=b}},overListPosition:function(a){this.boxCurrentSelectedObject=null;this.boxCurrentPosition=parseInt(a.getAttribute("filterPosition",0));TBView.Switch.SwitchCursor(a,1);this.showListPosition()},outListPosition:function(a){delete this.boxCurrentSelectedObject;this.boxCurrentSelectedObject=null;TBView.Switch.SwitchCursor(a,0)},CLASS_NAME:"TBView.Formular.Filter.List"});TBView.Formular.Files={initialize:function(){var b=document.getElementsByTagName("input");for(var a=0;a<b.length;a++){if(b[a].type=="file"){var c=b[a];c._fake_file_input=b[a].parentNode.getElementsByTagName("input")[1];c._fake_file_input.readOnly=true;c.onchange=function(){this._fake_file_input.value=this.value};c.onmouseover=function(){this.parentNode.style.cursor="pointer";this.parentNode.className+="Active"};c.onmouseout=function(){this._fake_file_input.value=this.value;this.parentNode.style.cursor="auto";this.parentNode.className=this.parentNode.className.replace("Active","")}}}},selectFile:function(f,c,e,b,a,i){var h=TBView.Util.GetObject(f);if(h){h.value=c;var g=TBView.Util.GetLayer("preview"+f);if(g){if(e){TBView.Util.SetContent(g,"");var d=TBView.Util.CreateImg("imgpreview"+f,"../../"+b,parseInt(a),parseInt(i));g.appendChild(d)}else{TBView.Util.SetContent(g,b)}}return true}return false},deleteFile:function(b,c,f){if(!b||b==""||!c||c==""){return false}var a={action:"admin/tiles/box.files.delete.php",directory:b,file:c,ts:(new Date()).getTime()};var e=TBView.Util.GetParameterString(a);var d=TBView.getRoot()+"action.php?"+TBView.getSession()+"&"+e;TBView.Requests.sendCustom(d,function(g){if(!TBView.Requests.isComplete()){return}if(f){f()}TBView.Requests.reset()})},CLASS_NAME:"TBView.Formular.Files"};TBView.Formular.Search={id:"",resultId:"",field:null,resultBox:null,action:"",query:"",lastFilterText:"",initialize:function(e,a,c,b){this.id=e;this.resultId=a;this.action=c;this.query=b;this.field=TBView.Util.GetObject("fldSearch"+this.id);this.resultBox=TBView.Util.GetLayer(this.resultId);if(!this.field||!this.resultBox){return}var d=this;this.field.oninput=function(f){d.update(f)};this.field.onkeyup=function(f){d.update(f)};this.update()},getField:function(){return this.field},search:function(e,a,c,b,d){this.field=TBView.Util.GetObject("fldSearch"+e);this.resultBox=TBView.Util.GetLayer(a);if(!this.field||!this.resultBox){return}if(TBView.Requests.isBusy()){TBView.Requests.reset()}this.field.value+=d;this.initialize(e,a,c,b)},clear:function(){this.id="";this.resultId="";this.action="";this.query="";this.lastFilterText="";this.field.value="";if(TBView.Requests.isBusy()){TBView.Requests.reset()}TBView.Util.SetContent(this.resultBox,"")},update:function(c){if(!c){c=window.event}if(!this.field||!this.resultBox||this.lastFilterText==this.field.value){return}if(TBView.Util.isEmpty(this.field.value)){TBView.Util.SetContent(this.resultBox,"");return}if(TBView.Requests.isBusy()){TBView.Requests.reset()}var b=(c&&c.keyCode)||(c&&c.keyCode)||"";if(b=="38"){return}else{if(b=="40"){return}else{if(b=="13"){}else{if(b=="27"){try{this.field.blur()}catch(a){}return}else{if(1==0&&b=="8"){return}else{if(1==0&&b=="46"){return}else{if(b=="37"){return}else{if(b=="39"){return}else{if(b=="16"){return}else{if(b=="17"){return}else{if(b=="35"){return}else{if(b=="36"){return}else{}}}}}}}}}}}}this.lastFilterText=this.field.value;TBView.load(this.resultBox.id,"actions","action="+this.action+"&text="+encodeURIComponent(this.field.value)+TBView.Util.GetQueryGlue(this.query));TBView.LOADING=true},CLASS_NAME:"TBView.Formular.Search"};TBView.Formular.Plot={initialized:false,active:false,form:null,controlLayer:null,controlModify:null,controlFeature:null,plotCenter:null,plotType:"",plotFormat:"A4",plotOrientation:"landscape",plotRotate:0,plotScale:0,initialize:function(b,a){this.map=TBView.Map.getMap();this.form=TBView.Util.GetForm(b);if(!this.controlLayer){this.controlLayer=new OpenLayers.Layer.Vector(this.CLASS_NAME,{displayInLayerSwitcher:false,style:OpenLayers.Util.extend(OpenLayers.Feature.Vector.style.select,TBView.Map.SketchSymbolizers.Plot),selectStyle:OpenLayers.Util.extend(OpenLayers.Feature.Vector.style.select,TBView.Map.SketchSymbolizers.Plot),calculateInRange:function(){return true}});this.controlLayer.setVisibility(false);this.controlLayer.events.on({featuremodified:function(){TBView.Formular.Plot._updateFormular()}});this.map.addLayer(this.controlLayer)}if(this.controlModify){this.controlModify.clearRadiusVertex()}if(!this.initialized&&a&&a!=""){TBView.Boxes.addBoxTriggerClose(a,function(){TBView.Formular.Plot.destroy()})}this.activate();this.initialized=true},destroy:function(){try{if(this.controlModify){this.map.removeControl(this.controlModify);this.controlModify.destroy();delete this.controlModify;this.controlModify=null}}catch(a){}try{if(this.controlFeature){this.controlFeature.destroy();delete this.controlFeature;this.controlFeature=null}}catch(a){}try{if(this.controlLayer){this.map.removeLayer(this.controlLayer);this.controlLayer.destroyFeatures();this.controlLayer.destroy();delete this.controlLayer;this.controlLayer=null}}catch(a){}try{if(this.form){if(this.form.rotate){this.form.rotate.value=0}}}catch(a){}delete this.form;delete this.map;delete this.plotCenter;delete this.plotType;delete this.plotFormat;delete this.plotOrientation;delete this.plotRotate;delete this.plotScale;this.form=null;this.map=null;this.plotCenter=null;this.plotType="";this.plotFormat="A4";this.plotOrientation="landscape";this.plotRotate=0;this.plotScale=0;this.initialized=false},activate:function(){if(!this.form){return false}this.active=true;var c=false;for(var b=0;b<this.form.usePrint.length;b++){if(this.form.usePrint[b].checked){this.plotType=this.form.usePrint[b].value;break}}if(this.form.baseLayers){var d=[];for(var a=0;a<this.map.layers.length;a++){if(this.map.layers[a].visibility){d.push(this.map.layers[a].themeName)}}this.form.baseLayers.value=d.join(",")}if(this.form.scale&&parseInt(this.form.scale.value)>0){c=true;this.plotScale=parseInt(this.form.scale.value)}else{c=false;this.plotScale=this.map.getScale()}this.plotRotate=isNaN(parseInt(this.form.rotate.value))?0:parseInt(this.form.rotate.value);if(this.plotType=="fast"){this.plotFormat=this.form.fastFormat.value;this.plotOrientation=this.form.fastOrientation.value}else{if(this.plotType=="standard"){this.plotFormat=this.form.standardFormat.value;this.plotOrientation=this.form.standardOrientation.value}else{return false}}if(c){this._showPlotRectangle()}else{this.deactivate()}return true},deactivate:function(a){if(!this.active){return false}this.active=false;this.plotCenter=null;if(this.controlLayer){this.controlLayer.setVisibility(false)}if(this.controlModify){this.controlModify.deactivate()}return true},_updateFormular:function(){if(!this.controlModify.feature){return false}var k=this.controlModify.feature.geometry;if(this.form&&this.form.centerX&&this.form.centerY){this.plotCenter=k.getCentroid();this.form.centerX.value=this.plotCenter.x;this.form.centerY.value=this.plotCenter.y}else{var l=TBView.Map.getCenter();this.plotCenter=new OpenLayers.Geometry.Point(l.lon,l.lat)}var g=k.getBounds();var a=g.getCenterLonLat();var j=new OpenLayers.Geometry.Point(a.lon,a.lat);var h=this.controlModify.getRadiusVertexStart();var i=this.controlModify.getRadiusVertexLast();var m=h.x-j.x;var d=h.y-j.y;var f=Math.atan2(d,m)*180/Math.PI;var n=i.x-j.x;var e=i.y-j.y;var b=Math.atan2(e,n)*180/Math.PI;var c=(f-b);if(this.form&&this.form.rotate){this.plotRotate=parseInt(this.form.rotate.value)+Math.round(c);this.plotRotate=(this.plotRotate>=360)?(this.plotRotate-360):this.plotRotate;this.plotRotate=(this.plotRotate<=-360)?(this.plotRotate+360):this.plotRotate;this.form.rotate.value=this.plotRotate}},_getSize:function(){var a=(this.plotOrientation=="landscape")?29.7:21;var b=(this.plotOrientation=="landscape")?21:29.7;switch(this.plotFormat){case"A3":a=(this.plotOrientation=="landscape")?42:29.7;b=(this.plotOrientation=="landscape")?29.7:42;break;case"A2":a=(this.plotOrientation=="landscape")?59.4:42;b=(this.plotOrientation=="landscape")?42:59.4;break;case"A1":a=(this.plotOrientation=="landscape")?84.1:59.4;b=(this.plotOrientation=="landscape")?59.4:84.1;break;case"A0":a=(this.plotOrientation=="landscape")?118.9:84.1;b=(this.plotOrientation=="landscape")?84.1:118.9;break}return{width:(this.plotScale*a/100),height:(this.plotScale*b/100)}},_showPlotRectangle:function(){if(!this.active){return false}if(this.controlLayer){this.controlLayer.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style.select,TBView.Map.SketchSymbolizers.Plot);this.controlLayer.selectStyle=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style.select,TBView.Map.SketchSymbolizers.Plot);this.controlLayer.setVisibility(true)}if(!this.controlModify){this.controlModify=new TBView.Map.Controls.Plot(this.controlLayer,{staticRadiusVertex:true});this.map.addControl(this.controlModify)}this.controlModify.activate();var f=TBView.Map.getCenter();var a=(this.plotCenter)?this.plotCenter:new OpenLayers.Geometry.Point(f.lon,f.lat);var e=this._getSize();var c=[];c.push(new OpenLayers.Geometry.Point((a.x+e.width/2),(a.y+e.height/2)));c.push(new OpenLayers.Geometry.Point((a.x+e.width/2),(a.y-e.height/2)));c.push(new OpenLayers.Geometry.Point((a.x-e.width/2),(a.y-e.height/2)));c.push(new OpenLayers.Geometry.Point((a.x-e.width/2),(a.y+e.height/2)));c.push(c[0]);var b=new OpenLayers.Geometry.LinearRing(c);var d=new OpenLayers.Geometry.Polygon([b]);if(this.plotRotate!=0){d.rotate((this.plotRotate*(-1)),a)}if(this.controlFeature){this.controlFeature.destroy()}this.controlFeature=new OpenLayers.Feature.Vector(d);this.controlLayer.addFeatures([this.controlFeature],{silent:true});if(this.controlModify&&this.controlFeature){this.controlModify.selectFeature(this.controlFeature)}return true},CLASS_NAME:"TBView.Formular.Plot"};TBView.Formular.Redlining={initialized:false,active:false,form:null,map:null,digitizeType:"",lastDigitizeType:null,control:null,error:"",result:{},initialize:function(b,a){if(this.active){this.deactivate()}this.form=TBView.Util.GetForm(b);this.map=TBView.Map.getMap();this.digitizeType=(this.form.geometryType)?this.form.geometryType.value:"";if(!this.initialized&&a&&a!=""){TBView.Boxes.addBoxTriggerClose(a,function(){TBView.Formular.Redlining.destroy()})}TBView.Legend.updateTemporaryDigitizeLayers();this.initialized=true},activate:function(){if(this.active){return false}this.result={};if(!this._checkFormValues()){alert(this.error);return false}var f="";var c=null;var a={sides:"",snapAngle:0};if(this.digitizeType=="text"){c=OpenLayers.Handler.Point;f="crosshair"}else{if(this.digitizeType=="line"){c=OpenLayers.Handler.Path;f="url("+TBView.getRoot()+"layout/images/cursors/linestring.cur), crosshair"}else{if(this.digitizeType=="rectangle"){c=OpenLayers.Handler.RegularPolygon;a.sides=4;a.irregular=true;f="url("+TBView.getRoot()+"layout/images/cursors/rectangle.cur), crosshair"}else{if(this.digitizeType=="circle"){c=OpenLayers.Handler.RegularPolygon;a.sides=80;a.finalize=function(){};f="url("+TBView.getRoot()+"layout/images/cursors/circle.cur), crosshair"}else{if(this.digitizeType=="area"){c=OpenLayers.Handler.Polygon;a.sides="";f="url("+TBView.getRoot()+"layout/images/cursors/polygon.cur), crosshair"}else{if(this.digitizeType=="symbol"){c=OpenLayers.Handler.Point;a.sides="";f="url("+TBView.getRoot()+"layout/images/cursors/point.cur), crosshair"}else{return false}}}}}}if(this.digitizeType!=this.lastDigitizeType&&this.control){this.control.destroy();this.map.removeControl(this.control);delete this.control;this.control=null}if(!this.control){var e=OpenLayers.Function.bind(this.done,this);var g=OpenLayers.Function.bind(this.deactivate,this);this.control=new TBView.Map.Controls.Feature(c,{handlerOptions:a,style:OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],TBView.Map.SketchSymbolizers.Redlining),triggerDone:e,triggerCancel:g,deactivateHandler:false,type:this.selectionType});this.map.addControl(this.control)}this.control.handler.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],TBView.Map.SketchSymbolizers.Redlining);this.control.activate();var b=TBView.Util.GetImage("TBDigitizingStart");if(b){b.style.display="none"}var d=TBView.Util.GetImage("TBDigitizingStop");if(d){d.style.display="inline"}this.active=true;this._deactivateStyleParameters();TBView.Map.setCursor(f);return true},deactivate:function(){if(!this.active){return false}var a=TBView.Util.GetImage("TBDigitizingStart");if(a){a.style.display="inline"}var b=TBView.Util.GetImage("TBDigitizingStop");if(b){b.style.display="none"}this._activateStyleParameters();this.lastDigitizeType=null;this.style={};this.error="";if(this.control){this.control.deactivate()}TBView.Map.initializeCursor();this.active=false;return true},destroy:function(){if(this.control){this.control.destroy();this.map.removeControl(this.control);delete this.control;this.control=null}delete this.form;delete this.map;delete this.result;this.form=null;this.map=null;this.digitizeType="";this.lastDigitizeType=null;this.error="";this.result={};this.initialized=false;this.active=false;TBView.Formular.Selection.deactivate()},done:function(d){if(!this.active||!this.form){return false}var c=this._getDigitizeXml();var a={type:"actions",action:"map.digitize",digitize:c,digitizeType:this.digitizeType,ts:(new Date()).getTime()};var e=TBView.Util.GetParameterString(a);var b=TBView.getRoot()+"action.php?"+TBView.getSession()+"&"+e;TBView.Requests.sendCustom(b,function(f){if(!TBView.Requests.isComplete()){return}TBView.Map.refreshOverlayMap();TBView.Legend.updateTemporaryDigitizeLayers();TBView.Requests.reset()})},clearAll:function(){var a={type:"actions",action:"map.digitize.clear",clear:"all",ts:(new Date()).getTime()};var c=TBView.Util.GetParameterString(a);var b=TBView.getRoot()+"action.php?"+TBView.getSession()+"&"+c;TBView.Requests.sendCustom(b,function(d){if(!TBView.Requests.isComplete()){return}TBView.Map.refreshOverlayMap();TBView.Legend.updateTemporaryDigitizeLayers();TBView.Requests.reset()})},clearSelection:function(){var a={type:"actions",action:"map.digitize.clear",clear:"selection",ts:(new Date()).getTime()};var c=TBView.Util.GetParameterString(a);var b=TBView.getRoot()+"action.php?"+TBView.getSession()+"&"+c;TBView.Requests.sendCustom(b,function(d){if(!TBView.Requests.isComplete()){return}TBView.Map.refreshOverlayMap();TBView.Legend.updateTemporaryDigitizeLayers();TBView.Requests.reset()})},_deactivateStyleParameters:function(){if(!this.active||!this.form){return false}for(var a=0;a<this.form.elements.length;a++){if(this.form.elements[a].name!="geometryType"){this.form.elements[a].disabled=true;this.form.elements[a].lastColor=(this.form.elements[a].style.color)?this.form.elements[a].style.color:"";this.form.elements[a].style.color="#999999"}}},_activateStyleParameters:function(){if(!this.active||!this.form){return false}for(var a=0;a<this.form.elements.length;a++){if(this.form.elements[a].name!="geometryType"){this.form.elements[a].disabled=false;this.form.elements[a].style.color=(this.form.elements[a].lastColor)?this.form.elements[a].lastColor:""}}if(this.form.elements.areaProperty&&!this.form.elements.areaProperty.checked){this.switchAreaParameters(false)}if(this.form.elements.lineProperty&&!this.form.elements.lineProperty.checked){this.switchLineParameters(false)}},switchAreaParameters:function(a){if(!this.active||!this.form){return false}if(a){this.form.areaPattern.disabled=false;this.form.areaPattern.style.color=(this.form.areaPattern.lastColor)?this.form.areaPattern.lastColor:"";this.form.areaForegroundColor.disabled=false;this.form.areaForegroundColor.style.color=(this.form.areaForegroundColor.lastColor)?this.form.areaForegroundColor.lastColor:"";this.form.areaBackgroundColor.disabled=false;this.form.areaBackgroundColor.style.color=(this.form.areaBackgroundColor.lastColor)?this.form.areaBackgroundColor.lastColor:""}else{this.form.areaPattern.disabled=true;this.form.areaPattern.lastColor=(this.form.areaPattern.style.color)?this.form.areaPattern.style.color:"";this.form.areaPattern.style.color="#999999";this.form.areaForegroundColor.disabled=true;this.form.areaForegroundColor.lastColor=(this.form.areaForegroundColor.style.color)?this.form.areaForegroundColor.style.color:"";this.form.areaForegroundColor.style.color="#999999";this.form.areaBackgroundColor.disabled=true;this.form.areaBackgroundColor.lastColor=(this.form.areaBackgroundColor.style.color)?this.form.areaBackgroundColor.style.color:"";this.form.areaBackgroundColor.style.color="#999999"}},switchLineParameters:function(a){if(!this.active||!this.form){return false}if(a){this.form.lineThickness.disabled=false;this.form.lineThickness.style.color=(this.form.lineThickness.lastColor)?this.form.lineThickness.lastColor:"";this.form.lineUnit.disabled=false;this.form.lineUnit.style.color=(this.form.lineUnit.lastColor)?this.form.lineUnit.lastColor:"";this.form.linePattern.disabled=false;this.form.linePattern.style.color=(this.form.linePattern.lastColor)?this.form.linePattern.lastColor:"";this.form.lineColor.disabled=false;this.form.lineColor.style.color=(this.form.lineColor.lastColor)?this.form.lineColor.lastColor:""}else{this.form.lineThickness.disabled=true;this.form.lineThickness.lastColor=(this.form.lineThickness.style.color)?this.form.lineThickness.style.color:"";this.form.lineThickness.style.color="#999999";this.form.lineUnit.disabled=true;this.form.lineUnit.lastColor=(this.form.lineUnit.style.color)?this.form.lineUnit.style.color:"";this.form.lineUnit.style.color="#999999";this.form.linePattern.disabled=true;this.form.linePattern.lastColor=(this.form.linePattern.style.color)?this.form.linePattern.style.color:"";this.form.linePattern.style.color="#999999";this.form.lineColor.disabled=true;this.form.lineColor.lastColor=(this.form.lineColor.style.color)?this.form.lineColor.style.color:"";this.form.lineColor.style.color="#999999"}},_checkFormValues:function(){if(!this.form){return false}this.error="";switch(this.digitizeType){case"text":var e=parseFloat(this.form.textSize.value);if(isNaN(e)||e<=0||e>999999){this.error=TBView.Locale.getText("map.redlining.text.error.size.not.valid")}var a=this.form.textValue.value;if(a==""){this.error=TBView.Locale.getText("map.redlining.text.error.value.not.valid")}break;case"line":var d=parseFloat(this.form.lineThickness.value);if(isNaN(d)||d<=0||d>999999){this.error=TBView.Locale.getText("map.redlining.line.error.thickness.not.valid")}break;case"rectangle":var d=parseFloat(this.form.lineThickness.value);if(isNaN(d)||d<=0||d>999999){this.error=TBView.Locale.getText("map.redlining.line.error.thickness.not.valid")}if(this.form.elements.areaProperty&&this.form.elements.lineProperty&&!this.form.elements.areaProperty.checked&&!this.form.elements.lineProperty.checked){this.error=TBView.Locale.getText("map.redlining.area.error.properties.not.valid")}break;case"circle":var d=parseFloat(this.form.lineThickness.value);if(isNaN(d)||d<=0||d>999999){this.error=TBView.Locale.getText("map.redlining.line.error.thickness.not.valid")}if(this.form.elements.areaProperty&&this.form.elements.lineProperty&&!this.form.elements.areaProperty.checked&&!this.form.elements.lineProperty.checked){this.error=TBView.Locale.getText("map.redlining.area.error.properties.not.valid")}break;case"area":var d=parseFloat(this.form.lineThickness.value);if(isNaN(d)||d<=0||d>999999){this.error=TBView.Locale.getText("map.redlining.line.error.thickness.not.valid")}if(this.form.elements.areaProperty&&this.form.elements.lineProperty&&!this.form.elements.areaProperty.checked&&!this.form.elements.lineProperty.checked){this.error=TBView.Locale.getText("map.redlining.area.error.properties.not.valid")}break;case"symbol":var b=parseFloat(this.form.symbolHeight.value);if(isNaN(b)||b<=0||b>999999){this.error=TBView.Locale.getText("map.redlining.symbol.error.height.not.valid")}var c=parseFloat(this.form.symbolWidth.value);if(isNaN(c)||c<=0||c>999999){this.error=TBView.Locale.getText("map.redlining.symbol.error.width.not.valid")}break}if(this.form.sizeContext){this.result.sizeContext=this.form.sizeContext.value}if(!this.form.elements.lineProperty||this.form.elements.lineProperty.checked){if(this.form.lineThickness){this.result.lineThickness=parseFloat(this.form.lineThickness.value)}if(this.form.lineUnit){this.result.lineUnit=this.form.lineUnit.value}if(this.form.linePattern){this.result.linePattern=this.form.linePattern.value}if(this.form.lineColor){this.result.lineColor=this.form.lineColor.value.replace(/#/g,"FF")}}if(!this.form.elements.areaProperty||this.form.elements.areaProperty.checked){if(this.form.areaPattern){this.result.areaPattern=this.form.areaPattern.value}if(this.form.areaForegroundColor){this.result.areaForegroundColor=this.form.areaForegroundColor.value.replace(/#/g,"FF")}if(this.form.areaBackgroundColor){this.result.areaBackgroundColor=this.form.areaBackgroundColor.value.replace(/#/g,"FF")}}if(this.form.textValue){this.result.textValue=this.form.textValue.value}if(this.form.textFont){this.result.textFont=this.form.textFont.value}if(this.form.textSize){this.result.textSize=parseFloat(this.form.textSize.value)}if(this.form.textUnit){this.result.textUnit=this.form.textUnit.value}if(this.form.textFormat){this.result.textFormat=this.form.textFormat.value}if(this.form.textRotation){this.result.textRotation=this.form.textRotation.value}if(this.form.textColor){this.result.textColor=this.form.textColor.value.replace(/#/g,"FF")}if(this.form.textBackgroundColor){this.result.textBackgroundColor=this.form.textBackgroundColor.value.replace(/#/g,"FF")}if(this.form.textBackgroundStyle){this.result.textBackgroundStyle=this.form.textBackgroundStyle.value}if(this.form.symbolType){this.result.symbolType=this.form.symbolType.value}if(this.form.symbolWidth){this.result.symbolWidth=parseFloat(this.form.symbolWidth.value)}if(this.form.symbolHeight){this.result.symbolHeight=parseFloat(this.form.symbolHeight.value)}if(this.form.symbolUnit){this.result.symbolUnit=this.form.symbolUnit.value}if(this.form.symbolRotation){this.result.symbolRotation=parseFloat(this.form.symbolRotation.value)}if(this.form.symbolColor){this.result.symbolColor=this.form.symbolColor.value.replace(/#/g,"FF")}return(this.error=="")?true:false},_getDigitizePointXml:function(b){if(!this.active){return false}var c="";if(b.length>0){for(var a=0;a<b.length;a++){c+="\t<Point>\n";c+="\t\t<X>"+b[a].x+"</X>\n";c+="\t\t<Y>"+b[a].y+"</Y>\n";c+="\t</Point>\n"}}return c},_getDigitizeXml:function(){if(!this.active){return false}var b="";b='<?xml version="1.0" encoding="UTF-8"?>\n';b+="<DigitizeSet>\n";b+="\t<GeometryType>"+this.digitizeType+"</GeometryType>\n";switch(this.digitizeType){case"text":if(this.result.sizeContext){b+="\t<SizeContext>"+this.result.sizeContext+"</SizeContext>\n"}if(this.result.textValue){b+="\t<TextValue>"+TBView.Util.UTF8.encode(this.result.textValue)+"</TextValue>\n"}if(this.result.textFont){b+="\t<TextFont>"+this.result.textFont+"</TextFont>\n"}if(this.result.textSize){b+="\t<TextSize>"+this.result.textSize+"</TextSize>\n"}if(this.result.textUnit){b+="\t<TextUnit>"+this.result.textUnit+"</TextUnit>\n"}if(this.result.textFormat){b+="\t<TextFormat>"+this.result.textFormat+"</TextFormat>\n"}if(this.result.textRotation){b+="\t<TextRotation>"+this.result.textRotation+"</TextRotation>\n"}if(this.result.textColor){b+="\t<TextColor>"+this.result.textColor+"</TextColor>\n"}if(this.result.textBackgroundColor){b+="\t<TextBackgroundColor>"+this.result.textBackgroundColor+"</TextBackgroundColor>\n"}if(this.result.textBackgroundStyle){b+="\t<TextBackgroundStyle>"+this.result.textBackgroundStyle+"</TextBackgroundStyle>\n"}var c=this.control.handler.getGeometry();if(c){b+=this._getDigitizePointXml(c.getVertices())}break;case"line":if(this.result.sizeContext){b+="\t<SizeContext>"+this.result.sizeContext+"</SizeContext>\n"}if(this.result.lineThickness){b+="\t<LineThickness>"+this.result.lineThickness+"</LineThickness>\n"}if(this.result.linePattern){b+="\t<LineUnit>"+this.result.lineUnit+"</LineUnit>\n"}if(this.result.linePattern){b+="\t<LinePattern>"+this.result.linePattern+"</LinePattern>\n"}if(this.result.lineColor){b+="\t<LineColor>"+this.result.lineColor+"</LineColor>\n"}var c=this.control.handler.getGeometry();if(c){b+=this._getDigitizePointXml(c.getVertices())}break;case"rectangle":if(this.result.sizeContext){b+="\t<SizeContext>"+this.result.sizeContext+"</SizeContext>\n"}if(this.result.lineThickness){b+="\t<LineThickness>"+this.result.lineThickness+"</LineThickness>\n"}if(this.result.lineUnit){b+="\t<LineUnit>"+this.result.lineUnit+"</LineUnit>\n"}if(this.result.linePattern){b+="\t<LinePattern>"+this.result.linePattern+"</LinePattern>\n"}if(this.result.lineColor){b+="\t<LineColor>"+this.result.lineColor+"</LineColor>\n"}if(this.result.areaPattern){b+="\t<AreaPattern>"+this.result.areaPattern+"</AreaPattern>\n"}if(this.result.areaForegroundColor){b+="\t<AreaForegroundColor>"+this.result.areaForegroundColor+"</AreaForegroundColor>\n"}if(this.result.areaBackgroundColor){b+="\t<AreaBackgroundColor>"+this.result.areaBackgroundColor+"</AreaBackgroundColor>\n"}var c=this.control.handler.feature.geometry;if(c){b+=this._getDigitizePointXml(c.getVertices())}break;case"circle":if(this.result.sizeContext){b+="\t<SizeContext>"+this.result.sizeContext+"</SizeContext>\n"}if(this.result.lineThickness){b+="\t<LineThickness>"+this.result.lineThickness+"</LineThickness>\n"}if(this.result.linePattern){b+="\t<LineUnit>"+this.result.lineUnit+"</LineUnit>\n"}if(this.result.linePattern){b+="\t<LinePattern>"+this.result.linePattern+"</LinePattern>\n"}if(this.result.lineColor){b+="\t<LineColor>"+this.result.lineColor+"</LineColor>\n"}if(this.result.areaPattern){b+="\t<AreaPattern>"+this.result.areaPattern+"</AreaPattern>\n"}if(this.result.areaForegroundColor){b+="\t<AreaForegroundColor>"+this.result.areaForegroundColor+"</AreaForegroundColor>\n"}if(this.result.areaBackgroundColor){b+="\t<AreaBackgroundColor>"+this.result.areaBackgroundColor+"</AreaBackgroundColor>\n"}var a=new Array();a[0]=this.control.handler.origin;b+=this._getDigitizePointXml(a);b+="\t<Radius>"+this.control.handler.radius+"</Radius>\n";this.control.handler.origin=null;this.control.handler.radius=this.control.handler.options.radius;break;case"area":if(this.result.sizeContext){b+="\t<SizeContext>"+this.result.sizeContext+"</SizeContext>\n"}if(this.result.lineThickness){b+="\t<LineThickness>"+this.result.lineThickness+"</LineThickness>\n"}if(this.result.linePattern){b+="\t<LineUnit>"+this.result.lineUnit+"</LineUnit>\n"}if(this.result.linePattern){b+="\t<LinePattern>"+this.result.linePattern+"</LinePattern>\n"}if(this.result.lineColor){b+="\t<LineColor>"+this.result.lineColor+"</LineColor>\n"}if(this.result.areaPattern){b+="\t<AreaPattern>"+this.result.areaPattern+"</AreaPattern>\n"}if(this.result.areaForegroundColor){b+="\t<AreaForegroundColor>"+this.result.areaForegroundColor+"</AreaForegroundColor>\n"}if(this.result.areaBackgroundColor){b+="\t<AreaBackgroundColor>"+this.result.areaBackgroundColor+"</AreaBackgroundColor>\n"}var c=this.control.handler.getGeometry();if(c){b+=this._getDigitizePointXml(c.getVertices())}break;case"symbol":if(this.result.sizeContext){b+="\t<SizeContext>"+this.result.sizeContext+"</SizeContext>\n"}if(this.result.symbolType){b+="\t<SymbolType>"+this.result.symbolType+"</SymbolType>\n"}if(this.result.symbolWidth){b+="\t<SymbolWidth>"+this.result.symbolWidth+"</SymbolWidth>\n"}if(this.result.symbolHeight){b+="\t<SymbolHeight>"+this.result.symbolHeight+"</SymbolHeight>\n"}if(this.result.symbolUnit){b+="\t<SymbolUnit>"+this.result.symbolUnit+"</SymbolUnit>\n"}if(this.result.symbolRotation){b+="\t<SymbolRotation>"+this.result.symbolRotation+"</SymbolRotation>\n"}if(this.result.symbolColor){b+="\t<SymbolColor>"+this.result.symbolColor+"</SymbolColor>\n"}var c=this.control.handler.getGeometry();if(c){b+=this._getDigitizePointXml(c.getVertices())}break}b+="</DigitizeSet>\n";return b},CLASS_NAME:"TBView.Formular.Redlining"};TBView.Formular.Dimensioning={initialized:false,active:false,form:null,map:null,dimensioningType:"",lastDimensioningType:null,controlLine:null,controlPoint:null,error:"",result:{},initialize:function(b,a){if(this.active){this.deactivate()}this.form=TBView.Util.GetForm(b);this.map=TBView.Map.getMap();this.dimensioningType=(this.form.dimensioningType)?this.form.dimensioningType.value:"";if(!this.initialized&&a&&a!=""){TBView.Boxes.addBoxTriggerClose(a,function(){TBView.Formular.Dimensioning.destroy()})}TBView.Legend.updateTemporaryDigitizeLayers();this.initialized=true},activate:function(){if(this.active){return false}this.result={};if(!this._checkFormValues()){alert(this.error);return false}if(this.dimensioningType!=this.lastDimensioningType&&this.controlLine){this.controlLine.destroy();this.map.removeControl(this.controlLine);delete this.controlLine;this.controlLine=null}if(this.dimensioningType!=this.lastDimensioningType&&this.controlPoint){this.controlPoint.destroy();this.map.removeControl(this.controlPoint);delete this.controlPoint;this.controlLine=null}if(!this.controlLine){var d=OpenLayers.Function.bind(this.doneLine,this);var e=OpenLayers.Function.bind(this.deactivate,this);this.controlLine=new TBView.Map.Controls.Feature(OpenLayers.Handler.Path,{handlerOptions:{},style:OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],TBView.Map.SketchSymbolizers.Dimensioning),triggerDone:d,triggerCancel:e,maxPoints:2,deactivateHandler:false,destroyHandler:false,type:this.dimensioningType});this.map.addControl(this.controlLine)}if(!this.controlPoint){var b=(this.dimensioningType=="standard")?true:false;var d=OpenLayers.Function.bind(this.donePoint,this);var e=OpenLayers.Function.bind(this.deactivate,this);this.controlPoint=new TBView.Map.Controls.Feature(OpenLayers.Handler.Point,{handlerOptions:{},style:OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],TBView.Map.SketchSymbolizers.Dimensioning),triggerDone:d,triggerCancel:e,deactivateHandler:b,type:this.dimensioningType});this.map.addControl(this.controlPoint)}this.controlLine.handler.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],TBView.Map.SketchSymbolizers.Dimensioning);this.controlLine.activate();var a=TBView.Util.GetImage("TBDimensioningStart");if(a){a.style.display="none"}var c=TBView.Util.GetImage("TBDimensioningStop");if(c){c.style.display="inline"}if(this.dimensioningType=="standard"){TBView.Util.SetContent(TBView.Util.GetLayer("TBDimensioningMessages"),TBView.Locale.getText("map.dimensioning.standard.step.1"))}else{if(this.dimensioningType=="orthogonal"){TBView.Util.SetContent(TBView.Util.GetLayer("TBDimensioningMessages"),TBView.Locale.getText("map.dimensioning.orthogonal.step.1"))}}this._deactivateStyleParameters();TBView.Map.setCursor("url("+TBView.getRoot()+"layout/images/cursors/measure.cur), crosshair");this.active=true;return true},deactivate:function(){if(!this.active){return false}var a=TBView.Util.GetImage("TBDimensioningStart");if(a){a.style.display="inline"}var b=TBView.Util.GetImage("TBDimensioningStop");if(b){b.style.display="none"}TBView.Util.SetContent(TBView.Util.GetLayer("TBDimensioningMessages"),"");this._activateStyleParameters();this.result={};if(this.controlLine){this.controlLine.deactivate()}if(this.controlPoint){this.controlPoint.deactivate()}TBView.Map.initializeCursor();this.active=false;return true},destroy:function(){if(this.controlLine){this.controlLine.destroy();this.map.removeControl(this.controlLine);delete this.controlLine;this.controlLine=null}if(this.controlPoint){this.controlPoint.destroy();this.map.removeControl(this.controlPoint);delete this.controlPoint;this.controlPoint=null}delete this.form;delete this.map;delete this.result;this.form=null;this.map=null;this.dimensioningType="";this.lastDimensioningType=null;this.error="";this.result={};this.initialized=false;this.active=false;TBView.Formular.Selection.deactivate()},doneLine:function(a){if(!this.active||!this.controlLine){return false}var b=this.controlLine.handler.getGeometry();if(b){this.result.line=b.getVertices()}if(this.dimensioningType=="standard"){TBView.Util.SetContent(TBView.Util.GetLayer("TBDimensioningMessages"),TBView.Locale.getText("map.dimensioning.standard.step.2"))}else{if(this.dimensioningType=="orthogonal"){TBView.Util.SetContent(TBView.Util.GetLayer("TBDimensioningMessages"),TBView.Locale.getText("map.dimensioning.orthogonal.step.2"))}}this.controlPoint.handler.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],TBView.Map.SketchSymbolizers.Dimensioning);this.controlPoint.activate();TBView.Map.setCursor("crosshair")},donePoint:function(e){if(!this.active||!this.controlPoint){return false}var g=this.controlPoint.handler.getGeometry();if(g){this.result.points=g.getVertices()}var d=this._getDimensioningXml();var c=(this.dimensioningType=="standard")?true:false;var a={type:"actions",action:"map.dimensioning",dimensioning:d,dimensioningType:this.dimensioningType,ts:(new Date()).getTime()};var f=TBView.Util.GetParameterString(a);var b=TBView.getRoot()+"action.php?"+TBView.getSession()+"&"+f;TBView.Requests.sendCustom(b,function(h){if(!TBView.Requests.isComplete()){return}TBView.Map.refreshOverlayMap();TBView.Legend.updateTemporaryDimensioningLayers();if(c){TBView.Formular.Dimensioning.deactivate()}TBView.Requests.reset()})},clearAll:function(){var a={type:"actions",action:"map.dimensioning.clear",clear:"all",ts:(new Date()).getTime()};var c=TBView.Util.GetParameterString(a);var b=TBView.getRoot()+"action.php?"+TBView.getSession()+"&"+c;TBView.Requests.sendCustom(b,function(d){if(!TBView.Requests.isComplete()){return}TBView.Map.refreshOverlayMap();TBView.Legend.updateTemporaryDimensioningLayers();TBView.Requests.reset()})},clearSelection:function(){var a={type:"actions",action:"map.dimensioning.clear",clear:"selection",ts:(new Date()).getTime()};var c=TBView.Util.GetParameterString(a);var b=TBView.getRoot()+"action.php?"+TBView.getSession()+"&"+c;TBView.Requests.sendCustom(b,function(d){if(!TBView.Requests.isComplete()){return}TBView.Map.refreshOverlayMap();TBView.Legend.updateTemporaryDimensioningLayers();TBView.Requests.reset()})},_deactivateStyleParameters:function(){for(var a=0;a<this.form.elements.length;a++){if(this.form.elements[a].name!="dimensioningType"){this.form.elements[a].disabled=true;this.form.elements[a].lastColor=(this.form.elements[a].style.color)?this.form.elements[a].style.color:"";this.form.elements[a].style.color="#999999"}}},_activateStyleParameters:function(){for(var a=0;a<this.form.elements.length;a++){if(this.form.elements[a].name!="dimensioningType"){this.form.elements[a].disabled=false;this.form.elements[a].style.color=(this.form.elements[a].lastColor)?this.form.elements[a].lastColor:""}}},_checkFormValues:function(){if(!this.form){return false}this.error="";this.result.snapping=(this.form.elements.snapping.checked)?true:false;this.result.snappingRadius=parseInt(this.form.snappingRadius.value);this.result.linePattern=this.form.linePattern.value;this.result.lineColor=this.form.lineColor.value.replace(/#/g,"FF");this.result.textFont=this.form.textFont.value;this.result.textSize=parseFloat(this.form.textSize.value);if(isNaN(this.result.textSize)||this.result.textSize<=0||this.result.textSize>999999){this.error=TBView.Locale.getText("map.dimensioning.text.error.size.not.valid")}this.result.textColor=this.form.textColor.value.replace(/#/g,"FF");return(this.error=="")?true:false},_getDimensioningPointsXml:function(c,a){if(!this.active){return false}var d="";if(c.length>0){for(var b=0;b<c.length;b++){d+="\t<Point>\n";d+="\t\t<X>"+c[b].x+"</X>\n";d+="\t\t<Y>"+c[b].y+"</Y>\n";if(a){d+="\t\t<SnapRadius>"+a+"</SnapRadius>\n"}d+="\t</Point>\n"}}return d},_getDimensioningXml:function(){if(!this.active){return false}if(!this.controlLine&&!this.controlPoint){return}var a='<?xml version="1.0" encoding="UTF-8"?>\n';a+="<DimensioningSet>\n";a+="\t<DimensioningType>"+this.dimensioningType+"</DimensioningType>\n";a+="\t<Snapping>"+this.result.snapping+"</Snapping>\n";if(this.result.textFont){a+="\t<TextFont>"+this.result.textFont+"</TextFont>\n"}if(this.result.textSize){a+="\t<TextSize>"+this.result.textSize+"</TextSize>\n"}if(this.result.textColor){a+="\t<TextColor>"+this.result.textColor+"</TextColor>\n"}if(this.result.linePattern){a+="\t<LinePattern>"+this.result.linePattern+"</LinePattern>\n"}if(this.result.lineColor){a+="\t<LineColor>"+this.result.lineColor+"</LineColor>\n"}if(this.result.line){a+="\t<Line>\n";a+=this._getDimensioningPointsXml(this.result.line,this.result.snappingRadius);a+="\t</Line>\n"}if(this.result.points){a+=this._getDimensioningPointsXml(this.result.points)}a+="</DimensioningSet>\n";return a},CLASS_NAME:"TBView.Formular.Dimensioning"};TBView.Formular.Selection={initialized:false,active:false,form:null,map:null,selectionType:"",lastSelectionType:null,layerNames:"",checkLegend:false,control:null,tolerance:0.3,initialize:function(b,a){this.form=TBView.Util.GetForm(b);this.map=TBView.Map.getMap();if(!this.initialized&&a&&a!=""){TBView.Boxes.addBoxTriggerClose(a,function(){TBView.Formular.Selection.destroy()})}this.initialized=true},activate:function(e,f,b,g){if(!this.map){this.map=TBView.Map.getMap()}TBView.Formular.Redlining.deactivate();TBView.Formular.Dimensioning.deactivate();this.selectionType=e.toLowerCase();this.layerNames=(f)?f:null;this.checkLegend=(g)?g:false;TBView.Selection.setTriggerDone(b);var h="";var i=null;var d={sides:"",snapAngle:0};if(this.selectionType=="point"){i=OpenLayers.Handler.Point;h="crosshair"}else{if(this.selectionType=="line"){i=OpenLayers.Handler.Path;h="url("+TBView.getRoot()+"layout/images/cursors/linestring.cur), crosshair"}else{if(this.selectionType=="circle"){i=OpenLayers.Handler.RegularPolygon;d.sides=80;d.finalize=function(){};h="url("+TBView.getRoot()+"layout/images/cursors/circle.cur), crosshair"}else{if(this.selectionType=="polygon"){i=OpenLayers.Handler.Polygon;d.sides="";h="url("+TBView.getRoot()+"layout/images/cursors/polygon.cur), crosshair"}else{return false}}}}if(this.selectionType!=this.lastSelectionType&&this.control){this.control.destroy();this.map.removeControl(this.control);delete this.control;this.control=null}if(!this.control){var a=OpenLayers.Function.bind(this.done,this);var c=OpenLayers.Function.bind(this.deactivate,this);this.control=new TBView.Map.Controls.Feature(i,{handlerOptions:d,style:OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],TBView.Map.SketchSymbolizers.Selection),triggerDone:a,triggerCancel:c,type:this.selectionType});this.map.addControl(this.control)}this.control.handler.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],TBView.Map.SketchSymbolizers.Selection);this.control.activate();TBView.Map.setCursor(h);this.active=true;return true},deactivate:function(){if(this.control){this.control.deactivate()}TBView.Map.initializeCursor();delete trigger;this.trigger=null;this.triggerTimeout=null;this.layerNames=null;this.active=false;return true},destroy:function(){if(this.control){this.control.destroy();this.map.removeControl(this.control);delete this.control;this.control=null}delete this.form;delete this.map;delete trigger;this.form=null;this.map=null;this.trigger=null;this.triggerTimeout=null;this.selectionType="";this.lastSelectionType=null;this.layerNames=null;this.initialized=false;this.active=false},done:function(b){if(!this.active||!this.control){return false}var h="";switch(this.selectionType){case"point":var j=this.control.handler.getGeometry();var d=new OpenLayers.LonLat(j.x-this.tolerance,j.y-this.tolerance);var g=new OpenLayers.LonLat(j.x+this.tolerance,j.y+this.tolerance);h="POLYGON(("+d.lon+" "+d.lat+", "+d.lon+" "+g.lat+", "+g.lon+" "+g.lat+", "+g.lon+" "+d.lat+", "+d.lon+" "+d.lat+"))";break;case"line":h=this.control.handler.getGeometry();break;case"circle":h=this.control.handler.feature.geometry;break;case"polygon":h=this.control.handler.getGeometry();break}var e=null;if(this.layerNames&&this.checkLegend&&TBView.Legend){var i=this.layerNames.split(",");var a=TBView.Legend.getSelectableLayers();e=[];for(var k=0;k<a.length;k++){for(var f=0;f<i.length;f++){if(a[k]==i[f]){e.push(i[f])}}}e=e.join(",")}else{if(this.layerNames){e=this.layerNames}}TBView.Selection.doSelection(h,true,99,true,e);TBView.Map.initializeCursor();return true},clear:function(a){TBView.Selection.setTriggerDone(a);if(TBView.Selection.clearSelections){TBView.Selection.clearSelections()}},CLASS_NAME:"TBView.Formular.Selection"};TBView.Formular.LandRegister={initialized:false,form:null,resultBox:null,initialize:function(b,a){if(!this.initialized&&a&&a!=""){TBView.Boxes.addBoxTriggerClose(a,function(){TBView.Formular.LandRegister.destroy()})}this.initialized=true},destroy:function(){if(this.resultBox){TBView.Util.SetContent(this.resultBox,"")}delete this.form;delete this.resultBox;this.form=null;this.resultBox=null;if(TBView.Requests.isBusy()){TBView.Requests.reset()}this.initialized=false;TBView.Formular.Selection.deactivate()},search:function(d,a,c,b){this.form=TBView.Util.GetForm(d);this.resultBox=TBView.Util.GetLayer(a);if(!this.form||!this.resultBox){return}if(TBView.Requests.isBusy()){TBView.Requests.reset()}this.resultBox=TBView.Util.GetLayer(a);if(!this.resultBox){return}if(!TBView.Util.isVisible(this.resultBox)){TBView.Switch.SwitchLayer(this.resultBox,1)}TBView.send(this.resultBox.id,"actions","action="+c+TBView.Util.GetQueryGlue(b),this.form.name);TBView.LOADING=true},loadResults:function(a,b){this.resultBox=TBView.Util.GetLayer(a);if(!this.resultBox){return}if(!TBView.Util.isVisible(this.resultBox)){TBView.Switch.SwitchLayer(this.resultBox,1)}TBView.LOADING=false;TBView.load(this.resultBox.id,"actions",b);TBView.LOADING=true},CLASS_NAME:"TBView.Formular.LandRegister"};TBView.Formular.InvokeReport={initialized:false,form:null,openedReports:[],initialize:function(b,a){if(!this.initialized&&a&&a!=""){TBView.Boxes.addBoxTriggerClose(a,function(){TBView.Formular.InvokeReport.destroy()})}this.initialized=true},destroy:function(){delete this.form;this.form=null;if(this.openedReports){for(var a=0;a<this.openedReports.length;a++){if(this.openedReports[a]&&!this.openedReports[a].closed){this.openedReports[a].close()}}}this.initialized=false;TBView.Formular.Selection.deactivate()},openReport:function(a,c,d){if(!TBView.Selection.hasSelections()){return false}var b=TBView.getRoot()+"services/invokereport.php?"+TBView.getSession()+"&ident="+a;var d=(d)?d:"";var c=(c&&c==true)?"yes":"no";var g=window.open(b,d,"dependent=yes,toolbar="+c+",location="+c+",menubar="+c+",directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=800,height=600");try{if(g){g.focus()}}catch(f){}try{if(g){this.openedReports.push(g)}}catch(f){}},CLASS_NAME:"TBView.Formular.InvokeReport"};TBView.Formular.MultipleSelection={initialized:false,form:null,initialize:function(b,a){if(!this.initialized&&a&&a!=""){TBView.Boxes.addBoxTriggerClose(a,function(){TBView.Formular.MultipleSelection.destroy()})}this.initialized=true},destroy:function(){delete this.form;this.form=null;this.initialized=false;TBView.Formular.Selection.deactivate()},CLASS_NAME:"TBView.Formular.MultipleSelection"};TBView.Formular.Dialog={initialized:false,marginTop:20,marginLeft:20,marginBottom:20,form:null,resultBox:null,openedDialogs:[],initialize:function(b,a){if(!this.initialized&&a&&a!=""){TBView.Boxes.addBoxTriggerClose(a,function(){TBView.Formular.Dialog.destroy()})}this.initialized=true},initializeContentSize:function(g){var l=(TBView.Client.isNS4())?g.document.layers.FixedHeader:g.document.getElementById("FixedHeader");var d=(TBView.Client.isNS4())?g.document.layers.FixedFooter:g.document.getElementById("FixedFooter");var h=(TBView.Client.isNS4())?g.document.layers.FixedContent:g.document.getElementById("FixedContent");if(l){var e=TBView.Util.GetHeight(l);TBView.Util.SetStyle(h,"marginTop",(e-this.marginTop)+"px")}if(d){var j=TBView.Util.GetHeight(d);TBView.Util.SetStyle(h,"marginBottom",(j-this.marginBottom)+"px")}if(h){var k=0;for(var i=0;i<h.childNodes.length;i++){var b=h.childNodes[i];var f=parseInt(b.offsetTop);var a=parseInt(b.offsetHeight);if((f+a)>k){k=f+a}}TBView.Util.SetStyle(h,"height",(k)+"px")}},deactivate:function(){if(TBView.Requests.isBusy()){TBView.Requests.reset()}TBView.Formular.Selection.deactivate()},destroy:function(){if(this.resultBox){TBView.Util.SetContent(this.resultBox,"")}delete this.form;delete this.resultBox;this.form=null;this.resultBox=null;if(this.openedDialogs){for(var a=0;a<this.openedDialogs.length;a++){if(this.openedDialogs[a]&&!this.openedDialogs[a].closed){this.openedDialogs[a].close()}}}if(TBView.Requests.isBusy()){TBView.Requests.reset()}this.initialized=false;TBView.Formular.Selection.deactivate()},openDialogsBySelection:function(){if(!TBView.Selection.hasSelections()){return false}var a={type:"actions",action:"module.dialog.selection",ts:(new Date()).getTime()};var b=TBView.getRoot()+"action.php?"+TBView.getSession()+"&"+TBView.Util.GetParameterString(a);TBView.Requests.sendCustom(b,function(h){if(!TBView.Requests.isComplete()){return}var c=TBView.Requests.getXml();if(c&&c.dialogs){var g=[].concat(c.dialogs.dialog);if(g.length>0){for(var i=0;i<g.length;i++){var f=g[i];if(f){TBView.Formular.Dialog.openDialog(f.dialogpk,f.documentpk,f.name,f.width,f.height,f.left,f.top,f.objectpks)}}}}TBView.Requests.reset()})},loadResultsBySelection:function(a,b){this.resultBox=TBView.Util.GetLayer(a);if(!this.resultBox){return}if(!TBView.Util.isVisible(this.resultBox)){TBView.Switch.SwitchLayer(this.resultBox,1)}TBView.LOADING=false;TBView.load(a,"actions",b);TBView.LOADING=true},clearResults:function(a){this.resultBox=TBView.Util.GetLayer(a);if(!this.resultBox){return}TBView.Util.SetContent(this.resultBox,"")},openDialog:function(b,g,s,m,l,c,k,p){var j=(TBView.Util.intval(m)<1)?TBView.CONFIG_APPLICATION_DEFAULT_WIDTH:TBView.Util.intval(m);var a=(TBView.Util.intval(l)<1)?TBView.CONFIG_APPLICATION_DEFAULT_HEIGHT:TBView.Util.intval(l);var r=(TBView.Util.intval(c)<1)?0:TBView.Util.intval(c);var n=(TBView.Util.intval(k)<1)?0:TBView.Util.intval(k);var f=TBView.getRoot()+"detail.php?"+TBView.getSession()+"&type=box&action=view.dialog.form&dialogPk="+b+"&documentPk="+g+"&title="+encodeURI(s)+"&reset=all&objectPks="+p;var q=[];for(var h=0;h<this.openedDialogs.length;h++){if(this.openedDialogs[h]&&!this.openedDialogs[h].closed){q.push(this.openedDialogs[h])}}this.openedDialogs=q;for(var h=0;h<this.openedDialogs.length;h++){if(this.openedDialogs[h]&&!this.openedDialogs[h].closed&&"Dialog"+b==this.openedDialogs[h].name){try{this.openedDialogs[h].focus()}catch(o){}this.openedDialogs[h].location=f;return}}var i="no";var d=window.open(f,"Dialog"+b,"dependent=yes,toolbar="+i+",location="+i+",menubar="+i+",directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no,width="+j+",height="+a+",left="+r+",top="+n);try{if(d){d.focus()}}catch(o){}try{if(d){this.openedDialogs.push(d)}}catch(o){}},go:function(c,b){for(var a=0;a<this.openedDialogs.length;a++){if(c==this.openedDialogs[a].name){try{this.openedDialogs[a].focus()}catch(d){}this.openedDialogs[a].location=b;break}}},initializeEvents:function(c,d){if(d=="table"){c.document.onmousemove=function(j){if(!j){j=c.event}if(!c.resizeObject||c.resizeObject==null){return}TBView.Events.clearEvents(j);var k=j.clientX||j.x||j.pageX||null;var f=c.resizeObject;var i=TBView.Util.GetX(f);var h=TBView.Util.GetWidth(f);var g=k-i-c.resizeObject.dragDiffX;g=(parseInt(g)<10)?10:parseInt(g);TBView.Util.SetStyle(c.resizeObject.parentNode,"width",g+"px")};c.document.onmouseup=function(f){if(!f){f=c.event}if(c.resizeObject&&c.resizeCallback){c.resizeCallback()}try{delete c.resizeObject}catch(f){}c.resizeObject=null;try{delete c.resizeCallback}catch(f){}c.resizeCallback=null;TBView.Events.clearEvents(f)};if(c.document.images&&c.document.images["imgListColumn[0]"]){for(var b=0;c.document.images["imgListColumn["+b+"]"];b++){var a=c.document.images["imgListColumn["+b+"]"];var e=c.document.getElementById("ListColumn["+b+"]");if(a&&e){a.onmousedown=function(i){if(!i){i=c.event}TBView.Events.clearEvents(i);var f=c.document.getElementById(this.name.replace(/img/,""));var h=TBView.Util.GetX(f);var g=TBView.Util.GetWidth(f);var j=i.clientX||i.x||i.pageX||null;c.resizeObject=f;c.resizeObject.dragDiffX=j-h-g;c.resizeCallback=function(q){if(!c.document.images||!c.document.images["imgListColumn[0]"]){return}var p="";var o=[];for(var m=0;c.document.images["imgListColumn["+m+"]"];m++){var n=c.document.getElementById("ListColumn["+m+"]");p=n.getAttribute("dialogPk",0);o.push(TBView.Util.GetWidth(n))}var k={type:"actions",action:"module.dialog.columns",dialogPk:p,columnsWidth:o.join(","),ts:(new Date()).getTime()};var l=TBView.getRoot()+"action.php?"+TBView.getSession()+"&"+TBView.Util.GetParameterString(k);TBView.Requests.loadCustom(l,function(r){if(!TBView.Requests.isComplete()){return}TBView.Requests.reset()})}}}else{TBView.Util.SetStyle(a,"cursor","auto")}}}}},CLASS_NAME:"TBView.Formular.Dialog"};TBView.Formular.Favorites={active:false,initialized:false,form:null,map:null,control:null,initialize:function(a,b){if(this.active){this.deactivate()}this.form=TBView.Util.GetForm(a);this.map=TBView.Map.getMap();if(!this.initialized&&b&&b!=""){TBView.Boxes.addBoxTriggerClose(b,function(){TBView.Formular.Favorites.destroy()})}this.initialized=true},activate:function(){if(this.active){return false}var a=OpenLayers.Function.bind(this.done,this);var b=OpenLayers.Function.bind(this.cancel,this);if(!this.control){this.control=new TBView.Map.Controls.Feature(OpenLayers.Handler.Point,{handlerOptions:{},style:OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],TBView.Map.SketchSymbolizers.Selection),triggerDone:a,triggerCancel:b});this.map.addControl(this.control)}this.control.activate();TBView.Map.setCursor("crosshair");this.active=true;return true},deactivate:function(){if(!this.active){return false}if(this.control){this.control.destroy();this.map.removeControl(this.control);this.control=null;delete this.control}delete this.form;delete this.map;this.form=null;this.map=null;TBView.Map.initializeCursor();this.active=false;this.initialized=false;return true},destroy:function(){if(this.control){this.control.destroy();this.map.removeControl(this.control);delete this.control;this.control=null}TBView.Map.initializeCursor();this.initialized=false;this.active=false;return true},done:function(b){if(!this.active||!this.control){return false}try{var a=this.control.handler.getGeometry();if(a){this.form.positionX.value=parseInt(a.x);this.form.positionY.value=parseInt(a.y)}if(parseInt(this.form.scale.value)<1){this.form.scale.value=Math.round(this.map.getScale())}}catch(c){}return true},CLASS_NAME:"TBView.Formular.Favorites"};TBView.Formular.Colorpicker={bindClass:"FieldColor",binding:true,preloading:true,activePicker:null,images:{pad:[181,101],sld:[16,101],cross:[15,15],arrow:[7,11]},imgRequired:{},imgLoaded:{},initialize:function(){if(this.binding){this.bind()}if(this.preloading){this.preload()}},bind:function(){var a=document.getElementsByTagName("input");for(var b=0;b<a.length;b++){if(!a[b].picker&&a[b].className==this.bindClass){a[b].picker=new TBView.Formular.Colorpicker.Picker(a[b])}}},preload:function(){for(var a in this.imgRequired){this.loadImage(a)}},requireImage:function(a){this.imgRequired[a]=true},loadImage:function(a){if(!this.imgLoaded[a]){this.imgLoaded[a]=new Image();this.imgLoaded[a].src=TBView.getRoot()+"layout/images/colorpicker/"+a}},getElementPos:function(c){var d=c,b=c;var a=0,f=0;if(d.offsetParent){do{a+=d.offsetLeft;f+=d.offsetTop}while(d=d.offsetParent)}while((b=b.parentNode)&&b.nodeName!="BODY"){a-=b.scrollLeft;f-=b.scrollTop}return[a,f]},getElementSize:function(a){return[a.offsetWidth,a.offsetHeight]},getMousePos:function(a){if(!a){a=window.event}if(typeof a.pageX=="number"){return[a.pageX,a.pageY]}else{if(typeof a.clientX=="number"){return[a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,a.clientY+document.body.scrollTop+document.documentElement.scrollTop]}}},getViewPos:function(){if(typeof window.pageYOffset=="number"){return[window.pageXOffset,window.pageYOffset]}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){return[document.body.scrollLeft,document.body.scrollTop]}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){return[document.documentElement.scrollLeft,document.documentElement.scrollTop]}else{return[0,0]}}}},getViewSize:function(){if(typeof window.innerWidth=="number"){return[window.innerWidth,window.innerHeight]}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){return[document.body.clientWidth,document.body.clientHeight]}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){return[document.documentElement.clientWidth,document.documentElement.clientHeight]}else{return[0,0]}}}},CLASS_NAME:"TBView.Formular.Colorpicker"};TBView.Formular.Colorpicker.Picker={};TBView.Formular.Colorpicker.Picker=TBView.Class({modeId:0,mode:"HSV",displayOnFocus:true,required:true,adjust:true,hash:true,caps:true,hsv:[0,0,1],rgb:[1,1,1],colorElement:null,containerElement:null,withBlurTimer:true,blurTimerId:null,blurTimer:500,holdPad:false,holdSlider:false,posPad:0,posSlider:0,leaveValue:1<<0,leaveStyle:1<<1,leavePad:1<<2,leaveSlide:1<<3,pickerStyle:{position:"bottom",face:10,faceColor:"ThreeDFace",border:1,borderColor:"ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight",inset:1,insetColor:"ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow",zIndex:10000},initialize:function(b){this.colorElement=b;this.modeID=(this.mode.toLowerCase()=="hvs")?1:0;if(this.colorElement){var a=this;TBView.Events.addEvent(this.colorElement,"focus",function(){if(a.displayOnFocus){a.show()}});TBView.Events.addEvent(this.colorElement,"blur",function(){if(a.withBlurTimer){a.blurTimerId=setTimeout(function(){a.hide()},a.blurTimer)}else{a.hide();a.withBlurTimer=true}});TBView.Events.addEvent(this.colorElement,"mouseout",function(){try{if(a.colorElement&&a.colorElement.blur){a.colorElement.blur()}}catch(c){}});TBView.Events.addEvent(this.colorElement,"keyup",function(){a.update()});TBView.Events.addEvent(this.colorElement,"input",function(){a.update()});this.colorElement.setAttribute("autocomplete","off")}TBView.Formular.Colorpicker.requireImage("hs.png");TBView.Formular.Colorpicker.requireImage("hv.png");TBView.Formular.Colorpicker.requireImage("cross.gif");TBView.Formular.Colorpicker.requireImage("arrow.gif");this.importColor()},update:function(){this.importColorFromString(this.colorElement.value,this.leaveValue)},hide:function(){try{document.getElementsByTagName("body")[0].removeChild(this.containerElement.boxB)}catch(a){}delete TBView.Formular.Colorpicker.activePicker},cancelBlur:function(){window.clearTimeout(this.blurTimerId);this.blurTimerId=null;this.withBlurTimer=true},show:function(){this.cancelBlur();if(TBView.Formular.Colorpicker.activePicker==this){return}var k=TBView.Formular.Colorpicker.getElementPos(this.colorElement);var h=TBView.Formular.Colorpicker.getElementSize(this.colorElement);var e=TBView.Formular.Colorpicker.getViewPos();var n=TBView.Formular.Colorpicker.getViewSize();var d=[2*this.pickerStyle.border+4*this.pickerStyle.inset+2*this.pickerStyle.face+TBView.Formular.Colorpicker.images.pad[0]+2*TBView.Formular.Colorpicker.images.arrow[0]+TBView.Formular.Colorpicker.images.sld[0],2*this.pickerStyle.border+2*this.pickerStyle.inset+2*this.pickerStyle.face+TBView.Formular.Colorpicker.images.pad[1]];var m,j,i;switch(this.pickerStyle.position.toLowerCase()){case"left":m=1;j=0;i=-1;break;case"right":m=1;j=0;i=1;break;case"top":m=0;j=1;i=-1;break;default:m=0;j=1;i=1;break}var g=(h[j]+d[j])/2;var f=[-e[m]+k[m]+d[m]>n[m]?(-e[m]+k[m]+h[m]/2>n[m]/2&&k[m]+h[m]-d[m]>=0?k[m]+h[m]-d[m]:k[m]):k[m],-e[j]+k[j]+h[j]+d[j]-g+g*i>n[j]?(-e[j]+k[j]+h[j]/2>n[j]/2&&k[j]+h[j]-g-g*i>=0?k[j]+h[j]-g-g*i:k[j]+h[j]-g+g*i):(k[j]+h[j]-g+g*i>=0?k[j]+h[j]-g+g*i:k[j]+h[j]-g-g*i)];this.draw(f[m],f[j])},draw:function(a,h){if(!this.containerElement){this.containerElement={box:document.createElement("div"),boxB:document.createElement("div"),pad:document.createElement("div"),padB:document.createElement("div"),padM:document.createElement("div"),sld:document.createElement("div"),sldB:document.createElement("div"),sldM:document.createElement("div")};for(var d=0,g=4;d<TBView.Formular.Colorpicker.images.sld[1];d+=g){var b=document.createElement("div");b.style.height=g+"px";b.style.fontSize="1px";b.style.lineHeight="0";this.containerElement.sld.appendChild(b)}this.containerElement.sldB.appendChild(this.containerElement.sld);this.containerElement.box.appendChild(this.containerElement.sldB);this.containerElement.box.appendChild(this.containerElement.sldM);this.containerElement.padB.appendChild(this.containerElement.pad);this.containerElement.box.appendChild(this.containerElement.padB);this.containerElement.box.appendChild(this.containerElement.padM);this.containerElement.boxB.appendChild(this.containerElement.box)}this.posPad=[a+this.pickerStyle.border+this.pickerStyle.face+this.pickerStyle.inset,h+this.pickerStyle.border+this.pickerStyle.face+this.pickerStyle.inset];this.posSlider=[null,h+this.pickerStyle.border+this.pickerStyle.face+this.pickerStyle.inset];var f=this;this.containerElement.boxB.onmousemove=function(i){f.colorElement.focus()};this.containerElement.boxB.onmouseout=function(){f.withBlurTimer=true;f.colorElement.blur()};this.containerElement.box.onmouseup=function(){f.holdPad=false;f.holdSlider=false};this.containerElement.box.onmouseout=function(){};this.containerElement.box.onmouseover=function(){f.cancelBlur()};this.containerElement.box.onmousedown=function(){};this.containerElement.box.onmousemove=function(i){if(f.holdPad){f.setPad(i)}if(f.holdSlider){f.setSlider(i)}};this.containerElement.padM.onmouseup=function(){};this.containerElement.padM.onmouseout=function(){f.holdPad=false};this.containerElement.padM.onmousedown=function(i){f.holdPad=true;f.setPad(i)};this.containerElement.padM.onclick=function(i){f.holdPad=false;f.setPad(i)};this.containerElement.sldM.onmouseup=function(){};this.containerElement.sldM.onmouseout=function(){};this.containerElement.sldM.onmousedown=function(i){f.holdSlider=true;f.setSlider(i)};this.containerElement.sldM.onclick=function(i){f.holdSlider=false;f.setSlider(i)};this.containerElement.box.style.width=4*this.pickerStyle.inset+2*this.pickerStyle.face+TBView.Formular.Colorpicker.images.pad[0]+2*TBView.Formular.Colorpicker.images.arrow[0]+TBView.Formular.Colorpicker.images.sld[0]+"px";this.containerElement.box.style.height=2*this.pickerStyle.inset+2*this.pickerStyle.face+TBView.Formular.Colorpicker.images.pad[1]+"px";this.containerElement.boxB.style.position="absolute";this.containerElement.boxB.style.clear="both";this.containerElement.boxB.style.left=a+"px";this.containerElement.boxB.style.top=h+"px";this.containerElement.boxB.style.zIndex=this.pickerStyle.zIndex;this.containerElement.boxB.style.border=this.pickerStyle.border+"px solid";this.containerElement.boxB.style.borderColor=this.pickerStyle.borderColor;this.containerElement.boxB.style.background=this.pickerStyle.faceColor;this.containerElement.pad.style.width=TBView.Formular.Colorpicker.images.pad[0]+"px";this.containerElement.pad.style.height=TBView.Formular.Colorpicker.images.pad[1]+"px";this.containerElement.padB.style.position="absolute";this.containerElement.padB.style.left=this.pickerStyle.face+"px";this.containerElement.padB.style.top=this.pickerStyle.face+"px";this.containerElement.padB.style.border=this.pickerStyle.inset+"px solid";this.containerElement.padB.style.borderColor=this.pickerStyle.insetColor;this.containerElement.padM.style.position="absolute";this.containerElement.padM.style.left="0";this.containerElement.padM.style.top="0";this.containerElement.padM.style.width=this.pickerStyle.face+2*this.pickerStyle.inset+TBView.Formular.Colorpicker.images.pad[0]+TBView.Formular.Colorpicker.images.arrow[0]+"px";this.containerElement.padM.style.height=this.containerElement.box.style.height;this.containerElement.padM.style.cursor="crosshair";this.containerElement.sld.style.overflow="hidden";this.containerElement.sld.style.width=TBView.Formular.Colorpicker.images.sld[0]+"px";this.containerElement.sld.style.height=TBView.Formular.Colorpicker.images.sld[1]+"px";this.containerElement.sldB.style.position="absolute";this.containerElement.sldB.style.right=this.pickerStyle.face+"px";this.containerElement.sldB.style.top=this.pickerStyle.face+"px";this.containerElement.sldB.style.border=this.pickerStyle.inset+"px solid";this.containerElement.sldB.style.borderColor=this.pickerStyle.insetColor;this.containerElement.sldM.style.position="absolute";this.containerElement.sldM.style.right="0";this.containerElement.sldM.style.top="0";this.containerElement.sldM.style.width=TBView.Formular.Colorpicker.images.sld[0]+TBView.Formular.Colorpicker.images.arrow[0]+this.pickerStyle.face+2*this.pickerStyle.inset+"px";this.containerElement.sldM.style.height=this.containerElement.box.style.height;try{this.containerElement.sldM.style.cursor="pointer"}catch(c){this.containerElement.sldM.style.cursor="hand"}switch(this.modeID){case 0:var e="hs.png";break;case 1:var e="hv.png";break}this.containerElement.padM.style.background="url('"+TBView.getRoot()+"layout/images/colorpicker/cross.gif') no-repeat";this.containerElement.sldM.style.background="url('"+TBView.getRoot()+"layout/images/colorpicker/arrow.gif') no-repeat";this.containerElement.pad.style.background="url('"+TBView.getRoot()+"layout/images/colorpicker/"+e+"') 0 0 no-repeat";this.redrawPad();this.redrawSlider();TBView.Formular.Colorpicker.activePicker=this;document.getElementsByTagName("body")[0].appendChild(this.containerElement.boxB)},importColor:function(){if(!this.colorElement){this.exportColor()}else{if(!this.adjust){if(!this.importColorFromString(this.colorElement.value,this.leaveValue)){this.exportColor(this.leaveValue|this.leaveStyle)}}else{if(!this.required&&/^\s*$/.test(this.colorElement.value)){this.colorElement.value="";this.exportColor(this.leaveValue|this.leaveStyle)}else{if(this.importColorFromString(this.colorElement.value)){}else{this.exportColor()}}}}},exportColor:function(a){if(!(a&this.leaveValue)){var b=this.getColorToString();if(this.caps){b=b.toUpperCase()}if(this.hash){b="#"+b}this.colorElement.value=b}if(!(a&this.leaveStyle)){this.colorElement.style.backgroundColor="#"+this.getColorToString();this.colorElement.style.color=(0.213*this.rgb[0]+0.715*this.rgb[1]+0.072*this.rgb[2]<0.5)?"#FFF":"#000"}if(!(a&this.leavePad)){this.redrawPad()}if(!(a&this.leaveSlider)){this.redrawSlider()}},exportColorFromHsv:function(d,c,b,a){d<0&&(d=0)||d>6&&(d=6);c<0&&(c=0)||c>1&&(c=1);b<0&&(b=0)||b>1&&(b=1);this.rgb=this.getHsvToRgb(d==null?this.hsv[0]:(this.hsv[0]=d),c==null?this.hsv[1]:(this.hsv[1]=c),b==null?this.hsv[2]:(this.hsv[2]=b));this.exportColor(a)},exportColorFromRgb:function(f,e,a,c){f<0&&(f=0)||f>1&&(f=1);e<0&&(e=0)||e>1&&(e=1);a<0&&(a=0)||a>1&&(a=1);var d=this.getRgbToHsv((f==null)?this.rgb[0]:(this.rgb[0]=f),(e==null)?this.rgb[1]:(this.rgb[1]=e),(a==null)?this.rgb[2]:(this.rgb[2]=a));if(d[0]!=null){this.hsv[0]=d[0]}if(d[2]!=0){this.hsv[1]=d[1]}this.hsv[2]=d[2];this.exportColor(c)},importColorFromString:function(c,b){var a=c.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i);if(!a){return false}else{if(a[1].length==6){this.exportColorFromRgb(parseInt(a[1].substr(0,2),16)/255,parseInt(a[1].substr(2,2),16)/255,parseInt(a[1].substr(4,2),16)/255,b)}else{this.exportColorFromRgb(parseInt(a[1].charAt(0)+a[1].charAt(0),16)/255,parseInt(a[1].charAt(1)+a[1].charAt(1),16)/255,parseInt(a[1].charAt(2)+a[1].charAt(2),16)/255,b)}return true}},getColorToString:function(){return((256|Math.round(255*this.rgb[0])).toString(16).substr(1)+(256|Math.round(255*this.rgb[1])).toString(16).substr(1)+(256|Math.round(255*this.rgb[2])).toString(16).substr(1))},getRgbToHsv:function(i,f,c){var j=Math.min(Math.min(i,f),c);var d=Math.max(Math.max(i,f),c);var a=d-j;if(a==0){return[null,0,d]}var e=i==j?3+(c-f)/a:(f==j?5+(i-c)/a:1+(f-i)/a);return[e==6?0:e,a/d,d]},getHsvToRgb:function(e,d,b){if(e==null){return[b,b,b]}var c=Math.floor(e);var g=c%2?e-c:1-(e-c);var a=b*(1-d);var j=b*(1-d*g);switch(c){case 6:case 0:return[b,j,a];case 1:return[j,b,a];case 2:return[a,b,j];case 3:return[a,j,b];case 4:return[j,a,b];case 5:return[b,a,j]}},redrawPad:function(){switch(this.modeID){case 0:var g=1;break;case 1:var g=2;break;default:return}var l=Math.round((this.hsv[0]/6)*(TBView.Formular.Colorpicker.images.pad[0]-1));var k=Math.round((1-this.hsv[g])*(TBView.Formular.Colorpicker.images.pad[1]-1));l=this.pickerStyle.face+this.pickerStyle.inset+l-Math.floor(TBView.Formular.Colorpicker.images.cross[0]/2);k=this.pickerStyle.face+this.pickerStyle.inset+k-Math.floor(TBView.Formular.Colorpicker.images.cross[1]/2);try{this.containerElement.padM.style.backgroundPosition=l+"px "+k+"px";var b=this.containerElement.sld.childNodes;switch(this.modeID){case 0:var j=this.getHsvToRgb(this.hsv[0],this.hsv[1],1);for(var d=0;d<b.length;d++){b[d].style.backgroundColor="rgb("+(j[0]*(1-d/b.length)*100)+"%,"+(j[1]*(1-d/b.length)*100)+"%,"+(j[2]*(1-d/b.length)*100)+"%)"}break;case 1:var j,m,h=[this.hsv[2],0,0];var d=Math.floor(this.hsv[0]);var e=d%2?this.hsv[0]-d:1-(this.hsv[0]-d);switch(d){case 6:case 0:j=[0,1,2];break;case 1:j=[1,0,2];break;case 2:j=[2,0,1];break;case 3:j=[2,1,0];break;case 4:j=[1,2,0];break;case 5:j=[0,2,1];break}for(var d=0;d<b.length;d++){m=1-1/(b.length-1)*d;h[1]=h[0]*(1-m*e);h[2]=h[0]*(1-m);b[d].style.backgroundColor="rgb("+(h[j[0]]*100)+"%,"+(h[j[1]]*100)+"%,"+(h[j[2]]*100)+"%)"}break}}catch(a){}},redrawSlider:function(){switch(this.modeID){case 0:var a=2;break;case 1:var a=1;break;default:return}var c=Math.round((1-this.hsv[a])*(TBView.Formular.Colorpicker.images.sld[1]-1));c=this.pickerStyle.face+this.pickerStyle.inset+c-Math.floor(TBView.Formular.Colorpicker.images.arrow[1]/2);try{this.containerElement.sldM.style.backgroundPosition="0 "+c+"px"}catch(b){}},setPad:function(b){var d=TBView.Formular.Colorpicker.getMousePos(b);var a=d[0]-this.posPad[0];var c=d[1]-this.posPad[1];switch(this.modeID){case 0:this.exportColorFromHsv(a*(6/(TBView.Formular.Colorpicker.images.pad[0]-1)),1-c/(TBView.Formular.Colorpicker.images.pad[1]-1),null,this.leaveSlider);break;case 1:this.exportColorFromHsv(a*(6/(TBView.Formular.Colorpicker.images.pad[0]-1)),null,1-c/(TBView.Formular.Colorpicker.images.pad[1]-1),this.leaveSlider);break}},setSlider:function(a){var c=TBView.Formular.Colorpicker.getMousePos(a);var b=c[1]-this.posPad[1];switch(this.modeID){case 0:this.exportColorFromHsv(null,null,1-b/(TBView.Formular.Colorpicker.images.sld[1]-1),this.leavePad);break;case 1:this.exportColorFromHsv(null,1-b/(TBView.Formular.Colorpicker.images.sld[1]-1),null,this.leavePad);break}},CLASS_NAME:"TBView.Formular.Colorpicker.Picker"});TBView.Switch={SwitchLayer:function(b,a){if(b){if(TBView.Client.isNS4()){b.visibility=a?"show":"hide";b.display=a?"block":"none";return true}else{b.style.visibility=a?"visible":"hidden";b.style.display=a?"block":"none";return true}}else{return false}},SwitchImage:function(c,a){var b=TBView.Util.GetImage(c);if(!b){return}if(a=="1"||a==1){if(!stristr(b.src,"_over")){b.src=b.src.replace(/\.gif/g,"_over.gif")}}else{if(stristr(b.src,"_over")){b.src=b.src.replace(/_over/g,"")}}},SwitchCursor:function(b,a){if(a=="-1"){TBView.Util.SetStyle(b,"cursor","default")}else{if(a=="1"){TBView.Util.SetStyle(b,"cursor","pointer")}else{if(a=="2"){TBView.Util.SetStyle(b,"cursor","move")}else{TBView.Util.SetStyle(b,"cursor","auto")}}}},SwitchClass:function(c,a){var b=c.className;var d=b.search(a);if(d!=-1){c.className=b.replace(a,"");TBView.Util.SetStyle(c,"cursor","auto")}else{c.className=b+a;TBView.Util.SetStyle(c,"cursor","pointer")}},SwitchChecked:function(b){var a=TBView.Util.GetObject(b);if(a!=null){if(a.checked){a.checked=false}else{a.checked=true}}},SwitchCheckedAll:function(d,a){var c=document.forms[d];var e=c.elements[a];for(var b=0;b<e.length;b++){if(e[b].checked){e[b].checked=false}else{e[b].checked=true}}},SwitchDisabled:function(d,b,a){var c=document.forms[d];if(c){var e=c[b];if(e){if(a){e.disabled=true;TBView.Util.SetStyle(e,"color","#808080")}else{e.disabled=false;TBView.Util.SetStyle(e,"color","")}}}},SwitchFieldByChecked:function(a,c){if(TBView.Switch.SwitchFieldByChecked.arguments.length>2){for(var b=2;b<TBView.Switch.SwitchFieldByChecked.arguments.length;b++){var d=TBView.Switch.SwitchFieldByChecked.arguments[b];if(a.checked){document.forms[c][d].disabled=false}else{document.forms[c][d].disabled=true}}}},SwitchBox:function(c){var b=TBView.Util.GetLayer(c);if(!b){return}var a=(TBView.Util.GetStyle(b,"display")=="none")?true:false;var d=TBView.Switch.SwitchBox.arguments[1];if(typeof d!="undefined"){a=(d=="1"||d==1)?true:false}if(a){this.SwitchLayer(b,1);this.SwitchImage("img"+c,1)}else{this.SwitchLayer(b,0);this.SwitchImage("img"+c,0)}},SwitchBoxByPosition:function(e,f,a,g){var b=TBView.Util.GetLayer(e);if(b&&f){var d=parseFloat(TBView.Util.GetX(f))+parseFloat(a);var c=parseFloat(TBView.Util.GetY(f))+parseFloat(g);TBView.Util.SetStyle(b,"position","absolute");TBView.Util.SetStyle(b,"left",d+"px");TBView.Util.SetStyle(b,"top",c+"px");TBView.Util.SetStyle(b,"zIndex","99999");if(TBView.Util.GetStyle(b,"display")=="block"){TBView.Util.SetStyle(b,"display","none")}else{TBView.Util.SetStyle(b,"display","block")}}},SwitchVisibility:function(c,b){var a=TBView.Util.GetLayer(c);if(a!=null&&typeof a!="undefined"&&a!=""){if(b){TBView.Util.SetStyle(a,"display","block")}else{TBView.Util.SetStyle(a,"display","none")}}},SwitchSelect:function(i,g,b,f){var e=document.forms[i][g];var h=document.forms[i][b];var d=h.originalOptions;if(TBView.Util.isEmpty(d)){d=new Array();for(var a=(h.length-1);a>=0;a--){d.unshift(h.options[a]);h.options[a]=null}h.originalOptions=d}else{for(var a=(h.length-1);a>=0;a--){h.options[a]=null}}for(var a=0;a<d.length;a++){var c=d[a];if(e.value==""||e.value==c.getAttribute(f)||c.getAttribute(f)==""){h.options[h.length]=c}}},CLASS_NAME:"TBView.Switch"};TBView.Util.UTF8={encode:function(b){b=b.replace(/\r\n/g,"\n");var a="";for(var e=0;e<b.length;e++){var d=b.charCodeAt(e);if(d<128){a+=String.fromCharCode(d)}else{if((d>127)&&(d<2048)){a+=String.fromCharCode((d>>6)|192);a+=String.fromCharCode((d&63)|128)}else{a+=String.fromCharCode((d>>12)|224);a+=String.fromCharCode(((d>>6)&63)|128);a+=String.fromCharCode((d&63)|128)}}}return a},decode:function(a){var b="";var d=0;var e=c1=c2=0;while(d<a.length){e=a.charCodeAt(d);if(e<128){b+=String.fromCharCode(e);d++}else{if((e>191)&&(e<224)){c2=a.charCodeAt(d+1);b+=String.fromCharCode(((e&31)<<6)|(c2&63));d+=2}else{c2=a.charCodeAt(d+1);c3=a.charCodeAt(d+2);b+=String.fromCharCode(((e&15)<<12)|((c2&63)<<6)|(c3&63));d+=3}}}return b},CLASS_NAME:"TBView.Util.UTF8"};TBView.Locale={locales:{},getText:function(a){return((this.locales[a]!=null)?this.locales[a]:"Not found: "+a)},addText:function(a,b){this.locales[a]=b},_getReplacedDatetime:function(a,h){if(!this.locales[a]){return"Not found: "+a}var i=h.split(" ");var e=TBView.Util.isEmpty(i[0])?"0000-00-00":i[0];var c=TBView.Util.isEmpty(i[1])?"00:00:00":i[1];if(e.indexOf(".")>-1){var b=e.split(".")}else{var b=e.split("-")}var d=c.split(":");var j=TBView.Util.isEmpty(b[0])?"0000":b[0];var g=TBView.Util.isEmpty(b[1])?"00":b[1];var k=TBView.Util.isEmpty(b[2])?"00":b[2];var l=TBView.Util.isEmpty(d[0])?"00":d[0];var f=TBView.Util.isEmpty(d[1])?"00":d[1];var m=TBView.Util.isEmpty(d[2])?"00":d[2];var n=this.locales[a];n=n.replace(/{Y}/g,j);n=n.replace(/{M}/g,g);n=n.replace(/{D}/g,k);n=n.replace(/{H}/g,l);n=n.replace(/{i}/g,f);n=n.replace(/{s}/g,m);return n},getDatetime:function(a){return this._getReplacedDatetime("datetime",a)},getDate:function(a){return this._getReplacedDatetime("date",a)},getTime:function(a){return this._getReplacedDatetime("time",a)},CLASS_NAME:"TBView.Locale"};TBView.Navigation={DD_SPEED:3,DD_TIMER:15,submenuOffsetTop:0,submenuOffsetLeft:0,timerMenu:[],timerSubMenu:[],setOffset:function(a,b){this.submenuOffsetTop=(TBView.Util.isEmpty(a))?0:a;this.submenuOffsetLeft=(TBView.Util.isEmpty(b))?0:b},_clearMenu:function(a){if(this.timerMenu[a]){clearTimeout(this.timerMenu[a])}},_clearSubmenu:function(a){if(this.timerSubMenu[a]){clearInterval(this.timerSubMenu[a])}},switchMenu:function(f,a){var e=TBView.Util.GetObject("Menu"+f);var b=TBView.Util.GetObject("Submenu"+f);this._clearSubmenu(f);if(a==1){this._clearMenu(f);if(!TBView.Util.stristr(e.className,"Active")){e.className=e.className+"Active"}TBView.Switch.SwitchCursor(e,1);if(b!=null){b.style.display="block";if(!b.startHeight){b.style.height="auto";b.startHeight=b.offsetHeight;b.startTop=b.offsetTop;b.startLeft=b.offsetLeft;b.style.height="0px";b.style.zIndex="50000";var d=parseInt(b.startTop)+parseInt(this.submenuOffsetTop);var c=parseInt(b.startLeft)+parseInt(this.submenuOffsetLeft);b.style.top=d+"px";b.style.left=c+"px";TBView.Util.SetStyle(b,"backgroundPosition","bottom")}this.timerSubMenu[f]=setInterval(function(){TBView.Navigation.slideMenu(f,1)},TBView.Navigation.DD_TIMER)}}else{this.timerMenu[f]=setTimeout(function(){TBView.Navigation.collapseMenu(f)},100)}},cancelSwitchMenu:function(d){var c=TBView.Util.GetObject("Menu"+d);var a=TBView.Util.GetObject("Submenu"+d);this._clearMenu(d);if(a!=null){this._clearSubmenu(d);var b=parseInt(a.style.height)||0;TBView.Util.SetStyle(a,"backgroundPosition","bottom");if(a.startHeight&&b<=a.startHeight){this.timerSubMenu[d]=setInterval(function(){TBView.Navigation.slideMenu(d,1)},TBView.Navigation.DD_TIMER)}}},collapseMenu:function(c){var b=TBView.Util.GetObject("Menu"+c);var a=TBView.Util.GetObject("Submenu"+c);TBView.Switch.SwitchCursor(b,-1);if(a!=null){this.timerSubMenu[c]=setInterval(function(){TBView.Navigation.slideMenu(c,-1)},TBView.Navigation.DD_TIMER)}else{if(b){if(TBView.Util.stristr(b.className,"Active")){b.className=b.className.replace("Active","")}}}},slideMenu:function(f,c){var d=TBView.Util.GetObject("Menu"+f);var b=TBView.Util.GetObject("Submenu"+f);if(b==null){return}if(c>0){var e=(b.startHeight-parseInt(b.style.height))/TBView.Navigation.DD_SPEED;e=parseInt(Math.round(e));if(isNaN(e)||e<1){e=2}var a=parseInt(TBView.Util.GetStyle(b,"height"))+e;if(isNaN(a)||a>=b.startHeight){TBView.Util.SetStyle(b,"height",b.startHeight+"px");TBView.Util.SetStyle(b,"backgroundPosition","bottom");this._clearSubmenu(f)}else{TBView.Util.SetStyle(b,"height",a+"px");TBView.Util.SetStyle(b,"backgroundPosition","bottom")}}else{var e=parseInt(TBView.Util.GetStyle(b,"height"))/TBView.Navigation.DD_SPEED;e=parseInt(Math.round(e));if(isNaN(e)||e<1){e=2}var a=parseInt(TBView.Util.GetStyle(b,"height"))-e;if(isNaN(a)||a<1){if(TBView.Util.stristr(d.className,"Active")){d.className=d.className.replace("Active","")}TBView.Util.SetStyle(b,"height","0px");TBView.Util.SetStyle(b,"display","none");this._clearSubmenu(f)}else{TBView.Util.SetStyle(b,"height",a+"px");TBView.Util.SetStyle(b,"backgroundPosition","bottom")}}},CLASS_NAME:"TBView.Navigation"};TBView.Requests={request:false,requestBusy:false,requestTimer:null,UPLOAD_STATUS:false,TIMEOUT:20,isBusy:function(){return this.requestBusy},reset:function(){window.clearTimeout(this.requestTimer);if(this.request){this.request.abort();delete this.requestBusy;delete this.requestTimer;this.requestBusy=null;this.requestTimer=null}},destroy:function(){window.clearTimeout(this.requestTimer);if(this.request){delete this.request;delete this.requestBusy;delete this.requestTimer;this.request=false;this.requestBusy=null;this.requestTimer=null}},_createRequest:function(){try{this.request=new XMLHttpRequest()}catch(b){try{this.request=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{this.request=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){this.request=false}}}if(this.request){window.clearTimeout(this.requestTimer);this.requestTimer=window.setTimeout(function(){TBView.Requests.reset()},(this.TIMEOUT*1000));this.requestBusy=true}},_insertContent:function(b){if(!this.isComplete()){return}if(this.getStatus()>=200&&this.getStatus()<300){var a=TBView.Util.GetObject(b);if(a){TBView.Util.SetContent(a,this.getText());TBView.Util.ExecuteJavascript(a)}TBView.hideLoading()}this.reset();return},isComplete:function(){if(this.request.readyState!=4){window.clearTimeout(this.requestTimer);this.requestTimer=window.setTimeout(function(){TBView.Requests.reset()},(this.TIMEOUT*1000));return false}else{return true}},getStatus:function(){try{return this.request.status||0}catch(a){return 0}},getText:function(){if(!this.isComplete()){return}var a="";if(this.getStatus()>=200&&this.getStatus()<300){a=(this.request.responseText==null)?"":String(this.request.responseText)}return a},getXml:function(){if(!this.isComplete()){return}var a=null;if(this.getStatus()>=200&&this.getStatus()<300){if(this.request.responseXML&&this.request.responseXML.documentElement){return TBView.Xml.parseDOM(this.request.responseXML.documentElement)}else{if(this.request.responseText){return TBView.Xml.parseXML(this.request.responseText)}}}return null},loadCustom:function(a,b){if(this.isBusy()){window.setTimeout(function(){TBView.Requests.loadCustom(a,b)},100)}else{if(TBView.Util.isEmpty(a)){return}this._createRequest();this.request.onreadystatechange=(typeof b!="function")?{}:b;this.request.open("GET",a,true);this.request.setRequestHeader("X-Requested-With","XMLHttpRequest");this.request.setRequestHeader("Accept","text/javascript, text/html, application/xml, text/xml, */*");this.request.setRequestHeader("TBView",true);this.request.setRequestHeader("Connection","close");this.request.send(null)}return},sendCustom:function(b,f){if(this.isBusy()){window.setTimeout(function(){TBView.Requests.sendCustom(b,f)},100)}else{var c=b.split("?");var d=TBView.Util.isEmpty(c[0])?"":c[0];var e=TBView.Util.isEmpty(c[1])?"":c[1];if(TBView.Util.isEmpty(d)){return}this._createRequest();var a="application/x-www-form-urlencoded; charset=iso-8859-1";this.request.onreadystatechange=(typeof f!="function")?{}:f;this.request.open("POST",d,true);this.request.setRequestHeader("X-Requested-With","XMLHttpRequest");this.request.setRequestHeader("Accept","text/javascript, text/html, application/xml, text/xml, */*");this.request.setRequestHeader("TBView",true);this.request.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=iso-8859-1");this.request.setRequestHeader("Content-Length",e.length);this.request.setRequestHeader("Connection","close");this.request.send(e)}return},load:function(b,a){if(this.isBusy()){window.setTimeout(function(){TBView.Requests.load(b,a)},100)}else{if(TBView.Util.isEmpty(b)||TBView.Util.isEmpty(a)){return}this._createRequest();if(TBView.showLoading){TBView.showLoading()}this.request.onreadystatechange=function(c){TBView.Requests._insertContent(b)};this.request.open("GET",a,true);this.request.setRequestHeader("X-Requested-With","XMLHttpRequest");this.request.setRequestHeader("Accept","text/javascript, text/html, application/xml, text/xml, */*");this.request.setRequestHeader("TBView",true);this.request.setRequestHeader("Connection","close");this.request.send(null)}return},send:function(l,b,m,k){if(this.isBusy()){window.setTimeout(function(){TBView.Requests.send(l,b,m,k)},100)}else{if(TBView.Util.isEmpty(l)||TBView.Util.isEmpty(b)||TBView.Util.isEmpty(k)){return}this._createRequest();var e=false;var h=m;var g="application/x-www-form-urlencoded; charset=iso-8859-1";var d=TBView.Util.GetForm(k);if(!d){return}var a=d.elements;for(var j=0;j<a.length;j++){var f=a[j];if(f.name!=""){if(f.type=="file"&&f.value!=""){e=true}else{if(f.type=="select-multiple"){for(var c=0;c<f.options.length;c++){if(f.options[c].selected==true){var n=encodeURIComponent(f.options[c].value);h+="&"+f.name+"="+n}}}else{if(f.type=="select-one"){var n=encodeURIComponent(f.value);if(f.value!=""){h+="&"+f.name+"="+n}}else{if(f.type=="checkbox"||f.type=="radio"){var n=encodeURIComponent(f.value);if(f.checked&&f.value!=""){h+="&"+f.name+"="+n}}else{if(f.type=="submit"||f.type=="button"){}else{var n=encodeURIComponent(f.value);if(f.value!=""){h+="&"+f.name+"="+n}}}}}}}}if(e&&d.ProgressId&&d.ProgressId.value!=""){this._uploadFiles(d,l,h)}else{if(TBView.showLoading){TBView.showLoading()}this.request.onreadystatechange=function(i){TBView.Requests._insertContent(l)};this.request.open("POST",b,true);this.request.setRequestHeader("X-Requested-With","XMLHttpRequest");this.request.setRequestHeader("Accept","text/javascript, text/html, application/xml, text/xml, */*");this.request.setRequestHeader("TBView",true);this.request.setRequestHeader("Content-Type",g);this.request.setRequestHeader("Content-Length",h.length);this.request.setRequestHeader("Connection","close");this.request.send(h)}}return},closeUploadStatus:function(b){var a=TBView.Util.GetLayer("boxUploadStatus");if(a){window.setTimeout(function(){TBView.Util.SwitchLayer(a,0)},1000)}this.UPLOAD_STATUS=false;TBView.LOADING=true;this.reset()},_openUploadStatus:function(e){if(!this.UPLOAD_STATUS){return}var b=TBView.Util.GetLayer("boxUploadStatus");if(typeof(b)=="undefined"||!b){b=document.createElement("DIV");b.id="boxUploadStatus";b.name="boxUploadStatus";b.setAttribute("id","boxUploadStatus");b.setAttribute("name","boxUploadStatus");SetStyle(b,"position","absolute");SetStyle(b,"display","none");SetStyle(b,"zIndex","200");SetStyle(b,"position","absolute");SetStyle(b,"visibility","hidden");SetStyle(b,"backgroundColor","#f6f6f6");SetStyle(b,"border","solid 1px #666666");SetStyle(b,"overflow","hidden");SetStyle(b,"padding","10px 10px 10px 10px;");SetStyle(b,"width","300px");SetStyle(b,"height","180px");var a=TBView.Client.getViewportSize();var c=parseInt(TBView.Util.GetStyle(b,"width"));var d=parseInt(TBView.Util.GetStyle(b,"height"));SetStyle(b,"left",(a[0]/2-c/2)+"px");SetStyle(b,"top",(a[1]/2-d/2+TBView.Client.getPageOffsetY())+"px");body.insertBefore(b,body.firstChild)}if(b){TBView.Util.SwitchLayer(b,1);if(this.isBusy()){window.setTimeout(function(){TBView.Requests._openUploadStatus(e)},10)}else{this.load("boxUploadStatus",TBView.getRoot()+"upload_status.php?"+TBView.getSession()+"&ProgressId="+e);window.setTimeout(function(){TBView.Requests._openUploadStatus(e)},1000)}}},_uploadFiles:function(b,j,d){var n=b.ProgressId.value;if(n==""){alert("No Progress-Id found!!");return}if(typeof b!="undefined"&&b){var l=TBView.Util.GetLayer("boxUpload");if(typeof(l)=="undefined"||!l){l=document.createElement("DIV");l.id="boxUpload";l.name="boxUpload";l.setAttribute("id","boxUpload");l.setAttribute("name","boxUpload");var g="0";SetStyle(l,"position","absolute");if(g=="0"){SetStyle(l,"display","none");SetStyle(l,"visibility","hidden")}l.innerHTML='<iframe name="UploadIFrame" id="UploadIFrame" style="width:'+g+"px; height:"+g+'px; overflow:hidden; border:none; background-color: #FFFFFF;"></iframe>';var h=document.getElementsByTagName("body")[0];h.insertBefore(l,h.firstChild)}b.onsubmit="";b.enctype="multipart/form-data";b.target="UploadIFrame";b.method="post";if(b.mergeAttributes){b.mergeAttributes(b,false)}var k=document.createElement("INPUT");k.type="hidden";k.name="target";k.value=encodeURIComponent(j);b.appendChild(k);var k=document.createElement("INPUT");k.type="hidden";k.name="query";k.value=encodeURIComponent(d);b.appendChild(k);var m=0;var a=b.elements;for(var f=0;f<a.length;f++){var c=a[f];if(c.type=="submit"||c.type=="button"){c.disabled=true}else{if(c.type=="file"&&c.name!=""&&c.value!=""){m++}}}b.action="upload.php?&ProgressId="+n+"&ProgressCountFiles="+encodeURIComponent(m);var k=document.createElement("INPUT");k.type="hidden";k.name="ProgressCountFiles";k.value=encodeURIComponent(m);b.appendChild(k);this.UPLOAD_STATUS=true;TBView.LOADING=false;this._openUploadStatus(n);b.submit()}},CLASS_NAME:"TBView.Requests"};TBView.Boxes={boxes:[],boxesForOnClickEvent:true,boxesPositionSnap:10,closeBox:function(d){var c=this.getBox(d);if(c&&c.id){if(TBView.Util.GetObjectName(c)=="TBView.Box"||TBView.Util.GetObjectName(c)=="TBView.Formular.SelectFilter"||TBView.Util.GetObjectName(c)=="TBView.Formular.Calendar"){c.hide()}for(var a=0;a<this.boxes.length;a++){if(this.boxes[a].id==c.id){this.boxes.splice(a,1);break}}this.boxes.unshift(c)}},closeBoxes:function(){for(var a=0;a<this.boxes.length;a++){this.closeBox(this.boxes[a].id)}},closeLastBox:function(){var a=this.boxes.pop();if(a){this.boxes.unshift(a);this.closeBox(a.id)}},setBox:function(c){if(!c||!c.id){return}for(var a=0;a<this.boxes.length;a++){if(this.boxes[a].id==c.id){this.setBoxAsTop(c);return}}if(TBView.Events&&(TBView.Util.GetObjectName(c)=="TBView.Box"||TBView.Util.GetObjectName(c)=="TBView.BoxOverlay"||TBView.Util.GetObjectName(c)=="TBView.Formular.Calendar")){TBView.Events.addEventsToBox(c)}this.boxes.push(c);this.setBoxAsTop(c)},isBoxClosed:function(c){for(var a=0;a<this.boxes.length;a++){if(this.boxes[a].id==c){return this.boxes[a].isClosed()}}return true},getBox:function(c){for(var a=0;a<this.boxes.length;a++){if(this.boxes[a].id==c){return this.boxes[a]}}return null},showBox:function(b){var a=this.getBox(b);if(a){a.show()}},openBox:function(e){var c=this.getBox(e);if(c){c.hide();var d=(typeof arguments[1]!="undefined")?arguments[1]:"";if(d!=""){c.setTitle(d)}}else{var d=(typeof arguments[1]!="undefined")?arguments[1]:"";var b=(typeof arguments[2]!="undefined")?arguments[2]:"default";var a=(typeof arguments[3]!="undefined")?arguments[3]:true;c=new TBView.Box(e,d,b,a)}c.show();this.setBox(c);return c},setBoxAsTop:function(d){if(!d||!d.id){return}if(TBView.Util.GetObjectName(d)=="TBView.Box"||TBView.Util.GetObjectName(d)=="TBView.Formular.SelectFilter"||TBView.Util.GetObjectName(d)=="TBView.Formular.Calendar"){for(var c=0;c<this.boxes.length;c++){if(this.boxes[c].id==d.id){this.boxes.splice(c,1);break}}this.boxes.push(d);var a=5000;for(var c=0;c<this.boxes.length;c++){a+=25;TBView.Util.SetStyle(this.boxes[c].divbox,"zIndex",a)}}},setBoxesOnClick:function(a){this.boxesForOnClickEvent=(a==1||a==true||a=="1")?true:false},addBoxTriggerOpen:function(id,trigger){var box=this.getBox(id);if(box&&trigger){if(typeof trigger!="function"){trigger=function(){eval(trigger)}}if(box.triggerOpen){var triggerOpen=box.triggerOpen;box.triggerOpen=function(){triggerOpen();trigger()}}else{box.triggerOpen=trigger}}},addBoxTriggerClose:function(id,trigger){var box=this.getBox(id);if(box&&trigger){if(typeof trigger!="function"){trigger=function(){eval(trigger)}}if(box.triggerClose){var triggerClose=box.triggerClose;box.triggerClose=function(){triggerClose();trigger()}}else{box.triggerClose=trigger}}},getBoxPositionX:function(e){for(var c=0;c<this.boxes.length;c++){var a=this.boxes[c].getPositionX()-this.boxesPositionSnap;var d=this.boxes[c].getPositionX()+this.boxesPositionSnap;if(a<e&&e<d){e+=20;return this.getBoxPositionX(e)}}return e},getBoxPositionY:function(d){for(var a=0;a<this.boxes.length;a++){var e=this.boxes[a].getPositionY()-this.boxesPositionSnap;var c=this.boxes[a].getPositionY()+this.boxesPositionSnap;if(e<d&&d<c){d+=20;return this.getBoxPositionY(d)}}return d},CLASS_NAME:"TBView.Boxes"};TBView.Events={dragObject:null,dragCallback:null,getDragObject:function(){return this.dragObject},clearEvents:function(a){if(!a){a=window.event}a.returnValue=false;a.cancelBubble=true;if(a.preventDefault||a.stopPropagation){a.stopPropagation();a.preventDefault()}},clearEnterEvents:function(b){if(!b){b=window.event}var a=(b)?(b.keyCode||b.charCode||""):"";if(a==13){b.returnValue=false;b.cancelBubble=true;if(b.preventDefault||b.stopPropagation){b.stopPropagation();b.preventDefault()}return false}return true},clearSelections:function(b){if(!b){b=window.event}if(window.getSelection){var a=window.getSelection();if(a&&a.removeAllRanges){a.removeAllRanges()}}else{if(typeof document.selection!=="undefined"){var a=document.selection;if(a&&a.createRange().text!=""){a.empty()}}}},doError:function(a){return false},doContextMenu:function(a){return false},doKeyDown:function(b){if(!b){b=window.event}var a=(b.keyCode)?b.keyCode:b.charCode;if(a=="27"&&TBView.Boxes){TBView.Boxes.closeLastBox()}},doMouseUp:function(a){if(!a){a=window.event}if(this.dragObject&&this.dragCallback){this.dragCallback()}delete this.dragObject;this.dragObject=null;delete this.dragCallback;this.dragCallback=null},doMouseMove:function(j){if(!j){j=window.event}if(!this.dragObject||this.dragObject==null){return}this.clearEvents(j);var b=j.clientY||j.y||j.pageY||null;var c=j.clientX||j.x||j.pageX||null;var f=TBView.Client.getViewportSize();if(this.dragObject.dragType=="dragndrop"){var i=this.dragObject.getWidth();var l=this.dragObject.getHeight();var h=(this.dragObject.isMinimized())?(f[1]-this.dragObject.HEIGHT_TOP-this.dragObject.HEIGHT_BOTTOM):(f[1]-l);var d=(f[0]-i);var k=parseInt(b)-parseInt(this.dragObject.dragDiffY);var m=parseInt(c)-parseInt(this.dragObject.dragDiffX);if(k<=0){k=0}else{if(k>=h){k=h}}if(m<=0){m=0}else{if(m>=d){m=d}}TBView.Util.SetStyle(this.dragObject.divbox,"top",k+"px");TBView.Util.SetStyle(this.dragObject.divbox,"left",m+"px")}else{if(this.dragObject.dragType=="resize"){var m=boxLeft=this.dragObject.getPositionX();var k=boxTop=this.dragObject.getPositionY();var g=i=this.dragObject.getWidth();var a=l=this.dragObject.getHeight();if(this.dragObject.dragMode=="ne-resize"){k=b-this.dragObject.dragDiffY;g=c-m-this.dragObject.dragDiffX;a=boxTop+l-b+this.dragObject.dragDiffY}else{if(this.dragObject.dragMode=="nw-resize"){k=b-this.dragObject.dragDiffY;m=c-this.dragObject.dragDiffX;g=boxLeft+i-m;a=boxTop+l-b+this.dragObject.dragDiffY}else{if(this.dragObject.dragMode=="se-resize"){g=c-m-this.dragObject.dragDiffX;a=b-k-this.dragObject.dragDiffY}else{if(this.dragObject.dragMode=="sw-resize"){m=c-this.dragObject.dragDiffX;g=boxLeft+i-m;a=b-k-this.dragObject.dragDiffY}}}}if(g<200||a<100||k<0||m<0||(m+g)>f[0]||(k+a)>f[1]){return}TBView.Util.SetStyle(this.dragObject.divbox,"left",m+"px");TBView.Util.SetStyle(this.dragObject.divbox,"top",k+"px");TBView.Util.SetStyle(this.dragObject.divbox,"width",g+"px");TBView.Util.SetStyle(this.dragObject.getContainerDiv(),"width",(g-this.dragObject.WIDTH_LEFT-this.dragObject.WIDTH_RIGHT)+"px");TBView.Util.SetStyle(this.dragObject.getContainerDiv(),"height",(a-this.dragObject.HEIGHT_TOP-this.dragObject.HEIGHT_BOTTOM)+"px");TBView.Util.SetStyle(this.dragObject.getContainerDiv(),"maxHeight",(a-this.dragObject.HEIGHT_TOP-this.dragObject.HEIGHT_BOTTOM)+"px")}}this.clearSelections()},isElementForDrag:function(d){if(!d){d=window.event}var a=d.target||d.srcElement||null;if(a!=null){var b=a.tagName;var c=a.className;if(b=="SELECT"||b=="OPTION"||b=="INPUT"||b=="BUTTON"||b=="LABEL"||b=="TEXTAREA"){return false}else{if(b=="DIV"||b=="TD"){if(TBView.Util.stristr(c,"boxmenu")||TBView.Util.stristr(c,"results")||TBView.Util.stristr(c,"selectobject")||TBView.Util.stristr(c,"list")||TBView.Util.stristr(c,"field")||TBView.Util.stristr(c,"button")||TBView.Util.stristr(c,"extentrectangle")){return false}}else{if(b=="IMG"){if(TBView.Util.stristr(a.id,"action")||TBView.Util.stristr(a.src,"actions")||TBView.Util.stristr(a.src,"toolbar")){return false}}else{if(b=="UL"||b=="LI"){if(TBView.Util.stristr(c,"tbLegendContainer")){return false}}}}}}return true},getDragModeBox:function(i,d){if(!i){i=window.event}var g="dragndrop";if(!d.resizeable){return g}var a=i.clientY||i.y||i.pageY||null;var b=i.clientX||i.x||i.pageX||null;var h=d.getPositionX();var l=d.getPositionY();var f=d.getWidth();var j=d.getHeight();var k=0;var c=30;if((h+k)<b&&b<(h+c)){if((l+k)<a&&a<(l+c)){g="nw-resize"}else{if((l+j-c)<a&&a<(l+j-k)){g="sw-resize"}}}else{if((h+f-c-20)<b&&b<(h+f-k-20)){if((l+k)<a&&a<(l+c)){g="ne-resize"}else{if((l+j-c)<a&&a<(l+j-k)){g="se-resize"}}}}return g},addEventsToBox:function(a){if(a.isInitalizedEvents()){return}if(TBView.Util.GetObjectName(a)!="TBView.Box"&&TBView.Util.GetObjectName(a)!="TBView.Calendar"){return}a.divbox.onmouseover=function(b){if(!b){b=window.event}if(!TBView.Events.isElementForDrag(b)){return}var c=TBView.Events.getDragModeBox(b,a);if(c=="dragndrop"){TBView.Switch.SwitchCursor(this,"2")}else{TBView.Util.SetStyle(this,"cursor",c)}};a.divbox.onmousemove=function(b){if(!b){b=window.event}if(!TBView.Events.isElementForDrag(b)){return}if(TBView.Events.getDragObject()){return}var c=TBView.Events.getDragModeBox(b,a);if(c=="dragndrop"){TBView.Switch.SwitchCursor(this,"2")}else{TBView.Util.SetStyle(this,"cursor",c)}};a.divbox.onmouseout=function(b){if(!b){b=window.event}if(!TBView.Events.isElementForDrag(b)){return}if(TBView.Events.getDragObject()==null){TBView.Switch.SwitchCursor(this,"0")}};a.divbox.onclick=function(b){if(!b){b=window.event}if(TBView.Boxes&&TBView.Boxes.boxesForOnClickEvent){TBView.Boxes.setBoxAsTop(a)}};a.divbox.onmousedown=function(h){if(!h){h=window.event}if(TBView.Boxes){TBView.Boxes.setBoxAsTop(a)}if(!TBView.Events.isElementForDrag(h)){return}TBView.Events.clearEvents(h);var j="";var f=TBView.Events.getDragModeBox(h,a);var g=a.getPositionX();var k=a.getPositionY();var d=a.getWidth();var i=a.getHeight();var b=h.clientY||h.y||h.pageY||null;var c=h.clientX||h.x||h.pageX||null;if(f=="nw-resize"){j="resize";diffX=g;diffY=k}else{if(f=="ne-resize"){j="resize";diffX=g+d;diffY=k}else{if(f=="sw-resize"){j="resize";diffX=g;diffY=k+i}else{if(f=="se-resize"){j="resize";diffX=g+d;diffY=k+i}else{if(f=="dragndrop"){j="dragndrop";diffX=g;diffY=k;if((g+d)-37<c){return}}else{return}}}}}TBView.Events.dragObject=a;TBView.Events.dragObject.dragType=j;TBView.Events.dragObject.dragMode=f;TBView.Events.dragObject.dragDiffX=c-diffX;TBView.Events.dragObject.dragDiffY=b-diffY};a.initializedEvents=true},addEvent:function(a,c,b){if(a.addEventListener){return a.addEventListener(c,b,false)}else{if(a.attachEvent){return a.attachEvent("on"+c,b)}else{return false}}},fireEvent:function(a,c){if(!a){return false}else{if(document.createEventObject){var b=document.createEventObject();return a.fireEvent("on"+c,b)}else{if(document.createEvent){var b=document.createEvent("HTMLEvents");b.initEvent(c,true,true);return a.dispatchEvent(b)}else{if(a["on"+c]){return a["on"+c]()}else{return false}}}}},doClickRight:function(a){if(!a){a=window.event}if((a.which&&a.which==3)||(a.button&&a.button==2)){return false}else{return true}},doClickLeft:function(a){if(!a){a=window.event}if((a.which&&event.which==1)||(event.button&&event.button==1)){}},getTargetElement:function(b){if(!b){b=window.event}var a=b.target||b.srcElement||null;if(a&&a.nodeType==3){a=a.parentNode}return a},getTargetElementClassName:function(b){var a=this.getTargetElement(b);return((a)?a.className:"")},getTargetElementTagName:function(b){var a=this.getTargetElement(b);return((a)?a.tagName:"")},CLASS_NAME:"TBView.Events"};if(document.layers){window.captureEvents(Event.KEYDOWN);window.captureEvents(Event.MOUSEMOVE);window.captureEvents(Event.MOUSEUP);window.captureEvents(Event.CLICK);window.captureEvents(Event.ERROR)}document.onkeydown=function(a){TBView.Events.doKeyDown(a)};document.onmousemove=function(a){TBView.Events.doMouseMove(a)};document.onmouseup=function(a){TBView.Events.doMouseUp(a)};document.onerror=function(a){TBView.Events.doError(a)};document.oncontextmenu=function(a){TBView.Events.doContextMenu(a)};TBView.Map={mapObject:null,mapBaseLayer:null,mapControlAttribution:null,mapControlCopyright:null,mapControlNavigation:null,mapControlHistory:null,mapControlSelection:null,mapControlOverview:null,mapControlPrint:null,mapControlPanel:null,mapControlShortcutPanel:null,mapControlToolbar:[],mapControlShortcuts:[],mapControlTooltips:"false",mapControlHyperlinks:"false",mapControlScale:"false",mapControlScaleLine:"false",mapControlCoordinate:"false",mapInitalized:false,mapBuffer:0,mapTileWidth:300,mapTileHeight:300,mapSession:"",mapName:"",mapDefinition:"",mapExtent:"",mapDigitizeSet:"",mapDimensioningSet:"",mapWorkspace:"",mapBgColor:"#FFFFFF",mapSelectionColor:"0x0000FFFF",mapWidth:0,mapHeight:0,mapRatio:1,mapFormat:"PNG",mapDpi:96,mapFractionalZoom:false,mapScales:null,mapMinScale:null,mapMaxScale:null,mapZoomLevels:15,mapRequestLayers:[],mapRequestLayerGroups:[],mapLayers:[],mapThemes:[],mapThemesAsOverlay:false,mapPositionRightBottom:20,mapStartPosX:0,mapStartPosY:0,mapStartScale:null,mapProjection:"EPSG:31467",mapDisplayProjection:"EPSG:31467",mapUnitsType:"",mapMetersPerUnit:0,mapMetersPerPixel:(0.0254/this.mapDpi),mapProxyUrl:"",mapCredentials:"USERNAME=Anonymous&",mapAgentUrl:"",mapLegendUrl:"",mapThemeUrls:[],initialize:function(){this.mapWidth=(this.mapWidth==0)?TBView.Util.GetWidth(TBView.Util.GetObject(TBView.getContainerMapId())):this.mapWidth;this.mapHeight=(this.mapHeight==0)?document.body.clientHeight:this.mapHeight;this.setFormat(TBView.CONFIG_MAP_FORMAT);this.setRatio(TBView.CONFIG_MAP_RATIO);this.setProjection(TBView.CONFIG_MAP_PROJECTION);this.setDisplayProjection(TBView.CONFIG_MAP_DISPLAYPROJECTION);this.setSelectionColor(TBView.CONFIG_MAP_SELECTION_COLOR);this.setThemesAsOverlay(TBView.CONFIG_APPLICATION_THEMESASOVERLAY);this.setMinScale(TBView.CONFIG_MAP_FARTHESTSCALE);this.setMaxScale(TBView.CONFIG_MAP_NEARESTSCALE);this.setZoomLevels(TBView.CONFIG_MAP_ZOOMLEVELS);if(OpenLayers){OpenLayers.IMAGE_RELOAD_ATTEMPTS=3;OpenLayers.Util.onImageLoadErrorColor="transparent";OpenLayers.ImgPath=TBView.getRoot()+"layout/images/";OpenLayers.Tile.Image.useBlankTile=true}var a={maxExtent:this.mapExtent,maxResolution:"auto",transitionEffect:"resize",units:"m",projection:this.mapProjection,fractionalZoom:this.mapFractionalZoom,displayProjection:this.mapDisplayProjection,theme:false,numZoomLevels:this.mapZoomLevels,minScale:this.mapMinScale,maxScale:this.mapMaxScale,scales:this.mapScales,controls:[]};this.mapObject=new OpenLayers.Map(TBView.getContainerMapId(),a);this.mapInitalized=true;this._initializeUrls();this._initializeLayers();this._initializeControls();this._initializeToolbar();this._initializeShortcuts();this.doInitialView();this._initializeEvents()},initializePrint:function(){this.mapWidth=(this.mapWidth==0)?TBView.Util.GetWidth(TBView.Util.GetObject(TBView.getContainerMapPrintId())):this.mapWidth;this.mapHeight=(this.mapHeight==0)?TBView.Util.GetHeight(TBView.Util.GetObject(TBView.getContainerMapPrintId())):this.mapHeight;this.setFormat(TBView.CONFIG_MAP_FORMAT);this.setRatio(TBView.CONFIG_MAP_RATIO);this.setSelectionColor(TBView.CONFIG_MAP_SELECTION_COLOR);this.setMinScale(TBView.CONFIG_MAP_FARTHESTSCALE);this.setMaxScale(TBView.CONFIG_MAP_NEARESTSCALE);this.setScales(TBView.CONFIG_MAP_SCALES);this.setZoomLevels(TBView.CONFIG_MAP_ZOOMLEVELS);if(OpenLayers){OpenLayers.IMAGE_RELOAD_ATTEMPTS=3;OpenLayers.Util.onImageLoadErrorColor="transparent";OpenLayers.ImgPath=TBView.getRoot()+"layout/images/";OpenLayers.Tile.Image.useBlankTile=true}var e={maxExtent:this.mapExtent,maxResolution:"auto",transitionEffect:"resize",units:"m",projection:this.mapProjection,displayProjection:this.mapDisplayProjection,numZoomLevels:this.mapZoomLevels,minScale:this.mapMinScale,maxScale:this.mapMaxScale,scales:this.mapScales,controls:[]};this.mapObject=new OpenLayers.Map(TBView.getContainerMapPrintId(),e);this.mapInitalized=true;this._initializeUrls();this._initializeLayers();if(window.opener&&window.opener.TBView.Map){var g=window.opener.TBView.Map;var f=g.getCenter();var d=g.getScale();var b=g.getBaseLayer();this.setCenter(f.lon,f.lat);this.setScale(d);var a=this.mapObject.getUnits();var c=OpenLayers.Util.getResolutionFromScale(d,a);zoom=this.mapObject.getZoomForResolution(c,true)-1;zoom=(zoom<0)?0:zoom;zoom=(zoom>=this.mapObject.getNumZoomLevels())?(this.mapObject.getNumZoomLevels()-1):zoom;this.mapObject.setCenter(f,zoom)}else{this.doInitialView()}},isInitalized:function(){return(this.mapInitalized&&this.mapObject&&this.mapExtent)?true:false},getMap:function(){return this.mapObject},getBaseLayer:function(){return this.mapBaseLayer},getScale:function(){return Math.round(this.mapObject.getScale())},getCenter:function(){return this.mapObject.getCenter()},getRatio:function(){return this.mapRatio},getProjection:function(){return this.mapProjection},getDisplayProjection:function(){return this.mapDisplayProjection},getResolution:function(){return this.mapObject.getResolution()},getZoom:function(){return this.mapObject.getZoom()},getFractionalZoom:function(){return this.mapFractionalZoom},getSession:function(){return this.mapSession},setSession:function(a){if(typeof a=="string"&&a!=""&&a!=undefined){this.mapSession=a}},getName:function(){return this.mapName},setName:function(a){if(typeof a=="string"&&a!=""&&a!=undefined){this.mapName=a}},setDefinition:function(a){this.mapDefinition=a},setExtent:function(extent){if(TBView.Util.GetObjectName(extent)==""&&typeof OpenLayers!="undefined"){eval("this.mapExtent = new OpenLayers.Bounds("+extent+");")}else{this.mapExtent=extent}},getDigitizeSet:function(){return this.mapDigitizeSet},setDigitizeSet:function(a){this.mapDigitizeSet=a},getDimensioningSet:function(){return this.mapDimensioningSet},setDimensioningSet:function(a){this.mapDimensioningSet=a},getWorkspace:function(){return this.mapWorkspace},setWorkspace:function(a){this.mapWorkspace=a},setCenter:function(b,a){this.mapStartPosX=parseInt(b);this.mapStartPosY=parseInt(a)},setScale:function(a){this.mapStartScale=parseFloat(a)},setScales:function(a){if(typeof a=="string"){this.mapScales=(a=="")?null:a.split(",")}else{this.mapScales=a}},setZoomLevels:function(a){if(parseInt(a)>0){this.mapZoomLevels=parseInt(a)}},setMinScale:function(a){if(parseFloat(a)>0){this.mapMinScale=parseFloat(a)}},setMaxScale:function(a){if(parseFloat(a)>0){this.mapMaxScale=parseFloat(a)}},setFractionalZoom:function(a){this.mapFractionalZoom=(a&&a==true)?true:false},setBgColor:function(b){var a=TBView.Util.GetObject(TBView.getContainerMapId());if(a){TBView.Util.SetStyle(a,"backgroundColor",b)}var c=TBView.Util.GetObject(TBView.getContainerMapPrintId());if(c){TBView.Util.SetStyle(c,"backgroundColor",b)}},setSelectionColor:function(a){if(a!=""){this.mapSelectionColor=(a.indexOf("#")>=0)?a.replace("#","0x")+"FF":a}},setThemesAsOverlay:function(a){this.mapThemesAsOverlay=(a=="true"||a=="1"||a==true)?true:false},hasThemesAsOverlay:function(){return this.mapThemesAsOverlay},setControlToolbar:function(a){if(a!=""){this.mapControlToolbar=a.toLowerCase().split(",")}},setControlTooltips:function(a){this.mapControlTooltips=a},setControlHyperlinks:function(a){this.mapControlHyperlinks=a},setControlScale:function(a){this.mapControlScale=a},setControlScaleline:function(a){this.mapControlScaleline=a},setControlCoordinate:function(a){this.mapControlCoordinate=a},setWidth:function(a){this.mapWidth=parseFloat(a)},setHeight:function(a){this.mapHeight=parseFloat(a)},setFormat:function(a){if(!TBView.Util.isEmpty(a)&&(TBView.Util.stristr(a,"png")||TBView.Util.stristr(a,"png8")||TBView.Util.stristr(a,"jpg"))){this.mapFormat=a}},setProjection:function(a){if(!TBView.Util.isEmpty(a)){this.mapProjection=a}},setDisplayProjection:function(a){if(!TBView.Util.isEmpty(a)){this.mapDisplayProjection=a}},setRatio:function(a){if(!TBView.Util.isEmpty(a)){this.mapRatio=parseFloat(a)}},setDpi:function(a){this.mapDpi=parseInt(a);this.mapMetersPerPixel=(0.0254/this.mapDpi);if(OpenLayers){OpenLayers.DOTS_PER_INCH=this.mapDpi}},setMetersPerUnit:function(a){this.mapMetersPerUnit=parseFloat(a);if(OpenLayers){var b=OpenLayers.INCHES_PER_UNIT.m*this.mapMetersPerUnit;OpenLayers.INCHES_PER_UNIT.dd=b;OpenLayers.INCHES_PER_UNIT.degrees=b}},setUnitsType:function(a){this.mapUnitsType=a},destroy:function(){if(this.isInitalized()){this.mapInitalized=false;if(this.mapObject.layers!=null){for(var b=0;b<this.mapObject.layers.length;b++){if(this.mapObject.layers[b].markers!=null){for(var a=0;a<this.mapObject.layers[b].markers.length;a++){this.mapObject.layers[b].markers[a].destroy();delete this.mapObject.layers[b].markers[a]}}delete this.mapObject.layers[b]}}this.mapObject.destroy();delete this.mapObject;delete this.mapBaseLayer;this.mapObject=null;this.mapBaseLayer=null;delete this.mapControlAttribution;delete this.mapControlCopyright;delete this.mapControlCoordinate;delete this.mapControlHistory;delete this.mapControlHyperlinks;delete this.mapControlNavigation;delete this.mapControlOverview;delete this.mapControlPanel;delete this.mapControlPrint;delete this.mapControlScale;delete this.mapControlScaleline;delete this.mapControlSelection;delete this.mapControlShortcutPanel;delete this.mapControlShortcuts;delete this.mapControlToolbar;delete this.mapControlTooltips;this.mapControlAttribution=null;this.mapControlCopyright=null;this.mapControlCoordinate="false";this.mapControlHistory=null;this.mapControlHyperlinks="false";this.mapControlNavigation=null;this.mapControlOverview=null;this.mapControlPanel=null;this.mapControlPrint=null;this.mapControlScale="false";this.mapControlScaleline="false";this.mapControlSelection=null;this.mapControlShortcutPanel=null;this.mapControlShortcuts=[];this.mapControlToolbar=[];this.mapControlTooltips="false";delete this.mapLayers;delete this.mapThemes;this.mapLayers=new Array();this.mapThemes=new Array()}if(TBView.closeOpenedWindows){TBView.closeOpenedWindows()}},_initializeUrls:function(){if(!this.isInitalized()){return}if(TBView.CONFIG_MAP_USERNAME!=""){this.mapCredentials="USERNAME="+TBView.CONFIG_MAP_USERNAME+"&";if(TBView.CONFIG_MAP_PASSWORD!=""){this.mapCredentials+="PASSWORD="+TBView.CONFIG_MAP_PASSWORD+"&"}}this.mapAgentUrl=TBView.CONFIG_MAP_AGENTURL+"?"+this.mapCredentials;this.mapLegendUrl=TBView.CONFIG_MAP_LEGENDURL+"?"+this.mapCredentials;for(var a=0;a<TBView.CONFIG_MAP_THEMEURLS.length;a++){this.mapThemeUrls.push(TBView.CONFIG_MAP_THEMEURLS[a]+"?"+this.mapCredentials)}},_initializeControls:function(){if(!this.isInitalized()){return}this.mapObject.addControl(new TBView.Map.Controls.PanZoomBar());this.mapControlCopyright=new TBView.Map.Controls.Copyright();this.mapObject.addControl(this.mapControlCopyright);if(TBView.Map.mapControlCoordinate=="true"){this.mapObject.addControl(new OpenLayers.Control.MousePosition({numDigits:2,prefix:"Y: ",separator:" &middot; X: ",suffix:""}))}if(TBView.Map.mapControlScale=="true"){this.mapObject.addControl(new TBView.Map.Controls.Scale())}if(TBView.Map.mapControlScaleline=="true"){this.mapObject.addControl(new TBView.Map.Controls.ScaleLine())}var b=new TBView.Map.Controls.Click();this.mapObject.addControl(b);b.activate();if(TBView.Map.mapControlHyperlinks=="true"){var a=new TBView.Map.Controls.Hyperlink();this.mapObject.addControl(a);a.activate()}if(TBView.Map.mapControlTooltips=="true"){var c=new TBView.Map.Controls.Tooltip();this.mapObject.addControl(c);c.activate()}this.mapControlAttribution=new TBView.Map.Controls.Attribution();this.mapObject.addControl(this.mapControlAttribution);this.mapControlLoading=new TBView.Map.Controls.Loading();this.mapObject.addControl(this.mapControlLoading)},_initializeToolbar:function(){if(!this.isInitalized()){return}var f=new TBView.Map.Controls.Start({title:TBView.Locale.getText("map.startmap"),eventListeners:TBView.Map.Listeners.Toolbar});this.mapControlHistory=new OpenLayers.Control.NavigationHistory({previousOptions:{title:TBView.Locale.getText("map.history.previous"),CLASS_NAME:"OpenLayers.Control.NavigationHistory.Previous"},nextOptions:{title:TBView.Locale.getText("map.history.next"),CLASS_NAME:"OpenLayers.Control.NavigationHistory.Next"}});this.mapControlHistory.restore=function(k){var j=this.map.getZoomForResolution(k.resolution);TBView.Map.doCenter(k.center.lon,k.center.lat,j)};this.mapObject.addControl(this.mapControlHistory);this.mapControlNavigation=new OpenLayers.Control.MouseDefaults({title:TBView.Locale.getText("map.move"),eventListeners:TBView.Map.Listeners.Toolbar});this.mapObject.addControl(this.mapControlNavigation);var c=new OpenLayers.Control.ZoomBox({title:TBView.Locale.getText("map.zoom.box"),eventListeners:TBView.Map.Listeners.Toolbar});this.mapControlSelection=new TBView.Map.Controls.Selection({title:TBView.Locale.getText("map.selection"),eventListeners:TBView.Map.Listeners.Toolbar});this.mapObject.addControl(this.mapControlSelection);var g=new TBView.Map.Controls.SelectionClear({title:TBView.Locale.getText("map.selection.clear")});var a=new TBView.Map.Controls.Measure(OpenLayers.Handler.Path,{title:TBView.Locale.getText("map.measure.line"),eventListeners:TBView.Map.Listeners.Toolbar});var e=new TBView.Map.Controls.Measure(OpenLayers.Handler.Polygon,{title:TBView.Locale.getText("map.measure.polygon"),eventListeners:TBView.Map.Listeners.Toolbar});this.mapControlPrint=new TBView.Map.Controls.Print({title:TBView.Locale.getText("map.print")});var d=new OpenLayers.Control.ZoomIn({title:TBView.Locale.getText("map.zoom.in")});var b=new OpenLayers.Control.ZoomOut({title:TBView.Locale.getText("map.zoom.out")});var h=[];for(var i=0;i<this.mapControlToolbar.length;i++){if(this.mapControlToolbar[i]=="start"){h.push(f)}else{if(this.mapControlToolbar[i]=="history"){h.push(this.mapControlHistory.previous);h.push(this.mapControlHistory.next)}else{if(this.mapControlToolbar[i]=="move"){h.push(this.mapControlNavigation)}else{if(this.mapControlToolbar[i]=="zoombox"){h.push(c)}else{if(this.mapControlToolbar[i]=="selection"){h.push(this.mapControlSelection)}else{if(this.mapControlToolbar[i]=="clear"){h.push(g)}else{if(this.mapControlToolbar[i]=="measureline"){h.push(a)}else{if(this.mapControlToolbar[i]=="measurepolygon"){h.push(e)}else{if(this.mapControlToolbar[i]=="print"){h.push(this.mapControlPrint)}else{if(this.mapControlToolbar[i]=="zoom"){h.push(d);h.push(b)}}}}}}}}}}}if(h.length>0){this.mapControlPanel=new OpenLayers.Control.Panel({defaultControl:this.mapControlNavigation,eventListeners:{}});this.mapControlPanel.addControls(h);this.mapObject.addControl(this.mapControlPanel)}},_initializeShortcuts:function(){if(!this.isInitalized()){return}if(!this.hasControlShortcuts()){return}var c=null;for(var b=0;b<this.mapControlShortcuts.length;b++){if(this.mapControlShortcuts[b].activated){c=this.mapControlShortcuts[b];break}}this.mapControlShortcutPanel=new OpenLayers.Control.Panel({defaultControl:c,eventListeners:{}});this.mapControlShortcutPanel.addControls(this.mapControlShortcuts);if(this.mapControlPanel&&this.mapControlPanel.div&&this.mapControlToolbar.length>0){var a=parseInt(this.mapControlPanel.div.offsetLeft);var d=parseInt(this.mapControlPanel.div.offsetTop)+38;this.mapObject.addControl(this.mapControlShortcutPanel,new OpenLayers.Pixel(a,d))}else{this.mapObject.addControl(this.mapControlShortcutPanel)}},initializeCursor:function(c){var b="";if(this.mapControlPanel&&this.mapControlPanel.controls){for(var a=0;a<this.mapControlPanel.controls.length;a++){if(this.mapControlPanel.controls[a].CLASS_NAME=="OpenLayers.Control.NavigationHistory.Previous"){if(this.mapControlHistory.previousStack.length>0){this.mapControlPanel.controls[a].activate()}}else{if(this.mapControlPanel.controls[a].CLASS_NAME=="OpenLayers.Control.NavigationHistory.Next"){if(this.mapControlHistory.nextStack.length>0){this.mapControlPanel.controls[a].activate()}}else{if(this.mapControlPanel.controls[a].active){b=this.mapControlPanel.controls[a].CLASS_NAME;break}}}}}var d="";switch(b){case"TBView.Map.Controls.Selection":d="help";break;case"TBView.Map.Controls.ZoomBox":case"OpenLayers.Control.ZoomBox":d="url("+TBView.getRoot()+"layout/images/cursors/zoom_rectangle.cur), crosshair";break;case"OpenLayers.Control.MouseDefaults":d="all-scroll";break;case"OpenLayers.Control.Navigation":d="all-scroll";break;case"OpenLayers.Control.Button":d="all-scroll";break;case"TBView.Map.Controls.Measure":d="url("+TBView.getRoot()+"layout/images/cursors/measure.cur), default";break;default:d="all-scroll";break}this.setCursor(d)},_initializeLayers:function(){this.addLayer("TBView.Overlay","Overlay","Overlay","Overlay",!this.hasThemes(),true);if(this.hasThemesAsOverlay()&&this.mapThemes.length>0){this.mapObject.allOverlays=true}for(var a=0;a<this.mapThemes.length;a++){this.mapObject.addLayer(this.mapThemes[a]);if(this.mapThemes[a].standard){this.mapBaseLayer=this.mapThemes[a];this.mapObject.setBaseLayer(this.mapBaseLayer)}}for(var a=0;a<this.mapLayers.length;a++){this.mapObject.addLayer(this.mapLayers[a]);if(this.mapLayers[a].isBaseLayer){this.mapBaseLayer=this.mapLayers[a];this.mapObject.setBaseLayer(this.mapBaseLayer)}}},_initializeEvents:function(){if(!TBView.Map.hasThemes()){this.mapObject.getScale=function(){var c=null;if(this.baseLayer!=null){if(this.baseLayer.scale){c=this.baseLayer.scale}else{var b=this.getResolution();var a=this.baseLayer.units;c=OpenLayers.Util.getScaleFromResolution(b,a)}}return c}}if(this.mapFractionalZoom){this.mapObject.zoomIn=function(){var a=parseInt(this.getZoom())+1;this.zoomTo(a)};this.mapObject.zoomOut=function(){var a=(parseInt(this.getZoom())<this.getZoom())?parseInt(this.getZoom()):parseInt(this.getZoom())-1;this.zoomTo(a)};this.mapObject.zoomToMaxExtent=function(d){var c=(d)?d.restricted:true;var b=this.getMaxExtent({restricted:c});var e=Math.round(this.getZoomForExtent(b,true));var a=b.getCenterLonLat();this.moveTo(a,e,{dragging:false,forceZoomChange:true,caller:"setCenter"})}}if(TBView.Legend){TBView.Legend.initialize()}if(TBView.Map.Session){TBView.Map.Session.check()}},doInitialView:function(){if(!this.isInitalized()||!this.mapBaseLayer){return}var d=null;if(this.mapHeight*this.mapExtent.getWidth()>this.mapWidth*this.mapExtent.getHeight()){d=this.mapExtent.getWidth()*this.mapMetersPerUnit/(this.mapWidth*this.mapMetersPerPixel)}else{d=this.mapExtent.getHeight()*this.mapMetersPerUnit/(this.mapHeight*this.mapMetersPerPixel)}if(this.mapStartScale!=null){d=this.mapStartScale}var c=null;if(d&&this.mapBaseLayer){var a=this.mapObject.getUnits();var b=OpenLayers.Util.getResolutionFromScale(d,a);c=this.mapObject.getZoomForResolution(b,true)}if(c>0){this.doCenter(this.mapStartPosX,this.mapStartPosY,c)}else{this.mapObject.zoomToMaxExtent()}},hasControlShortcuts:function(){return(this.mapControlShortcuts.length>0)?true:false},addControlShortcut:function(e,f,c,d,a){var b={id:e,title:f,icon:c,trigger:d,activated:a};this.mapControlShortcuts.push(new TBView.Map.Controls.Shortcut(b))},getCurrentTheme:function(){return this.mapBaseLayer},hasThemes:function(){return(this.mapThemes.length>0)?true:false},addTheme:function(d,g,b,e,f){var c={mapdefinition:this.mapDefinition,basemaplayergroupname:b,transparent:true,units:"m",format:TBView.CONFIG_MAP_TILE_IMAGE_FORMAT};var a={singleTile:false,isBaseLayer:true,useHttpTile:false,transitionEffect:"resize",buffer:this.mapBuffer,visibility:f,mapType:d,standard:f,themeId:g,themeName:b,defaultSize:new OpenLayers.Size(this.mapTileWidth,this.mapTileHeight)};if(!TBView.Util.isEmpty(TBView.CONFIG_GLOBAL_ATTRIBUTION)){a.attribution=TBView.CONFIG_GLOBAL_ATTRIBUTION}this.mapThemes.push(new OpenLayers.Layer.MapGuide(e,this.mapThemeUrls,c,a))},addThemeWms:function(k,d,a,o,e,m,j,n,c,h,f,g){var b=j.split(",");if(k=="TBView.Theme.WMS"){var l={transparent:true,units:"m",layers:m,format:"image/"+n};var i={visibility:e,singleTile:c,isBaseLayer:true,buffer:this.mapBuffer,mapType:k,standard:e,themeId:d,themeName:a,themeLabel:o};if(!TBView.Util.isEmpty(f)){l.srs=f}if(!TBView.Util.isEmpty(g)){i.attribution=g}if(!TBView.Util.isEmpty(h)){i.ratio=h}this.mapThemes.push(new OpenLayers.Layer.WMS(o,b,l,i))}else{if(k=="TBView.Theme.TMS"){var l={transparent:true,units:"m",visibility:e,layername:m,type:n,buffer:this.mapBuffer,mapType:k,standard:e,themeId:d,themeName:a,themeLabel:o};if(!TBView.Util.isEmpty(f)){l.srs=f}if(!TBView.Util.isEmpty(g)){l.attribution=g}if(!TBView.Util.isEmpty(h)){l.ratio=h}this.mapThemes.push(new OpenLayers.Layer.TMS(o,b,l))}else{return}}},setTheme:function(e,b){if(!this.mapThemesAsOverlay&&this.mapBaseLayer.themeId==e){return false}for(var a=0;a<this.mapThemes.length;a++){if(this.mapThemes[a].themeId==e){var d=(b&&typeof(b)!="undefined")?b:!this.mapThemes[a].visibility;if(this.mapThemesAsOverlay){this.mapThemes[a].setVisibility(d);var c=TBView.Legend.getThemeById(this.mapThemes[a].themeId);if(c){c.visible=d}}else{this.mapThemes[a].setVisibility(true)}this.mapBaseLayer=this.mapThemes[a];this.mapObject.setBaseLayer(this.mapBaseLayer);break}}TBView.Legend._updateThemes();TBView.Overview.initialize();return true},setThemeByName:function(b,c){if(!this.mapThemesAsOverlay&&this.mapBaseLayer.themeName==b){return false}for(var a=0;a<this.mapThemes.length;a++){if(this.mapThemes[a].themeName==b){var e=(c&&typeof(c)!="undefined")?c:!this.mapThemes[a].visibility;if(this.mapThemesAsOverlay){this.mapThemes[a].setVisibility(e);var d=TBView.Legend.getThemeById(this.mapThemes[a].themeId);if(d){d.visible=e}}else{this.mapThemes[a].setVisibility(true)}this.mapBaseLayer=this.mapThemes[a];this.mapObject.setBaseLayer(this.mapBaseLayer);break}}TBView.Legend._updateThemes();TBView.Overview.initialize()},hasLayers:function(){return(this.mapLayers.length>0)?true:false},addLayer:function(b,h,a,e,d,f){var g={mapName:this.mapName,session:this.mapSession,transparent:true,units:"m",format:this.mapFormat,selectioncolor:this.mapSelectionColor,behavior:7};var c={ratio:this.mapRatio,singleTile:true,isBaseLayer:d,useOverlay:!d,useAsyncOverlay:!d,transitionEffect:"resize",buffer:this.mapBuffer,visibility:f,mapType:b,standard:f,layerId:h,name:a};if(g.format&&g.format.toLowerCase().indexOf("png")>=0){c.alpha=true}if(b=="TBView.Overlay"){this.mapLayers.push(new OpenLayers.Layer.MapGuide(e,this.mapAgentUrl,g,c))}else{if(b=="TBView.Vector"){this.mapLayers.push(new OpenLayers.Layer.Vector(e,c))}}},getLayer:function(b){for(var a=0;a<this.mapLayers.length;a++){if(b==this.mapLayers[a].layerId){return this.mapLayers[a]}}return null},doCenter:function(d,c,b){if(!this.isInitalized()){return}if(!TBView.Util.isEmpty(b)){b=(parseFloat(b)<0||isNaN(parseFloat(b)))?0:parseFloat(b);b=(b>=this.mapObject.getNumZoomLevels())?(this.mapObject.getNumZoomLevels()-1):b}else{b=null}b=(this.getZoom()==b)?null:b;if(!TBView.Util.isEmpty(d)&&!TBView.Util.isEmpty(c)){var a=new OpenLayers.LonLat(parseFloat(d),parseFloat(c));if(b){this.mapObject.setCenter(a,b)}else{this.mapObject.panTo(a)}}},doCenterToScale:function(b,a,d){if(!this.isInitalized()){return}if(!TBView.Util.isEmpty(b)&&!TBView.Util.isEmpty(a)){var c=new OpenLayers.LonLat(parseFloat(b),parseFloat(a))}else{return}if(!TBView.Util.isEmpty(d)){d=(parseInt(d)<0||isNaN(parseInt(d)))?0:parseInt(d);d=(d<this.mapObject.maxScale)?this.mapObject.maxScale:d;d=(d>this.mapObject.minScale)?this.mapObject.minScale:d;if(d==parseInt(this.mapObject.getScale())){this.mapObject.panTo(c);return}this.mapObject.baseLayer.scale=d;var j=this.mapObject.getSize();var f=OpenLayers.Util.getResolutionFromScale(this.mapObject.baseLayer.scale,this.mapObject.baseLayer.units);var i=j.w*f/2;var e=j.h*f/2;var h=new OpenLayers.Bounds(c.lon-i,c.lat-e,c.lon+i,c.lat+e);var g=this.mapObject.getZoomForExtent(h,true)}else{var g=null}g=(this.getZoom()==g)?null:g;if(g){this.mapObject.moveTo(c,g,{dragging:false,forceZoomChange:true,caller:"setCenter"});if(!TBView.Util.isEmpty(d)){this.mapObject.events.triggerEvent("zoomend",{})}}else{this.mapObject.panTo(c)}},doCenterToArea:function(g,f,e){if(!this.isInitalized()){return}var c=Math.sqrt(parseFloat(e))*4;if(!TBView.Util.isEmpty(g)&&!TBView.Util.isEmpty(f)){var a=new OpenLayers.LonLat(parseFloat(g),parseFloat(f))}else{return}var b=new OpenLayers.Bounds(a.lon-c/2,a.lat-c/2,a.lon+c/2,a.lat+c/2);var d=this.mapObject.getZoomForExtent(b,true);d=(this.getZoom()==d)?null:d;if(d){this.mapObject.setCenter(a,d,false,true)}else{this.mapObject.panTo(a)}},doCenterToPoints:function(i){if(!i||i.length<1){return false}if(i.length==1){this.doCenter(parseFloat(i[0].x),parseFloat(i[0].y));return true}var f=99999999;var e=99999999;var b=0;var a=0;for(var d=0;d<i.length;d++){if(i[d].x<f){f=parseFloat(i[d].x)}if(i[d].y<e){e=parseFloat(i[d].y)}if(i[d].x>b){b=parseFloat(i[d].x)}if(i[d].y>a){a=parseFloat(i[d].y)}}var h=f+(b-f)/2;var g=e+(a-e)/2;var c=(b-f)*(a-e);this.doCenterToArea(h,g,c)},refreshOverlayMap:function(){var b=TBView.Map.getLayer("Overlay");if(b){var a={ts:(new Date()).getTime()};a=OpenLayers.Util.upperCaseObject(a);b.mergeNewParams(a)}},setCursor:function(a){a=a.replace(/(\/+)/g,"/");if(!TBView.Util.isEmpty(a)&&this.mapObject&&this.mapObject.div){this.mapObject.div.onmouseover=function(){this.style.cursor=a};this.mapObject.div.onmouseout=function(){this.style.cursor="auto"}}},showLayers:function(c,a,b){if(c!=""){this.setThemeByName(c,true)}if(a!=""||b!=""){TBView.Legend.showLayersAndLayergroups(a,b)}},showLoading:function(b){if(b=="theme"){var a=TBView.Util.GetImage("LoadingBaseLayer")}else{if(b=="layer"){var a=TBView.Util.GetImage("LoadingOverlayLayer")}}if(a){TBView.Util.SetStyle(a,"display","block")}},hideLoading:function(b){if(b=="theme"){var a=TBView.Util.GetImage("LoadingBaseLayer")}else{if(b=="layer"){var a=TBView.Util.GetImage("LoadingOverlayLayer")}}if(a){TBView.Util.SetStyle(a,"display","none")}},CLASS_NAME:"TBView.Map"};TBView.Map.Listeners={};TBView.Map.Listeners.Toolbar={activate:function(a){TBView.Formular.Favorites.deactivate();TBView.Formular.Redlining.deactivate();TBView.Formular.Selection.deactivate();TBView.Formular.Dimensioning.deactivate();TBView.Formular.Dialog.deactivate();TBView.Formular.LandRegister.destroy();TBView.Formular.InvokeReport.destroy();TBView.Formular.MultipleSelection.destroy();TBView.Map.initializeCursor(a)},CLASS_NAME:"TBView.Map.Listeners.Toolbar"};TBView.Map.Session={timerId:null,intervalSeconds:600,check:function(a){this.timerId=window.setInterval(function(){TBView.Map.Session.create()},this.intervalSeconds*1000)},create:function(d){var a={type:"actions",action:"map.check.session",ts:(new Date()).getTime()};var c=TBView.Util.GetParameterString(a);var b=TBView.getRoot()+"action.php?"+TBView.getSession()+"&"+c;TBView.Requests.sendCustom(b,function(g){if(!TBView.Requests.isComplete()){return}var f=TBView.Requests.getXml();if(f&&f.session){TBView.Map.setSession(f.session)}TBView.Requests.reset()})},CLASS_NAME:"TBView.Map.Session"};TBView.Map.Controls={};TBView.Map.Controls.PanZoomBar={};TBView.Map.Controls.PanZoomBar=OpenLayers.Class(OpenLayers.Control.PanZoomBar,{panIconW:18,panIconH:18,zoomWorldIcon:true,draw:function(b){OpenLayers.Control.prototype.draw.apply(this,arguments);b=this.position.clone();this.buttons=[];var d=new OpenLayers.Size(this.panIconW,this.panIconH);var a=new OpenLayers.Pixel(b.x+d.w/2,b.y);var c=d.w;if(this.zoomWorldIcon){a=new OpenLayers.Pixel(b.x+d.w,b.y)}this._addButton("panup","map/north.png",a,d);b.y=a.y+d.h;this._addButton("panleft","map/west.png",b,d);if(this.zoomWorldIcon){this._addButton("zoomworld","map/zoom-extent.png",b.add(d.w,0),d);c*=2}this._addButton("panright","map/east.png",b.add(c,0),d);this._addButton("pandown","map/south.png",a.add(0,d.h*2),d);if(this.map.getNumZoomLevels()>0){this._addButton("zoomin","map/zoom-plus.png",a.add(0,d.h*3+5),d);a=this._addZoomBar(a.add(0,d.h*4+5));this._addButton("zoomout","map/zoom-minus.png",a,d)}this.div.style.top="10";this.div.style.right="67";this.div.style.left="";this.div.onmouseover=function(){this.style.cursor="pointer"};this.div.onmouseout=function(){this.style.cursor=""};return this.div},_addZoomBar:function(a){var e=OpenLayers.Util.getImagesLocation();var g=this.id+"_"+this.map.id;var b=this.map.getNumZoomLevels()-1-this.map.getZoom();var c=OpenLayers.Util.createAlphaImageDiv(g,a.add(-1,b*this.zoomStopHeight),new OpenLayers.Size(20,9),e+"map/zoom-slider.png","absolute");this.slider=c;c.onmouseover=function(){this.style.cursor="pointer"};c.onmouseout=function(){this.style.cursor=""};this.sliderEvents=new OpenLayers.Events(this,c,null,true,{includeXY:true});this.sliderEvents.on({mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp,dblclick:this.doubleClick,click:this.doubleClick});var d=new OpenLayers.Size();d.h=this.zoomStopHeight*this.map.getNumZoomLevels();d.w=this.zoomStopWidth;var f=null;if(OpenLayers.Util.alphaHack()){var g=this.id+"_"+this.map.id;f=OpenLayers.Util.createAlphaImageDiv(g,a,new OpenLayers.Size(d.w,this.zoomStopHeight),e+"map/zoom-bar.png","absolute",null,"crop");f.style.height=d.h+"px"}else{f=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,a,d,e+"map/zoom-bar.png")}f.onmouseover=function(){this.style.cursor="pointer"};f.onmouseout=function(){this.style.cursor=""};this.zoombarDiv=f;this.divEvents=new OpenLayers.Events(this,f,null,true,{includeXY:true});this.divEvents.on({mousedown:this.divClick,mousemove:this.passEventToSlider,dblclick:this.doubleClick,click:this.doubleClick});this.div.appendChild(f);this.startTop=parseInt(f.style.top);this.div.appendChild(c);this.map.events.register("zoomend",this,this.moveZoomBar);a=a.add(0,this.zoomStopHeight*this.map.getNumZoomLevels());return a},CLASS_NAME:"TBView.Map.Controls.PanZoomBar"});TBView.Map.Controls.Start={};TBView.Map.Controls.Start=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.displayClass="olControlStart"},trigger:function(){TBView.Map.doInitialView()},CLASS_NAME:"TBView.Map.Controls.Start"});TBView.Map.Controls.Copyright={};TBView.Map.Controls.Copyright=OpenLayers.Class(OpenLayers.Control,{initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a])},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);var c=OpenLayers.Util.getImagesLocation();var a="poweredby.png";if(TBView.CONFIG_VERSION&&TBView.CONFIG_VERSION=="pro"){a="poweredby_pro.png"}var b=OpenLayers.Util.createAlphaImageDiv(this.id+"_Copyright",new OpenLayers.Pixel(0,0),new OpenLayers.Size(130,40),c+"map/"+a,"absolute");this.div.appendChild(b);OpenLayers.Event.observe(b,"mousedown",OpenLayers.Function.bindAsEventListener(function(d){TBView.openBox("Terms",TBView.Locale.getText("content.terms.title"),"content","view.terms","");OpenLayers.Event.stop(d,false)},b));this.div.style.top="";this.div.style.right="";this.div.style.left="0";this.div.style.bottom="45";this.div.style.cursor="pointer";return this.div},moveTo:function(a){if((a!=null)&&(this.div!=null)){this.div.style.left=a.x+"px";this.div.style.bottom=a.y+"px"}},CLASS_NAME:"TBView.Map.Controls.Copyright"});TBView.Map.Controls.Attribution={};TBView.Map.Controls.Attribution=OpenLayers.Class(OpenLayers.Control.Attribution,{initialize:function(a){OpenLayers.Control.Attribution.prototype.initialize.apply(this,arguments);this.displayClass="olControlAttribution"},updateAttribution:function(){var e=[];if(this.map&&this.map.layers){for(var d=0,b=this.map.layers.length;d<b;d++){var c=this.map.layers[d];if(c&&c.attribution&&c.getVisibility()){e.push(c.attribution)}}this.div.innerHTML=e.join(this.separator);if(TBView.Map.mapControlCopyright){var a=(e.length>0)?new OpenLayers.Pixel(0,65):new OpenLayers.Pixel(0,45);TBView.Map.mapControlCopyright.moveTo(a)}}},CLASS_NAME:"TBView.Map.Controls.Attribution"});TBView.Map.Controls.Click={};TBView.Map.Controls.Click=OpenLayers.Class(OpenLayers.Control,{initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.handler=new OpenLayers.Handler.Click(this,{click:this.trigger},{single:true,"double":false,stopSingle:true,stopDouble:true})},trigger:function(a){if(this.map.disableMapClick){return}var b=this.map.getLonLatFromViewPortPx(a.xy);this.map.panTo(b);TBView.Map.initializeCursor(a)},CLASS_NAME:"TBView.Map.Controls.Click"});TBView.Map.Controls.Feature={};TBView.Map.Controls.Feature=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,style:{},callbacks:null,handler:null,handlerOptions:null,deactivateHandler:true,destroyHandler:true,maxPoints:null,clearTime:1000,initialize:function(c,a){OpenLayers.Control.prototype.initialize.apply(this,[a]);if(this.className&&this.className!=""){this.CLASS_NAME=this.className}var b=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],this.style);this.handlerOptions=OpenLayers.Util.extend({style:b,persist:true},this.handlerOptions);this.handler=new c(this,{done:this.drawFeature,point:this.pointFeature,cancel:this.cancelFeature},this.handlerOptions)},activate:function(){if(this.active){return false}if(this.handler){this.handler.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],this.style);this.handler.selectStyle=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],this.style)}return OpenLayers.Control.prototype.activate.apply(this,arguments)},triggerDone:function(){},triggerPoint:function(){},triggerCancel:function(){},drawFeature:function(e){var c=new OpenLayers.Feature.Vector(e);var b=this.handler;var d=this.deactivateHandler;var a=this.destroyHandler;window.setTimeout(function(){if(d){b.deactivate()}if(a){if(b.destroyPoint){b.destroyPoint()}else{if(b.destroyFeature){b.destroyFeature()}else{if(b.clear){b.clear()}}}}},this.clearTime);if(this.triggerDone){this.triggerDone(c)}},pointFeature:function(d){var b=new OpenLayers.Feature.Vector(d);if(!this.handler||!this.handler.line){return}if(this.triggerPoint){this.triggerPoint(b)}var c=this.handler.line.geometry.components;if(this.maxPoints&&(c.length)>this.maxPoints){var a=this.handler.line.geometry.components.length-1;this.handler.line.geometry.removeComponent(this.handler.line.geometry.components[a]);this.handler.removePoint();this.handler.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(-100000,-10000));this.handler.finalize()}},cancelFeature:function(b){var a=new OpenLayers.Feature.Vector(b);if(this.handler){this.handler.deactivate();if(this.handler.destroyPoint){this.handler.destroyPoint()}else{if(this.handler.destroyFeature){this.handler.destroyFeature()}else{if(this.handler.clear){this.handler.clear()}}}}if(this.triggerCancel){this.triggerCancel(a)}},CLASS_NAME:"TBView.Map.Controls.Feature"});TBView.Map.Controls.Shortcut={};TBView.Map.Controls.Shortcut=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.icon=TBView.getRoot()+"layout/images/shortcuts/"+this.icon;this.displayClass="olControlShortcut"},deactivate:function(){OpenLayers.Control.prototype.deactivate.apply(this,arguments);if(this.panel_div&&this.icon){this.panel_div.style.backgroundImage="url('"+this.icon+"')"}return false},activate:function(){OpenLayers.Control.prototype.activate.apply(this,arguments);if(this.panel_div&&this.icon){this.panel_div.style.backgroundImage="url('"+this.icon+"')"}return true},CLASS_NAME:"TBView.Map.Controls.Shortcut"});TBView.Map.Controls.Tooltip={};TBView.Map.Controls.Tooltip=OpenLayers.Class(OpenLayers.Control,{tolerance:2,clientAgent:"TBView Tooltip",delay:500,divTooltip:null,lastX:null,lastY:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.handler=new OpenLayers.Handler.Hover(this,{pause:this.checkTooltip,move:this.closeTooltip},{});this.clientAgent=TBView.getTitle()+" Tooltip"},draw:function(){if(!this.divTooltip){this.divTooltip=OpenLayers.Util.createDiv("TooltipInfo");this.divTooltip.style.zIndex=(this.map.Z_INDEX_BASE.Popup-1);this.divTooltip.style.display="none";this.divTooltip.style.position="absolute";this.divTooltip.style.top="";this.divTooltip.style.left="";this.divTooltip.className="olControlTooltip";this.map.viewPortDiv.appendChild(this.divTooltip)}},checkTooltip:function(i){var c=this.map.getLonLatFromViewPortPx(new OpenLayers.Pixel(i.xy.x-this.tolerance,i.xy.y-this.tolerance));var h=this.map.getLonLatFromViewPortPx(new OpenLayers.Pixel(i.xy.x+this.tolerance,i.xy.y+this.tolerance));if(!c||!h||!this.divTooltip||(this.lastY==i.xy.y&&this.lastX==i.xy.x)){return}this.lastY=i.xy.y;this.lastX=i.xy.x;this.divTooltip.style.top=(i.xy.y+10)+"px";this.divTooltip.style.left=(i.xy.x+10)+"px";var g="POLYGON(("+c.lon+" "+c.lat+", "+c.lon+" "+h.lat+", "+h.lon+" "+h.lat+", "+h.lon+" "+c.lat+", "+c.lon+" "+c.lat+"))";var b={operation:"QUERYMAPFEATURES",session:TBView.Map.getSession(),mapname:TBView.Map.getName(),geometry:g,maxFeatures:1,persist:0,selectionVariant:"INTERSECTS",layerAttributeFilter:5,version:"1.0.0",clientAgent:this.clientAgent,ts:(new Date()).getTime()};var d=TBView.Legend.getSelectableLayers();if(d.length>0){b.layerNames=d.join(",")}b=OpenLayers.Util.upperCaseObject(b);var e=TBView.Util.GetParameterString(b);var a=TBView.Map.mapAgentUrl+e;var f=OpenLayers.Function.bind(this.showTooltip,this);TBView.Requests.sendCustom(a,function(k){if(!TBView.Requests.isComplete()){return}try{var j=TBView.Requests.getXml();if(j&&j.FeatureInformation){f(j.FeatureInformation.Tooltip,j.FeatureInformation.Hyperlink)}}catch(k){}TBView.Requests.reset()})},showTooltip:function(d,c){if(!this.divTooltip){return}d=(d)?d.replace(/\\n/g,"<br>"):"";c=(c)?c.replace(/\\n/g,"<br>"):"";var b=TBView.Util.stripHTML(d);var a=TBView.Util.stripHTML(c);if(TBView.Util.isEmpty(b)&&TBView.Util.isEmpty(a)){return}if(!TBView.Util.isEmpty(a)){if(!TBView.Util.isEmpty(b)){d+='<br><br clear="all">'}d+=TBView.Locale.getText("map.tooltip.link")}d=d.replace(/<br><br>/g,"<br>");d=d.replace(/<br><br>/g,"<br>");d=d.replace(/<br><br>/g,"<br>");d=d.replace(/<br><br>/g,"<br>");d=d.replace(/<br><br>/g,"<br>");d=d.replace(/<br><br>/g,"<br>");this.divTooltip.innerHTML=d;this.divTooltip.style.display="block"},closeTooltip:function(a){if(this.divTooltip){this.divTooltip.style.display="none"}},CLASS_NAME:"TBView.Map.Controls.Tooltip"});TBView.Map.Controls.Plot={};TBView.Map.Controls.Plot=OpenLayers.Class(OpenLayers.Control.ModifyFeature,{staticRadiusVertex:false,startRadiusVertexOffsetX:null,startRadiusVertexOffsetY:null,lastRadiusVertexOffsetX:null,lastRadiusVertexOffsetY:null,initialize:function(b,a){OpenLayers.Control.ModifyFeature.prototype.initialize.apply(this,arguments);this.mode=OpenLayers.Control.ModifyFeature.ROTATE|OpenLayers.Control.ModifyFeature.DRAG;this.deleteCodes=[];this.toggle=false;this.clickout=false},dragStart:function(e,c){if(this.staticRadiusVertex){var h=this.feature.geometry;var g=h.getBounds();var a=g.getCenterLonLat();var f=new OpenLayers.Geometry.Point(a.lon,a.lat);if(this.lastRadiusVertexOffsetX&&this.lastRadiusVertexOffsetY){var b=new OpenLayers.Geometry.Point(f.x+this.lastRadiusVertexOffsetX,f.y+this.lastRadiusVertexOffsetY)}else{var b=new OpenLayers.Geometry.Point(g.right,g.bottom)}var d=this._getNearestVertice(b);this.startRadiusVertexOffsetX=(d)?(d.x-f.x):null;this.startRadiusVertexOffsetY=(d)?(d.y-f.y):null;if(!this.lastRadiusVertexOffsetX&&!this.lastRadiusVertexOffsetY){this.lastRadiusVertexOffsetX=this.startRadiusVertexOffsetX;this.lastRadiusVertexOffsetY=this.startRadiusVertexOffsetY}}return OpenLayers.Control.ModifyFeature.prototype.dragStart.apply(this,arguments)},collectRadiusHandle:function(){var h=this.feature.geometry;var a=h.getBounds();var b=a.getCenterLonLat();var i=new OpenLayers.Geometry.Point(b.lon,b.lat);if(this.staticRadiusVertex&&this.lastRadiusVertexOffsetX&&this.lastRadiusVertexOffsetY){var g=this._getNearestVertice(new OpenLayers.Geometry.Point(i.x+this.lastRadiusVertexOffsetX,i.y+this.lastRadiusVertexOffsetY));this.lastRadiusVertexOffsetX=(g)?(g.x-i.x):null;this.lastRadiusVertexOffsetY=(g)?(g.y-i.y):null}else{var g=new OpenLayers.Geometry.Point(a.right,a.bottom)}var f=new OpenLayers.Feature.Vector(g);var c=(this.mode&OpenLayers.Control.ModifyFeature.RESIZE);var e=(this.mode&OpenLayers.Control.ModifyFeature.RESHAPE);var d=(this.mode&OpenLayers.Control.ModifyFeature.ROTATE);var j=this;g.move=function(u,t){j.radiusVertexMoveing=true;OpenLayers.Geometry.Point.prototype.move.call(this,u,t);var v=this.x-i.x;var q=this.y-i.y;var w=v-u;var r=q-t;if(d){var l=Math.atan2(r,w);var k=Math.atan2(q,v);var o=(k-l)*180/Math.PI;h.rotate(o,i);if(j.staticRadiusVertex){j.lastRadiusVertexOffsetX=v;j.lastRadiusVertexOffsetY=q}}if(c){var n,s;if(e){n=q/r;s=(v/w)/n}else{var p=Math.sqrt((w*w)+(r*r));var m=Math.sqrt((v*v)+(q*q));n=m/p}h.resize(n,i,s)}};f._sketch=true;this.radiusHandle=f;this.layer.addFeatures([this.radiusHandle],{silent:true})},clearRadiusVertex:function(){this.lastRadiusVertexOffsetX=null;this.lastRadiusVertexOffsetY=null;this.startRadiusVertexOffsetX=null;this.startRadiusVertexOffsetY=null},getRadiusVertexStart:function(){var a=this.feature.geometry.getBounds().getCenterLonLat();var b=new OpenLayers.Geometry.Point(a.lon,a.lat);return new OpenLayers.Geometry.Point(b.x+this.startRadiusVertexOffsetX,b.y+this.startRadiusVertexOffsetY)},getRadiusVertexLast:function(){var a=this.feature.geometry.getBounds().getCenterLonLat();var b=new OpenLayers.Geometry.Point(a.lon,a.lat);return new OpenLayers.Geometry.Point(b.x+this.lastRadiusVertexOffsetX,b.y+this.lastRadiusVertexOffsetY)},_getNearestVertice:function(e){if(!this.feature||!this.feature.geometry){return new OpenLayers.Geometry.Point()}var c=this.feature.geometry.getVertices();var d=null;var a=null;for(var b=0;b<c.length;b++){var f=e.distanceTo(c[b]);if(!d||f<a){d=c[b];a=f}}return new OpenLayers.Geometry.Point(d.x,d.y)},dragComplete:function(d){if(this.staticRadiusVertex&&this.radiusVertexMoveing){var a=this.feature.geometry.getBounds().getCenterLonLat();var c=new OpenLayers.Geometry.Point(a.lon,a.lat);var b=this._getNearestVertice(this.getRadiusVertexLast());this.lastRadiusVertexOffsetX=(b)?(b.x-c.x):null;this.lastRadiusVertexOffsetY=(b)?(b.y-c.y):null}this.radiusVertexMoveing=false;this.resetVertices();this.setFeatureState();this.onModification(this.feature);this.layer.events.triggerEvent("featuremodified",{feature:this.feature})},CLASS_NAME:"TBView.Map.Controls.Plot"});TBView.Map.Controls.Hyperlink={};TBView.Map.Controls.Hyperlink=OpenLayers.Class(OpenLayers.Control,{tolerance:2,clientAgent:"TBView Hyperlink",initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.handler=new OpenLayers.Handler.Click(this,{dblclick:this.onDblClick},{single:false,"double":true,stopSingle:false,stopDouble:true});this.clientAgent=TBView.getTitle()+" Hyperlink"},onDblClick:function(c){if(TBView.Map.getMap().disableMapClick){return}var e=TBView.Map.getMap().getLonLatFromViewPortPx(new OpenLayers.Pixel(c.xy.x-this.tolerance,c.xy.y-this.tolerance));var b=TBView.Map.getMap().getLonLatFromViewPortPx(new OpenLayers.Pixel(c.xy.x+this.tolerance,c.xy.y+this.tolerance));if(!e||!b){return}var h="POLYGON(("+e.lon+" "+e.lat+", "+e.lon+" "+b.lat+", "+b.lon+" "+b.lat+", "+b.lon+" "+e.lat+", "+e.lon+" "+e.lat+"))";var a={operation:"QUERYMAPFEATURES",session:TBView.Map.getSession(),mapname:TBView.Map.getName(),geometry:h,maxFeatures:1,persist:0,selectionVariant:"INTERSECTS",layerAttributeFilter:3,version:"1.0.0",clientAgent:this.clientAgent,ts:(new Date()).getTime()};var g=TBView.Legend.getSelectableLayers();if(g.length>0){a.layerNames=g.join(",")}a=OpenLayers.Util.upperCaseObject(a);var f=TBView.Util.GetParameterString(a);var d=TBView.Map.mapAgentUrl+f;TBView.Requests.sendCustom(d,function(k){if(!TBView.Requests.isComplete()){return}try{var j=TBView.Requests.getXml();if(j&&j.FeatureInformation&&j.FeatureInformation.Hyperlink){var l=j.FeatureInformation.Hyperlink;if(TBView.Util.stristr(l,"image#")||TBView.Util.stristr(l,"link#")){var i=l.split("#").reverse();l=i[0]}TBView.openWindow(l,true)}}catch(k){}TBView.Requests.reset()});OpenLayers.Event.stop(c);return false},CLASS_NAME:"TBView.Map.Controls.Hyperlink"});TBView.Map.Controls.Print={};TBView.Map.Controls.Print=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.displayClass="olControlPrint"},trigger:function(){TBView.openBox("MapPrint",TBView.Locale.getText("map.print.title"),"featureinfo","view.map.print","")},CLASS_NAME:"TBView.Map.Controls.Print"});TBView.Map.Controls.Scale={};TBView.Map.Controls.Scale=OpenLayers.Class(OpenLayers.Control,{zoom:null,height:22,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a])},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){this.div.left="";this.div.top="";this.element=this.div;this.element.className="olControlScale"}this.div.style.top="";this.div.style.right="3";this.div.style.left="";this.div.style.bottom=TBView.Map.mapPositionRightBottom;TBView.Map.mapPositionRightBottom+=this.height;this.inputField=TBView.Util.CreateElement("INPUT",{type:"text",maxLength:"6",className:"olControlScaleInput",value:"0"},{width:"48px"});this.element.innerHTML=TBView.Locale.getText("map.scale")+"&nbsp;1&nbsp;:&nbsp;";this.element.appendChild(this.inputField);this.inputField.onmousedown=function(a){TBView.Events.clearEvents(a)};this.inputField.onmousemove=function(a){TBView.Events.clearEvents(a)};this.inputField.ondblclick=function(a){TBView.Events.clearEvents(a)};this.inputField.onclick=function(a){this.focus();this.value="";this.style.border="1px dashed #333333";this.style.padding="0px 2px";TBView.Events.clearEvents(a)};OpenLayers.Event.observe(this.inputField,"keyup",this.keyPressHandler.bindAsEventListener(this));this.map.events.register("zoomend",this,this.scaleChanged);this.scaleChanged();return this.div},keyPressHandler:function(b){this.inputField.value=(isNaN(parseInt(this.inputField.value)))?this.map.getScale():parseInt(this.inputField.value);var a=(b.keyCode)?b.keyCode:b.charCode;if(a==13){this.zoomToScale()}},zoomToScale:function(c){var d=(isNaN(this.inputField.value))?this.map.getScale():this.inputField.value;var a=this.map.getCenter();TBView.Map.doCenterToScale(a.lon,a.lat,d);this.inputField.value=Math.round(this.map.getScale());try{if(this.inputField.blur){this.inputField.blur()}}catch(b){}this.inputField.style.border="0px";this.inputField.style.padding="0px"},scaleChanged:function(){if(!this.map.getScale()){return}if(this.zoom&&this.zoom!=this.map.getZoom()){this.map.baseLayer.scale=null}this.zoom=this.map.getZoom();this.inputField.value=Math.round(this.map.getScale());this.inputField.style.border="0px";this.inputField.style.padding="0px";try{if(this.inputField.blur){this.inputField.blur()}}catch(a){}},CLASS_NAME:"TBView.Map.Controls.Scale"});TBView.Map.Controls.ScaleLine={};TBView.Map.Controls.ScaleLine=OpenLayers.Class(OpenLayers.Control,{maxWidth:100,outUnits:"km",inUnits:"m",element:null,height:22,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a])},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){this.div.left="";this.div.top="";this.element=this.div;this.element.className="olControlScaleLine"}this.div.style.display="block";this.div.style.position="absolute";this.div.style.top="";this.div.style.right="3";this.div.style.left="";this.div.style.bottom=TBView.Map.mapPositionRightBottom;TBView.Map.mapPositionRightBottom+=this.height;this.map.events.register("moveend",this,this.updateScaleLine);this.updateScaleLine();return this.div},getBarLen:function(b){var d=parseInt(Math.log(b)/Math.log(10));var a=Math.pow(10,d);var c=parseInt(b/a);var e;if(c>5){e=5}else{if(c>2){e=2}else{e=1}}return e*a},updateScaleLine:function(){var e=this.map.getResolution();if(!e){return}var g=this.map.getUnits();var h=OpenLayers.INCHES_PER_UNIT;var f=this.maxWidth*e*h[g];var c;if(f>100000){c=this.outUnits}else{c=this.inUnits}var b=f/h[c];var a=this.getBarLen(b);b=a/h[g]*h[c];var d=b/e;this.element.style.width=Math.round(d)+"px";this.element.innerHTML=a+" "+c},CLASS_NAME:"TBView.Map.Controls.ScaleLine"});TBView.Map.Controls.Selection={};TBView.Map.Controls.Selection=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,controlHyperlink:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a]);if(TBView.Map.mapControlHyperlinks=="true"){this.controlHyperlink=new TBView.Map.Controls.Hyperlink()}this.handler=new OpenLayers.Handler.Click(this,{click:this.onClick,dblclick:this.onDblClick,keyMask:OpenLayers.Handler.MOD_CTRL},{single:true,"double":(this.controlHyperlink)?true:false,stopSingle:true,stopDouble:true});this.displayClass="olControlSelection"},onClick:function(b){var a=this.map.events.getMousePosition(b);TBView.Selection.doSelectionPoint(a.x,a.y,"px",b.ctrlKey,false)},onDblClick:function(a){if(this.controlHyperlink){this.controlHyperlink.onDblClick(a)}},CLASS_NAME:"TBView.Map.Controls.Selection"});TBView.Map.Controls.SelectionClear={};TBView.Map.Controls.SelectionClear=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.displayClass="olControlSelectionClear"},trigger:function(){TBView.Selection.clearSelections()},CLASS_NAME:"TBView.Map.Controls.SelectionClear"});TBView.Map.Controls.Measure={};TBView.Map.Controls.Measure=OpenLayers.Class(OpenLayers.Control.Measure,{type:OpenLayers.Control.TYPE_TOOL,geodesic:false,callbacks:null,handlerOptions:{},mode:"",controlModify:null,divTooltips:[],initialize:function(b,a){this.EVENT_TYPES=OpenLayers.Control.Measure.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);this.callbacks=OpenLayers.Util.extend({done:this.measureComplete,point:this.measurePartial},this.callbacks);this.handlerOptions=OpenLayers.Util.extend({style:OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],TBView.Map.SketchSymbolizers.Measure),selectStyle:OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],TBView.Map.SketchSymbolizers.MeasureSelect),persist:true},this.handlerOptions);this.handler=new b(this,this.callbacks,this.handlerOptions);if(this.handler.CLASS_NAME=="OpenLayers.Handler.Path"){this.displayClass="olControlMeasureLine";this.mode="Path"}else{if(this.handler.CLASS_NAME=="OpenLayers.Handler.Polygon"){this.displayClass="olControlMeasurePolygon";this.mode="Polygon"}}this.events.on({measure:this.updateTooltips,measurepartial:this.updateTooltips})},activate:function(){if(this.active){return false}this.divTooltips=[];OpenLayers.Control.prototype.activate.apply(this,arguments);this.handler.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],TBView.Map.SketchSymbolizers.Measure);this.handler.selectStyle=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],TBView.Map.SketchSymbolizers.MeasureSelect);if(this.handler.layer){if(!this.controlModify){this.controlModify=new OpenLayers.Control.ModifyFeature(this.handler.layer,{renderIntent:"default",toggle:false});this.map.addControl(this.controlModify)}this.controlModify.activate();this.controlModify.selectControl.selectStyle=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style.select,TBView.Map.SketchSymbolizers.MeasureSelect)}TBView.Map.setCursor("url("+TBView.getRoot()+"layout/images/cursors/measure.cur), crosshair");this.map.events.register("move",this,this.updateTooltips);return true},deactivate:function(){if(!this.active){return false}if(this.divTooltips.length>0&&this.handler.layer){for(var a=0;a<this.divTooltips.length;a++){this.map.viewPortDiv.removeChild(this.divTooltips[a])}this.divTooltips=null;delete this.divTooltips}if(this.controlModify){this.controlModify.destroy();delete this.controlModify}this.map.events.unregister("move",this,this.updateTooltips);TBView.Map.initializeCursor();return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},_getTooltipDiv:function(){var a=OpenLayers.Util.createDiv("MeasureInfo"+(this.divTooltips.length+1));if(a){a.style.zIndex=(this.map.Z_INDEX_BASE.Popup-1);a.style.display="none";a.style.position="absolute";a.style.top="";a.style.left="";a.className="olControlMeasure"}return a},measureComplete:function(a){if(!this.active){return false}if(this.mode=="Polygon"){this.controlModify.selectFeature(this.handler.polygon)}else{if(this.mode=="Path"){this.controlModify.selectFeature(this.handler.line)}}this.controlModify.activate();this.handler.layer.events.on({vertexmodified:this.updateTooltips,scope:this});return OpenLayers.Control.Measure.prototype.measureComplete.apply(this,arguments)},measurePartial:function(a,d){if(!this.active){return false}if(!this.drawing&&this.divTooltips.length>0){for(var b=0;b<this.divTooltips.length;b++){this.divTooltips[b].style.display="none"}}if(this.mode=="Polygon"){if(this.divTooltips.length<1){var c=this._getTooltipDiv();this.divTooltips.push(c);if(this.handler.layer){this.map.viewPortDiv.appendChild(c)}}}else{if(this.mode=="Path"){var c=this._getTooltipDiv();this.divTooltips.push(c);if(this.handler.layer){this.map.viewPortDiv.appendChild(c)}}}return OpenLayers.Control.Measure.prototype.measurePartial.apply(this,arguments)},updateTooltips:function(){var f=this.handler.getGeometry();if(!f){return false}var d,a;if(f.CLASS_NAME.indexOf("LineString")>-1){d=this.getBestLength(f);a=1;var b=f.getVertices();for(var c=this.divTooltips.length;c<b.length;c++){var e=this._getTooltipDiv();this.divTooltips.push(e);if(this.handler.layer){this.map.viewPortDiv.appendChild(e)}}}else{d=this.getBestArea(f);a=2}this.showTooltips({measure:d[0],units:d[1],order:a,geometry:f})},showTooltips:function(k){if(this.divTooltips.length<1){return}var n=k.geometry;var m=k.units;var g=k.order;var d=k.measure;if(this.mode=="Polygon"){var l=n.getVertices();if(l.length<3){return}var h=999999999;var c=0;var f=999999999;var a=0;for(var q=0;q<l.length;q++){var r=l[q];if(r.x<h){h=r.x}if(r.x>c){c=r.x}if(r.y<f){f=r.y}if(r.y>a){a=r.y}}var o=this.map.getViewPortPxFromLonLat(new OpenLayers.LonLat(h+(c-h)/2,f+(a-f)/2));if(isNaN(o.x)||isNaN(o.y)){return}var s=this.divTooltips[0];s.style.display="block";s.innerHTML=TBView.Locale.getText("map.measure.area")+":&nbsp;"+d.toFixed(1)+"&nbsp;"+m+"&sup2;";s.style.top=(parseInt(o.y)-TBView.Util.GetHeight(s)/2)+"px";s.style.left=(parseInt(o.x)-TBView.Util.GetWidth(s)/2)+"px"}else{if(this.mode=="Path"){var l=n.getVertices();if(l.length<2){return}var p=[];p.push(l[0]);for(var j=1;j<l.length;j++){var r=l[j];p.push(r);var b=this.getBestLength(new OpenLayers.Geometry.LineString(p));var o=this.map.getViewPortPxFromLonLat(new OpenLayers.LonLat(r.x,r.y));var s=this.divTooltips[j];if(s&&!isNaN(o.x)&&!isNaN(o.y)){s.style.display="block";s.style.top=(parseInt(o.y)+5)+"px";s.style.left=(parseInt(o.x)+5)+"px";s.innerHTML=TBView.Locale.getText("map.measure.length")+":&nbsp;"+b[0].toFixed(1)+"&nbsp;"+b[1]}}}}},CLASS_NAME:"TBView.Map.Controls.Measure"});TBView.Map.Controls.Loading={};TBView.Map.Controls.Loading=OpenLayers.Class(OpenLayers.Control,{counter:0,maximized:false,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.displayClass="LoadingMap";this.div=TBView.Util.GetLayer("TBViewLoadingMap")},addLayer:function(a){if(a.layer){a.layer.events.register("loadstart",this,this.increaseCounter);a.layer.events.register("loadend",this,this.decreaseCounter)}},setMap:function(c){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.events.register("preaddlayer",this,this.addLayer);for(var b=0;b<this.map.layers.length;b++){var a=this.map.layers[b];a.events.register("loadstart",this,this.increaseCounter);a.events.register("loadend",this,this.decreaseCounter)}},resetCounter:function(){this.counter=1;this.maximizeControl()},increaseCounter:function(){this.counter++;if(this.counter>0){this.maximizeControl()}},decreaseCounter:function(){if(this.counter>0){this.counter--}if(this.counter==0){this.minimizeControl()}},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);return this.div},minimizeControl:function(a){if(!this.maximized){return}this.div.style.display="none";this.maximized=false;if(a!=null){OpenLayers.Event.stop(a)}},maximizeControl:function(a){if(this.maximized){return}this.div.style.display="block";this.maximized=true;if(a!=null){OpenLayers.Event.stop(a)}},destroy:function(){if(this.map){this.map.events.unregister("preaddlayer",this,this.addLayer);if(this.map.layers){for(var b=0;b<this.map.layers.length;b++){var a=this.map.layers[b];if(a){a.events.unregister("loadstart",this,this.increaseCounter);a.events.unregister("loadend",this,this.decreaseCounter)}}}}OpenLayers.Control.prototype.destroy.apply(this,arguments)},CLASS_NAME:"TBView.Map.Controls.Loading"});TBView.Selection={divSelection:null,tolerance:2,clientAgent:"TBView Selection",selections:[],featuresTree:[],triggerDone:null,activeFeatureLayerId:"",initialize:function(){this.divSelection=TBView.Util.GetObject("TBViewSelection");if(this.divSelection){TBView.Util.SetClass(this.divThemes,"tbSelections")}this.clientAgent=TBView.getTitle()+" Selection";this.showFeatureInfos()},clear:function(){this.selections=[];this.activeFeatureLayerId="";this.update()},doSelectionPoint:function(b,a,i,g,d){var f=TBView.Map.getMap().getSize();var h=TBView.Map.getMap().getExtent();if(i=="lonlat"){var e=TBView.Map.getMap().getViewPortPxFromLonLat(new OpenLayers.LonLat(b,a));b=e.x;a=e.y}else{if(i=="px"){}else{return}}var c=TBView.Map.getMap().getLonLatFromViewPortPx(new OpenLayers.Pixel(b-this.tolerance,a-this.tolerance));var j=TBView.Map.getMap().getLonLatFromViewPortPx(new OpenLayers.Pixel(b+this.tolerance,a+this.tolerance));if(!c||!j){return}var k="POLYGON(("+c.lon+" "+c.lat+", "+c.lon+" "+j.lat+", "+j.lon+" "+j.lat+", "+j.lon+" "+c.lat+", "+c.lon+" "+c.lat+"))";this.doSelection(k,g,1,d)},doSelection:function(q,m,c,g,b){if(!q||q==""){return false}var k=TBView.Map.getMap().getSize();var n=TBView.Map.getMap().getExtent();if(b&&typeof(b)=="string"){if(b.toLowerCase()=="digitize%"||b.toLowerCase()=="dimensioning%"){var h=[];var f=TBView.Legend.getSelectableLayers();for(var e=0;e<f.length;e++){var j=f[e];if(j.toLowerCase().substr(0,8)=="digitize"){h.push(j)}else{if(j.toLowerCase().substr(0,12)=="dimensioning"){h.push(j)}}}if(h.length<1){return false}}else{var h=b.split(",")}}else{var h=TBView.Legend.getSelectableLayers()}var p=(g)?false:true;var l=(m)?false:true;var c=(c)?c:1;if(l){this.clear()}var d={operation:"QUERYMAPFEATURES",session:TBView.Map.getSession(),mapname:TBView.Map.getName(),geometry:q,maxFeatures:c,persist:1,selectionVariant:"INTERSECTS",layerNames:h.join(","),layerAttributeFilter:3,version:"1.0.0",clientAgent:this.clientAgent,ts:(new Date()).getTime()};d=OpenLayers.Util.upperCaseObject(d);var o=TBView.Util.GetParameterString(d);var a=TBView.Map.mapAgentUrl+o;TBView.Requests.sendCustom(a,function(D){if(!TBView.Requests.isComplete()){return}var H=null;try{var A=TBView.Requests.getXml();if(A){H=new TBView.Selection.Feature(A.FeatureInformation.Tooltip,A.FeatureInformation.Hyperlink);if(A.FeatureInformation.FeatureSet){var z=[].concat(A.FeatureInformation.FeatureSet);if(z[0].Layer){var x=[].concat(z[0].Layer);if(x.length>0){for(var y=0;y<x.length;y++){var w=x[y]["@id"];var t=x[y].Class;var F=x[y].Class["@id"];var B=new TBView.Selection.Layer(w,F);var u=[].concat(t.ID);for(var C=0;C<u.length;C++){B.addFeature(u[C])}H.addLayer(B)}}}}if(A.FeatureInformation.Property){var E=[].concat(A.FeatureInformation.Property);if(E.length>0){for(var s=0;s<E.length;s++){try{var r=E[s]["@name"];var G=E[s]["@value"];if(G.indexOf("TIMESTAMP")>-1){G=G.replace(/TIMESTAMP '/,"");G=G.replace(/'/,"");var v=G.split(" ");if(v[0]=="0000-00-00"){G=TBView.Locale.getTime(G)}else{if(v[1]=="00:00:00"){G=TBView.Locale.getDate(G)}else{G=TBView.Locale.getDatetime(G)}}}H.addProperty(r,G)}catch(D){}}}}}}catch(D){}TBView.Selection._addSelectedFeature(H);if(p&&H&&H.properties&&H.properties.length>0){TBView.Selection.showFeatureInfos()}TBView.Requests.reset()})},_addSelectedFeature:function(c){if(!c){return}this.selections.push(c);var e=this._getSelectionXml();var a={type:"actions",action:"map.selection",selection:e,ts:(new Date()).getTime()};var d=TBView.Util.GetParameterString(a);var b=TBView.getRoot()+"action.php?"+TBView.getSession()+"&"+d;TBView.Requests.sendCustom(b,function(f){if(!TBView.Requests.isComplete()){return}TBView.Selection.doTriggerDone();TBView.Map.refreshOverlayMap();TBView.Requests.reset()})},_getSelectionXml:function(){var e="";if(this.selections.length>0){e='<?xml version="1.0" encoding="UTF-8"?>\n';e+="<FeatureSet>\n";for(var f=0;f<this.selections.length;f++){var d=this.selections[f];for(var a=0;a<d.layers.length;a++){var c=d.layers[a];e+='<Layer id="'+c.getId()+'">\n';e+='<Class id="'+c.getClassName()+'">\n';for(var b=0;b<c.features.length;b++){var g=c.features[b];e+="<ID>"+g+"</ID>\n"}e+="</Class>\n</Layer>\n"}}e+="</FeatureSet>\n"}return e},showFeatureInfos:function(){var a=TBView.Boxes.getBox("MapSelections");if(a==null){TBView.openBox("MapSelections",TBView.Locale.getText("map.selections.title"),"featureinfo","view.map.selections","")}else{a.show()}this.update();TBView.Map.initializeCursor()},closeFeatureInfos:function(){var a=TBView.Boxes.getBox("MapSelections");if(a!=null&&!a.isClosed()){a.hide()}TBView.Map.initializeCursor()},update:function(){if(!this.divSelection){return}TBView.Util.SetContent(this.divSelection,"");this.featuresTree=[];if(this.selections.length>0){for(var e=0;e<this.selections.length;e++){var d=this.selections[e];if(d.hasProperties()&&d.hasLayers()){var b=d.layers[0].getId();var f=null;for(var c=0;c<this.featuresTree.length;c++){if(this.featuresTree[c].id==b){f=this.featuresTree[c];break}}if(f){f.properties=f.features.push(d)}else{this.activeFeatureLayerId=(this.activeFeatureLayerId=="")?b:this.activeFeatureLayerId;this.featuresTree.push({id:b,features:[d]})}}}}if(this.featuresTree.length<1){var a=TBView.Util.CreateDiv("","Textbold");a.align="center";a.style.margin="30px";a.appendChild(TBView.Util.CreateText(TBView.Locale.getText("map.selections.error.notfound")));this.divSelection.appendChild(a)}else{this._doRenderFeatures()}},hasSelections:function(){return(this.selections.length>0)?true:false},clearSelections:function(){this.clear();this.update();var a={type:"actions",action:"map.selection.clear",ts:(new Date()).getTime()};var c=TBView.Util.GetParameterString(a);var b=TBView.getRoot()+"action.php?"+TBView.getSession()+"&"+c;TBView.Requests.sendCustom(b,function(d){if(!TBView.Requests.isComplete()){return}TBView.Selection.doTriggerDone();TBView.Map.refreshOverlayMap();TBView.Requests.reset()})},doTriggerDone:function(){if(this.triggerDone){this.triggerDone();this.triggerDone=null}},setTriggerDone:function(trigger){if(typeof trigger=="function"){this.triggerDone=trigger}else{this.triggerDone=function(){eval(trigger)}}},_doRenderFeatures:function(){if(this.featuresTree.length<1){return}TBView.Util.SetContent(this.divSelection,"");var d=this._getRenderedLayers();this.divSelection.appendChild(d);var f=this._getRenderedProperties();this.divSelection.appendChild(f);var b=TBView.Util.CreateDiv("","Line");b.style.margin="5px 0px";b.appendChild(TBView.Util.CreateText(" "));this.divSelection.appendChild(b);var e=TBView.Util.CreateDiv("","SelectObjectBold");e.align="center";this.divSelection.appendChild(e);var c=TBView.Util.CreateDiv("","SelectObjectBold");c.style.display="inline";c.appendChild(TBView.Util.CreateText(TBView.Locale.getText("map.selections.clear")));e.appendChild(c);OpenLayers.Event.observe(c,"mouseover",OpenLayers.Function.bindAsEventListener(function(){TBView.Switch.SwitchClass(this,"Active")},c));OpenLayers.Event.observe(c,"mouseout",OpenLayers.Function.bindAsEventListener(function(){TBView.Switch.SwitchClass(this,"Active")},c));OpenLayers.Event.observe(c,"mousedown",OpenLayers.Function.bindAsEventListener(function(g){TBView.Selection.clearSelections()},c));e.appendChild(TBView.Util.CreateText(" | "));var a=TBView.Util.CreateDiv("","SelectObjectBold");a.style.display="inline";a.appendChild(TBView.Util.CreateText(TBView.Locale.getText("map.selections.print")));e.appendChild(a);OpenLayers.Event.observe(a,"mouseover",OpenLayers.Function.bindAsEventListener(function(){TBView.Switch.SwitchClass(this,"Active")},a));OpenLayers.Event.observe(a,"mouseout",OpenLayers.Function.bindAsEventListener(function(){TBView.Switch.SwitchClass(this,"Active")},a));OpenLayers.Event.observe(a,"mousedown",OpenLayers.Function.bindAsEventListener(function(g){TBView.Map.mapControlPrint.trigger()},a))},_getRenderedLayers:function(){var m=TBView.Util.GetObject("SelectionsContainerLayers");if(!m){m=TBView.Util.CreateDiv("SelectionsContainerLayers","tbSelections")}var b=TBView.Util.CreateDiv("","tbSelections");b.style.width="100%";m.appendChild(b);var k=document.createElement("TABLE");k.width="100%";k.border="0";k.cellSpacing="0";k.cellPadding="2";b.appendChild(k);var i=document.createElement("TBODY");k.appendChild(i);var a=i.insertRow(-1);a.vAlign="middle";var c=a.insertCell(-1);c.appendChild(TBView.Util.CreateImg("","blank.gif","5","1","","",""));var c=a.insertCell(-1);c.className="Textbold";c.noWrap=true;c.appendChild(TBView.Util.CreateText(TBView.Locale.getText("map.selections.layer")));var c=a.insertCell(-1);c.appendChild(TBView.Util.CreateImg("","blank.gif","10","1","","",""));if(this.featuresTree.length>1){var j=TBView.Util.CreateElement("SELECT",{size:1,className:"Select"},{width:"100%"});var c=a.insertCell(-1);c.width="100%";c.appendChild(j);for(var h=0;h<this.featuresTree.length;h++){var e=this.featuresTree[h];var g=TBView.Legend.getLayerById(e.id);var d=(e.id==this.activeFeatureLayerId)?true:false;j.options[j.options.length]=new Option(g.getLabel()+" ["+e.features.length+"]",e.id,false,d)}OpenLayers.Event.observe(j,"change",OpenLayers.Function.bindAsEventListener(function(f){TBView.Selection.activeFeatureLayerId=this.value;TBView.Selection._doRenderFeatures();OpenLayers.Event.stop(f,false)},j))}else{var g=TBView.Legend.getLayerById(this.featuresTree[0].id);var l=(g&&g.getLabel)?g.getLabel():"";var c=a.insertCell(-1);c.className="Textnormal";c.width="100%";c.appendChild(TBView.Util.CreateText(l))}var c=a.insertCell(-1);c.appendChild(TBView.Util.CreateImg("","blank.gif","5","1","","",""));return m},_getRenderedProperties:function(){var s=TBView.Util.GetObject("SelectionsContainerProperties");if(!s){s=TBView.Util.CreateDiv("SelectionsContainerProperties","tbSelections")}for(var j=0;j<this.featuresTree.length;j++){if(this.featuresTree[j].id==this.activeFeatureLayerId){var g=this.featuresTree[j].features;for(var n=0;n<g.length;n++){var q=g[n].properties;var l=TBView.Util.CreateDiv("","Line");l.style.margin="5px 0px";l.appendChild(TBView.Util.CreateText(" "));s.appendChild(l);var c=TBView.Util.CreateDiv("","tbSelections");c.style.padding="0px 5px";c.style.width="100%";s.appendChild(c);var r=document.createElement("TABLE");r.width="100%";r.border="0";r.cellSpacing="0";r.cellPadding="2";c.appendChild(r);var m=document.createElement("TBODY");r.appendChild(m);for(var d=0;d<q.length;d++){if(q[d].value!=""){try{var b=m.insertRow(-1);b.vAlign="top";var h=b.insertCell(-1);h.className="Textnormal";h.noWrap=true;h.appendChild(TBView.Util.CreateText(q[d].name+":"));var h=b.insertCell(-1);h.appendChild(TBView.Util.CreateImg("","blank.gif","10","1","","",""));if(TBView.Util.stristr(q[d].value,"LINK#")){var a=q[d].value.split("#");var k=TBView.Util.CreateElement("A",{href:a[1],target:"_blank",className:"Textnormal"},{});k.appendChild(TBView.Util.CreateText(TBView.Locale.getText("map.selections.link")))}else{if(TBView.Util.stristr(q[d].value,"IMAGE#")){var a=q[d].value.split("#");var k=new Image();k.src=a[3];if(!isNaN(parseInt(a[1]))&&parseInt(a[1])>0){k.width=parseInt(a[1])}if(!isNaN(parseInt(a[2]))&&parseInt(a[2])>0){k.height=parseInt(a[2])}}else{if(TBView.Util.stristr(q[d].value,"://")){var k=TBView.Util.CreateElement("A",{href:q[d].value,target:"_blank",className:"Textnormal"},{});k.appendChild(TBView.Util.CreateText(TBView.Locale.getText("map.selections.link")))}else{var k=TBView.Util.CreateText(q[d].value)}}}var h=b.insertCell(-1);h.className="Textnormal";h.width="100%";h.appendChild(k)}catch(o){}}}}break}}return s},CLASS_NAME:"TBView.Selection"};TBView.Selection.Feature={};TBView.Selection.Feature=OpenLayers.Class({tooltip:"",hyperlink:"",properties:[],layers:[],initialize:function(a,b){this.tooltip=a;this.hyperlink=b;this.properties=[];this.layers=[];this.id="TBView.Selection.Feature-"+Date.parse(new Date())},hasProperties:function(){return(this.properties.length>0)?true:false},hasLayers:function(){return(this.layers.length>0)?true:false},addLayer:function(a){this.layers.push(a)},addProperty:function(a,b){this.properties.push({name:a,value:((b==undefined)?"":b)})},getId:function(){return this.id},getTooltip:function(){return this.tooltip},getHyperlink:function(){return this.hyperlink},CLASS_NAME:"TBView.Selection.Feature"});TBView.Selection.Layer={};TBView.Selection.Layer=OpenLayers.Class({id:"",className:"",features:[],initialize:function(b,a){this.id=b;this.className=a;this.features=[]},addFeature:function(a){this.features.push(a)},getId:function(){return this.id},getClassName:function(){return this.className},hasFeatures:function(){return(this.features.length>0)?true:false},getCountFeatures:function(){return this.features.length},removeFeatures:function(a){var b=a.length;for(var c=0;c<a.length;c++){this.features.remove(a[c])}},CLASS_NAME:"TBView.Selection.Layer"});TBView.Legend={defaultLayerDWFIcon:"layout/images/legend/DWF.png",defaultLayerRasterIcon:"layout/images/legend/raster.png",defaultLayerThemeIcon:"layout/images/legend/theme.png",defaultLayerDisabledIcon:"layout/images/legend/layer.png",defaultLayerSelectIcon:"layout/images/legend/select.gif",defaultLayerUnselectIcon:"layout/images/legend/unselect.gif",defaultLayerCheckedIcon:"layout/images/legend/checked.gif",defaultLayerUncheckedIcon:"layout/images/legend/unchecked.gif",bgPositionNode:"0px -60px",bgPositionNodeOpened:"0px -100px",bgPositionNodeClosed:"0px -80px",bgPositionNodeLast:"0px -120px",bgPositionNodeLastOpened:"0px -160px",bgPositionNodeLastClosed:"0px -140px",bgPositionFolderOpened:"0px -38px",bgPositionFolderClosed:"0px -18px",imgBlankSrc:"layout/images/blank.gif",imgBlank:null,clientAgent:"TBView Legend",lastOverlayParams:{},lastInitializedScale:null,divThemes:null,divLegend:null,config:null,treeLegend:[],treeThemes:[],layergroups:[],layers:[],themes:[],showHiddenLayers:false,imagesNoCache:false,visibleLayers:[],hiddenLayers:[],selectableLayers:[],selectableTemporaryDigitizeLayers:[],selectableTemporaryDimensioningLayers:[],visibleLayergroups:[],hiddenLayergroups:[],initialize:function(){this.divThemes=TBView.Util.GetObject("TBViewThemes");this.divLegend=TBView.Util.GetObject("TBViewLegend");this.clientAgent=TBView.getTitle()+" Legend";if(this.divThemes){TBView.Util.SetClass(this.divThemes,"tbThemesTree");TBView.Util.SetStyle(this.divThemes,"marginBottom","20px")}if(this.divLegend){TBView.Util.SetClass(this.divLegend,"tbLegendTree");TBView.Util.SetStyle(this.divLegend,"marginBottom","20px")}if(this.config){return this.update()}this.imgBlank=new Image();this.imgBlank.src=TBView.getRoot()+this.imgBlankSrc;this.showHiddenLayers=(TBView.CONFIG_MAP_LEGEND_SHOWHIDDENLAYERS=="true")?true:false;this.imagesNoCache=(TBView.CONFIG_MAP_LEGEND_IMAGESNOCACHE=="true")?true:false;TBView.Requests.loadCustom(TBView.getRoot()+"action.php?type=actions&action=map.legend&"+TBView.getSession(),function(a){if(!TBView.Requests.isComplete()||this.config){return}TBView.Legend.setXml(TBView.Requests.getXml());TBView.Requests.reset()});TBView.Map.mapObject.events.register("zoomend",TBView.Map.mapObject,function(a){if(TBView.Legend.config){TBView.Legend.update()}})},clearScale:function(){this.lastOverlayParams={};this.lastInitializedScale=null},clearVisibility:function(){this.visibleLayers=[];this.hiddenLayers=[];this.visibleLayergroups=[];this.hiddenLayergroups=[]},clearSelectability:function(){this.selectableLayers=[];this.selectableTemporaryDigitizeLayers=[];this.selectableTemporaryDimensioningLayers=[]},isInitialized:function(){return(this.config)?true:false},setXml:function(e){if(!e||!e.legend){return}this.config=e;this.layers=[];this.layergroups=[];this.themes=[];var j=[];if(this.config.legend&&this.config.legend.layergroups&&this.config.legend.layergroups.layergroup){j=[].concat(this.config.legend.layergroups.layergroup)}for(var h=0;h<j.length;h++){var a=new TBView.Legend.Layergroup(j[h]);if(a.type==2){this.themes.push(a);j.remove(h);h--}else{if(a.parentGroupId==""){this.layergroups.push(a);j.remove(h);h--}else{j[h]=a}}}for(var h=0;h<j.length;h++){var i=this.getLayergroupById(j[h].parentGroupId);i.addLayergroup(j[h]);j.remove(h);h--}for(var k=0;k<TBView.Map.mapThemes.length;k++){var c=TBView.Map.mapThemes[k];if(c.mapType!="TBView.Theme.Mapguide"){var a=new TBView.Legend.Layergroup({id:c.themeId,name:c.themeName,label:c.themeLabel,type:2,displayinlegend:"true",expandinlegend:"false",selectable:"false",visible:((c.standard)?"true":"false"),actuallyvisible:((c.visibility)?"true":"false")});this.themes.push(a)}}var d=[];if(this.config.legend&&this.config.legend.layers&&this.config.legend.layers.layer){d=[].concat(this.config.legend.layers.layer)}for(var b=0;b<d.length;b++){var f=new TBView.Legend.Layer(d[b]);if(f.parentGroupId==""){this.layers.push(f)}else{var i=this.getLayergroupById(f.parentGroupId);if(i){i.addLayer(f)}else{this.layers.push(f)}}}this.update()},hasLayergroups:function(){return(this.layergroups.length>0)?true:false},hasLayers:function(){return(this.layers.length>0)?true:false},getLayergroupByName:function(a){return this.getLayergroupByAttribute("name",a)},getLayergroupById:function(a){return this.getLayergroupByAttribute("id",a)},getLayergroupByAttribute:function(c,d){for(var b=0;b<this.layergroups.length;b++){var e=this.layergroups[b].getLayergroupByAttribute(c,d);if(e){return e}}for(var a=0;a<this.themes.length;a++){var e=this.themes[a].getLayergroupByAttribute(c,d);if(e){return e}}return null},getThemeByName:function(a){return this.getThemeByAttribute("name",a)},getThemeById:function(a){return this.getThemeByAttribute("id",a)},getThemeByAttribute:function(b,c){for(var a=0;a<this.themes.length;a++){var d=this.themes[a].getLayergroupByAttribute(b,c);if(d){return d}}return null},getLayerByName:function(a){return this.getLayerByAttribute("name",a)},getLayerById:function(a){return this.getLayerByAttribute("id",a)},getLayerByAttribute:function(d,e){for(var c=0;c<this.layers.length;c++){if(this.layers[c][d]==e){return this.layers[c]}}for(var c=0;c<this.layergroups.length;c++){var b=this.layergroups[c].getLayerByAttribute(d,e);if(b){return b}}for(var a=0;a<this.themes.length;a++){var b=this.themes[a].getLayerByAttribute(d,e);if(b){return b}}return null},getAllLayers:function(){var c=[];if(this.config.legend&&this.config.legend.layers&&this.config.legend.layers.layer){c=[].concat(this.config.legend.layers.layer)}var b=[];for(var a=0;a<c.length;a++){b.push(c[a].name)}return b},getSelectableLayers:function(){return this.selectableLayers.concat(this.selectableTemporaryDimensioningLayers.concat(this.selectableTemporaryDigitizeLayers))},getLegendImageURL:function(b,c){var a=TBView.Map.mapLegendUrl;a+="OPERATION=GETLEGENDIMAGE&SESSION="+TBView.Map.getSession();a+="&VERSION=1.0.0&SCALE="+TBView.Map.getScale();a+="&LAYERDEFINITION="+encodeURIComponent(b.resourceId);a+="&LAYERID="+encodeURIComponent(b.id);a+="&THEMECATEGORY="+c.categoryIndex;a+="&TYPE="+c.geometryType;a+="&CLIENTAGENT="+encodeURIComponent(this.clientAgent);if(this.imagesNoCache){a+="&NOCACHE="+(new Date()).getTime()}return a},isLastLayergroup:function(a){var b=false;var c=false;if(this.layergroups.length>0){b=(this.layergroups[this.layergroups.length-1].id==a.id)}if(this.themes.length>0){c=(this.themes[this.themes.length-1].id==a.id)}return((b||c)?true:false)},isLastLayer:function(a){if(this.layers.length==0){return false}else{return(this.layers[this.layers.length-1].id==a.id)}},update:function(){if(TBView.Map.getScale()==this.lastInitializedScale){return}this.lastInitializedScale=TBView.Map.getScale();this.clearVisibility();this.clearSelectability();this._updateThemes();this._updateLegend();return true},updateTemporaryDigitizeLayers:function(){var a={type:"actions",action:"map.digitize.temporary",ts:(new Date()).getTime()};var c=TBView.Util.GetParameterString(a);var b=TBView.getRoot()+"action.php?"+TBView.getSession()+"&"+c;TBView.Requests.sendCustom(b,function(h){if(!TBView.Requests.isComplete()){return}TBView.Legend.selectableTemporaryDigitizeLayers=[];var d=TBView.Requests.getXml();if(d&&d.temporary&&d.temporary.layers&&d.temporary.layers.layer){var g=[].concat(d.temporary.layers.layer);for(var f=0;f<g.length;f++){TBView.Legend.selectableTemporaryDigitizeLayers.push(g[f].name)}}TBView.Requests.reset()})},updateTemporaryDimensioningLayers:function(){var a={type:"actions",action:"map.dimensioning.temporary",ts:(new Date()).getTime()};var c=TBView.Util.GetParameterString(a);var b=TBView.getRoot()+"action.php?"+TBView.getSession()+"&"+c;TBView.Requests.sendCustom(b,function(h){if(!TBView.Requests.isComplete()){return}TBView.Legend.selectableTemporaryDimensioningLayers=[];var d=TBView.Requests.getXml();if(d&&d.temporary&&d.temporary.layers&&d.temporary.layers.layer){var g=[].concat(d.temporary.layers.layer);for(var f=0;f<g.length;f++){TBView.Legend.selectableTemporaryDimensioningLayers.push(g[f].name)}}TBView.Requests.reset()})},refreshOverlayMap:function(){var b=TBView.Map.getLayer("Overlay");if(b){var a={showLayers:this.visibleLayers.length>0?this.visibleLayers.toString():null,hideLayers:this.hiddenLayers.length>0?this.hiddenLayers.toString():null,showGroups:this.visibleLayergroups.length>0?this.visibleLayergroups.toString():null,hideGroups:this.hiddenLayergroups.length>0?this.hiddenLayergroups.toString():null};if(this.lastOverlayParams!=a){this.lastOverlayParams=a;a.ts=(new Date()).getTime();a=OpenLayers.Util.upperCaseObject(a);b.mergeNewParams(a);TBView.Legend.clearVisibility()}}},_updateThemes:function(){if(this.themes.length<1||!this.divThemes){if(this.divThemes){TBView.Switch.SwitchLayer(this.divThemes,0)}return}delete this.treeThemes;this.treeThemes=[];var e=TBView.Util.CreateElement("ul",{id:"legRoot",className:"tbLegendContainer"},{margin:"0px"});if(this.divThemes){TBView.Util.SetContent(this.divThemes,"");this.divThemes.appendChild(e)}if(this.themes.length>0){var a=TBView.Util.CreateDiv("","Textbold");a.appendChild(TBView.Util.CreateText(TBView.Locale.getText("legend.themes")));e.appendChild(a);TBView.Util.SetStyle(a,"marginTop","5px")}var d=false;for(var c=0;c<this.themes.length;c++){var b=this._getRenderedTheme(this.themes[c]);if(b){if(this.divThemes&&this.themes[c].displayInLegend){b.append(e);d=true}this.treeThemes.push(b);b.finalize()}}TBView.Switch.SwitchLayer(this.divThemes,((d)?1:0));return true},_getRenderedTheme:function(h){if(!TBView.Map.hasThemesAsOverlay()){h.visible=(TBView.Map.getCurrentTheme().themeId==h.id)?true:false}if(h.visible){this.showLayergroup(h.id)}else{this.hideLayergroup(h.id)}var d=new TBView.Legend.TreeBranch(null,h,{onclick:function(){TBView.Map.setTheme(h.id)}});if(d){for(var c=0;c<h.layers.length;c++){var b=h.layers[c];var a=b.getScaleRange(this.lastInitializedScale);if(a!=null){if(a.styles.length>1){var g=new TBView.Legend.TreeItem(h,b,{checkbox:false,selectbox:b.initiallySelectable,style:null,type:"Theme",body:"Theme"});if(g){for(var f=0;f<a.styles.length;f++){var e=new TBView.Legend.TreeItem(h,b,{checkbox:false,selectbox:false,style:a.styles[f],type:"Style",body:"Theme"});if(e){e.append(g);g.treestyleitems.push(e)}}}}else{var g=new TBView.Legend.TreeItem(h,b,{checkbox:false,selectbox:b.initiallySelectable,style:a.styles[0],type:"Layer",body:"Theme"})}}else{if(TBView.Legend.showHiddenLayers){var g=new TBView.Legend.TreeItem(h,b,{checkbox:false,selectbox:false,style:null,type:"Layer",body:"Theme"})}}if(g){if(b.displayInLegend){g.append(d)}d.treeitems.push(g)}}}return d},_updateLegend:function(){if((this.layers.length<1&&this.layergroups.length<1)||!this.divLegend){if(this.divLegend){TBView.Switch.SwitchLayer(this.divLegend,0)}return}delete this.treeLegend;this.treeLegend=[];var h=TBView.Util.CreateElement("ul",{id:"legRoot",className:"tbLegendContainer"},{margin:"0px"});if(this.divLegend){TBView.Util.SetContent(this.divLegend,"");this.divLegend.appendChild(h)}if(this.layers.length>0||this.layergroups.length>0){var a=TBView.Util.CreateDiv("","Textbold");a.appendChild(TBView.Util.CreateText(TBView.Locale.getText("legend.layers")));h.appendChild(a);TBView.Util.SetStyle(a,"marginTop","5px")}var e=false;for(var c=0;c<this.layers.length;c++){var f=this._getRenderedLayer(null,this.layers[c]);if(f){if(this.layers[c].displayInLegend){f.append(h);f.displayed(true);e=true}this.treeLegend.push(f);f.finalize()}}for(var d=0;d<this.layergroups.length;d++){var b=this._getRenderedLayergroup(null,this.layergroups[d]);if(b){if(this.layergroups[d].displayInLegend){b.append(h);e=true}this.treeLegend.push(b);b.finalize()}}TBView.Switch.SwitchLayer(this.divLegend,((e)?1:0));return true},_getRenderedLayer:function(e,b){var a=b.getScaleRange(this.lastInitializedScale);if(a!=null){if(a.styles.length>1){var f=new TBView.Legend.TreeItem(e,b,{checkbox:true,selectbox:b.initiallySelectable,style:null,type:"Theme",body:"Legend"});if(f){for(var d=0;d<a.styles.length;d++){var c=new TBView.Legend.TreeItem(f,b,{checkbox:false,selectbox:false,style:a.styles[d],type:"Style",body:"Legend"});if(c){c.append(f);f.treestyleitems.push(c)}}}}else{if(b.name.toLowerCase().substr(0,8)!="digitize"&&b.name.toLowerCase().substr(0,12)!="dimensioning"){var f=new TBView.Legend.TreeItem(e,b,{checkbox:true,selectbox:b.initiallySelectable,style:a.styles[0],type:"Layer",body:"Legend"})}}}else{if(TBView.Legend.showHiddenLayers){var f=new TBView.Legend.TreeItem(e,b,{checkbox:false,selectbox:false,style:null,type:"Layer",body:"Legend"})}}return(f)?f:null},_getRenderedLayergroup:function(e,b){var d=new TBView.Legend.TreeBranch(e,b,{});if(d){for(var c=0;c<b.layers.length;c++){var h=this._getRenderedLayer(b,b.layers[c]);if(h){if(b.layers[c].displayInLegend){h.append(d)}d.treeitems.push(h)}}for(var f=0;f<b.layergroups.length;f++){var a=this._getRenderedLayergroup(b,b.layergroups[f]);if(a){if(b.layergroups[f].displayInLegend){a.append(d)}d.treebranches.push(a)}}}return((d)?d:null)},showLayer:function(c){this.visibleLayers.push(c);var b=[];for(var a=0;a<this.hiddenLayers.length;a++){if(this.hiddenLayers[a]!=c){b.push(this.hiddenLayers[a])}}this.hiddenLayers=b},hideLayer:function(c){this.hiddenLayers.push(c);var b=[];for(var a=0;a<this.visibleLayers.length;a++){if(this.visibleLayers[a]!=c){b.push(this.visibleLayers[a])}}this.visibleLayers=b},showLayergroup:function(c){this.visibleLayergroups.push(c);var b=[];for(var a=0;a<this.hiddenLayergroups.length;a++){if(this.hiddenLayergroups[a]!=c){b.push(this.hiddenLayergroups[a])}}this.hiddenLayergroups=b},hideLayergroup:function(c){this.hiddenLayergroups.push(c);var b=[];for(var a=0;a<this.visibleLayergroups.length;a++){if(this.visibleLayergroups[a]!=c){b.push(this.visibleLayergroups[a])}}this.visibleLayergroups=b},selectLayer:function(a){this.selectableLayers.push(a)},unselectLayer:function(a){var c=[];for(var b=0;b<this.selectableLayers.length;b++){if(this.selectableLayers[b]!=a){c.push(this.selectableLayers[b])}}this.selectableLayers=c},showLayersAndLayergroups:function(c,f){if(c!=""||f!=""){this.clearVisibility();this.clearSelectability();for(var e=0;e<this.layers.length;e++){var d=this.layers[e];if(d){d.visible=false;this.hideLayer(d.id)}}for(var e=0;e<this.layergroups.length;e++){var b=this.layergroups[e];if(b){b.visible=false;this.hideLayergroup(b.id)}}var a=c.split(",");for(var e=0;e<a.length;e++){var d=this.getLayerByName(a[e]);if(d){d.visible=true;this.showLayer(d.id)}}var g=f.split(",");for(var e=0;e<g.length;e++){var b=this.getLayergroupByName(g[e]);if(b){b.visible=true;this.showLayergroup(b.id)}}this._updateLegend();this.refreshOverlayMap()}},CLASS_NAME:"TBView.Legend"};TBView.Legend.LAYER_TYPE_POINT=0;TBView.Legend.LAYER_TYPE_LINE=1;TBView.Legend.LAYER_TYPE_POLYGON=2;TBView.Legend.LAYER_TYPE_SOLID=3;TBView.Legend.LAYER_TYPE_RASTER=4;TBView.Legend.LAYER_TYPE_DWF=5;TBView.Legend.TreeItem={};TBView.Legend.TreeItem=TBView.Class({id:"",data:null,parent:null,layer:null,treestyleitems:[],options:{},initialize:function(d,c,b){this.options={checkbox:true,selectbox:true,style:null,type:"Layer",body:"Legend",forexpand:true,forvisibility:true,forselectability:true};TBView.Class.setOptions(this,b);var e=this;this.parent=d;this.layer=c;this.id=((this.hasStyle()&&this.getType()=="Style")?this.options.style.id:this.layer.id);this.data=null;this.treestyleitems=[];this.data=TBView.Util.CreateElement("li",{id:"legend"+this.getId(),className:((this.isLast())?"tbLegendItemLast":"tbLegendItem")},{marginLeft:((d)?"16px":"0px")});this.data.container=TBView.Util.CreateDiv(this.getId(),"tbLegendLabel");this.data.container.title=this.getLabel();this.data.appendChild(this.data.container);OpenLayers.Event.observe(this.data.container,"mouseover",OpenLayers.Function.bindAsEventListener(function(){TBView.Switch.SwitchClass(this,"Active")},this.data.container));OpenLayers.Event.observe(this.data.container,"mouseout",OpenLayers.Function.bindAsEventListener(function(){TBView.Switch.SwitchClass(this,"Active")},this.data.container));OpenLayers.Event.observe(this.data.container,"mousedown",OpenLayers.Function.bindAsEventListener(function(){e.switchNode()},this.data.container));this.data.node=TBView.Util.CreateElement("img",{id:"node"+this.getId(),className:"tbLegendNode",src:TBView.Legend.imgBlank.src},{backgroundPosition:this.getNodePosition()});this.data.container.appendChild(this.data.node);if(this.hasCheckbox()){this.data.checkbox=TBView.Util.CreateElement("img",{id:"chk"+this.getId(),className:"tbLegendImage",src:this.getCheckboxUrl()},{});this.data.container.appendChild(this.data.checkbox);OpenLayers.Event.observe(this.data.checkbox,"mouseover",OpenLayers.Function.bindAsEventListener(function(){e.options.forexpand=false},this.data.checkbox));OpenLayers.Event.observe(this.data.checkbox,"mouseout",OpenLayers.Function.bindAsEventListener(function(){e.options.forexpand=true},this.data.checkbox));var a=(this.options.onclick)?this.options.onclick:function(){e.switchVisibility()};OpenLayers.Event.observe(this.data.checkbox,"mousedown",OpenLayers.Function.bindAsEventListener(function(){a()},this.data.checkbox));this.data.checkbox.checked=this.isVisible()}this.data.image=TBView.Util.CreateElement("img",{id:"img"+this.getId(),className:"tbLegendImage",src:TBView.Legend.imgBlank.src},{});this.data.container.appendChild(this.data.image);if(this.hasSelectbox()){this.data.selectbox=TBView.Util.CreateElement("img",{id:"select"+this.getId(),className:"tbLegendImage",src:this.getSelectboxUrl()},{});this.data.container.appendChild(this.data.selectbox);OpenLayers.Event.observe(this.data.selectbox,"mouseover",OpenLayers.Function.bindAsEventListener(function(){e.options.forexpand=false},this.data.selectbox));OpenLayers.Event.observe(this.data.selectbox,"mouseout",OpenLayers.Function.bindAsEventListener(function(){e.options.forexpand=true},this.data.selectbox));OpenLayers.Event.observe(this.data.selectbox,"mousedown",OpenLayers.Function.bindAsEventListener(function(){e.switchSelectability()},this.data.selectbox))}this.data.text=TBView.Util.CreateText(this.getLabel());this.data.container.appendChild(this.data.text)},getId:function(){return this.id},getLabel:function(){return((this.hasStyle()&&this.getType()=="Style")?this.options.style.label:this.layer.getLabel())},getType:function(){return this.options.type},getContainer:function(){return TBView.Util.GetObject("legend"+this.getId())},getNode:function(){return TBView.Util.GetObject("node"+this.getId())},getCheckbox:function(){return TBView.Util.GetObject("chk"+this.getId())},getSelectbox:function(){return TBView.Util.GetObject("select"+this.getId())},getItemImage:function(){return TBView.Util.GetObject("img"+this.getId())},hasStyle:function(){return(this.options.style)?true:false},isExpanded:function(){return this.layer.expandInLegend},isVisible:function(){return this.layer.visible},isSelectable:function(){return this.layer.selectable},isLast:function(){if(this.hasStyle()&&this.getType()=="Style"){return this.layer.isLastStyleItem(this.options.style)}else{if(this.parent){return((this.parent.isLastLayer(this.layer)&&!this.parent.hasLayergroups())?true:false)}else{return((TBView.Legend.isLastLayer(this.layer)&&!TBView.Legend.hasLayergroups())?true:false)}}},getNodePosition:function(){if(this.isLast()){if(this.getType()=="Style"||this.getType()=="Layer"){return TBView.Legend.bgPositionNodeLast}else{if(this.isExpanded()){return TBView.Legend.bgPositionNodeLastOpened}else{return TBView.Legend.bgPositionNodeLastClosed}}}else{if(this.getType()=="Style"||this.getType()=="Layer"){return TBView.Legend.bgPositionNode}else{if(this.isExpanded()){return TBView.Legend.bgPositionNodeOpened}else{return TBView.Legend.bgPositionNodeClosed}}}},getImage:function(){var a=new Image();if(this.options.type=="Theme"){a.src=TBView.getRoot()+TBView.Legend.defaultLayerThemeIcon}else{if(this.hasStyle()){if(this.layer.type==4){if(this.options.style&&this.options.style.staticIcon==TBView.Legend.LAYER_TYPE_DWF){a.src=TBView.getRoot()+TBView.Legend.defaultLayerDWFIcon}else{a.src=TBView.getRoot()+TBView.Legend.defaultLayerRasterIcon}}else{a.src=TBView.Legend.getLegendImageURL(this.layer,this.options.style)}}else{this.options.checkbox=false;a.src=TBView.getRoot()+TBView.Legend.defaultLayerDisabledIcon}}return a},getSelectboxUrl:function(){return(this.isSelectable())?TBView.getRoot()+TBView.Legend.defaultLayerSelectIcon:TBView.getRoot()+TBView.Legend.defaultLayerUnselectIcon},getCheckboxUrl:function(){return(this.isVisible())?TBView.getRoot()+TBView.Legend.defaultLayerCheckedIcon:TBView.getRoot()+TBView.Legend.defaultLayerUncheckedIcon},hasSelectbox:function(){return(this.getType()=="Style")?false:this.options.selectbox},hasCheckbox:function(){return this.options.checkbox},switchNode:function(){if(!this.options.forexpand){return}if(this.isExpanded()){this.collapse()}else{this.expand()}},switchVisibility:function(){if(!this.options.forvisibility){return}if(this.isVisible()){TBView.Legend.hideLayer(this.layer.id);this.visibility(false)}else{TBView.Legend.showLayer(this.layer.id);this.visibility(true)}},switchSelectability:function(){if(!this.options.forselectability){return}if(this.isSelectable()){this.selectability(false)}else{this.selectability(true)}},collapse:function(){this.layer.expandInLegend=false;TBView.Util.SetStyle(this.getNode(),"backgroundPosition",this.getNodePosition());for(var a=0;a<this.treestyleitems.length;a++){this.treestyleitems[a].displayed(false)}},expand:function(){this.layer.expandInLegend=true;TBView.Util.SetStyle(this.getNode(),"backgroundPosition",this.getNodePosition());for(var a=0;a<this.treestyleitems.length;a++){this.treestyleitems[a].displayed(true)}},visibility:function(a){this.layer.visible=a;if(this.hasCheckbox()&&this.getCheckbox()){this.getCheckbox().src=this.getCheckboxUrl();if(arguments.length==1||arguments[1]==true){TBView.Legend.refreshOverlayMap()}}},displayed:function(a){TBView.Util.SetStyle(this.getContainer(),"display",(a?"block":"none"));if(a){if(this.options.body=="Legend"&&TBView.Legend.divLegend){this.data.image.src=this.getImage().src}else{if(this.options.body=="Theme"&&TBView.Legend.divThemes){this.data.image.src=this.getImage().src}}}},selectability:function(a){this.layer.selectable=a;if(this.options.body=="Theme"&&this.isSelectable()&&this.parent.visible){TBView.Legend.selectLayer(this.layer.name)}else{if(this.options.body=="Legend"&&this.isSelectable()){TBView.Legend.selectLayer(this.layer.name)}else{TBView.Legend.unselectLayer(this.layer.name)}}if(this.hasSelectbox()&&this.getSelectbox()){this.getSelectbox().src=this.getSelectboxUrl()}},finalize:function(){this.visibility(this.layer.visible,false);this.selectability(this.layer.selectable);if(this.isExpanded()){this.expand()}else{this.collapse()}},append:function(a){if(!a||!this.data){return}if(a.data){a.data.appendChild(this.data)}else{a.appendChild(this.data)}},CLASS_NAME:"TBView.Legend.TreeItem"});TBView.Legend.TreeBranch={};TBView.Legend.TreeBranch=TBView.Class({id:"",data:null,parent:null,layergroup:null,treeitems:[],treebranches:[],options:{},initialize:function(d,c,b){this.options={checkbox:true,forexpand:true,forvisibility:true};TBView.Class.setOptions(this,b);var e=this;this.parent=d;this.layergroup=c;this.id=this.layergroup.id;this.data=null;this.treeitems=[];this.treebranches=[];this.data=TBView.Util.CreateElement("ul",{id:"legend"+this.getId(),className:((this.isLast())?"tbLegendItemLast":"tbLegendItem")},{marginLeft:((d)?"16px":"0px")});this.data.container=TBView.Util.CreateDiv(this.getId(),"tbLegendLabel");this.data.container.title=this.getLabel();this.data.appendChild(this.data.container);OpenLayers.Event.observe(this.data.container,"mouseover",OpenLayers.Function.bindAsEventListener(function(){TBView.Switch.SwitchClass(this,"Active")},this.data.container));OpenLayers.Event.observe(this.data.container,"mouseout",OpenLayers.Function.bindAsEventListener(function(){TBView.Switch.SwitchClass(this,"Active")},this.data.container));OpenLayers.Event.observe(this.data.container,"mousedown",OpenLayers.Function.bindAsEventListener(function(){e.switchNode()},this.data.container));this.data.node=TBView.Util.CreateElement("img",{id:"node"+this.getId(),className:"tbLegendNode",src:TBView.Legend.imgBlank.src},{backgroundPosition:this.getNodePosition()});this.data.container.appendChild(this.data.node);if(this.hasCheckbox()){this.data.checkbox=TBView.Util.CreateElement("img",{id:"chk"+this.getId(),className:"tbLegendImage",src:this.getCheckboxUrl()},{});this.data.container.appendChild(this.data.checkbox);OpenLayers.Event.observe(this.data.checkbox,"mouseover",OpenLayers.Function.bindAsEventListener(function(){e.options.forexpand=false},this.data.checkbox));OpenLayers.Event.observe(this.data.checkbox,"mouseout",OpenLayers.Function.bindAsEventListener(function(){e.options.forexpand=true},this.data.checkbox));var a=(this.options.onclick)?this.options.onclick:function(){e.switchVisibility()};OpenLayers.Event.observe(this.data.checkbox,"mousedown",OpenLayers.Function.bindAsEventListener(function(){a()},this.data.checkbox));this.data.checkbox.checked=this.isVisible()}this.data.image=TBView.Util.CreateElement("img",{id:"img"+this.getId(),className:"tbLegendFolder",src:TBView.Legend.imgBlank.src},{backgroundPosition:this.getImagePosition()});this.data.container.appendChild(this.data.image);this.data.text=TBView.Util.CreateText(this.getLabel());this.data.container.appendChild(this.data.text)},getId:function(){return this.id},getLabel:function(){return this.layergroup.getLabel()},getContainer:function(){return TBView.Util.GetObject("legend"+this.getId())},getNode:function(){return TBView.Util.GetObject("node"+this.getId())},getCheckbox:function(){return TBView.Util.GetObject("chk"+this.getId())},getImage:function(){return TBView.Util.GetObject("img"+this.getId())},hasStyle:function(){return(this.options.style)?true:false},isExpanded:function(){return this.layergroup.expandInLegend},isVisible:function(){return this.layergroup.visible},isSelectable:function(){return this.layergroup.selectable},isLast:function(){return((this.parent)?this.parent.isLastLayergroup(this.layergroup):TBView.Legend.isLastLayergroup(this.layergroup))},getNodePosition:function(){if(this.isLast()){if(!this.layergroup.hasLayergroups()&&!this.layergroup.hasLayers()){return TBView.Legend.bgPositionNodeLast}else{if(this.isExpanded()){return TBView.Legend.bgPositionNodeLastOpened}else{return TBView.Legend.bgPositionNodeLastClosed}}}else{if(!this.layergroup.hasLayergroups()&&!this.layergroup.hasLayers()){return TBView.Legend.bgPositionNode}else{if(this.isExpanded()){return TBView.Legend.bgPositionNodeOpened}else{return TBView.Legend.bgPositionNodeClosed}}}},getCheckboxUrl:function(){return(this.isVisible())?TBView.getRoot()+TBView.Legend.defaultLayerCheckedIcon:TBView.getRoot()+TBView.Legend.defaultLayerUncheckedIcon},getImagePosition:function(){return((this.isExpanded())?TBView.Legend.bgPositionFolderOpened:TBView.Legend.bgPositionFolderClosed)},hasCheckbox:function(){return this.options.checkbox},switchNode:function(){if(!this.options.forexpand){return}if(this.isExpanded()){this.collapse()}else{this.expand()}},switchVisibility:function(){if(!this.options.forvisibility){return}if(this.isVisible()){TBView.Legend.hideLayergroup(this.layergroup.id);this.visibility(false)}else{TBView.Legend.showLayergroup(this.layergroup.id);this.visibility(true)}},collapse:function(){this.layergroup.expandInLegend=false;TBView.Util.SetStyle(this.getNode(),"backgroundPosition",this.getNodePosition());TBView.Util.SetStyle(this.getImage(),"backgroundPosition",this.getImagePosition());for(var a=0;a<this.treeitems.length;a++){this.treeitems[a].displayed(false)}for(var a=0;a<this.treebranches.length;a++){this.treebranches[a].displayed(false)}},expand:function(){this.layergroup.expandInLegend=true;TBView.Util.SetStyle(this.getNode(),"backgroundPosition",this.getNodePosition());TBView.Util.SetStyle(this.getImage(),"backgroundPosition",this.getImagePosition());for(var a=0;a<this.treeitems.length;a++){this.treeitems[a].displayed(true)}for(var a=0;a<this.treebranches.length;a++){this.treebranches[a].displayed(true)}},visibility:function(a){this.layergroup.visible=a;if(this.hasCheckbox()&&this.getCheckbox()){this.getCheckbox().src=this.getCheckboxUrl();if(arguments.length==1||arguments[1]==true){TBView.Legend.refreshOverlayMap()}}},displayed:function(a){TBView.Util.SetStyle(this.getContainer(),"display",(a?"block":"none"))},finalize:function(){this.visibility(this.layergroup.visible,false);if(this.isExpanded()){this.expand()}else{this.collapse()}for(var a=0;a<this.treeitems.length;a++){this.treeitems[a].finalize()}for(var a=0;a<this.treebranches.length;a++){this.treebranches[a].finalize()}},append:function(a){if(!a||!this.data){return}if(a.data){a.data.appendChild(this.data)}else{a.appendChild(this.data)}},CLASS_NAME:"TBView.Legend.TreeBranch"});TBView.Legend.StyleItem={};TBView.Legend.StyleItem=TBView.Class({initialize:function(c,b,a){this.label=b.label;this.id="style-"+c;this.filter=b.filter;this.geometryType=(b.geomtype=="")?-1:b.geomtype;this.categoryIndex=(b.category=="")?-1:b.category;this.staticIcon=a},CLASS_NAME:"TBView.Legend.StyleItem"});TBView.Legend.ScaleRange={};TBView.Legend.ScaleRange=TBView.Class({styles:null,initialize:function(g,f,c){this.id="range-"+g;this.minScale=f.minscale;this.maxScale=f.maxscale;if(this.maxScale=="infinity"||this.maxScale=="auto"){this.maxScale=Infinity}this.styles=[];if(!f.style){var e=new TBView.Legend.StyleItem(g+"-"+0,{label:"DWF"},c);this.styles.push(e);return}var b=[].concat(f.style);var d=(b.length>1)?false:c;for(var a=0;a<b.length;a++){var e=new TBView.Legend.StyleItem(g+"-"+a,b[a],d);this.styles.push(e)}},contains:function(a){var b=Math.round(a);return(b>=this.minScale&&b<=this.maxScale)},CLASS_NAME:"TBView.Legend.ScaleRange"});TBView.Legend.Layer={};TBView.Legend.Layer=TBView.Class({id:null,name:null,initialize:function(d){this.id=d.id;this.name=d.name;this.type=d.type;this.label=(typeof d.label=="undefined")?d.name:d.label;this.resourceId=d.resourceid;this.displayInLegend=(d.displayinlegend=="true")?true:false;this.expandInLegend=(d.expandinlegend=="true")?true:false;this.selectable=(d.selectable=="true")?true:false;this.initiallySelectable=(d.selectable=="true")?true:false;this.visible=(d.visible=="true")?true:false;this.actuallyVisible=(d.actuallyvisible=="true")?true:false;this.initiallyVisible=(d.visible=="true")?true:false;this.parentGroupId=TBView.Util.isEmpty(d.parentgroup)?"":d.parentgroup;this.parentGroup=null;this.selectedFeatureCount=0;this.minScale=d.minscale;this.maxScale=(d.maxScale=="infinity")?1000000000000:d.maxscale;this.scaleRanges=[];if(d.scalerange){var c=[].concat(d.scalerange);for(var a=0;a<c.length;a++){var b=new TBView.Legend.ScaleRange(this.id,c[a],this.type);this.scaleRanges.push(b)}}},getScaleRange:function(b){if(!b){return null}for(var a=0;a<this.scaleRanges.length;a++){if(this.scaleRanges[a].contains(b)){return this.scaleRanges[a]}}return null},getLabel:function(){return((this.label=="")?this.name:this.label)},hasScaleRanges:function(){return(this.scaleRanges.length>0)?true:false},isLastStyleItem:function(b){var a=this.getScaleRange(TBView.Map.getScale());if(a&&a.styles.length>0){return(a.styles[a.styles.length-1].id==b.id)}else{return false}},CLASS_NAME:"TBView.Legend.Layer"});TBView.Legend.Layergroup={};TBView.Legend.Layergroup=TBView.Class({id:null,name:null,layergroups:null,layers:null,initialize:function(a){this.id=a.id;this.name=a.name;this.type=a.type;this.label=a.label;this.layergroups=[];this.layers=[];this.displayInLegend=(a.displayinlegend=="true")?true:false;this.expandInLegend=(a.expandinlegend=="true")?true:false;this.selectable=(a.selectable=="true")?true:false;this.visible=(a.visible=="true")?true:false;this.actuallyVisible=(a.actuallyvisible=="true")?true:false;this.initiallyVisible=(a.visible=="true")?true:false;this.parentGroupId=TBView.Util.isEmpty(a.parentgroup)?"":a.parentgroup;this.parentGroup=null},getLabel:function(){return((this.label=="")?this.name:this.label)},show:function(a){if(this.visible){return}this.oMap.showGroup(this,a?true:false);this.visible=true;if(this.legend&&this.legend.checkBox){this.legend.checkBox.checked=true}},hide:function(a){if(!this.visible){return}this.oMap.hideGroup(this,a?true:false);this.visible=false;if(this.legend&&this.legend.checkBox){this.legend.checkBox.checked=false}},isVisible:function(){return this.visible},clear:function(){for(var a=0;a<this.layergroups.length;a++){this.layergroups[a].clear()}for(var a=0;a<this.layers.length;a++){this.layers[a].clear()}this.layergroups=[];this.layers=[]},hasLayergroups:function(){return(this.layergroups.length>0)?true:false},hasLayers:function(){return(this.layers.length>0)?true:false},addLayergroup:function(b,a){b.parentGroup=this;if(a){this.layergroups.unshift(b)}else{this.layergroups.push(b)}},addLayer:function(b,a){b.parentGroup=this;if(a){this.layers.unshift(b)}else{this.layers.push(b)}},getLayergroupByName:function(a){return this.getLayergroupByAttribute("name",a)},getLayergroupById:function(a){return this.getLayergroupByAttribute("id",a)},getLayergroupByAttribute:function(b,c){if(this[b]==c){return this}for(var a=0;a<this.layergroups.length;a++){var d=this.layergroups[a].getLayergroupByAttribute(b,c);if(d){return d}}return null},getLayerByName:function(a){return this.getLayerByAttribute("name",a)},getLayerById:function(a){return this.getLayerByAttribute("id",a)},getLayerByAttribute:function(c,d){for(var b=0;b<this.layers.length;b++){if(this.layers[b][c]==d){return this.layers[b]}}for(var b=0;b<this.layergroups.length;b++){var a=this.layergroups[b].getLayerByAttribute(c,d);if(a){return a}}return null},isLastLayergroup:function(a){if(this.layergroups.length==0){return false}else{return(this.layergroups[this.layergroups.length-1].id==a.id)}},isLastLayer:function(a){if(this.layers.length==0){return false}else{return(this.layers[this.layers.length-1].id==a.id)}},CLASS_NAME:"TBView.Legend.Layergroup"});TBView.Map.SketchSymbolizers={Measure:{pointRadius:5,graphicName:"circle",strokeWidth:1,strokeOpacity:1,strokeColor:"#000000",strokeDashstyle:"solid",fillColor:"white",fillOpacity:0.5,cursor:"url("+TBView.getRoot()+"layout/images/cursors/measure.cur), default"},MeasureSelect:{pointRadius:5,graphicName:"circle",strokeWidth:1,strokeOpacity:1,strokeColor:"#000000",strokeDashstyle:"solid",fillColor:"white",fillOpacity:0.5,cursor:"pointer"},Redlining:{pointRadius:5,graphicName:"circle",strokeWidth:1,strokeOpacity:1,strokeColor:"#000000",strokeDashstyle:"solid",fillColor:"white",fillOpacity:0.5,cursor:"crosshair"},RedliningSelect:{pointRadius:5,graphicName:"circle",strokeWidth:1,strokeOpacity:1,strokeColor:"#000000",strokeDashstyle:"solid",fillColor:"white",fillOpacity:0.5,cursor:"pointer"},Dimensioning:{pointRadius:5,graphicName:"circle",strokeWidth:1,strokeOpacity:1,strokeColor:"#cc0033",strokeDashstyle:"dash",fillColor:"white",fillOpacity:0.5,cursor:"crosshair"},Selection:{pointRadius:5,graphicName:"circle",strokeWidth:1,strokeOpacity:1,strokeColor:"#000000",strokeDashstyle:"solid",fillColor:"white",fillOpacity:0.5,cursor:"pointer"},Plot:{pointRadius:5,graphicName:"circle",externalGraphic:null,strokeWidth:1,strokeOpacity:1,strokeColor:"#cc0033",strokeDashstyle:"solid",fillColor:"white",fillOpacity:0.5,cursor:"pointer"}};TBView.Map.Markers={initialized:false,map:null,form:null,controlLayer:null,features:[],initialize:function(b,a){this.map=TBView.Map.getMap();this.form=TBView.Util.GetForm(b);if(!this.initialized&&a&&a!=""){TBView.Boxes.addBoxTriggerClose(a,function(){TBView.Map.Markers.destroy()})}this.initialized=true},destroy:function(a){if(this.features){for(var b=0;b<this.features.length;b++){if(this.features[b]&&this.features[b].destroy){this.features[b].destroy()}}delete this.features;this.features=[]}if(this.controlLayer){this.controlLayer.removeFeatures();this.controlLayer.destroyFeatures();this.map.removeLayer(this.controlLayer,false);delete this.controlLayer;this.controlLayer=null}delete this.map;delete this.form;this.map=null;this.form=null;this.features=[];this.initialized=false;return true},show:function(b,a,c){this.map=TBView.Map.getMap();this.features=[];c=(c&&typeof c!="undefined")?c:"";var d=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(parseFloat(b),parseFloat(a)));d.attributes={tooltip:c};this.features.push(d);var e=new OpenLayers.StyleMap({"default":{externalGraphic:TBView.getRoot()+"layout/images/pins/marker.png",fillColor:"white",fillOpacity:0,graphicOpacity:1,graphicWidth:26,graphicHeight:26,graphicXOffset:-2,graphicYOffset:-23,graphicTitle:"${tooltip}"}});if(!this.controlLayer){this.controlLayer=new OpenLayers.Layer.Vector(this.CLASS_NAME,{displayInLayerSwitcher:false,styleMap:e,calculateInRange:function(){return true}});this.map.addLayer(this.controlLayer)}this.controlLayer.destroyFeatures();this.controlLayer.addFeatures(this.features,{silent:true});return true},showPoints:function(a){this.map=TBView.Map.getMap();this.features=[];if(!a){return false}for(var d=0;d<a.length;d++){var b=(a[d].tooltip&&typeof a[d].tooltip!="undefined")?a[d].tooltip:"";var c=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(a[d].x,a[d].y));c.attributes={tooltip:b};this.features.push(c)}var e=new OpenLayers.StyleMap({"default":{externalGraphic:TBView.getRoot()+"layout/images/pins/marker.png",fillColor:"white",fillOpacity:0,graphicOpacity:1,graphicWidth:26,graphicHeight:26,graphicXOffset:-2,graphicYOffset:-23,graphicTitle:"${tooltip}"}});if(!this.controlLayer){this.controlLayer=new OpenLayers.Layer.Vector(this.CLASS_NAME,{displayInLayerSwitcher:false,styleMap:e,calculateInRange:function(){return true}});this.map.addLayer(this.controlLayer)}this.controlLayer.destroyFeatures();this.controlLayer.addFeatures(this.features,{silent:true});return true},CLASS_NAME:"TBView.Map.Markers"};TBView.Overview={divOverview:null,initialize:function(){this.divOverview=TBView.Util.GetObject("TBViewOverview");var a=TBView.Boxes.getBox("MapOverview");if(!this.divOverview||!a){return}a.getContentDiv().style.margin="0px";a.getContentDiv().style.padding="0px";var b=a.getWidth()-a.WIDTH_LEFT-a.WIDTH_RIGHT;var d=a.getHeight()-a.HEIGHT_TOP-a.HEIGHT_BOTTOM;TBView.Util.SetContent(this.divOverview,"");this.divOverview.style.width=b+"px";this.divOverview.style.height=d+"px";var c={div:this.divOverview,mapOptions:{maxExtent:TBView.Map.mapExtent,maxResolution:"auto",transitionEffect:"resize",units:"m",projection:TBView.Map.mapProjection,displayProjection:TBView.Map.mapDisplayProjection,numZoomLevels:TBView.Map.mapZoomLevels,minScale:TBView.Map.mapMinScale,maxScale:TBView.Map.mapMaxScale,scales:TBView.Map.mapScales,controls:[]},minRatio:10,maxRatio:10,minRectSize:20,displayClass:"tbOverview",minRectDisplayClass:"MinimumExtentRectangle",size:new OpenLayers.Size(b,d)};TBView.Map.mapControlOverview=new OpenLayers.Control.OverviewMap(c);TBView.Map.getMap().addControl(TBView.Map.mapControlOverview)},CLASS_NAME:"TBView.Overview"};TBView.Xml={xmlDeclaration:'<?xml version="1.0" encoding="UTF-8" ?>\n',prefixAttributes:"@",parseXML:function(c){var b;if(window.DOMParser){var a=new DOMParser();var d=a.parseFromString(c,"application/xml");if(!d){return}b=d.documentElement}else{if(window.ActiveXObject){a=new ActiveXObject("Microsoft.XMLDOM");a.async=false;a.loadXML(c);b=a.documentElement}}if(!b){return}return this.parseDOM(b)},parseDOM:function(a){if(!a){return}this.__force_array={};if(this.force_array){for(var d=0;d<this.force_array.length;d++){this.__force_array[this.force_array[d]]=1}}var c=this.parseElement(a);if(this.__force_array[a.nodeName]){c=[c]}if(a.nodeType!=11){var b={};b[a.nodeName]=c;c=b}return c},parseElement:function(e){if(e.nodeType==7){return}if(e.nodeType==3||e.nodeType==4){var f=e.nodeValue.match(/[^\x00-\x20]/);if(f==null){return}return e.nodeValue}var b;var d={};if(e.attributes&&e.attributes.length){b={};for(var g=0;g<e.attributes.length;g++){var j=e.attributes[g].nodeName;if(typeof(j)!="string"){continue}var c=e.attributes[g].nodeValue;if(!c){continue}j=this.prefixAttributes+j;if(typeof(d[j])=="undefined"){d[j]=0}d[j]++;this.addNode(b,j,d[j],c)}}if(e.childNodes&&e.childNodes.length){var h=true;if(b){h=false}for(var g=0;g<e.childNodes.length&&h;g++){var a=e.childNodes[g].nodeType;if(a==3||a==4){continue}h=false}if(h){if(!b){b=""}for(var g=0;g<e.childNodes.length;g++){b+=e.childNodes[g].nodeValue}}else{if(!b){b={}}for(var g=0;g<e.childNodes.length;g++){var j=e.childNodes[g].nodeName;if(typeof(j)!="string"){continue}var c=this.parseElement(e.childNodes[g]);if(!c){continue}if(typeof(d[j])=="undefined"){d[j]=0}d[j]++;this.addNode(b,j,d[j],c)}}}return b},addNode:function(c,a,b,d){if(this.__force_array[a]){if(b==1){c[a]=[]}c[a][c[a].length]=d}else{if(b==1){c[a]=d}else{if(b==2){c[a]=[c[a],d]}else{c[a][c[a].length]=d}}}},writeXML:function(a){var b=this.hashToXml(null,a);return this.xmlDeclaration+b},hashToXml:function(c,b){var f=[];var a=[];for(var e in b){if(!b.hasOwnProperty(e)){continue}var h=b[e];if(e.charAt(0)!=this.prefixAttributes){if(typeof(h)=="undefined"||h==null){f[f.length]="<"+e+" />"}else{if(typeof(h)=="object"&&h.constructor==Array){f[f.length]=this.arrayToXml(e,h)}else{if(typeof(h)=="object"){f[f.length]=this.hashToXml(e,h)}else{f[f.length]=this.scalarToXml(e,h)}}}}else{a[a.length]=" "+(e.substring(1))+'="'+(this.escape(h))+'"'}}var g=a.join("");var d=f.join("");if(typeof(c)=="undefined"||c==null){}else{if(f.length>0){if(d.match(/\n/)){d="<"+c+g+">\n"+d+"</"+c+">\n"}else{d="<"+c+g+">"+d+"</"+c+">\n"}}else{d="<"+c+g+" />\n"}}return d},arrayToXml:function(b,e){var a=[];for(var c=0;c<e.length;c++){var d=e[c];if(typeof(d)=="undefined"||d==null){a[a.length]="<"+b+" />"}else{if(typeof(d)=="object"&&d.constructor==Array){a[a.length]=this.arrayToXml(b,d)}else{if(typeof(d)=="object"){a[a.length]=this.hashToXml(b,d)}else{a[a.length]=this.scalarToXml(b,d)}}}}return a.join("")},scalarToXml:function(a,b){if(a=="#text"){return this.escape(b)}else{return"<"+a+">"+this.escape(b)+"</"+a+">\n"}},escape:function(a){return String(a).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},CLASS_NAME:"TBView.Xml"};TBView.Box={};TBView.Box=TBView.Class({divbox:null,minimized:false,closed:true,triggerClose:null,triggerOpen:null,startPosition:"",startTop:null,startLeft:null,startWidth:0,startHeight:0,initializedBox:false,initializedSize:false,initializedPosition:false,initializedEvents:false,HEIGHT_TOP:20,HEIGHT_BOTTOM:11,WIDTH_LEFT:5,WIDTH_RIGHT:5,initialize:function(e,d,b,c){this.id=e;this.title=d;this.type=b.toLowerCase();this.resizeable=((c)?c:true);this.resizeable=((this.type=="overview")?false:this.resizeable);this.divbox=TBView.Util.GetLayer(this.getId());if(this.divbox==null){this.divbox=TBView.Util.CreateDiv(this.getId(),"Box");var a=document.getElementsByTagName("body")[0];a.appendChild(this.divbox)}this._initializeBox();this._initializeSize();this._initializePosition()},getId:function(){return"box"+this.id},getDiv:function(){return this.divbox},getContentId:function(){return"box"+this.id+"Content"},getContentDiv:function(){return TBView.Util.GetLayer(this.getContentId())},getContent:function(a){return TBView.Util.GetContent(this.divbox)},getContainerId:function(){return"box"+this.id+"Container"},getContainerDiv:function(){return TBView.Util.GetLayer(this.getContainerId())},isClosed:function(){return this.closed},isMinimized:function(){return this.minimized},setResizeable:function(a){this.resizeable=a},isInitalized:function(){return this.initializedBox},isInitalizedSize:function(){return this.initializedSize},isInitalizedPosition:function(){return this.initializedPosition},isInitalizedEvents:function(){return this.initializedEvents},setTitle:function(b){var d=TBView.Util.GetLayer("box"+this.id+"Header");var a=TBView.Util.GetImage("imgActionClose"+this.id);var c=TBView.Util.GetImage("imgActionSwitch"+this.id);if(d&&a&&c){TBView.Util.SetContent(d,"");d.appendChild(a);d.appendChild(c);d.appendChild(document.createTextNode(b))}},getPositionX:function(){return parseInt(TBView.Util.GetStyle(this.divbox,"left"))},getPositionY:function(){return parseInt(TBView.Util.GetStyle(this.divbox,"top"))},getWidth:function(){return TBView.Util.GetWidth(this.divbox)},getHeight:function(){return parseInt(TBView.Util.GetStyle(this.getContainerDiv(),"height"))+this.HEIGHT_TOP+this.HEIGHT_BOTTOM},_initializeBox:function(){var p=this;var b=document.createElement("TABLE");b.width="100%";b.border="0";b.cellSpacing="0";b.cellPadding="0";this.divbox.appendChild(b);var l=document.createElement("TBODY");b.appendChild(l);var n=l.insertRow(-1);var h=n.insertCell(-1);var f=document.createElement("TABLE");f.cellSpacing="0";f.cellPadding="0";h.appendChild(f);var k=document.createElement("TBODY");f.appendChild(k);var s=k.insertRow(-1);k.vAlign="bottom";var h=s.insertCell(-1);h.appendChild(TBView.Util.CreateImg("","box/box_shadow_top_left.png","10","20","","",""));var h=s.insertCell(-1);h.width="100%";h.style.background="url("+TBView.getRoot()+"layout/images/box/box_shadow_top.png) bottom no-repeat";var o=TBView.Util.CreateDiv("box"+this.id+"Header","BoxHeader");o.ondblclick=function(){p.switchingContent()};o.style.overflow="hidden";h.appendChild(o);var e=TBView.Util.CreateImg("imgActionClose"+this.id,"box/box_close.gif","12","12","right","2","2");e.onmouseover=function(){TBView.Switch.SwitchCursor(e,"1")};e.onmouseout=function(){TBView.Switch.SwitchCursor(e,"0")};e.onclick=function(){p.hide()};o.appendChild(e);var i=TBView.Util.CreateImg("imgActionSwitch"+this.id,"box/box_content_close.gif","12","12","right","4","2");i.onmouseover=function(){TBView.Switch.SwitchCursor(i,"1")};i.onmouseout=function(){TBView.Switch.SwitchCursor(i,"0")};i.onclick=function(){p.switchingContent()};o.appendChild(i);o.appendChild(document.createTextNode(this.title));var h=s.insertCell(-1);h.appendChild(TBView.Util.CreateImg("","box/box_shadow_top_right.png","10","20","","",""));var n=l.insertRow(-1);var h=n.insertCell(-1);var a=document.createElement("TABLE");a.cellSpacing="0";a.cellPadding="0";h.appendChild(a);var q=document.createElement("TBODY");a.appendChild(q);var m=a.insertRow(-1);m.vAlign="top";var h=m.insertCell(-1);h.className="BoxShadowLeft";h.style.background="url("+TBView.getRoot()+"layout/images/box/box_shadow_middle_left.png) left no-repeat";h.appendChild(TBView.Util.CreateImg("","blank.gif","5","1","","",""));var h=m.insertCell(-1);h.width="100%";var g=TBView.Util.CreateDiv(this.getContainerId(),"BoxContainer");h.appendChild(g);var c=TBView.Util.CreateDiv(this.getContentId(),"BoxContent");g.appendChild(c);var h=m.insertCell(-1);h.className="BoxShadowRight";h.style.background="url("+TBView.getRoot()+"layout/images/box/box_shadow_middle_right.png) right no-repeat";h.appendChild(TBView.Util.CreateImg("","blank.gif","5","1","","",""));var n=l.insertRow(-1);var h=n.insertCell(-1);var j=document.createElement("TABLE");j.cellSpacing="0";j.cellPadding="0";h.appendChild(j);var d=document.createElement("TBODY");j.appendChild(d);var r=d.insertRow(-1);r.vAlign="top";var h=r.insertCell(-1);h.appendChild(TBView.Util.CreateImg("imgActionResizeSW","box/box_shadow_bottom_left.png","10","11","","",""));var h=r.insertCell(-1);h.width="100%";h.style.background="url("+TBView.getRoot()+"layout/images/box/box_shadow_bottom.png) top no-repeat";h.appendChild(TBView.Util.CreateDiv("box"+this.id+"Footer","BoxFooter"));var h=r.insertCell(-1);h.appendChild(TBView.Util.CreateImg("imgActionResizeSE","box/box_shadow_bottom_right.png","10","11","","",""))},_initializeSize:function(){if(this.isInitalizedSize()){return}switch(this.type){case"content":this.startWidth=parseInt(TBView.CONFIG_APPLICATION_CONTENT_WIDTH);this.startHeight=parseInt(TBView.CONFIG_APPLICATION_CONTENT_HEIGHT);break;case"search":this.startWidth=parseInt(TBView.CONFIG_APPLICATION_SEARCH_WIDTH);this.startHeight=parseInt(TBView.CONFIG_APPLICATION_SEARCH_HEIGHT);break;case"featureinfo":this.startWidth=parseInt(TBView.CONFIG_APPLICATION_FEATUREINFO_WIDTH);this.startHeight=parseInt(TBView.CONFIG_APPLICATION_FEATUREINFO_HEIGHT);break;case"legend":this.startWidth=parseInt(TBView.CONFIG_APPLICATION_LEGEND_WIDTH);this.startHeight=parseInt(TBView.CONFIG_APPLICATION_LEGEND_HEIGHT);break;case"overview":this.startWidth=parseInt(TBView.CONFIG_APPLICATION_OVERVIEW_WIDTH);this.startHeight=parseInt(TBView.CONFIG_APPLICATION_OVERVIEW_HEIGHT);break;case"redlining":this.startWidth=parseInt(TBView.CONFIG_APPLICATION_REDLINING_WIDTH);this.startHeight=parseInt(TBView.CONFIG_APPLICATION_REDLINING_HEIGHT);break;case"login":this.startWidth=parseInt(TBView.CONFIG_APPLICATION_LOGIN_WIDTH);this.startHeight=parseInt(TBView.CONFIG_APPLICATION_LOGIN_HEIGHT);break;case"module":this.startWidth=parseInt(TBView.CONFIG_APPLICATION_MODULE_WIDTH);this.startHeight=parseInt(TBView.CONFIG_APPLICATION_MODULE_HEIGHT);break;case"custom":this.startWidth=parseInt(TBView.CONFIG_APPLICATION_CUSTOM_WIDTH);this.startHeight=parseInt(TBView.CONFIG_APPLICATION_CUSTOM_HEIGHT);break;default:this.startWidth=parseInt(TBView.CONFIG_APPLICATION_DEFAULT_WIDTH);this.startHeight=parseInt(TBView.CONFIG_APPLICATION_DEFAULT_HEIGHT);break}if(this.startWidth>0&&this.startHeight>0){TBView.Util.SetStyle(this.divbox,"width",this.startWidth+"px");TBView.Util.SetStyle(this.divbox,"height","auto");TBView.Util.SetStyle(this.getContainerDiv(),"width",(this.startWidth-this.WIDTH_LEFT-this.WIDTH_RIGHT)+"px");TBView.Util.SetStyle(this.getContainerDiv(),"height",(this.startHeight-this.HEIGHT_TOP-this.HEIGHT_BOTTOM)+"px");TBView.Util.SetStyle(this.getContainerDiv(),"maxHeight",(this.startHeight-this.HEIGHT_TOP-this.HEIGHT_BOTTOM)+"px")}this.initializedSize=true},_initializePosition:function(){if(this.isInitalizedPosition()){return}switch(this.type){case"content":if(TBView.CONFIG_APPLICATION_CONTENT_POSITION&&TBView.CONFIG_APPLICATION_CONTENT_POSITION!=""){this.startPosition=TBView.CONFIG_APPLICATION_CONTENT_POSITION}break;case"search":if(TBView.CONFIG_APPLICATION_SEARCH_POSITION&&TBView.CONFIG_APPLICATION_SEARCH_POSITION!=""){this.startPosition=TBView.CONFIG_APPLICATION_SEARCH_POSITION}break;case"featureinfo":if(TBView.CONFIG_APPLICATION_FEATUREINFO_POSITION&&TBView.CONFIG_APPLICATION_FEATUREINFO_POSITION!=""){this.startPosition=TBView.CONFIG_APPLICATION_FEATUREINFO_POSITION}break;case"legend":if(TBView.CONFIG_APPLICATION_LEGEND_POSITION&&TBView.CONFIG_APPLICATION_LEGEND_POSITION!=""){this.startPosition=TBView.CONFIG_APPLICATION_LEGEND_POSITION}break;case"overview":if(TBView.CONFIG_APPLICATION_OVERVIEW_POSITION&&TBView.CONFIG_APPLICATION_OVERVIEW_POSITION!=""){this.startPosition=TBView.CONFIG_APPLICATION_OVERVIEW_POSITION}break;case"redlining":if(TBView.CONFIG_APPLICATION_REDLINING_POSITION&&TBView.CONFIG_APPLICATION_REDLINING_POSITION!=""){this.startPosition=TBView.CONFIG_APPLICATION_REDLINING_POSITION}break;case"login":if(TBView.CONFIG_APPLICATION_LOGIN_POSITION&&TBView.CONFIG_APPLICATION_LOGIN_POSITION!=""){this.startPosition=TBView.CONFIG_APPLICATION_LOGIN_POSITION}break;case"module":if(TBView.CONFIG_APPLICATION_MODULE_POSITION&&TBView.CONFIG_APPLICATION_MODULE_POSITION!=""){this.startPosition=TBView.CONFIG_APPLICATION_MODULE_POSITION}break;case"custom":if(TBView.CONFIG_APPLICATION_CUSTOM_POSITION&&TBView.CONFIG_APPLICATION_CUSTOM_POSITION!=""){this.startPosition=TBView.CONFIG_APPLICATION_CUSTOM_POSITION}break;default:if(TBView.CONFIG_APPLICATION_DEFAULT_POSITION&&TBView.CONFIG_APPLICATION_DEFAULT_POSITION!=""){this.startPosition=TBView.CONFIG_APPLICATION_DEFAULT_POSITION}break}var b=TBView.Client.getViewportSize();var g=TBView.Util.GetObject(TBView.getContainerMapId());var a=TBView.Util.GetY(g);var d=TBView.Util.GetWidth(g);var f=TBView.Util.GetHeight(g);if(typeof this.startPosition=="object"&&this.startPosition!=null){this.startTop=TBView.Util.GetY(this.startPosition);this.startLeft=TBView.Util.GetX(this.startPosition)}else{if(typeof this.startPosition=="string"&&this.startPosition!=""&&g){this.show();var e=this.getWidth();var h=this.getHeight();this.hide();var c=this.startPosition.split(",");if(c[1]&&c[1]!=""){if(c[1]=="top"){this.startTop=a}else{if(c[1]=="bottom"){this.startTop=b[1]-h}}}if(c[0]&&c[0]!=""){if(c[0]=="left"){this.startLeft=0}else{if(c[0]=="right"){if(this.startTop>(b[1]/2)){this.startLeft=b[0]-e}else{this.startLeft=b[0]-e-75}}}}}}this.startTop=(this.startTop!=null)?this.startTop:(b[1]/2-this.startHeight/2+TBView.Client.getPageOffsetY());this.startLeft=(this.startLeft!=null)?this.startLeft:(b[0]/2-this.startWidth/2);if(this.startLeft<350&&this.startTop==a){this.startTop+=38;if(TBView.Map.hasControlShortcuts()){this.startTop+=38}this.startTop+=6}this.startLeft=TBView.Boxes.getBoxPositionX(this.startLeft);this.startTop=TBView.Boxes.getBoxPositionY(this.startTop);TBView.Util.SetStyle(this.divbox,"left",this.startLeft+"px");TBView.Util.SetStyle(this.divbox,"top",this.startTop+"px");this.initializedPosition=true},hide:function(){if(this.triggerClose){this.triggerClose()}TBView.Switch.SwitchLayer(this.divbox,0);this.closed=true},show:function(a){TBView.Switch.SwitchLayer(this.divbox,1);this.closed=false;if(this.isMinimized()){this.switchingContent()}if(this.triggerOpen){this.triggerOpen()}},switchingContent:function(){var c=this.getContainerDiv();var d=TBView.Util.GetImage("imgActionSwitch"+this.id);if(TBView.Util.isVisible(c)){TBView.Switch.SwitchLayer(c,0);if(d){d.src=d.src.replace(/close/g,"open")}this.minimized=true}else{TBView.Switch.SwitchLayer(c,1);if(d){d.src=d.src.replace(/open/g,"close")}var a=TBView.Client.getViewportSize();var f=this.getWidth();var g=this.getHeight();var b=this.getPositionY();var e=this.getPositionX();if(b<=0){TBView.Util.SetStyle(this.divbox,"top","0px")}else{if(b>=(a[1]-g)){TBView.Util.SetStyle(this.divbox,"top",(a[1]-g)+"px")}}if(e<=0){TBView.Util.SetStyle(this.divbox,"left","0px")}else{if(e>=(a[0]-f)){TBView.Util.SetStyle(this.divbox,"left",(a[0]-f)+"px")}}this.minimized=false}},CLASS_NAME:"TBView.Box"});TBView.BoxOverlay={divbox:null,overlaybox:null,closed:true,initialized:false,triggerClose:null,triggerOpen:null,id:"Overlay",title:"",width:750,height:550,getId:function(){return"box"+this.id},getDiv:function(){return this.divbox},getOverlay:function(){return this.overlaybox},getContentId:function(){return"box"+this.id+"Content"},getContentDiv:function(){return TBView.Util.GetLayer(this.getContentId())},getContent:function(a){return TBView.Util.GetContent(this.divbox)},getContainerId:function(){return"box"+this.id+"Container"},getContainerDiv:function(){return TBView.Util.GetLayer(this.getContainerId())},isClosed:function(){return this.closed},_initialize:function(){if(this.initialized){return true}var c=TBView.Client.getViewportSize();var h=(c[0]/2-parseInt(this.width)/2);var n=(c[1]/2-parseInt(this.height)/2+TBView.Client.getPageOffsetY());TBView.Util.SetStyle(this.divbox,"zIndex","9501");TBView.Util.SetStyle(this.divbox,"position","absolute");TBView.Util.SetStyle(this.divbox,"left",h+"px");TBView.Util.SetStyle(this.divbox,"top",n+"px");TBView.Util.SetStyle(this.divbox,"width",parseInt(this.width)+"px");TBView.Util.SetStyle(this.divbox,"height",parseInt(this.height)+"px");TBView.Util.SetStyle(this.overlaybox,"zIndex","9500");TBView.Util.SetStyle(this.overlaybox,"position","absolute");TBView.Util.SetOpacity(this.overlaybox,50);this.overlaybox.onclick=function(){TBView.BoxOverlay.close()};var b=document.createElement("TABLE");b.width="100%";b.border="0";b.cellSpacing="0";b.cellPadding="0";this.divbox.appendChild(b);var m=document.createElement("TBODY");b.appendChild(m);var p=m.insertRow(-1);var j=p.insertCell(-1);var g=document.createElement("TABLE");g.cellSpacing="0";g.cellPadding="0";j.appendChild(g);var l=document.createElement("TBODY");g.appendChild(l);var t=l.insertRow(-1);l.vAlign="bottom";var j=t.insertCell(-1);j.appendChild(TBView.Util.CreateImg("","box/box_shadow_top_left.png","10","20","","",""));var j=t.insertCell(-1);j.width="100%";j.style.background="url("+TBView.getRoot()+"layout/images/box/box_shadow_top.png) bottom no-repeat";var q=TBView.Util.CreateDiv("box"+this.id+"Header","BoxHeader");q.ondblclick=function(){current.switchingContent()};q.style.overflow="hidden";j.appendChild(q);var f=TBView.Util.CreateImg("imgActionClose"+this.id,"box/box_close.gif","12","12","right","2","2");f.onmouseover=function(){TBView.Switch.SwitchCursor(f,"1")};f.onmouseout=function(){TBView.Switch.SwitchCursor(f,"0")};f.onclick=function(){TBView.BoxOverlay.close()};q.appendChild(f);q.appendChild(document.createTextNode(this.title));var j=t.insertCell(-1);j.appendChild(TBView.Util.CreateImg("","box/box_shadow_top_right.png","10","20","","",""));var p=m.insertRow(-1);var j=p.insertCell(-1);var a=document.createElement("TABLE");a.cellSpacing="0";a.cellPadding="0";j.appendChild(a);var r=document.createElement("TBODY");a.appendChild(r);var o=a.insertRow(-1);o.vAlign="top";var j=o.insertCell(-1);j.className="BoxShadowLeft";j.style.background="url("+TBView.getRoot()+"layout/images/box/box_shadow_middle_left.png) left no-repeat";j.appendChild(TBView.Util.CreateImg("","blank.gif","5","1","","",""));var j=o.insertCell(-1);j.width="100%";var i=TBView.Util.CreateDiv(this.getContainerId(),"BoxContainer");j.appendChild(i);var d=TBView.Util.CreateDiv(this.getContentId(),"BoxContent");i.appendChild(d);var j=o.insertCell(-1);j.className="BoxShadowRight";j.style.background="url("+TBView.getRoot()+"layout/images/box/box_shadow_middle_right.png) right no-repeat";j.appendChild(TBView.Util.CreateImg("","blank.gif","5","1","","",""));var p=m.insertRow(-1);var j=p.insertCell(-1);var k=document.createElement("TABLE");k.cellSpacing="0";k.cellPadding="0";j.appendChild(k);var e=document.createElement("TBODY");k.appendChild(e);var s=e.insertRow(-1);s.vAlign="top";var j=s.insertCell(-1);j.appendChild(TBView.Util.CreateImg("imgActionResizeSW","box/box_shadow_bottom_left.png","10","11","","",""));var j=s.insertCell(-1);j.width="100%";j.style.background="url("+TBView.getRoot()+"layout/images/box/box_shadow_bottom.png) top no-repeat";j.appendChild(TBView.Util.CreateDiv("box"+this.id+"Footer","BoxFooter"));var j=s.insertCell(-1);j.appendChild(TBView.Util.CreateImg("imgActionResizeSE","box/box_shadow_bottom_right.png","10","11","","",""));TBView.Util.SetStyle(this.divbox,"width",this.width+"px");TBView.Util.SetStyle(this.divbox,"height","auto");TBView.Util.SetStyle(this.getContainerDiv(),"width",(this.width-TBView.Box.prototype.WIDTH_LEFT-TBView.Box.prototype.WIDTH_RIGHT)+"px");TBView.Util.SetStyle(this.getContainerDiv(),"height",(this.height-TBView.Box.prototype.HEIGHT_TOP-TBView.Box.prototype.HEIGHT_BOTTOM)+"px");TBView.Util.SetStyle(this.getContainerDiv(),"maxHeight",(this.height-TBView.Box.prototype.HEIGHT_TOP-TBView.Box.prototype.HEIGHT_BOTTOM)+"px");TBView.Util.SetStyle(this.getContainerDiv(),"overflow","auto");this.initialized=true},close:function(){if(this.triggerClose){this.triggerClose()}TBView.Switch.SwitchLayer(this.overlaybox,0);TBView.Switch.SwitchLayer(this.divbox,0);var a=document.getElementsByTagName("body")[0];TBView.Util.SetStyle(a,"overflow","auto");this.closed=true},open:function(d,b,c){this.title=d;var a=document.getElementsByTagName("body")[0];this.divbox=TBView.Util.GetLayer(this.getId());if(this.divbox==null){this.divbox=TBView.Util.CreateDiv(this.getId(),"Box");a.appendChild(this.divbox)}this.overlaybox=TBView.Util.GetLayer(this.getId()+"Background");if(this.overlaybox==null){this.overlaybox=TBView.Util.CreateDiv(this.getId()+"Background","BoxOverlay");a.appendChild(this.overlaybox)}TBView.Util.SetStyle(a,"overflow","hidden");window.scrollTo(0,0);this._initialize();TBView.Switch.SwitchLayer(this.divbox,1);TBView.Switch.SwitchLayer(this.overlaybox,1);this.closed=false;this.load(b,c);if(this.triggerOpen){this.triggerOpen()}},load:function(b,a){if(TBView.Requests){TBView.load(this.getContentId(),"box","boxid="+this.id.toLowerCase()+"&action="+b+TBView.Util.GetQueryGlue(a))}},send:function(c,b,a){if(TBView.Requests){TBView.send(this.getContentId(),"box","boxid="+this.id.toLowerCase()+"&action="+c+TBView.Util.GetQueryGlue(b),a)}},CLASS_NAME:"TBView.BoxOverlay"};TBView.Point={};TBView.Point=TBView.Class({initialize:function(a,c,b){this.x=parseFloat(a);this.y=parseFloat(c);if(b&&typeof b!="undefined"){this.tooltip=b}},CLASS_NAME:"TBView.Point"});
