var gc={CLASS_NAME:"gc",headTag:null,bodyTag:null,scriptLocation:null,scriptName:"gc.js",baseUrl:"",sessionName:"",sessionID:"",initClass:function(_1,_2,_3){gc.tmpObj=function(){if(this.constructor){this.constructor.apply(this,arguments);}};className2=_1.split(".");var _4="";for(var i=0;i<className2.length;++i){_4+=(i>0?".":"")+className2[i];if(eval("typeof("+_4+")")=="undefined"){eval(_4+" = {};");}if((i+1)>=className2.length){if(_2){eval("gc.tmpObj = "+_4+";");for(i in _3){gc.tmpObj[i]=_3[i];}gc.tmpObj.CLASS_NAME=_1;}else{gc.tmpObj.prototype=_3;gc.tmpObj.prototype.CLASS_NAME=_1;eval(_4+" = gc.tmpObj;");}}}},initSession:function(_6,_7){this.sessionName=_6;if(gc.Util.getCookie(_6)){this.sessionID=gc.Util.getCookie(_6);}else{this.sessionID=_7;gc.Util.setCookie(_6,_7);}gc.net.XHR.urlPostfix="&"+encodeURIComponent(this.sessionName)+"="+encodeURIComponent(this.sessionID);},head:function(){if(!this.headTag){this.headTag=document.getElementsByTagName("head")[0];}return this.headTag;
},body:function(){if(!this.bodyTag){this.bodyTag=(document.body||document.getElementsByTagName("body")[0]);}return this.bodyTag;},getScriptLocation:function(){if(!this.scriptLocation){var _8=document.getElementsByTagName("script");var _9;var _a;for(var i=0;i<_8.length;++i){_9=_8[i].getAttribute("src");if(_9){_a=_9.lastIndexOf(this.scriptName);if(_a>=0){this.scriptLocation=_9.substring(0,_a);}}}}return this.scriptLocation;},loadScript:function(_c){if(this.isIE()||this.isSafari()){document.write("<script type=\"text/javascript\" src=\""+this.getScriptLocation()+_c+"\"></script>");}else{var _d=document.createElement("script");_d.setAttribute("type","text/javascript");_d.setAttribute("src",this.getScriptLocation()+_c);gc.head().appendChild(script_tag);}},isIE:function(){return (/msie/.test(navigator.userAgent.toLowerCase()));},isIE7:function(){return ((document.all)&&(navigator.appVersion.toLowerCase().indexOf("msie 7.")!=-1));},isFF:function(){
return (/gecko/.test(navigator.userAgent.toLowerCase()));},isSafari:function(){return (/safari/.test(navigator.userAgent.toLowerCase()));},addOnLoadEvent:function(_e){if(window.addEventListener){window.addEventListener("load",_e,false);}else{if(window.attachEvent){window.attachEvent("onload",_e);}}}};
gc.initClass("gc.Content",true,{list:{},icon:{},set:function(id,_2,_3){this.list[id]=_2;this.icon[id]=_3;},reload:function(){for(id in this.list){this.load(id,this.list[id],this.icon[id]);}},load:function(id,_5,_6){this.set(id,_5,_6);var _7=new gc.net.Request(_5,this.onResponse,this,gc.net.Request.prototype.RESPONSE_TEXT,true);_7.callbackOnStartFunction=this.onStartLoad;_7.callbackOnStartObject=this;gc.net.XHR.addRequest(_7);},onStartLoad:function(_8){for(id in this.list){if(this.list[id]==_8){var _9=$(id);if(_9&&this.icon[id]){_9.innerHTML="";_9.style.height="20px";_9.style.backgroundImage="url(\""+gc.baseUrl+this.icon[id]+"\")";}}}},onResponse:function(_a,_b){for(id in this.list){if(this.list[id]==_b){var _c=$(id);if(_c){if(this.icon[id]){_c.style.height="";_c.style.backgroundImage="";}_c.scrollTop=0;_c.innerHTML=_a;gc.Util.execJS(_c);}}}}});
gc.initClass("gc.Util",true,{trim:function(_1){if(_1!=null&&_1.length>0){var i;for(i=0;i<_1.length;++i){if(_1.substring(i,i+1)!=" "){break;}}_1=_1.substring(i,_1.length);for(i=_1.length-1;i>=0;--i){if(_1.substring(i,i+1)!=" "){break;}}_1=_1.substring(0,i+1);}return _1;},urlParams:function(_3){var _4="";for(param in _3){_4+="&"+encodeURIComponent(param)+"="+encodeURIComponent(_3[param]);}return _4;},utf8_encode:function(_5){var _6="";var ch;for(var i=0;i<_5.length;++i){ch=_5.charCodeAt(i);if(ch<128){_6+=String.fromCharCode(ch);}else{_6+=String.fromCharCode((ch>>6)|192);_6+=String.fromCharCode((ch&63)|128);}}return _6;},utf8_decode:function(_9){var _a="";var ch;var _c;for(var i=0;i<_9.length;++i){ch=_9.charCodeAt(i);if(ch<128){_a+=String.fromCharCode(ch);}else{if((i+1)<_9.length){_c=_9.charCodeAt(i+1);_a+=String.fromCharCode(((ch&31)<<6)|(_c&63));++i;}}}return _a;},getCookie:function(_e){_e=this.trim(_e);var _f=document.cookie.split(";");var _10;for(var i=0;i<_f.length;++i){
_10=this.trim(_f[i]).split("=");if(_10.length>=2&&this.trim(_10[0])==_e){return this.trim(unescape(_10[1]));}}return "";},setCookie:function(_12,_13){document.cookie=_12+"="+escape(_13);},setCSS:function(_14,css){var key=css.substring(0,5).toLowerCase();if(key=="style"){css=css.replace("style=","");css=css.replace("\"","").replace("\"","");if(_14.style.setAttribute){var _17;var _18;try{_14.removeAttributeNode(_14.getAttributeNode("style"));}catch(e){}try{_14.removeAttribute("style");}catch(e){}_17=css.split(";");for(var j=0;j<_17.length;++j){_18=_17[j].split(":");_18[0]=this.trim(_18[0]);_18[1]=this.trim(_18[1]);if(_18[0]!=""&&_18[0]!=null){_14.style.setAttribute(_18[0],_18[1],false);_18[0]=_18[0].replace("-","").replace("-","").replace("-","");_14.style.setAttribute(_18[0],_18[1],false);}}}else{_14.setAttribute("style",css);}}if(key=="class"){css=css.replace("class=","");css=css.replace("\"","").replace("\"","");_14.className=css;}var tmp=_14.style.color;_14.style.color="#ffffff";
_14.style.color="#000000";_14.style.color=tmp;},setCSSByTagname:function(id,_1c,css,_1e){if(id!=""){var _1f;var tmp;var _21;_1f=document.getElementsByTagName(_1c);for(var i=0;i<_1f.length;++i){if((_1f[i].id==id||(_1e&&_1f[i].id.substr(0,id.length)==id))){this.setCSS(_1f[i],css);}}}},openPopup:function(url,_24,_25){var _26=window.open(url,_24,_25);if(_26){_26.focus();}},getScreenCenterX:function(_27){return Math.max(0,Math.round((this.getWindowWidth()-_27)/2));},getScreenCenterY:function(_28){return Math.max(0,Math.round((this.getWindowHeight()-_28)/2));},getWindowWidth:function(){if(window.innerWidth){return window.innerWidth;}else{return document.body.clientWidth;}},getWindowHeight:function(){if(window.innerHeight){return window.innerHeight;}else{if(document.documentElement&&document.documentElement.clientHeight){return document.documentElement.clientHeight;}else{return document.body.clientHeight;}}},getDocumentWidth:function(){if(document.width){return document.width;}else{
return document.body.clientWidth;}},getDocumentHeight:function(){if(document.height){return document.height;}else{if(gc.isIE()&&!gc.isIE7()){return document.body.scrollHeight;}else{return document.body.clientHeight;}}},setFormValue:function(_29,_2a,_2b){var _2c=document.getElementsByName(_29);for(var i=0;i<_2c.length;++i){_2c[i][_2a].value=_2b;}},execJS:function(tag){if(tag.childNodes){for(var i=0;i<tag.childNodes.length;++i){if(tag.childNodes[i].nodeName.toLowerCase()=="script"){eval(tag.childNodes[i].text);}else{this.execJS(tag.childNodes[i]);}}}}});
gc.initClass("gc.console",true,{log:function(){if(window.console){window.console.log(arguments);}},debug:function(){if(window.console){window.console.debug(arguments);}},info:function(){if(window.console){window.console.info(arguments);}},warn:function(){if(window.console){window.console.warn(arguments);}},error:function(){if(window.console){window.console.error(arguments);}}});
gc.initClass("gc.net.Request",false,{RESPONSE_TEXT:"text",RESPONSE_XML:"xml",RESPONSE_JSON:"json",url:null,highPriority:false,callbackFunction:null,callbackObject:null,responseType:null,postContentType:"application/x-www-form-urlencoded",postData:null,noCache:false,persistent:false,callbackOnStartFunction:null,callbackOnStartObject:null,constructor:function(_1,_2,_3,_4,_5,_6){if(!_4){_4=this.RESPONSE_TEXT;}if(!_5){_5=false;}this.url=_1;this.callbackFunction=_2;this.callbackObject=_3;this.responseType=_4;this.postData=_6;this.noCache=_5;},readPostDataFromForm:function(_7){if(_7){this.postData=Form.serialize(_7);}}});
gc.initClass("gc.net.XHR",true,{METHOD_XML_HTTP_REQUEST:0,METHOD_SCRIPT_TAG:1,method:1,requests:new Array(),xhr:null,script_tag:null,script_time:null,date:new Date(),urlPostfix:"",addRequest:function(_1,_2){_1.highPriority=_2;if(this.method==this.METHOD_SCRIPT_TAG){this.checkJSError();}if(_1.highPriority&&this.requests.length>1){for(var i=this.requests.length-1;i>=0;--i){if(i==0||this.requests[i].highPriority){this.requests[i+1]=_1;break;}else{this.requests[i+1]=this.requests[i];}}}else{this.requests.push(_1);}if(this.requests.length==1){this.sendRequest();}},newRequest:function(_4,_5,_6,_7,_8,_9,_a){var _b=new gc.net.Request(_4,_5,_6,_7,_8,_9);_b.persistent=false;this.addRequest(_b,_a);},init:function(){this.initDate();if(this.method==this.METHOD_SCRIPT_TAG){this.initScriptTag();}else{this.initXHR();}},initDate:function(){try{delete this.date;}finally{this.date=new Date();}},initXHR:function(){if(this.xhr){try{delete this.xhr;}catch(exc){gc.console.error(exc);}}
if(window.XMLHttpRequest){if(!this.xhr){this.xhr=new XMLHttpRequest();this.xhr.onerror=this.onError;}}else{try{this.xhr=new ActiveXObject("Msxml2.XMLHTTP");}catch(exc){try{this.xhr=new ActiveXObject("Microsoft.XMLHTTP");}catch(exc){this.xhr=null;gc.console.error(exc);}}}if(this.xhr){this.xhr.onreadystatechange=this.onReadyStateChange;}},initScriptTag:function(){this.freeScriptTag();this.script_time=this.date.getTime();},freeScriptTag:function(){if(this.script_tag){if(!gc.isIE()&&!gc.isSafari()){try{gc.head().removeChild(this.script_tag);}catch(exc){gc.console.error(exc);}try{delete this.script_tag;}catch(exc){gc.console.error(exc);}}this.script_tag=null;this.script_time=null;}},sendRequest:function(){if(gc.net.XHR.requests.length>0){gc.net.XHR.init();if(gc.net.XHR.requests.length>0){if(gc.net.XHR.requests[0].callbackOnStartFunction){try{gc.net.XHR.requests[0].callbackOnStartFunction.call(gc.net.XHR.requests[0].callbackOnStartObject,gc.net.XHR.requests[0].url);}catch(exc){}}
var _c="GET";var _d=gc.net.XHR.requests[0].url;var _e=null;var _f=null;if(_d.indexOf("?")>=0){_d+="&";}else{_d+="?";}if(document.charset){_d+="charset="+document.charset;}else{if(document.characterSet){_d+="charset="+document.characterSet;}else{if(document.inputEncoding){_d+="charset="+document.inputEncoding;}}}if(gc.net.XHR.requests[0].postData&&gc.net.XHR.requests[0].postData!=""){_c="POST";_e=gc.net.XHR.requests[0].postData;_f=gc.net.XHR.requests[0].postContentType;}else{if(gc.net.XHR.requests[0].noCache){_d+="&timestamp_no_cache="+gc.net.XHR.date.getTime();}}_d+=this.urlPostfix;try{if(gc.net.XHR.method==gc.net.XHR.METHOD_SCRIPT_TAG){_d+="&useCallback=1";gc.net.XHR.script_tag=document.createElement("script");gc.net.XHR.script_tag.type="text/javascript";gc.net.XHR.script_tag.src=_d;gc.head().appendChild(gc.net.XHR.script_tag);}else{gc.net.XHR.xhr.open(_c,_d,true);if(_f){gc.net.XHR.xhr.setRequestHeader("Content-Type",_f);}gc.net.XHR.xhr.send(_e);}}catch(exc){gc.console.error(exc);
gc.net.XHR.onError();}}}},sendResponse:function(_10){if(gc.net.XHR.requests.length>0){try{if(gc.net.XHR.requests[0].callbackFunction){if(gc.net.XHR.requests[0].callbackObject){gc.net.XHR.requests[0].callbackFunction.call(gc.net.XHR.requests[0].callbackObject,_10,gc.net.XHR.requests[0].url);}else{gc.net.XHR.requests[0].callbackFunction(_10,gc.net.XHR.requests[0].url);}}}catch(exc){gc.console.error(exc);}var _11=gc.net.XHR.requests.shift();try{if(!_11.persistent){delete _11;}}catch(exc){gc.console.error(exc);}gc.net.XHR.sendRequest();}},onReadyStateChange:function(){if(gc.net.XHR.xhr&&gc.net.XHR.xhr.readyState==4&&gc.net.XHR.requests.length>0){try{var _12=null;if(gc.net.XHR.requests[0].responseType==gc.net.Request.prototype.RESPONSE_XML){_12=gc.net.XHR.xhr.responseXML;}else{if(gc.net.XHR.requests[0].responseType==gc.net.Request.prototype.RESPONSE_JSON){_12=JSON.parse(gc.net.XHR.xhr.responseText);}else{_12=gc.net.XHR.xhr.responseText;}}gc.net.XHR.sendResponse(_12);}catch(exc){
gc.console.error(exc);}}},onError:function(){if(gc.net.XHR.requests.length>0){request=gc.net.XHR.requests.shift();try{if(request.callbackFunction){if(request.callbackObject){request.callbackFunction.call(request.callbackObject,null);}else{request.callbackFunction(null);}}}catch(exc){gc.console.error(exc);}try{if(!request.persistent){delete request;}}catch(exc){gc.console.error(exc);}gc.net.XHR.sendRequest();}},onJSCallback:function(_13){gc.net.XHR.freeScriptTag();if(gc.net.XHR.requests[0].responseType==gc.net.Request.prototype.RESPONSE_JSON){_13=JSON.parse(_13);}gc.net.XHR.sendResponse(_13);},checkJSError:function(){this.initDate();if(gc.net.XHR.requests.length>0&&this.script_tag&&(this.date.getTime()-this.script_time)>15000){gc.net.XHR.freeScriptTag();gc.net.XHR.onError();}}});
gc.initClass("gc.proj.lonlat",true,{maxx:180,maxy:90,srs:"EPSG:4326"});
gc.initClass("gc.proj.mercator",true,{maxx:20037508.34,maxy:20037508.34,srs:"EPSG:900913",toX:function(_1){return _1*this.maxx/180;},toY:function(_2){return Math.log(Math.tan((90+_2)*Math.PI/360))/Math.PI*this.maxy;},toLon:function(x){return x*180/this.maxx;},toLat:function(y){return Math.atan(Math.exp(y*Math.PI/this.maxy))*360/Math.PI-90;}});
gc.initClass("gc.widget.Widget",false,{x:0,y:0,width:200,height:300,is_drag:false,div_widget_bg:null,div_widget:null,img_close:null,div_title:null,div_content:null,div_disabled:null,list_index:-1,autoReload:false,constructor:function(_1,_2,_3,x,y,_6){this.list_index=gc.widget.widgets.length;gc.widget.widgets[this.list_index]=this;if(_2&&_3){this.width=_2;this.height=_3;}if(x||y){this.x=x;this.y=y;}else{this.x=gc.Util.getScreenCenterX(this.width);this.y=gc.Util.getScreenCenterY(this.height);}if(_6){this.div_widget_bg=document.createElement("div");this.div_widget_bg.style.display="none";this.div_widget_bg.className="gc_widget_background";gc.body().appendChild(this.div_widget_bg);}this.div_widget=document.createElement("div");this.div_widget.style.display="none";this.div_widget.className="gc_widget";var i=this.list_index;this.img_close=document.createElement("img");this.img_close.className="gc_widget_close";this.img_close.src=gc.baseUrl+"res/images/buttons/close.gif";
this.img_close.onclick=function(){gc.widget.widgets[i].setVisible(false);return false;};this.div_widget.appendChild(this.img_close);this.div_title=document.createElement("div");this.div_title.className="gc_widget_title";this.div_title.innerHTML=_1;this.div_widget.appendChild(this.div_title);this.div_content=document.createElement("div");this.div_content.className="gc_widget_content";this.div_widget.appendChild(this.div_content);this.div_disabled=document.createElement("div");this.div_disabled.className="gc_widget_content_disabled";this.div_disabled.style.display="none";this.div_widget.appendChild(this.div_disabled);this.setPosition(this.x,this.y,true);this.setSize(this.width,this.height);document.body.appendChild(this.div_widget);if(gc.event.Mouse){gc.event.Mouse.addListener(this);}},destroy:function(){if(gc.event.Mouse){gc.event.Mouse.removeListener(this);}if(this.div_widget){document.body.removeChild(this.div_widget);this.div_widget.removeChild(this.div_title);
this.div_widget.removeChild(this.div_content);delete this.div_widget;delete this.div_title;delete this.div_content;this.div_widget=null;this.div_title=null;this.div_content=null;}},setPosition:function(x,y,_a){if(_a){if(x>(gc.Util.getDocumentWidth()-this.width+4)){x=gc.Util.getDocumentWidth()-this.width+4;}if(x<0){x=0;}var _b=gc.Util.getWindowHeight()-38;if(y>(_b-this.height)){y=_b-this.height;}if(y<0){y=0;}}this.x=x;this.y=y;if(this.div_widget){this.div_widget.style.left=this.x+"px";this.div_widget.style.top=this.y+"px";}},setSize:function(_c,_d){this.width=Math.max(100,_c);this.height=Math.max(100,_d);if(this.div_content){this.div_content.style.width=this.width+"px";this.div_content.style.height=this.height+"px";}},setTitle:function(_e){if(this.div_title){this.div_title.innerHTML=_e;if(!_e){this.div_title.style.display="none";}else{this.div_title.style.display="";}}},getVisible:function(){return (this.div_widget&&this.div_widget.style.display=="none");},setVisible:function(_f){
if(_f){this.div_widget.style.display="";if(this.div_widget_bg){if((gc.isIE()&&!gc.isIE7())||gc.isFF()){this.div_widget_bg.style.position="absolute";this.div_widget_bg.style.height=Math.max(gc.Util.getDocumentHeight(),gc.Util.getWindowHeight())+"px";}this.div_widget_bg.style.display="";}}else{this.div_widget.style.display="none";if(this.div_widget_bg){this.div_widget_bg.style.display="none";}}},setContent:function(_10){this.div_disabled.style.display="none";this.div_disabled.style.backgroundImage="";if(_10){this.div_content.scrollTop=0;this.div_content.innerHTML=_10.replace(/this\.widget/g,"gc.widget.widgets["+this.list_index+"]");gc.Util.execJS(this.div_content);}},startLoad:function(url,_12){if(!_12){this.div_content.innerHTML="";}this.div_disabled.style.display="";this.div_disabled.style.backgroundImage="url('"+gc.baseUrl+"res/images/ajax-loader-grey.gif')";},stopLoad:function(_13){this.setContent(_13);this.setVisible(true);if(this.autoReload){gc.Content.reload();}
},show:function(_14,url,_16,_17){if(!_16){_16=400;}if(!_17){_17=gc.Util.getWindowHeight()-50;}this.setTitle(_14);this.setContent("");this.setSize(_16,_17);this.setPosition(gc.Util.getScreenCenterX(this.width),gc.Util.getScreenCenterY(this.height)-20,true);this.setVisible(true);this.reload(url);},reload:function(url){this.setContent("");var _19=new gc.net.Request(url,this.stopLoad,this,gc.net.Request.prototype.RESPONSE_TEXT,true);_19.callbackOnStartFunction=this.startLoad;_19.callbackOnStartObject=this;gc.net.XHR.addRequest(_19,true);},submitForm:function(_1a,url){try{req=new gc.net.Request();req.url=url;req.callbackFunction=this.stopLoad;req.callbackObject=this;req.noCache=true;req.responseType=req.RESPONSE_TEXT;req.readPostDataFromForm(_1a);gc.net.XHR.addRequest(req);this.startLoad(true);}catch(exc){}},onMouseDragStart:function(_1c,_1d,x,y,_20,_21){if(_1d==this.div_title){this.is_drag=true;this.setPosition(this.x,this.y,true);return true;}return false;
},onMouseDragStop:function(_22,_23,x,y,_26,_27){if(this.is_drag){this.is_drag=false;this.setPosition(this.x,this.y,true);return true;}return false;},onMouseDrag:function(_28,_29,x,y){if(_29==this.div_title&&this.is_drag){this.setPosition(this.x+x,this.y+y);return true;}return false;}});gc.widget.widgets=new Array();
gc.initClass("gc.widget.Div",false,{id:null,node:null,constructor:function(id){this.id=id;},reload:function(_2){if(!this.node){this.node=$(this.id);}if(this.node){this.node.innerHTML="";this.node.style.backgroundImage="url(\""+gc.baseUrl+"res/images/ajax-loader.gif\")";gc.net.XHR.newRequest(_2,this.onReload,this,gc.net.Request.prototype.RESPONSE_TEXT,true);}},onReload:function(_3){if(this.node){this.node.style.backgroundImage="";this.node.innerHTML=_3;}}});
gc.initClass("gc.tree.Util",true,{onClick:function(_1,_2,_3,_4){if(gc.tree.Tree.instances[_1]){gc.tree.Tree.instances[_1].onClick(_2,_3,_4);}},onSelect:function(_5,_6,_7){if(gc.tree.Tree.instances[_5]){gc.tree.Tree.instances[_5].onSelect(_6,_7);}}});
gc.initClass("gc.tree.Tree",false,{event:null,name:null,url:null,opened:null,selectedNodeName:null,selectedItem:null,selectedItemToolbar:null,classNodeOpen:"gctree_node_open",classNodeClose:"gctree_node_close",classItem:"gctree_node_title",classSelectedItem:"gctree_node_title_selected",constructor:function(_1,_2){this.event=new gc.event.Custom(this);if(_1){this.name=_1;gc.tree.Tree.instances[this.name]=this;}this.url=_2;this.opened={};},onClick:function(_3,_4,_5,_6){var _7=$("gctree_"+this.name+"_"+_3+"_sub");var _8=$("gctree_"+this.name+"_"+_3+"_node");if(_7&&_8){if(_7.style.display==""&&!_5&&!_6){this.opened[_3]=false;_7.style.display="none";_8.className=this.classNodeClose;}else{this.opened[_3]=true;_8.className=this.classNodeOpen;_7.style.display="";if((_5||_7.innerHTML=="")&&this.url&&this.url!=""){_7.innerHTML="";_7.style.height="20px";_7.style.backgroundImage="url(\""+gc.baseUrl+"res/images/ajax-loader-small.gif\")";
gc.net.XHR.newRequest(this.url+gc.Util.urlParams(_4),this.loadContent,_7,gc.net.Request.prototype.RESPONSE_TEXT,true);}}}},onSelect:function(_9,_a){var _b=$("gctree_"+this.name+"_"+_9+"_title");var _c=$("gctree_"+this.name+"_"+_9+"_toolbar");if(_b){if(this.selectedItem){this.selectedItem.className=this.classItem;}if(this.selectedItemToolbar){this.selectedItemToolbar.style.display="none";}_b.className=this.classSelectedItem;this.selectedNodeName=_9;this.selectedItem=_b;if(_c){_c.style.display="";}this.selectedItemToolbar=_c;this.event.trigger("onselect",{nodeName:_9,params:_a,selectedItem:this.selectedItem,selectedItemToolbar:this.selectedItemToolbar});}if(!this.opened[_9]&&_a){this.onClick(_9,_a,false,true);}},loadContent:function(_d){if(gc.isIE7()){this.style.height="100%";}else{this.style.height="";}this.style.backgroundImage="";if(_d){this.innerHTML=_d;}}});gc.tree.Tree.instances={};
gc.initClass("gc.map.Notepad",false,{menu:null,parser:null,dataUrl:null,notepad:null,current:null,category:null,constructor:function(_1){this.menu=_1;this.parser=new OpenLayers.Format.GeoJSON();},init:function(_2){this.dataUrl=_2;this.loadNotepad();},onShow:function(){if(this.category){this.category.setVisible(true);}},onHide:function(){if(this.category){this.category.setVisible(false);}},onChangeNotepad:function(_3){this.notepad=_3;this.menu.sectionContent["notepad"]=null;if(this.menu.visibleSection=="notepad"){this.menu.visibleSection=null;this.menu.show("notepad");}this.checkOnNotepad();this.loadNotepad();},onLoadNotepad:function(_4){if(_4){var _5=this.parser.read(_4,"FeatureCollection");if(_5){var _6;this.notepad=new Array();for(var i=0;i<_5.length;++i){this.notepad[this.notepad.length]=_5[i].attributes.notepad_key;_5[i].layer=this.menu.map.markerManager.layer;_5[i].attributes.level=null;_5[i].data.level=null;_6=this.menu.map.markerManager.getCategory(_5[i].attributes.layer);
if(!_5[i].marker&&_6){icon=_6.icon.clone();icon.imageDiv.style.cursor="pointer";_5[i].lonlat=new OpenLayers.LonLat(_5[i].geometry.x,_5[i].geometry.y);_5[i].marker=new OpenLayers.Marker(_5[i].lonlat,icon);}}if(!this.category){this.category=this.menu.map.markerManager.addCategory(null,"intern___notepad");}this.category.setFeatures(_5);this.category.updateMarkers();}}},loadNotepad:function(){if(this.dataUrl){gc.net.XHR.newRequest(this.dataUrl,this.onLoadNotepad,this,gc.net.Request.prototype.RESPONSE_TEXT,true,null,true);}},checkOnNotepad:function(id){if(id){this.current=id;}if(this.current){if(this.isOnNotepad(this.current)){document.getElementById(this.menu.map.name+"_poi_toolbar_add_notepad").style.display="none";document.getElementById(this.menu.map.name+"_poi_toolbar_remove_notepad").style.display="";}else{document.getElementById(this.menu.map.name+"_poi_toolbar_add_notepad").style.display="";
document.getElementById(this.menu.map.name+"_poi_toolbar_remove_notepad").style.display="none";}}},isOnNotepad:function(id){if(this.notepad){for(var i=0;i<this.notepad.length;++i){if(this.notepad[i]==id){return true;}}}return false;}});
gc.initClass("gc.map.Menu",false,{map:null,menuTag:null,menuPanelTag:null,sections:null,sectionContent:null,visible:false,visibleSection:null,loadCount:null,search:null,notepad:null,constructor:function(_1){this.map=_1;this.loadCount=0;this.sections=new Object();this.sectionContent=new Object();this.search=new gc.map.Search(this);this.notepad=new gc.map.Notepad(this);},init:function(_2,_3){this.menuTag=document.getElementById(_2);this.menuPanelTag=document.getElementById(_3);},add:function(_4,_5){this.sections[_4]=_5;},startLoad:function(){++this.loadCount;this.menuPanelTag.parentNode.style.backgroundImage="url('"+gc.baseUrl+"res/images/ajax-loader-grey.gif')";},stopLoad:function(){if(this.loadCount>0){--this.loadCount;}if(this.loadCount==0){this.menuPanelTag.parentNode.style.backgroundImage="";}},switchVisible:function(_6){if(this.visible&&this.visibleSection==_6){this.hide();}else{this.show(_6);}},show:function(_7){
if(this.menuTag&&this.menuPanelTag&&this.sections[_7]&&this.menuPanelTag.parentNode.style.backgroundImage==""){if(this.visibleSection){if(this[this.visibleSection]&&this[this.visibleSection].onHide){this[this.visibleSection].onHide();}this.sectionContent[this.visibleSection]=this.menuPanelTag.innerHTML;this.visibleSection=null;}this.visible=true;this.menuTag.style.display="";if(this.sectionContent[_7]){this.menuPanelTag.innerHTML=this.sectionContent[_7];this.visibleSection=_7;if(this[this.visibleSection]&&this[this.visibleSection].onShow){this[this.visibleSection].onShow();}}else{this.menuPanelTag.innerHTML="";this.startLoad();gc.net.XHR.newRequest(this.sections[_7],this.onContentLoad,this,gc.net.Request.prototype.RESPONSE_TEXT,true,null,true);}}},hide:function(){if(this.menuTag&&this.menuPanelTag&&this.menuPanelTag.parentNode.style.backgroundImage==""){if(this.visibleSection){if(this[this.visibleSection]&&this[this.visibleSection].onHide){this[this.visibleSection].onHide();}
this.sectionContent[this.visibleSection]=this.menuPanelTag.innerHTML;this.visibleSection=null;}this.visible=false;this.menuTag.style.display="none";this.menuPanelTag.innerHTML="";this.stopLoad();}},onContentLoad:function(_8,_9){if(this.menuTag&&this.menuPanelTag){this.menuPanelTag.innerHTML=_8;gc.Util.execJS(this.menuPanelTag);this.stopLoad();}for(var _a in this.sections){if(this.sections[_a]==_9){this.visibleSection=_a;this.sectionContent[_a]=_8;if(this[this.visibleSection]&&this[this.visibleSection].onShow){this[this.visibleSection].onShow();}break;}}}});
gc.initClass("gc.map.MarkerCategory",false,{markerManager:null,visible:false,id:null,title:null,subCategories:null,features:null,icon:null,dataUrl:null,detailUrl:null,levels:null,isRequested:false,constructor:function(_1,id,_3){this.markerManager=_1;this.id=id;this.title=_3;this.subCategories=new Array();this.features=null;},setIcon:function(_4,_5,_6,_7,_8){if(typeof _4=="Object"){this.icon=_4;}else{this.icon=new OpenLayers.Icon(_4,new OpenLayers.Size(_5,_6),(_7||_8)?(new OpenLayers.Pixel(_7,_8)):null);}},addSubCategory:function(_9){if(!this.subCategories){this.subCategories=[_9];}else{this.subCategories.push(_9);}},getSubCategory:function(id){var _b;if(this.subCategories&&this.subCategories.length>0){for(var i=0;i<this.subCategories.length;++i){if(this.subCategories[i].id==id){return this.subCategories[i];}else{_b=this.subCategories[i].getSubCategory(id);if(_b){return _b;}}}}},setVisible:function(_d,_e){this.visible=_d;if(_e&&this.subCategories&&this.subCategories.length>0){
for(var i=0;i<this.subCategories.length;++i){this.subCategories[i].setVisible(_d,_e);}}this.updateMarkers();},addFeature:function(x,y,_12){if(!this.features){this.features=new Array();}var _13=new OpenLayers.Feature.Vector();_13.geometry=new OpenLayers.Geometry.Point(x,y);_13.attributes.name=_12;this.features.push(_13);this.updateMarkers();},clearFeatures:function(){if(this.features){for(var i=0;i<this.features.length;++i){if(this.features[i].data.visible){this.features[i].data.visible=false;try{this.markerManager.layer.removeMarker(this.features[i].marker);}catch(exc){}try{this.features[i].marker.events.unregister("mousedown",this,this.onClick);}catch(exc){}}}this.features=null;}},loadFeatures:function(_15){var _16=new OpenLayers.Format.GeoJSON();if(_15){var _17=_16.read(_15,"FeatureCollection");if(_17){this.features=_17;this.isRequested=false;this.updateMarkers();}}else{this.isRequested=false;}},setFeatures:function(_18){this.clearFeatures();this.features=_18;
},getFeatures:function(x,y,_1b){if(!_1b){_1b=new Array();}if(this.features){var px;var x1;var x2;var y1;var y2;for(var i=this.features.length-1;i>=0;--i){if(this.features[i].data.visible&&this.features[i].lonlat&&this.features[i].marker&&this.features[i].marker.icon){px=this.markerManager.layer.getViewPortPxFromLonLat(this.features[i].lonlat);px=this.markerManager.layer.map.getLayerPxFromViewPortPx(px);x1=px.x+this.features[i].marker.icon.offset.x;x2=x1+this.features[i].marker.icon.size.w;y1=px.y+this.features[i].marker.icon.offset.y;y2=y1+this.features[i].marker.icon.size.h;if(x1<=x&&x<=x2&&y1<=y&&y<=y2){_1b.push(this.features[i]);}}}}if(this.subCategories&&this.subCategories.length>0){for(var i=0;i<this.subCategories.length;++i){this.subCategories[i].getFeatures(x,y,_1b);}}return _1b;},loadDetails:function(id){if(this.detailUrl){this.markerManager.onDetails(null);
var _23=new gc.net.Request(this.detailUrl+id,this.markerManager.onDetails,this.markerManager,gc.net.Request.prototype.RESPONSE_TEXT,false,null);_23.callbackOnStartFunction=this.markerManager.onDetailStartLoad;_23.callbackOnStartObject=this.markerManager;gc.net.XHR.addRequest(_23,true);}},updateMarkers:function(){if(this.markerManager){if(this.visible){if(this.dataUrl&&!this.features){if(!this.isRequested){this.isRequested=true;gc.net.XHR.newRequest(this.dataUrl,this.loadFeatures,this,gc.net.Request.prototype.RESPONSE_TEXT);}}else{if(this.features){var _24=this.markerManager.layer.map.getExtent();var _25=_24.getWidth();var _26=_24.getHeight();_24.left=_24.left-_25;_24.right=_24.right+_25;_24.bottom=_24.bottom-_26;_24.top=_24.top+_26;var _27;for(var i=0;i<this.features.length;++i){this.features[i].layer=this.markerManager.layer;if(!this.features[i].marker){_27=this.icon.clone();_27.imageDiv.style.cursor="pointer";
this.features[i].lonlat=new OpenLayers.LonLat(this.features[i].geometry.x,this.features[i].geometry.y);this.features[i].marker=new OpenLayers.Marker(this.features[i].lonlat,_27);}if(_24.containsLonLat(this.features[i].lonlat)&&(!this.features[i].data.level||this.features[i].data.level<=this.markerManager.layer.map.zoom)){if(!this.features[i].data.visible){this.features[i].data.visible=true;this.markerManager.layer.addMarker(this.features[i].marker);this.features[i].marker.events.register("mousedown",this,this.onClick);}}else{if(this.features[i].data.visible){this.features[i].data.visible=false;try{this.markerManager.layer.removeMarker(this.features[i].marker);}catch(exc){}try{this.features[i].marker.events.unregister("mousedown",this,this.onClick);}catch(exc){}}}}}}}else{if(this.features){for(var i=0;i<this.features.length;++i){if(this.features[i].data.visible){this.features[i].data.visible=false;try{this.markerManager.layer.removeMarker(this.features[i].marker);}catch(exc){}try{
this.features[i].marker.events.unregister("mousedown",this,this.onClick);}catch(exc){}}}}}}if(this.subCategories&&this.subCategories.length>0){for(var i=0;i<this.subCategories.length;++i){this.subCategories[i].updateMarkers();}}},onClick:function(_29){if(this.markerManager&&this.features){var _2a=gc.event.getTarget(_29).parentNode;for(var i=0;i<this.features.length;++i){if(this.features[i].data.visible&&this.features[i].marker&&this.features[i].marker.icon&&this.features[i].marker.icon.imageDiv&&this.features[i].marker.icon.imageDiv==_2a){if(this.features[i].marker.lonlat){this.markerManager.layer.map.setCenter(this.features[i].marker.lonlat);this.markerManager.setHighlight(this.features[i].lonlat.lon,this.features[i].lonlat.lat);}if(this.detailUrl){this.loadDetails(this.features[i].fid);}else{if(this.features[i].attributes.layer){var cat=this.markerManager.getCategory(this.features[i].attributes.layer);if(cat){cat.loadDetails(this.features[i].fid);}}}}}}OpenLayers.Event.stop(_29);
}});
gc.initClass("gc.Map",false,{name:null,baseZoom:null,map:null,menu:null,markerManager:null,tooltipTag:null,onClickCoordinatesIgnore:null,onClickCoordinatesHandler:null,onClickCoordinatesHandlerObj:null,geocoder:null,constructor:function(_1){if(_1){this.name=_1;gc.Map.instances[this.name]=this;}this.menu=new gc.map.Menu(this);this.onClickCoordinatesIgnore=false;this.onClickCoordinatesHandler=new Array();this.onClickCoordinatesHandlerObj=new Array();OpenLayers.Lang.setCode("de");},initMap:function(id,x,y,_5,_6,_7,_8,_9){this.baseZoom={x:x,y:y,zoom:_5};this.menu.search.init(_6,_7);this.map=new OpenLayers.Map(id,_8);this.map.events.register("click",this,this.doOnClickCoordinates);if(gc.isIE7()){this.map.events.register("movestart",this,this.doOnClickCoordinatesIgnore);}for(var i=0;i<_9.length;++i){if(eval("OpenLayers.Control."+_9[i])){var _b=eval("new OpenLayers.Control."+_9[i]+"()");if(_9[i]=="LayerSwitcher"){_b.activeColor="#F2F2F2";}this.map.addControl(_b);}}
},initMarkerManager:function(_c,_d,_e,_f){this.markerManager=new gc.map.MarkerManager(this.map);this.markerManager.defaultVisible=_d;if(_e){this.markerManager.initTooltip(_e);}if(_f){this.markerManager.initDetail(_f);}OpenLayers.Util.alphaHack=function(){return false;};if(_c&&_c!=""){gc.net.XHR.newRequest(_c,this.markerManager.loadCategories,this.markerManager,gc.net.Request.prototype.RESPONSE_TEXT,true);}},addLayerTMS:function(_10,_11,url,_13){var _14=(!this.map.layers||this.map.layers.length==0);var _15={layername:_11,type:"png",isBaseLayer:_13};if(!_13&&gc.isIE()&&!gc.isIE7()){_15["type"]="gif";}var tms=new OpenLayers.Layer.TMS(_10,url,_15);tms.displayOutsideMaxExtent=true;this.map.addLayer(tms);if(_14){this.map.setCenter(new OpenLayers.LonLat(this.baseZoom.x,this.baseZoom.y),this.baseZoom.zoom);}},addLayerWMS:function(_17,_18,url,_1a,_1b,_1c){var _1d=(!this.map.layers||this.map.layers.length==0);var wms;var _1f={transparent:(_1a)?"false":"true",layers:_18,format:"image/png"};
var _20={projection:this.map.projection,units:this.map.units,isBaseLayer:_1a};if(_1b){_20["singleTile"]=true;_20["ratio"]=1.5;}if(!_1a&&gc.isIE()&&!gc.isIE7()){_1f["format"]="image/gif";}wms=new OpenLayers.Layer.WMS(_17,url,_1f,_20);wms.displayOutsideMaxExtent=true;if(_1c){wms.gutter=_1c;}this.map.addLayer(wms);if(_1d){this.map.setCenter(new OpenLayers.LonLat(this.baseZoom.x,this.baseZoom.y),this.baseZoom.zoom);}},addLayerGoogle:function(_21,_22){if(!_21){_21="Google Maps";}var _23=(!this.map.layers||this.map.layers.length==0);var _24=new OpenLayers.Layer.Google(_21,{type:G_NORMAL_MAP,sphericalMercator:this.map.projection==gc.proj.mercator.srs,isBaseLayer:true});this.map.addLayer(_24);try{if(!_22){_24.mapObject.addMapType(G_NORMAL_MAP);_24.mapObject.addMapType(G_SATELLITE_MAP);_24.mapObject.addMapType(G_HYBRID_MAP);_24.mapObject.addMapType(G_PHYSICAL_MAP);_24.mapObject.addControl(new GHierarchicalMapTypeControl());var _25=_24.div.lastChild;_24.div.removeChild(_25);
_24.pane.appendChild(_25);}}catch(e){}if(_23){this.map.setCenter(new OpenLayers.LonLat(this.baseZoom.x,this.baseZoom.y),this.baseZoom.zoom);}},register:function(_26,obj,_28){return this.map.events.register(_26,obj,_28);},unregister:function(_29,obj,_2b){return this.map.events.unregister(_29,obj,_2b);},loadDetails:function(cat,id,_2e,_2f,_30){if(this.markerManager){var _31=this.markerManager.getCategory(cat);if(_31){this.markerManager.setHighlight(_2e,_2f);_31.loadDetails(id);}else{this.markerManager.setHighlight(null,null);this.markerManager.onDetails(null);return;}}this.map.setCenter(new OpenLayers.LonLat(_2e,_2f),(this.map.getZoom()<_30)?_30:null);},reload:function(){if(this.map.baseLayer){this.map.baseLayer.redraw();}},setCenter:function(x,y,_34){var tmp=new OpenLayers.LonLat();tmp.lon=x;tmp.lat=y;this.map.setCenter(tmp,_34,true);if(this.markerManager){this.markerManager.updateMarkers();}if(this.map.baseLayer&&this.map.baseLayer.singleTile){this.map.baseLayer.onMapResize();}
},getZoom:function(){return this.map.getZoom();},setZoom:function(_36){var ret=this.map.zoomTo(_36);if(this.markerManager){this.markerManager.updateMarkers();}return ret;},getLayerVisible:function(_38){for(var i=0;i<this.map.layers.length;i++){if(this.map.layers[i].name==_38){return this.map.layers[i].getVisibility();}}return false;},setLayerVisible:function(_3a,_3b){for(var i=0;i<this.map.layers.length;i++){if(this.map.layers[i].name==_3a){if(this.map.layers[i].isBaseLayer){if(_3b){this.map.setBaseLayer(this.map.layers[i]);}}else{this.map.layers[i].setVisibility(_3b);}}}},geocode:function(_3d,_3e,_3f){if(GClientGeocoder){if(!this.geocoder){this.geocoder=new GClientGeocoder(new GGeocodeCache());}if(_3f){if(this.map.projection==gc.proj.mercator.srs){this.geocoder.getLocations(_3d,function(_40){if(_40&&_40.Placemark){for(var i=0;i<_40.Placemark.length;++i){_40.Placemark[i].Point.coordinates[0]=gc.proj.mercator.toX(_40.Placemark[i].Point.coordinates[0]);
_40.Placemark[i].Point.coordinates[1]=gc.proj.mercator.toY(_40.Placemark[i].Point.coordinates[1]);_40.Placemark[i].x=_40.Placemark[i].Point.coordinates[0];_40.Placemark[i].y=_40.Placemark[i].Point.coordinates[1];}}_3e.apply(this,[_40]);});}else{this.geocoder.getLocations(_3d,_3e);}}else{if(this.map.projection==gc.proj.mercator.srs){this.geocoder.getLatLng(_3d,function(_42){if(_42){_42.x=gc.proj.mercator.toX(_42.x);_42.y=gc.proj.mercator.toY(_42.y);}_3e.apply(this,[_42]);});}else{this.geocoder.getLatLng(_3d,_3e);}}return true;}else{return false;}},addOnClickCoordinates:function(_43,_44){var i=this.onClickCoordinatesHandler.length;this.onClickCoordinatesHandler[i]=_43;this.onClickCoordinatesHandlerObj[i]=_44;},removeOnClickCoordinates:function(_46,_47){for(var i=0;i<this.onClickCoordinatesHandler.length;i++){if(this.onClickCoordinatesHandler[i]==_46&&this.onClickCoordinatesHandlerObj[i]==_47){this.onClickCoordinatesHandler.splice(i,1);this.onClickCoordinatesHandlerObj.splice(i,1);--i;}}
},doOnClickCoordinatesIgnore:function(_49){OpenLayers.Event.stop(_49);if(gc.isIE7()){this.onClickCoordinatesIgnore=true;}},doOnClickCoordinates:function(_4a){OpenLayers.Event.stop(_4a);if(!this.onClickCoordinatesIgnore){var tmp=this.map.getLonLatFromViewPortPx(_4a.xy);for(var i=0;i<this.onClickCoordinatesHandler.length;++i){if(this.onClickCoordinatesHandler[i]){this.onClickCoordinatesHandler[i].call(this.onClickCoordinatesHandlerObj[i],tmp.lon,tmp.lat);}}}else{this.onClickCoordinatesIgnore=false;}}});gc.Map.instances={};

gc.initClass("gc.map.Util",true,{setVisibleMenuCategory:function(_1,_2,_3){gc.map.Util.setVisibleSection(_2,_3);gc.Map.instances[_1].markerManager.setCategoryVisible(_2,_3,true);},setVisibleSection:function(_4,_5){if(_5){document.getElementById("mapcat_"+_4).style.display="none";document.getElementById("mapcat_"+_4+"_act").style.display="";}else{document.getElementById("mapcat_"+_4).style.display="";document.getElementById("mapcat_"+_4+"_act").style.display="none";}},saveToForm:function(_6,_7){var _8=gc.Map.instances[_6];gc.Util.setFormValue(_7,"zoomlevel",_8.getZoom());gc.Util.setFormValue(_7,"center_x",_8.map.getCenter().lon);gc.Util.setFormValue(_7,"center_y",_8.map.getCenter().lat);},changeNotepad:function(_9,_a){var _b=gc.Map.instances[_9];gc.net.XHR.newRequest(_a,_b.menu.notepad.onChangeNotepad,_b.menu.notepad,gc.net.Request.prototype.RESPONSE_JSON,true,null,true);}});
gc.initClass("gc.map.MarkerManager",false,{defaultVisible:false,map:null,layer:null,categories:null,layerHighlight:null,markerHighlight:null,tooltipTag:null,detailTag:null,constructor:function(_1){this.setMap(_1);this.categories=new Array();this.markerHighlight=new OpenLayers.Marker(null,new OpenLayers.Icon(gc.getScriptLocation()+"../icons/marker.gif",new OpenLayers.Size(29,29)));},setMap:function(_2){try{if(this.map){try{this.map.events.unregister("moveend",this,this.updateMarkers);}catch(exc){}try{this.map.events.unregister("zoomend",this,this.onTooltipHide);}catch(exc){}if(this.layer){this.map.removeLayer(this.layer);}if(this.layerHighlight){this.map.removeLayer(this.layerHighlight);}}}catch(exc){}this.map=_2;if(this.map){if(!this.layer){this.layer=new OpenLayers.Layer.Markers("",{displayInLayerSwitcher:false});}this.map.addLayer(this.layer);if(!this.layerHighlight){this.layerHighlight=new OpenLayers.Layer.Markers("",{displayInLayerSwitcher:false});}
this.map.addLayer(this.layerHighlight);this.map.events.register("moveend",this,this.updateMarkers);this.map.events.register("zoomend",this,this.onTooltipHide);}},initTooltip:function(id){this.tooltipTag=document.getElementById(id);if(this.tooltipTag&&this.layer){this.layer.events.register("mousemove",this,this.onTooltip);this.layer.events.register("mouseout",this,this.onTooltipHide);}},initDetail:function(id){this.detailTag=document.getElementById(id);},loadCategories:function(_5){if(_5){var _6=JSON.parse(_5);if(_6){this.loadChildCategories(null,_6);this.updateMarkers();}}},loadChildCategories:function(_7,_8){for(var i=0;i<_8.length;++i){this.addCategory(_7,_8[i].id,_8[i].title,(_8[i].icon)?_8[i].icon.src:null,(_8[i].icon)?_8[i].icon.width:null,(_8[i].icon)?_8[i].icon.height:null,_8[i].dataUrl,_8[i].detailUrl,[]);if(_8[i].items&&_8[i].items.length>0){this.loadChildCategories(_8[i].id,_8[i].items);}}},addCategory:function(_a,id,_c,_d,_e,_f,_10,_11,_12){var _13;if(_a){
_13=this.getCategory(_a);if(!_13){_13=new gc.map.MarkerCategory(this,_a);_13.visible=this.defaultVisible;this.categories.push(_13);}}var _14=new gc.map.MarkerCategory(this,id,_c);_14.dataUrl=_10;_14.detailUrl=_11;_14.levels=_12;if(_d){_14.setIcon(_d,_e,_f);}_14.visible=this.defaultVisible;if(_13){_13.subCategories.push(_14);}else{this.categories.push(_14);}return _14;},getCategory:function(id,_16){var tmp;for(var i=0;i<this.categories.length;++i){if(this.categories[i].id==id){return this.categories[i];}else{tmp=this.categories[i].getSubCategory(id);if(tmp){return tmp;}}}return null;},setCategoryVisible:function(id,_1a,_1b){var _1c=this.getCategory(id);if(_1c){_1c.setVisible(_1a,_1b);}},setAllVisible:function(_1d){for(var i=0;i<this.categories.length;++i){this.categories[i].setAllVisible(_1d);}this.updateMarkers();},getFeatures:function(x,y){var _21=new Array();for(var i=0;i<this.categories.length;++i){this.categories[i].getFeatures(x,y,_21);}return _21;},setHighlight:function(x,y){
if(this.layerHighlight){try{this.layerHighlight.removeMarker(this.markerHighlight);}catch(exc){}if(x&&y){if(this.markerHighlight.lonlat){this.markerHighlight.lonlat.lon=x;this.markerHighlight.lonlat.lat=y;}else{this.markerHighlight.lonlat=new OpenLayers.LonLat(x,y);}this.layerHighlight.addMarker(this.markerHighlight);}}},updateMarkers:function(){if(this.layer){for(var i=this.categories.length-1;i>=0;--i){this.categories[i].updateMarkers();}}},onTooltip:function(_26){OpenLayers.Event.stop(_26);if(this.tooltipTag&&this.layer){var _27=gc.event.getTarget(_26).parentNode;var px=new OpenLayers.Pixel(gc.event.getOffsetX(_26)+parseFloat(_27.style.left),gc.event.getOffsetY(_26)+parseFloat(_27.style.top));var _29=this.getFeatures(px.x,px.y);px=this.map.getViewPortPxFromLayerPx(px);if(_29&&_29.length>0){var tmp="";var _2b=new Object();for(var i=0;i<_29.length;++i){if(_29[i].attributes.name&&!_2b[_29[i].fid]){tmp+="<div style=\"padding: 2px 0px;\">"+_29[i].attributes.name+"</div>";
_2b[_29[i].fid]=1;}}this.tooltipTag.innerHTML=tmp;if(this.tooltipTag.style.position=="absolute"){this.tooltipTag.style.left=(px.x+10)+"px";this.tooltipTag.style.top=(px.y+10)+"px";}this.tooltipTag.style.display="";}else{this.onTooltipHide();}}},onTooltipHide:function(_2d){if(this.tooltipTag){this.tooltipTag.style.display="none";}if(_2d){OpenLayers.Event.stop(_2d);}},onDetailStartLoad:function(){this.onDetails();},onDetails:function(_2e){if(this.detailTag){if(_2e){this.detailTag.innerHTML=_2e;this.detailTag.style.backgroundImage="";this.detailTag.style.height="";gc.Util.execJS(this.detailTag);}else{this.detailTag.innerHTML="";this.detailTag.style.backgroundImage="url('"+gc.baseUrl+"res/images/ajax-loader-grey.gif')";this.detailTag.style.height="64px";}}}});
gc.initClass("gc.map.Search",false,{menu:null,formName:null,searchUrl:null,parser:null,resultTagAddress:null,resultTag:null,resultPage:0,searchText:null,searchResult:null,searchCategory:null,constructor:function(_1){this.menu=_1;},init:function(_2,_3){this.formName=_2;this.searchUrl=_3;this.parser=new OpenLayers.Format.GeoJSON();},execSearch:function(_4){this.resultTagAddress=document.getElementById(this.formName+"_result_address");this.resultTag=document.getElementById(this.formName+"_result");for(var i=0;i<_4.elements.length;++i){if(_4.elements[i].name==this.formName){this.resultPage=0;this.searchText=_4.elements[i].value;this.execSearchPOI();this.execSearchAddress();break;}}},execSearchPOI:function(){if(this.resultTag){this.resultTag.innerHTML="";gc.map.Util.setVisibleSection(this.resultTag.id,true);this.resultTag.parentNode.style.display="none";}if(this.searchCategory){this.searchCategory.setVisible(false);}
gc.net.XHR.newRequest(this.searchUrl+encodeURIComponent(this.searchText)+"&resultpage="+this.resultPage,this.onSearchResult,this,gc.net.Request.prototype.RESPONSE_TEXT,true,null,true);this.menu.startLoad();},execSearchAddress:function(){if(this.resultTagAddress){this.resultTagAddress.innerHTML="";gc.map.Util.setVisibleSection(this.resultTagAddress.id,true);this.resultTagAddress.parentNode.style.display="none";}var _6=this;if(this.menu.map.geocode(this.searchText,function(_7){_6.onSearchResultAddress(_7);},true)){this.menu.startLoad();}},showResult:function(_8){if(this.searchResult&&_8>=0&&_8<this.searchResult.length){var _9=this.menu.map.markerManager.getCategory(this.searchResult[_8].attributes.layer);if(_9){if(this.searchResult[_8].geometry){this.menu.map.setCenter(this.searchResult[_8].geometry.x,this.searchResult[_8].geometry.y);this.menu.map.markerManager.setHighlight(this.searchResult[_8].geometry.x,this.searchResult[_8].geometry.y);}_9.loadDetails(this.searchResult[_8].fid);}}
},onSearchResultAddress:function(_a){this.menu.stopLoad();if(this.resultTagAddress&&_a&&_a.Placemark){var _b="";var _c=this.menu.map.map.maxExtent;for(var i=0;i<_a.Placemark.length;++i){if(_c.left<=_a.Placemark[i].x&&_c.right>=_a.Placemark[i].x&&_c.bottom<=_a.Placemark[i].y&&_c.top>=_a.Placemark[i].y){_b+="<div class=\"gc_map_searchresult_address\""+" onclick=\"gc.Map.instances['"+this.menu.map.name+"'].setCenter("+_a.Placemark[i].x+","+_a.Placemark[i].y+");\">"+_a.Placemark[i].address.replace(", Germany","")+"</div>";}}if(_b!=""){this.resultTagAddress.innerHTML=_b;this.resultTagAddress.parentNode.style.display="";}else{this.resultTagAddress.innerHTML="";this.resultTagAddress.parentNode.style.display="none";}}},onSearchResult:function(_e){this.menu.stopLoad();if(this.resultTag&&_e){this.searchResult=this.parser.read(_e,"FeatureCollection");var _f="";for(var i=0;i<this.searchResult.length;++i){_f+=this.searchResult[i].attributes.html;}if(_f!=""){this.resultTag.innerHTML=_f;
this.resultTag.parentNode.style.display="";}else{this.resultTag.innerHTML="";this.resultTag.parentNode.style.display="none";}var _11,_12,_13,_14;var cat;if(!this.searchCategory){this.searchCategory=this.menu.map.markerManager.addCategory(null,"intern___searchresult");}for(var i=0;i<this.searchResult.length;++i){if(i==0||this.searchResult[i].geometry.x<_11){_11=this.searchResult[i].geometry.x;}if(i==0||this.searchResult[i].geometry.y<_12){_12=this.searchResult[i].geometry.y;}if(i==0||this.searchResult[i].geometry.x>_13){_13=this.searchResult[i].geometry.x;}if(i==0||this.searchResult[i].geometry.y>_14){_14=this.searchResult[i].geometry.y;}this.searchResult[i].layer=this.menu.map.markerManager.layer;this.searchResult[i].attributes.level=null;this.searchResult[i].data.level=null;cat=this.menu.map.markerManager.getCategory(this.searchResult[i].attributes.layer);if(!this.searchResult[i].marker&&cat){icon=cat.icon.clone();icon.imageDiv.style.cursor="pointer";
this.searchResult[i].lonlat=new OpenLayers.LonLat(this.searchResult[i].geometry.x,this.searchResult[i].geometry.y);this.searchResult[i].marker=new OpenLayers.Marker(this.searchResult[i].lonlat,icon);}}if(this.searchResult.length>1){this.menu.map.map.zoomToExtent(new OpenLayers.Bounds(_11,_12,_13,_14));}else{if(this.searchResult.length==1){this.menu.map.setCenter(this.searchResult[0].geometry.x,this.searchResult[0].geometry.y);}}this.searchCategory.setFeatures(this.searchResult);this.searchCategory.setVisible(true);}}});
gc.initClass("gc.event.Custom",false,{object:null,listeners:null,constructor:function(_1){this.object=_1;this.listeners={};},register:function(_2,_3,_4){if(!this.listeners[_2]){this.listeners[_2]=[];}this.listeners[_2][this.listeners[_2].length]={func:_3,obj:_4};},unregister:function(_5,_6,_7){if(this.listeners[_5]){for(i in this.listeners[_5]){if(this.listeners[_5][i]&&this.listeners[_5][i].func==_6&&this.listeners[_5][i].obj==_7){this.listeners[_5][i]=null;}}}},trigger:function(_8,_9){_9.object=this.object;if(this.listeners[_8]){for(i in this.listeners[_8]){if(this.listeners[_8][i]&&this.listeners[_8][i].func){if(this.listeners[_8][i].obj){this.listeners[_8][i].func.call(this.listeners[_8][i].obj,_9);}else{this.listeners[_8][i].func(_9);}}}}}});
gc.initClass("gc.event",true,{getOffsetX:function(_1){if(_1.layerX){return _1.layerX;}else{return _1.offsetX;}},getOffsetY:function(_2){if(_2.layerY){return _2.layerY;}else{return _2.offsetY;}},getPageX:function(_3){if(_3.pageX){return _3.pageX;}else{return _3.clientX;}},getPageY:function(_4){if(_4.pageY){return _4.pageY;}else{return _4.clientY;}},getTarget:function(_5){if(_5.target){return _5.target;}else{if(_5.srcElement){return _5.srcElement;}else{return null;}}}});
gc.initClass("gc.event.Mouse",true,{BUTTON_LEFT:1,BUTTON_RIGHT:2,BUTTON_MIDDLE:4,registered:false,listeners:new Array(),is_drag:false,drag_x:0,drag_y:0,drag_target:null,register:function(){this.registered=true;document.body.onmouseover=this.onMouseOver;document.body.onmouseout=this.onMouseOut;document.body.onmousemove=this.onMouseMove;document.body.onmousedown=this.onMouseDown;document.body.onmouseup=this.onMouseUp;if(window.addEventListener){window.addEventListener("DOMMouseScroll",this.onMouseWheel,false);}else{document.body.onmousewheel=this.onMouseWheel;}document.body.onselectstart=function(e){return !gc.event.Mouse.is_drag;};},unregister:function(){this.registered=false;document.body.onmouseover=null;document.body.onmouseout=null;document.body.onmousemove=null;document.body.onmousedown=null;document.body.onmouseup=null;if(window.addEventListener){window.removeEventListener("DOMMouseScroll",this.onMouseWheel,false);}else{document.body.onmousewheel=null;}
document.body.onselectstart=null;},addListener:function(_2){this.listeners.push(_2);if(!this.registered){this.register();}},removeListener:function(_3){for(var i=0;i<this.listeners.length;++i){if(this.listeners[i]==_3){this.listeners.splice(i,1);--i;}}if(this.listeners.length==0&&this.registered){this.unregister();}},onMouseOver:function(_5){if(!_5){_5=window.event;}var _6=gc.event.getTarget(_5);var x=gc.event.getOffsetX(_5);var y=gc.event.getOffsetY(_5);var _9=gc.event.getPageX(_5);var _a=gc.event.getPageY(_5);for(var i=0;i<gc.event.Mouse.listeners.length;++i){if(gc.event.Mouse.listeners[i].onMouseOver){gc.event.Mouse.listeners[i].onMouseOver(_5,_6,x,y,_9,_a);}}},onMouseOut:function(_c){if(!_c){_c=window.event;}var _d=gc.event.getTarget(_c);var x=gc.event.getOffsetX(_c);var y=gc.event.getOffsetY(_c);var _10=gc.event.getPageX(_c);var _11=gc.event.getPageY(_c);for(var i=0;i<gc.event.Mouse.listeners.length;++i){if(gc.event.Mouse.listeners[i].onMouseOut){
gc.event.Mouse.listeners[i].onMouseOut(_c,_d,x,y,_10,_11);}}},onMouseMove:function(_13){if(!_13){_13=window.event;}var _14=gc.event.getTarget(_13);var x=gc.event.getOffsetX(_13);var y=gc.event.getOffsetY(_13);var _17=gc.event.getPageX(_13);var _18=gc.event.getPageY(_13);for(var i=0;i<gc.event.Mouse.listeners.length;++i){if(gc.event.Mouse.listeners[i].onMouseMove){gc.event.Mouse.listeners[i].onMouseMove(_13,_14,x,y,_17,_18);}}gc.event.Mouse.onMouseDrag(_13);},onMouseDown:function(_1a){if(!_1a){_1a=window.event;}var _1b=gc.event.getTarget(_1a);var x=gc.event.getOffsetX(_1a);var y=gc.event.getOffsetY(_1a);var _1e=gc.event.getPageX(_1a);var _1f=gc.event.getPageY(_1a);for(var i=0;i<gc.event.Mouse.listeners.length;++i){if(gc.event.Mouse.listeners[i].onMouseDown){gc.event.Mouse.listeners[i].onMouseDown(_1a,_1b,x,y,_1e,_1f);}}gc.event.Mouse.onMouseDragStart(_1a);},onMouseUp:function(_21){if(!_21){_21=window.event;}var _22=gc.event.getTarget(_21);var x=gc.event.getOffsetX(_21);
var y=gc.event.getOffsetY(_21);var _25=gc.event.getPageX(_21);var _26=gc.event.getPageY(_21);for(var i=0;i<gc.event.Mouse.listeners.length;++i){if(gc.event.Mouse.listeners[i].onMouseUp){gc.event.Mouse.listeners[i].onMouseUp(_21,_22,x,y,_25,_26);}}gc.event.Mouse.onMouseDragStop(_21);},onMouseWheel:function(_28){if(!_28){_28=window.event;}var _29=gc.event.getTarget(_28);var x=gc.event.getOffsetX(_28);var y=gc.event.getOffsetY(_28);var _2c=gc.event.getPageX(_28);var _2d=gc.event.getPageY(_28);var _2e=0;if(_28.wheelDelta){_2e=_28.wheelDelta/120;if(window.opera){_2e=-_2e;}}else{if(_28.detail){_2e=-_28.detail/3;}}var _2f=false;for(var i=0;i<gc.event.Mouse.listeners.length;++i){if(gc.event.Mouse.listeners[i].onMouseWheel){if(gc.event.Mouse.listeners[i].onMouseWheel(_28,_2e,_29,x,y,_2c,_2d)){_2f=true;}}}if(_2f){if(_28.preventDefault){_28.preventDefault();}_28.returnValue=false;}},onMouseDragStart:function(_31){if(!_31.button||_31.button==this.BUTTON_LEFT){var _32=gc.event.getTarget(_31);
var x=gc.event.getOffsetX(_31);var y=gc.event.getOffsetY(_31);var _35=gc.event.getPageX(_31);var _36=gc.event.getPageY(_31);for(var i=0;i<this.listeners.length;++i){if(this.listeners[i].onMouseDragStart){if(this.listeners[i].onMouseDragStart(_31,_32,x,y,_35,_36)){this.is_drag=true;}}}if(this.is_drag){this.drag_x=_35;this.drag_y=_36;this.drag_target=_32;}}},onMouseDragStop:function(_38){if(this.is_drag){var _39=gc.event.getTarget(_38);var x=gc.event.getOffsetX(_38);var y=gc.event.getOffsetY(_38);var _3c=gc.event.getPageX(_38);var _3d=gc.event.getPageY(_38);this.is_drag=false;this.drag_x=0;this.drag_y=0;this.drag_target=null;for(var i=0;i<this.listeners.length;++i){if(this.listeners[i].onMouseDragStop){this.listeners[i].onMouseDragStop(_38,_39,x,y,_3c,_3d);}}}},onMouseDrag:function(_3f){if(this.is_drag){var x=gc.event.getPageX(_3f)-this.drag_x;var y=gc.event.getPageY(_3f)-this.drag_y;var _42=false;if(x!=0||y!=0){this.drag_x=gc.event.getPageX(_3f);this.drag_y=gc.event.getPageY(_3f);
for(var i=0;i<this.listeners.length;++i){if(this.listeners[i].onMouseDrag){if(this.listeners[i].onMouseDrag(_3f,this.drag_target,x,y)){_42=true;}}}}if(_42){if(_3f.preventDefault){_3f.preventDefault();}_3f.returnValue=false;}}}});
