if(!Bs_Objects){var Bs_Objects=[]
}function Bs_Checkbox(){this._id;
this._tagId;
this.checkboxName;
this.value=0;
this.noPartly=false;
this.disabled=false;
this.setDisabled=function(b){if(typeof(b)=="undefined"){b=!this.disabled
}this.disabled=b;
this.drawInto(this._tagId)
};
this.guiNochange=false;
this.caption;
this.imgDir="/js/geoportal/blueshoes-4.6/javascript/components/checkbox/img/bobby/";
this.imgWidth="13";
this.imgHeight="13";
this.imgStyle="";
this.eventOnClick;
this.eventOnChange;
this._constructor=function(){this._id=Bs_Objects.length;
Bs_Objects[this._id]=this;
this._tagId="Bs_Checkbox_"+this._id+"_"
};
this.render=function(tagId){if(this.noPartly&&(this.value==1)){this.value=2
}if(!bs_isEmpty(tagId)){this._tagId=tagId
}var out=new Array();
var outI=0;
var img="";
img+=(this.disabled)?"disabled":"enabled";
img+="_"+this.value;
if(!this.disabled){out[outI++]="<span";
if(!this.guiNochange){out[outI++]=' onClick="Bs_Objects['+this._id+"].onClick('"+this._tagId+"');\""
}out[outI++]=' style="cursor:hand;"';
if(this.useMouseover&&!this.guiNochange){out[outI++]=' onMouseOver="Bs_Objects['+this._id+"].onMouseOver('"+this._tagId+"');\"";
out[outI++]=' onMouseOut="Bs_Objects['+this._id+"].onMouseOut('"+this._tagId+"');\""
}out[outI++]=">"
}out[outI++]='<img id="'+this._tagId+'icon" src="'+this.imgDir+img+'.gif" border="0" width="'+this.imgWidth+'" height="'+this.imgHeight+'"';
if(!bs_isEmpty(this.imgStyle)){out[outI++]=' style="'+this.imgStyle+'"'
}out[outI++]=">";
if(this.caption){out[outI++]="&nbsp;"+this.caption
}if(!this.disabled){out[outI++]="</span>"
}if(!this.checkboxName){this.checkboxName="checkbox"+this._tagId
}out[outI++]='<input value="'+this.value+'" type=checkbox name="'+this.checkboxName+'" id="'+this.checkboxName+'" style="display:none; visibility:hidden;"';
if(this.value){out[outI++]=" checked"
}out[outI++]=">";
return out.join("")
};
this.drawInto=function(tagId){if(!bs_isEmpty(tagId)){this._tagId=tagId
}document.getElementById(this._tagId).innerHTML=this.render(this._tagId)
};
this.draw=function(tagId){this.drawInto(tagId)
};
this.write=function(){document.write(this.render(this._tagId))
};
this.onClick=function(){switch(this.value){case 0:this.value=2;
break;
case 1:case 2:this.value=0;
this.value=0;
break;
default:this.value=0
}this._updateHiddenField();
this._updateIcon();
if(this.eventOnClick){this._fireEvent(this.eventOnClick)
}if(this.eventOnChange){this._fireEvent(this.eventOnChange)
}};
this.setTo=function(value,cancelEventOnChange){this.value=value;
this._updateHiddenField();
this._updateIcon();
if(!cancelEventOnChange){if(this.eventOnChange){this._fireEvent(this.eventOnChange)
}}};
this.attachOnClick=function(globalFunctionName){this.eventOnClick=globalFunctionName
};
this.attachOnChange=function(globalFunctionName){this.eventOnChange=globalFunctionName
};
this._fireEvent=function(e){if(e){if(typeof(e)!="array"){e=new Array(e)
}for(var i=0;
i<e.length;
i++){if(typeof(e[i])=="function"){e[i](this)
}else{if(typeof(e[i])=="string"){eval(e[i])
}}}}};
this._updateIcon=function(){var iconElm=document.getElementById(this._tagId+"icon");
if(iconElm!=null){var img="";
img+=(this.disabled)?"disabled":"enabled";
img+="_"+this.value;
iconElm.src=this.imgDir+img+".gif"
}};
this._updateHiddenField=function(){var elm=document.getElementById(this.checkboxName);
if(elm!=null){elm.value=this.value;
elm.checked=(this.value)
}};
this._constructor()
}var ie=document.all!=null;
var moz=!ie&&document.getElementById!=null&&document.layers==null;
function Bs_Tree(){this._id;
this._objectId;
this.autoCollapse=false;
this.lookAhead=2;
this.loadAhead=2;
this.initAhead=2;
this.renderAhead=2;
this._workStack=new Array();
this.rememberState=false;
this.captionBgColor="yellow";
this.linkStyle;
this.divStyle="font-family: Arial, Helvetica, sans-serif; font-size: 11px;";
this.showPseudoElement=false;
this.useCheckboxSystem=false;
this.checkboxSystemWalkTree=3;
this.checkboxSystemIfPartlyThenFull=true;
this.checkboxSystemImgDir;
this.checkboxSystemGuiNochange;
this.imageDir="/js/geoportal/blueshoes-4.6/javascript/components/tree/img/bobby/blue/";
this.imageHeight=16;
this.useFolderIcon=true;
this.useLeaf=true;
this.walkTree=true;
this.useAutoSequence=true;
this.draggable=false;
this._clearingHouse=new Array;
this._pseudoElement;
this._currentActiveElement;
this._elementSequence=0;
this._errorArray;
this.stopWatch;
this.simple=false;
this._constructor=function(){this._id=Bs_Objects.length;
Bs_Objects[this._id]=this;
this._objectId="Bs_Tree_"+this._id;
var a=[];
a["id"]="pseudoElement001";
a["caption"]="root";
a["url"]="";
a["target"]="";
a["isOpen"]=true;
this._pseudoElement=this._createTreeElement(a,0)
};
this.setDisabled=function(b){if(typeof(b)=="undefined"){b=!this._disabled
}this._disabled=b;
for(var elementId in this._clearingHouse){if(this.useRadioButton){var radioId=this.getRadioButtonName()+"_"+elementId;
var radioElm=document.getElementById(radioId);
if(radioElm){radioElm.readonly=this._disabled;
radioElm.disabled=this._disabled
}}else{if(typeof(this._clearingHouse[elementId]._checkboxObject)!="undefined"){this._clearingHouse[elementId]._checkboxObject.setDisabled(this._disabled)
}}}};
this.initByArray=function(arr){this._pseudoElement._unloadedChildren=false;
this._pseudoElement._checkedForChildren=true;
if(arr.length>0){for(var i=0;
i<arr.length;
i++){var e=this._createTreeElement(arr[i],1);
if(e==false){return false
}this._pseudoElement.addChild(e)
}}else{for(var key in arr){if(typeof(arr[key])=="object"){var e=this._createTreeElement(arr[key],1);
if(e==false){return false
}this._pseudoElement.addChild(e)
}}}return true
};
this.getActiveElement=function(){if(typeof(this._currentActiveElement)!="undefined"){return this._currentActiveElement
}return false
};
this.setActiveElement=function(treeElement){this._currentActiveElement=treeElement
};
this.hasNodeLoader=function(){return(typeof(this._nodeLoaderType)!="undefined")
};
this.setNodeLoader=function(type,url){this._nodeLoaderType=type;
this._nodeLoaderUrl=url;
if(!this._pseudoElement.hasChildren()){this._pseudoElement._unloadedChildren=true
}};
this.loadNodeChildrenFromServer=function(nodeID){if(typeof(Bs_XmlRequestQueue[this._id])=="undefined"){Bs_XmlRequestQueue[this._id]=new Array()
}else{if(typeof(Bs_XmlRequestQueue[this._id][nodeID])!="undefined"){return
}}if(window.ActiveXObject){Bs_XmlRequestQueue[this._id][nodeID]=new ActiveXObject("Microsoft.XMLHTTP")
}else{if(window.XMLHttpRequest){Bs_XmlRequestQueue[this._id][nodeID]=new XMLHttpRequest()
}else{return false
}}var url=this._nodeLoaderUrl+"?bsObjectID="+this._id+"&nodeID="+nodeID;
Bs_XmlRequestQueue[this._id][nodeID].onreadystatechange=bsTree_loadNodeChildrenFromServer_callback;
Bs_XmlRequestQueue[this._id][nodeID].open("GET",url,true);
Bs_XmlRequestQueue[this._id][nodeID].send()
};
this._createTreeElement=function(arr,level){if(typeof(level)=="undefined"){level=1
}var e=new Bs_TreeElement();
var status=e.initByArray(arr,this,level);
if(!status){this._addError(e.getLastError());
return false
}this._clearingHouse[e.id]=e;
if(typeof(arr["children"])=="object"){e._unloadedChildren=false;
e._checkedForChildren=true;
if((this.useCheckboxSystem&&(this.checkboxSystemWalkTree>=2))||e.isOpen||((this.lookAhead+2)>level)||(this.lookAhead==-1)||((typeof(e.parent)=="object")&&(e.parent.isOpen))){if(arr["children"].length>0){for(var i=0,n=arr["children"].length;
i<n;
i++){var newE=this._createTreeElement(arr["children"][i],level+1);
if(!newE){return false
}e.addChild(newE)
}}else{for(key in arr["children"]){var newE=this._createTreeElement(arr["children"][key],level+1);
if(!newE){return false
}e.addChild(newE)
}}}else{e._undoneChildren=arr["children"]
}}return e
};
this.getElement=function(elementId){if(elementId==0){return this._pseudoElement
}if(typeof(this._clearingHouse[elementId])=="object"){return this._clearingHouse[elementId]
}else{return false
}};
this.getElementByCaptionPath=function(data){var elm=this._pseudoElement;
for(var i=0,n=data.length;
i<n;
i++){var newElm=null;
for(var j=0,jn=elm._children.length;
j<jn;
j++){if(elm._children[j].caption==data[i]){newElm=elm._children[j];
elm=newElm;
if(typeof(elm._undoneChildren)=="object"){for(var k=0,kn=elm._undoneChildren.length;
k<kn;
k++){var newE=this._createTreeElement(elm._undoneChildren[k],elm._level+1);
elm.addChild(newE)
}elm._undoneChildren=false
}break
}}if(newElm==null){return false
}}return newElm
};
this.removeElement=function(elementId){if(typeof(this._clearingHouse[elementId])=="undefined"){return false
}var elm=this._clearingHouse[elementId];
if((typeof(elm.parent)=="object")&&(typeof(elm.parent._children)=="object")){for(var i=0,n=elm.parent._children.length;
i<n;
i++){if(elm.parent._children[i].id==elementId){elm.parent._children.deleteItem(i);
break
}}}this._clearingHouse.deleteItemHash(elementId);
for(var i=0,n=elm._children.length;
i<n;
i++){this._clearingHouse.deleteItemHash(elm._children[i].id)
}if((typeof(elm.parent)=="object")&&(elm.parent._isOutrendered)){elm.parent.render(true,true)
}return true
};
this.expandAll=function(){this._pseudoElement.expandAll()
};
this.collapseAll=function(){this._pseudoElement.collapseAll(false)
};
this.draw=function(){if(this.simple){var content=this._pseudoElement.renderSimple()
}else{var content=this._pseudoElement.render()
}document.writeln(content[0]);
eval(content[1])
};
this.toHtml=function(){if(this.hasNodeLoader()){alert("Webmaster: Sorry, the toHtml() method cannot be used together with a node loader. Use drawInto() or draw().");
return
}if(this.simple){return this._pseudoElement.renderSimple()
}else{return this._pseudoElement.render()
}};
this.executeOnElement=function(id,func,params){if(this._clearingHouse[id]){if(this._clearingHouse[id][func]){if(params){switch(params.length){case 1:return this._clearingHouse[id][func](params[0]);
break;
case 2:return this._clearingHouse[id][func](params[0],params[1]);
break;
case 3:return this._clearingHouse[id][func](params[0],params[1],params[2]);
break;
case 4:return this._clearingHouse[id][func](params[0],params[1],params[2],params[3]);
break
}}else{return this._clearingHouse[id][func]()
}}}return
};
this.getJavascriptCode=function(){return this._pseudoElement.getJavascriptCode("a",true)
};
this.elementToggleOpenClose=function(id){this._clearingHouse[id].toggleOpenClose()
};
this.elementOpenWalkUp=function(id){if(typeof(this._clearingHouse[id])!="undefined"){var elm=this._clearingHouse[id];
elm.open(true);
if(typeof(elm.parent)!="undefined"){this.elementOpenWalkUp(elm.parent.id)
}}else{return false
}return true
};
this.elementCloseWalkUp=function(id){if(typeof(this._clearingHouse[id])!="undefined"){var elm=this._clearingHouse[id];
elm.close(true);
if(typeof(elm.parent)!="undefined"){this.elementCloseWalkUp(elm.parent.id)
}}else{return false
}return true
};
this.elementCloseWalkDown=function(id){if(typeof(id)=="undefined"){var elm=this._pseudoElement
}else{if(typeof(this._clearingHouse[id])!="undefined"){var elm=this._clearingHouse[id];
elm.close(true)
}else{return false
}}if(typeof(elm._children)!="undefined"){for(var i=0;
i<elm._children.length;
i++){this.elementCloseWalkDown(elm._children[i].id)
}}return true
};
this.elementOpen=function(id){if(typeof(this._clearingHouse[id])!="undefined"){this._clearingHouse[id].open()
}};
this.elementClose=function(id){this._clearingHouse[id].close()
};
this.openPath=function(data,valueType){var elm=this.getElementByCaptionPath(data);
if(elm==false){return false
}this.elementOpenWalkUp(elm.id);
return true
};
this.elementCheckboxEvent=function(id,value){this._clearingHouse[id].checkboxEvent(value)
};
this.applyState=function(){if(typeof(getCookie)=="undefined"){alert("Webmaster: please make sure core/lang/Bs_Cookie.lib.js is included for the rememberState/applyState feature.");
return false
}var name=this._objectId;
var data=getCookie(name);
for(treeElementId in data){var treeElm=this.getElement(treeElementId);
for(action in data[treeElementId]){if(data[treeElementId][action]){treeElm.open()
}else{treeElm.close()
}}}return true
};
this._updateStateCookie=function(treeElementId,action,value){if(typeof(setCookie)=="undefined"){alert("Webmaster: please make sure core/lang/Bs_Cookie.lib.js is included for the rememberState/applyState feature.");
return false
}var name=this._objectId;
var data=getCookie(name);
if((typeof(data)!="object")||(data==null)){data=new Object()
}if((typeof(data[treeElementId])!="object")||(typeof(data[treeElementId])==null)){data[treeElementId]=new Object()
}if(typeof(data[treeElementId][action])=="undefined"){data[treeElementId][action]=value
}else{if(data[treeElementId][action]!=value){delete data[treeElementId][action];
delete data[treeElementId]
}}setCookie(name,data);
return true
};
this.debugDumpTree=function(elm,indent){if(typeof(elm)=="undefined"){elm=this._pseudoElement;
indent="";
var firstCall=true
}var ret="";
if(typeof(elm._children)=="object"){for(var i=0;
i<elm._children.length;
i++){ret+=indent+i+": "+elm._children[i].id+": "+elm._children[i].caption+"\n";
ret+=this.debugDumpTree(elm._children[i],indent+"  ")
}}if(firstCall){alert(ret)
}else{return ret
}};
this._addError=function(str){if(typeof(this._errorArray)=="undefined"){this._errorArray=new Array(str)
}else{this._errorArray[this._errorArray.length]=str
}};
this.getLastError=function(){if(typeof(this._errorArray)!="undefined"){if(this._errorArray.length>0){return this._errorArray[this._errorArray.length-1]
}}return false
};
this.old_drawInto=function(id){if(this.simple){var content=this._pseudoElement.renderSimple()
}else{var content=this._pseudoElement.render()
}var e=document.getElementById(id);
if(e){e.innerHTML=content[0];
if(""!=content[1]){eval(content[1])
}}};
this._imgPreload=function(){var id=this.globalId
};
this._afterImgPreload=function(){var id=this.globalId;
if(this.hasNodeLoader()&&!this._pseudoElement._checkedForChildren&&!this.showPseudoElement){this.loadNodeChildrenFromServer(this._pseudoElement.id);
return
}if(this.simple){var content=this._pseudoElement.renderSimple()
}else{var content=this._pseudoElement.render()
}var e=document.getElementById(id);
if(e){e.innerHTML=content[0];
if(""!=content[1]){eval(content[1])
}this._afterRender()
}};
this._afterRender=function(){if(typeof(this._workStack)=="object"){for(var i=0;
i<this._workStack.length;
i++){eval(this._workStack[i]);
delete this._workStack[i]
}}};
this.drawInto=function(id){this.globalId=id;
setTimeout("Bs_Objects["+this._id+"]._imgPreload()",0);
setTimeout("Bs_Objects["+this._id+"]._afterImgPreload()",5)
};
this._constructor()
}function Bs_TreeElement(){this.id;
this.parent;
this._tree;
this.caption;
this.url;
this.target;
this.tooltip;
this.linkStyle;
this.linkTitle;
this.linkStatus;
this.divStyle;
this.onClick;
this.isOpen=false;
this.visible=true;
this.isChecked=0;
this.checkboxName;
this.useRadioButton=true;
this.radioButtonSelected;
this._checkboxObject;
this._level=0;
this._children=new Array;
this._undoneChildren;
this._unloadedChildren;
this._checkedForChildren=false;
this.hasUnloadedChildren=function(){if(!this._tree.hasNodeLoader()){return 0
}if(typeof(this._unloadedChildren)=="boolean"){return(this._unloadedChildren)?2:0
}return 1
};
this.hasUninitializedChildren=function(){if(typeof(this._undoneChildren)=="undefined"){return false
}return(this._undoneChildren.length>0)
};
this.imageDir;
this.imageHeight;
this.icon;
this.beforeIconSpan;
this.beforeCaptionSpan;
this.afterCaptionSpan;
this.dataContainer;
this._attachedEvents;
this._isOutrendered=false;
this._isLoaded=true;
this._errorArray;
this.getThis=function(){return this
};
this.getDhtmlCompatibleId=function(){return this.id;
if(typeof(this._id_md5)!="undefined"){return this._id_md5
}this._id_md5=MD5(this.id);
return this._id_md5
};
this.addChild=function(treeElement,renderChild){if(typeof(renderChild)=="undefined"){renderChild=true
}treeElement.parent=this;
if(typeof(this._children)!="object"){this._children=new Array
}if(this._children.push){this._children.push(treeElement)
}else{this._children[this._children.length]=treeElement
}treeElement._level=this._level+1;
this._updateLevelAndParent(treeElement);
this._tree._clearingHouse[treeElement.id]=treeElement;
if(this._isOutrendered&&renderChild){this.render(false,true)
}};
this.addChildByArray=function(elementData,renderChild){var treeElement=this._tree._createTreeElement(elementData,this._level+1);
this.addChild(treeElement,renderChild);
return treeElement
};
this.addChildrenByArray=function(childrenArray,renderChildren){for(var i=0;
i<childrenArray.length;
i++){var e=this._tree._createTreeElement(childrenArray[i],this._level+1);
if(e==false){return false
}this.addChild(e,renderChildren)
}return true
};
this.isChild=function(elementId,bubble){for(var i=0,n=this._children.length;
i<n;
i++){if(this._children[i].id==elementId){return true
}if(bubble){if(this._children[i].isChild(elementId,true)){return true
}}}return false
};
this.setCaption=function(caption){this.caption=caption;
if(this._isOutrendered){var span=document.getElementById(this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+"_caption2");
if(span){span.innerHTML=caption
}}};
this.render=function(omitDivTags,putIntoPage,lookAhead){if(typeof(this._tree.stopWatch)=="object"){this._tree.stopWatch.takeTime("Bs_TreeElement.render() for id: "+this.id+" in level: "+this._level)
}if(((this._level)==0)&&(!this._tree.showPseudoElement)&&this._tree.hasNodeLoader()&&!this._checkedForChildren){this._tree.loadNodeChildrenFromServer(this.id);
return false
}if(typeof(lookAhead)=="undefined"){lookAhead=this._tree.lookAhead
}if((this._tree._pseudoElement==this)&&!this._tree.showPseudoElement&&(lookAhead!=-1)){lookAhead++
}var imageDir=this._getVar("imageDir");
var imageHeight=this._getVar("imageHeight");
var out=new Array();
var outI=0;
var evalStr="";
var divTagStart='<span id="'+this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+'"';
divTagStart+=' style="';
if(!this.visible){divTagStart+="display:none;"
}divTagStart+='">';
if((this._level)>0||(this._tree.showPseudoElement)){out[outI++]="<nobr>";
out[outI++]='<div style="float:none;"';
out[outI++]=' id="'+this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+'_drag"';
if(this._tree.draggable){out[outI++]=' onDragStart="Bs_Objects['+this._tree._id+"].executeOnElement('"+this.id+"', 'fireEvent', Array('onDragStart'));\"";
out[outI++]=' onDragEnter="Bs_Objects['+this._tree._id+"].executeOnElement('"+this.id+"', 'fireEvent', Array('onDragEnter'));\"";
out[outI++]=' onDragOver="Bs_Objects['+this._tree._id+"].executeOnElement('"+this.id+"', 'fireEvent', Array('onDragOver'));\"";
out[outI++]=' onDrop="Bs_Objects['+this._tree._id+"].executeOnElement('"+this.id+"', 'fireEvent', Array('onDrop'));\""
}out[outI++]=">";
out[outI++]='<div style="overflow:visible; height:'+imageHeight+"; "+this._getVar("divStyle")+'">';
var level=this._level;
if(!this._tree.showPseudoElement){--level
}var obj=this;
var outTemp="";
for(var i=0;
i<level;
i++){obj=obj.parent;
if(obj.hasSiblingsDown(true)){var img="line1"
}else{var img="empty"
}outTemp='<img src="'+imageDir+img+'.gif" height="'+imageHeight+'" border="0" align="top">'+outTemp
}out[outI++]=outTemp;
if(this.hasSiblingsDown()){var imgNumber=3
}else{var imgNumber=2
}if(this.hasVisibleChildren()){if((this._level==0)||(!this._tree.showPseudoElement&&(this._level==1)&&((this._tree.useAutoSequence&&(this.id==1))||(!this._tree.useAutoSequence&&true)))){if(this.hasSiblingsDown()){imgNumber++
}else{imgNumber--
}}if(this.isOpen){var plusImg="minus"+imgNumber;
var onClick="Close"
}else{var plusImg="plus"+imgNumber;
var onClick="Open"
}}else{var plusImg="line"+imgNumber;
var onClick=false
}if(onClick){var onClickStr='onClick="Bs_Objects['+this._tree._id+"].elementToggleOpenClose('"+this.id+"');\""
}else{var onClickStr=""
}var useClickSpan=false;
var clickSpanTags="";
if(this.onClick){useClickSpan=true;
var onClick=this.onClick;
onClick=onClick.replace(/__this\.id__/g,this.id);
clickSpanTags+=' style="cursor:pointer; cursor:hand;" onClick="'+onClick+'" '
}if(this.hasEventAttached("onContextMenu")){useClickSpan=true;
clickSpanTags+=' onContextMenu="return Bs_Objects['+this._tree._id+"].executeOnElement('"+this.id+"', 'fireEvent', Array('onContextMenu'));\" "
}if(useClickSpan){out[outI++]="<span "+clickSpanTags+">"
}out[outI++]='<img id="'+this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+'_openClose" src="'+imageDir+plusImg+'.gif" height="'+imageHeight+'" border="0" '+onClickStr+' align="middle"';
out[outI++]=' style="vertical-align:'+((imageHeight>16)?"middle":"top")+'">';
if(this.beforeIconSpan){out[outI++]="<span>"+this.beforeIconSpan+"</span>"
}if(this.url){var hRef='<a href="'+this.url+'"';
hRef+=' name="'+this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+'_href"';
hRef+=' onkeydown="return Bs_Objects['+this._tree._id+"].executeOnElement('"+this.id+"', 'onKeyDown', Array(event));\"";
if(this.target){hRef+=' target="'+this.target+'"'
}if(this.tooltip){hRef+=' alt="'+this.tooltip+'"';
hRef+=' title="'+this.tooltip+'"'
}hRef+=' style="'+this._getVar("linkStyle")+'"';
if(typeof(this.linkTitle)!=="undefined"){hRef+=' title="'+this.linkTitle+'"'
}if(typeof(this.linkStatus)!=="undefined"){hRef+=" onmouseover=\"window.status='"+this.linkStatus+"'; return true;\"";
hRef+=" onmouseout=\"window.status='';\""
}hRef+=">"
}else{}var folderIconId=this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+"_folder";
if(this._getVar("useFolderIcon")){if(hRef){out[outI++]=hRef
}switch(typeof(this.icon)){case"undefined":if(this._tree.useLeaf&&!this.hasChildren()){var folderImg="leaf"
}else{var folderImg="folder";
folderImg+=(this.isOpen)?"Open":"Closed"
}out[outI++]='<img id="'+folderIconId+'" src="'+imageDir+folderImg+'.gif" height="'+imageHeight+'" border="0" align="top">';
break;
case"bool":case"boolean":break;
case"string":if(this.icon!="false"){out[outI++]='<img id="'+folderIconId+'" src="';
if(!this._iconHasPath(this.icon)){out[outI++]=imageDir
}out[outI++]=this.icon;
if(!this._iconHasExtension(this.icon)){out[outI++]=".gif"
}out[outI++]='" height="'+imageHeight+'" border="0" align="top">'
}}if(hRef){out[outI++]="</a>"
}}if(this.beforeCaptionSpan){out[outI++]="<span>"+this.beforeCaptionSpan+"</span>"
}if(this._tree.useRadioButton&&this.useRadioButton){out[outI++]='<input type="radio"';
out[outI++]=' name="'+this._tree.getRadioButtonName()+'"';
out[outI++]=' id="'+this._tree.getRadioButtonName()+"_"+this.getDhtmlCompatibleId()+'"';
out[outI++]=' value="'+this.id+'"';
if(ie&&!moz){out[outI++]=' style="height:16px;"'
}if(this.radioButtonSelected){out[outI++]=" checked"
}if(this._tree._disabled){out[outI++]=" readonly disabled"
}out[outI++]=">"
}if(this._tree.useCheckboxSystem){var cleanedCheckboxName=this._cleanCheckboxName(this.checkboxName);
var checkboxSpan=cleanedCheckboxName+"Span";
var checkboxObj=cleanedCheckboxName+"Obj";
out[outI++]='&nbsp;<span id="'+checkboxSpan+'">';
var t=new Bs_Checkbox();
t.objectName=checkboxObj;
t.checkboxName=this.checkboxName;
t.value=this.isChecked;
if(this._tree._disabled){t.disabled=true
}if(this._getVar("checkboxSystemGuiNochange")){t.guiNochange=true
}var chkImagDir=this._getVar("checkboxSystemImgDir");
if(chkImagDir){t.imgDir=chkImagDir
}else{t.imgDir="/js/geoportal/blueshoes-4.6/javascript/components/checkbox/img/bobby/"
}t.imgWidth="13";
t.imgHeight="13";
if(this._tree.checkboxSystemWalkTree){t.attachOnClick("Bs_Objects["+this._tree._id+"].elementCheckboxEvent('"+this.id+"', "+checkboxObj+".value);")
}eval(checkboxObj+" = t;");
this._checkboxObject=t;
evalStr+=checkboxObj+".draw('"+checkboxSpan+"');";
out[outI++]="</span>"
}out[outI++]="&nbsp;";
out[outI++]='<span id="'+this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+'_caption"';
if(this.onClick||this.hasEventAttached("onClickCaption")){out[outI++]=' style="cursor:pointer; cursor:hand;"'
}else{out[outI++]=' style="cursor:default;"'
}out[outI++]=' onclick="Bs_Objects['+this._tree._id+"].executeOnElement('"+this.id+"', 'fireEvent', Array('onClickCaption'));\"";
out[outI++]=">";
if(hRef){out[outI++]=hRef
}out[outI++]="<span";
if(!this.url){out[outI++]=' tabindex="0"';
out[outI++]=' onkeydown="return Bs_Objects['+this._tree._id+"].executeOnElement('"+this.id+"', 'onKeyDown', Array(event));\""
}out[outI++]=' id="'+this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+'_caption2">';
out[outI++]=this.caption;
out[outI++]="</span>";
if(hRef){out[outI++]="</a>"
}out[outI++]="</span>";
if(useClickSpan){out[outI++]="</span>"
}out[outI++]="</div>";
if(this.afterCaptionSpan){out[outI++]='<div style="overflow:visible;">'+this.afterCaptionSpan+"</div>"
}else{}out[outI++]="</div>";
out[outI++]="</nobr>"
}out[outI++]='<span id="'+this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+'_children"';
if(!this.isOpen){out[outI++]=' style="display:none;"'
}out[outI++]=">";
if(this.isOpen||(lookAhead>0)||(lookAhead==-1)){if(this.hasUnloadedChildren()){this._tree.loadNodeChildrenFromServer(this.id)
}else{for(var i=0,n=this._children.length;
i<n;
i++){if(lookAhead==-1){var newLookAhead=-1
}else{if(this.isOpen){var newLookAhead=lookAhead
}else{var newLookAhead=lookAhead-1
}}if(false){this._tree._workStack[this._tree._workStack.length]="Bs_Objects["+this._tree._id+"].executeOnElement('"+this._children[i].id+"', 'render', Array(false,true,"+newLookAhead+"));"
}else{var t=this._children[i].render(false,false,newLookAhead);
out[outI++]=t[0];
evalStr+=t[1]
}}}}out[outI++]="</span>";
divTagEnd="</span>";
this._isOutrendered=true;
var content=new Array(out.join(""),evalStr);
if(putIntoPage){var addNotReplace=false;
var doc=document.getElementById(this._tree._objectId+"_e_"+this.getDhtmlCompatibleId());
if((doc==null)&&(typeof(this.parent)!="undefined")){addNotReplace=true;
content[0]=divTagStart+content[0]+divTagEnd;
var doc=document.getElementById(this._tree._objectId+"_e_"+this.parent.getDhtmlCompatibleId()+"_children")
}if(doc!=null){if(addNotReplace){doc.innerHTML+=content[0]
}else{doc.innerHTML=content[0]
}if(content[1]!=""){eval(content[1])
}return true
}else{return false
}}else{if(!omitDivTags){content[0]=divTagStart+content[0]+divTagEnd
}return content
}};
this.renderSimple=function(omitDivTags,putIntoPage,lookAhead){if(typeof(this._tree.stopWatch)=="object"){this._tree.stopWatch.takeTime("Bs_TreeElement.renderSimple() for id: "+this.id+" in level: "+this._level)
}if(typeof(lookAhead)=="undefined"){lookAhead=this._tree.lookAhead
}if((this._tree._pseudoElement==this)&&!this._tree.showPseudoElement&&(lookAhead!=-1)){lookAhead++
}var imageDir=this._getVar("imageDir");
var imageHeight=this._getVar("imageHeight");
var out=new Array;
var outI=0;
var evalStr=new Array;
if(!omitDivTags){out[outI++]='<span id="'+this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+'"';
out[outI++]=' style="';
if(!this.visible){out[outI++]="display:none;"
}out[outI++]='">'
}if((this._level)>0||(this._tree.showPseudoElement)){out[outI++]="<nobr>";
out[outI++]='<div style="float:none;"';
out[outI++]=' id="'+this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+'_drag"';
out[outI++]=">";
out[outI++]='<div style="overflow:visible; height:'+imageHeight+"; "+this._getVar("divStyle")+'">';
var level=this._level;
if(!this._tree.showPseudoElement){--level
}var obj=this;
var outTemp="";
for(var i=0;
i<level;
i++){obj=obj.parent;
if(obj.hasSiblingsDown(true)){var img="line1"
}else{var img="empty"
}outTemp='<img src="'+imageDir+img+'.gif" height="'+imageHeight+'" border="0" align="top">'+outTemp
}out[outI++]=outTemp;
if(this.hasSiblingsDown()){var imgNumber=3
}else{var imgNumber=2
}if(this.hasVisibleChildren()){if((this._level==0)||(!this._tree.showPseudoElement&&(this._level==1)&&((this._tree.useAutoSequence&&(this.id==1))||(!this._tree.useAutoSequence&&true)))){if(this.hasSiblingsDown()){imgNumber++
}else{imgNumber--
}}if(this.isOpen){var plusImg="minus"+imgNumber;
var onClick="Close"
}else{var plusImg="plus"+imgNumber;
var onClick="Open"
}}else{var plusImg="line"+imgNumber;
var onClick=false
}if(onClick){var onClickStr='onClick="Bs_Objects['+this._tree._id+"].elementToggleOpenClose('"+this.id+"');\""
}else{var onClickStr=""
}out[outI++]='<img id="'+this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+'_openClose" src="'+imageDir+plusImg+'.gif" height="'+imageHeight+'" border="0" '+onClickStr+' align="middle"';
out[outI++]=' style="vertical-align:'+((imageHeight>16)?"middle":"top")+'">';
if(this.url){var hRef='<a href="'+this.url+'"';
hRef+=' name="'+this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+'_href"';
hRef+=' onkeydown="return Bs_Objects['+this._tree._id+"].executeOnElement('"+this.id+"', 'onKeyDown', Array(event));\"";
if(this.target){hRef+=' target="'+this.target+'"'
}hRef+=' style="'+this._getVar("linkStyle")+'"';
hRef+=">"
}var folderIconId=this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+"_folder";
if(this._getVar("useFolderIcon")){if(hRef){out[outI++]=hRef
}switch(typeof(this.icon)){case"undefined":if(this._tree.useLeaf&&!this.hasChildren()){var folderImg="leaf"
}else{var folderImg="folder";
folderImg+=(this.isOpen)?"Open":"Closed"
}out[outI++]='<img id="'+folderIconId+'" src="'+imageDir+folderImg+'.gif" height="'+imageHeight+'" border="0" align="top">';
break;
case"bool":case"boolean":break;
case"string":if(this.icon!="false"){out[outI++]='<img id="'+folderIconId+'" src="';
if(!this._iconHasPath(this.icon)){out[outI++]=imageDir
}out[outI++]=this.icon;
if(!this._iconHasExtension(this.icon)){out[outI++]=".gif"
}out[outI++]='" height="'+imageHeight+'" border="0" align="top">'
}}if(hRef){out[outI++]="</a>"
}}out[outI++]="&nbsp;";
out[outI++]='<span id="'+this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+'_caption"';
if(this.onClick){out[outI++]=' style="cursor:pointer; cursor:hand;"'
}else{out[outI++]=' style="cursor:default;"'
}out[outI++]=' onClick="Bs_Objects['+this._tree._id+"].executeOnElement('"+this.id+"', 'fireEvent', Array('onClickCaption'));\">";
if(hRef){out[outI++]=hRef
}out[outI++]='<span id="'+this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+'_caption2">'+this.caption+"</span>";
if(hRef){out[outI++]="</a>"
}out[outI++]="</span>";
out[outI++]="</div>";
out[outI++]="</div>";
out[outI++]="</nobr>"
}if(typeof(this._tree.stopWatch)=="object"){this._tree.stopWatch.takeTime("Bs_TreeElement.renderSimple() 3")
}out[outI++]='<span id="'+this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+'_children"';
if(!this.isOpen){out[outI++]=' style="display:none;"'
}out[outI++]=">";
if(this.isOpen||(lookAhead>0)||(lookAhead==-1)){for(var i=0,n=this._children.length;
i<n;
i++){if(lookAhead==-1){var newLookAhead=-1
}else{if(this.isOpen){var newLookAhead=lookAhead
}else{var newLookAhead=lookAhead-1
}}var t=this._children[i].renderSimple(false,false,newLookAhead);
out[outI++]=t[0];
evalStr[evalStr.length]=t[1]
}}out[outI++]="</span>";
if(!omitDivTags){out[outI++]="</span>"
}out[outI++]="\n";
this._isOutrendered=true;
var content=new Array(out.join(""),evalStr.join(""));
if(putIntoPage){var doc=document.getElementById(this._tree._objectId+"_e_"+this.getDhtmlCompatibleId());
if(doc!=null){doc.innerHTML=content[0];
if(content[1]!=""){eval(content[1])
}return true
}else{return false
}}else{return content
}};
this.reset=function(){this.caption=null;
this.url=null;
this.target=null;
this.tooltip=null;
this.onClick=null;
this.isOpen=false;
this.isChecked=0;
this.checkboxName=null;
this.beforeIconSpan=null;
this.beforeCaptionSpan=null;
this.afterCaptionSpan=null;
this.linkStyle=null;
this.linkTitle=null;
this.linkStatus=null;
this.divStyle=null
};
this.initByArray=function(a,tree,level){this._tree=tree;
this._level=level;
if(typeof(this._tree.stopWatch)=="object"){this._tree.stopWatch.takeTime("Bs_TreeElement.initByArray()")
}if(this._tree.useAutoSequence&&(level>0)){this.id=++this._tree._elementSequence
}else{if(typeof(a["id"])=="undefined"){var err="tree error: useAutoSequence is set to false, but for an array element there is no id defined.";
if(typeof(a["caption"])!="undefined"){err+=" ("+a["caption"]+")"
}alert(err);
this._addError(err);
return false
}this.id=a["id"]
}if(typeof(a["caption"])!="undefined"){this.caption=a["caption"]
}if(typeof(a["url"])!="undefined"){this.url=a["url"]
}if(typeof(a["target"])!="undefined"){this.target=a["target"]
}if(typeof(a["tooltip"])!="undefined"){this.tooltip=a["tooltip"]
}if(typeof(a["isOpen"])!="undefined"){this.isOpen=a["isOpen"]
}if(!this._tree.simple){if(typeof(a["linkStyle"])!="undefined"){this.linkStyle=a["linkStyle"]
}if(typeof(a["linkTitle"])!="undefined"){this.linkTitle=a["linkTitle"]
}if(typeof(a["linkStatus"])!="undefined"){this.linkStatus=a["linkStatus"]
}if(typeof(a["divStyle"])!="undefined"){this.divStyle=a["divStyle"]
}if(typeof(a["onClick"])!="undefined"){this.onClick=a["onClick"]
}if(typeof(a["isChecked"])!="undefined"){this.isChecked=parseInt(a["isChecked"])
}if(typeof(a["visible"])!="undefined"){this.visible=a["visible"]
}if(typeof(a["icon"])!="undefined"){this.icon=a["icon"]
}if(typeof(a["imageDir"])!="undefined"){this.imageDir=a["imageDir"]
}if(typeof(a["beforeIconSpan"])!="undefined"){this.beforeIconSpan=a["beforeIconSpan"]
}if(typeof(a["beforeCaptionSpan"])!="undefined"){this.beforeCaptionSpan=a["beforeCaptionSpan"]
}if(typeof(a["afterCaptionSpan"])!="undefined"){this.afterCaptionSpan=a["afterCaptionSpan"]
}if(typeof(a["useRadioButton"])!="undefined"){this.useRadioButton=a["useRadioButton"]
}if(typeof(a["radioButtonSelected"])!="undefined"){this.radioButtonSelected=a["radioButtonSelected"]
}if(typeof(a["dataContainer"])!="undefined"){this.dataContainer=a["dataContainer"]
}if(typeof(a["checkboxName"])!="undefined"){this.checkboxName=a["checkboxName"]
}else{if(this._tree.useCheckboxSystem){this.checkboxName="bsTreeChk_"+this._tree._objectId+"_"+this.id
}}if(typeof(a["onClickCaption"])!="undefined"){this.attachEvent("onClickCaption",a["onClickCaption"])
}if(typeof(a["onChangeCheckbox"])!="undefined"){this.attachEvent("onChangeCheckbox",a["onChangeCheckbox"])
}if(typeof(a["onContextMenu"])!="undefined"){this.attachEvent("onContextMenu",a["onContextMenu"])
}if(typeof(a["events"])!="undefined"){for(ev in a["events"]){this.attachEvent(ev,a["events"][ev])
}}}return true
};
this.exportAsArray=function(withChildren){var ret=new Array();
if(typeof(this.id)!="undefined"){ret["id"]=this.id
}if(typeof(this.caption)!="undefined"){ret["caption"]=this.caption
}if(typeof(this.url)!="undefined"){ret["url"]=this.url
}if(typeof(this.target)!="undefined"){ret["target"]=this.target
}if(typeof(this.tooltip)!="undefined"){ret["tooltip"]=this.tooltip
}if(typeof(this.onClick)!="undefined"){ret["onClick"]=this.onClick
}if(typeof(this.isOpen)!="undefined"){ret["isOpen"]=this.isOpen
}if(typeof(this.isChecked)!="undefined"){ret["isChecked"]=this.isChecked
}if(typeof(this.visible)!="undefined"){ret["visible"]=this.visible
}if(typeof(this.icon)!="undefined"){ret["icon"]=this.icon
}if(typeof(this.imageDir)!="undefined"){ret["imageDir"]=this.imageDir
}if(typeof(this.beforeIconSpan)!="undefined"){ret["beforeIconSpan"]=this.beforeIconSpan
}if(typeof(this.afterCaptionSpan)!="undefined"){ret["afterCaptionSpan"]=this.afterCaptionSpan
}if(typeof(this.useRadioButton)!="undefined"){ret["useRadioButton"]=this.useRadioButton
}if(typeof(this.radioButtonSelected)!="undefined"){ret["radioButtonSelected"]=this.radioButtonSelected
}if(typeof(this.dataContainer)!="undefined"){ret["dataContainer"]=this.dataContainer
}if(typeof(this.checkboxName)!="undefined"){ret["checkboxName"]=this.checkboxName
}if(typeof(this.beforeCaptionSpan)!="undefined"){ret["beforeCaptionSpan"]=this.beforeCaptionSpan
}if(typeof(this.linkStyle)!="undefined"){ret["linkStyle"]=this.linkStyle
}if(typeof(this.linkTitle)!="undefined"){ret["linkTitle"]=this.linkTitle
}if(typeof(this.linkStatus)!="undefined"){ret["linkStatus"]=this.linkStatus
}if(typeof(this.divStyle)!="undefined"){ret["divStyle"]=this.divStyle
}if(withChildren){ret["children"]=new Array();
for(var i=0;
i<this._children.length;
i++){ret["children"][ret["children"].length]=this._children[i].exportAsArray(true)
}}return ret
};
this.updateObjectByArray=function(a){this.reset();
this._isLoaded=true;
if(a["caption"]){this.caption=a["caption"]
}if(a["url"]){this.url=a["url"]
}if(a["target"]){this.target=a["target"]
}if(a["tooltip"]){this.tooltip=a["tooltip"]
}if(a["onClick"]){this.onClick=a["onClick"]
}if(a["isOpen"]){this.isOpen=a["isOpen"]
}if(a["isChecked"]){this.isChecked=a["isChecked"]
}if(a["imageDir"]){this.imageDir=a["imageDir"]
}if(a["checkboxName"]){this.checkboxName=a["checkboxName"]
}else{if(this._tree.useCheckboxSystem){this.checkboxName="bsTreeCheckbox"+this.id
}}if(a["beforeIconSpan"]){this.beforeIconSpan=a["beforeIconSpan"]
}if(a["beforeCaptionSpan"]){this.beforeCaptionSpan=a["beforeCaptionSpan"]
}if(a["afterCaptionSpan"]){this.afterCaptionSpan=a["afterCaptionSpan"]
}};
this.getJavascriptCode=function(varName,recursive){var ret="";
if((this._tree.useAutoSequence&&(this.id>1))||(!this._tree.useAutoSequence&&!this.parent)){}else{ret+=varName+" = new Array();\n";
if(!this._tree.useAutoSequence){ret+=varName+"['id'] = \""+this.id+'";\n'
}if(this.caption){ret+=varName+"['caption']            = \""+this.caption+'";\n'
}if(this.url){ret+=varName+"['url']                = \""+this.url+'";\n'
}if(this.target){ret+=varName+"['target']             = \""+this.target+'";\n'
}if(this.tooltip){ret+=varName+"['tooltip']            = \""+this.tooltip+'";\n'
}if(this.onClick){var onClick=this.onClick.replace(/"/g,'\\"');
ret+=varName+"['onClick']            = \""+onClick+'";\n'
}if(this.imageDir){ret+=varName+"['imageDir']           = \""+this.imageDir+'";\n'
}if(this.isOpen){ret+=varName+"['isOpen']             = '"+this.isOpen+"';\n"
}if(this.isChecked){ret+=varName+"['isChecked']          = '"+this.isChecked+"';\n"
}if(typeof(this.useRadioButton)!="undefined"){ret+=varName+"['useRadioButton']       = '"+this.useRadioButton+"';\n"
}if(typeof(this.radioButtonSelected)!="undefined"){ret+=varName+"['radioButtonSelected']       = '"+this.radioButtonSelected+"';\n"
}if(this.checkboxName){ret+=varName+"['checkboxName']       = '"+this.checkboxName+"';\n"
}if(this.icon){ret+=varName+"['icon']               = \""+this.icon+'";\n'
}if(this.beforeIconSpan){ret+=varName+"['beforeIconSpan']     = \""+this.beforeIconSpan+'";\n'
}if(this.beforeCaptionSpan){ret+=varName+"['beforeCaptionSpan']  = \""+this.beforeCaptionSpan+'";\n'
}if(this.afterCaptionSpan){ret+=varName+"['afterCaptionSpan']   = \""+this.afterCaptionSpan+'";\n'
}if(this.linkStyle){ret+=varName+"['linkStyle']          = \""+this.linkStyle+'";\n'
}if(this.linkTitle){ret+=varName+"['linkTitle']          = \""+this.linkTitle+'";\n'
}if(this.linkStatus){ret+=varName+"['linkStatus']         = \""+this.linkStatus+'";\n'
}if(this.divStyle){ret+=varName+"['divStyle']           = \""+this.divStyle+'";\n'
}varName+="['children']"
}if(recursive){if(this._children.length>0){ret+=varName+" = new Array();\n";
for(var i=0;
i<this._children.length;
i++){ret+=this._children[i].getJavascriptCode(varName+"["+i+"]",recursive)
}}}return ret
};
this.setActive=function(){var activeElement=this._tree.getActiveElement();
if(activeElement!=false){activeElement.unsetActive()
}this._tree.setActiveElement(this);
this._highlight()
};
this._highlight=function(){var elmSetActive=document.getElementById(this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+"_caption");
if(elmSetActive!=null){elmSetActive.style.backgroundColor=this._getVar("captionBgColor")
}else{setTimeout("Bs_Objects["+this._tree._id+"].executeOnElement('"+this.id+"', '_highlight');",800)
}};
this.unsetActive=function(){var e=document.getElementById(this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+"_caption");
if(e!=null){e.style.backgroundColor="transparent"
}};
this.toggleOpenClose=function(){if(this.isOpen){if(this.hasEventAttached("onBeforeClose")){var status=this.fireEvent("onBeforeClose");
if(status!=true){return
}}this.close();
if(this.hasEventAttached("onAfterClose")){this.fireEvent("onAfterClose")
}}else{if(this.hasEventAttached("onBeforeOpen")){var status=this.fireEvent("onBeforeOpen");
if(status!=true){return
}}this.open();
if(this.hasEventAttached("onAfterOpen")){this.fireEvent("onAfterOpen")
}}};
this.open=function(checkParents){if(this.isOpen){return
}this.isOpen=true;
if(this.hasVisibleChildren()){var lookAhead=this._tree.lookAhead;
var doRender=false;
for(var i=0;
i<this._children.length;
i++){if(!this._children[i]._isOutrendered||(this._children[i].hasUnloadedChildren())){doRender=true;
break
}}if(doRender){this.render(true,true,lookAhead)
}}if(true||!doRender){if(this._isOutrendered){var d=document.getElementById(this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+"_children");
if(d){d.style.display="block"
}this._switchIconsOnToggleOpenClose()
}else{if(checkParents){this._renderParentsUp()
}this.render(true,true)
}if(this._tree.rememberState){this._tree._updateStateCookie(this.id,"open",true)
}}if(this._tree.autoCollapse){var sib=this.getSiblings();
for(var i=0,n=sib.length;
i<n;
i++){if(sib[i].id!=this.id){sib[i].close()
}}}if(this.hasVisibleChildren()){var lookAhead=this._tree.lookAhead;
var treeElm=this;
for(var j=0,n=treeElm._children.length;
j<n;
j++){if(typeof(treeElm._children[j]._undoneChildren)=="object"){for(var k=0,kn=treeElm._children[j]._undoneChildren.length;
k<kn;
k++){var newE=this._tree._createTreeElement(treeElm._children[j]._undoneChildren[k],treeElm._children[j]._level+1);
treeElm._children[j].addChild(newE)
}treeElm._children[j]._undoneChildren=false
}if(treeElm._children[j].hasVisibleChildren()){var doRender=false;
for(var k=0,kn=treeElm._children[j]._children.length;
k<kn;
k++){if(!treeElm._children[j]._children[k]._isOutrendered){var doRender=true;
break
}}if(doRender){treeElm._children[j].render(true,true,lookAhead)
}}}}};
this._renderParentsUp=function(){if(typeof(this.parent)=="undefined"){this.parent._renderParentsUp()
}if(this._isOutrendered){return
}this.render(true,true)
};
this.close=function(){if(!this.isOpen){return
}this.isOpen=false;
if(this._isOutrendered){var d=document.getElementById(this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+"_children");
d.style.display="none";
this._switchIconsOnToggleOpenClose()
}else{this.render(true,true)
}if(this._tree.rememberState){this._tree._updateStateCookie(this.id,"open",false)
}};
this._switchIconsOnToggleOpenClose=function(){var openClose=document.getElementById(this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+"_openClose");
if(openClose){openClose.src=this._getSourceOpenCloseIcon()
}if(this._getVar("useFolderIcon")){var folderIconId=this._tree._objectId+"_e_"+this.getDhtmlCompatibleId()+"_folder";
var fIcon=document.getElementById(folderIconId);
if(fIcon){fIcon.src=this._getSourceFolderIcon()
}}};
this.expandAll=function(){this.open();
if(this.hasVisibleChildren()){for(var i=0;
i<this._children.length;
i++){this._children[i].expandAll()
}}};
this.collapseAll=function(closeThis){if(typeof(closeThis)=="undefined"){closeThis=true
}if(closeThis){this.close()
}if(this.hasVisibleChildren()){for(var i=0;
i<this._children.length;
i++){this._children[i].collapseAll(true)
}}};
this._getSourceOpenCloseIcon=function(){if(this.hasSiblingsDown()){var imgNumber=3
}else{var imgNumber=2
}if(this.hasVisibleChildren()){if((this._level==0)||(!this._tree.showPseudoElement&&(this._level==1)&&((this._tree.useAutoSequence&&(this.id==1))||(!this._tree.useAutoSequence&&true)))){if(this.hasSiblingsDown()){imgNumber++
}else{imgNumber--
}}if(this.isOpen){var plusImg="minus"+imgNumber;
var onClick="Close"
}else{var plusImg="plus"+imgNumber;
var onClick="Open"
}}else{var plusImg="line"+imgNumber
}var imageDir=this._getVar("imageDir");
return imageDir+plusImg+".gif"
};
this._getSourceFolderIcon=function(){var imageDir=this._getVar("imageDir");
switch(typeof(this.icon)){case"undefined":if(this._tree.useLeaf&&!this.hasChildren()){var folderImg="leaf"
}else{var folderImg="folder";
folderImg+=(this.isOpen)?"Open":"Closed"
}return imageDir+folderImg+".gif";
break;
case"bool":case"boolean":break;
case"string":if(this.icon!="false"){var ret="";
if(!this._iconHasPath(this.icon)){ret+=imageDir
}ret+=this.icon;
if(!this._iconHasExtension(this.icon)){ret+=".gif"
}return ret
}}return""
};
this.hasChildren=function(){return(this._children.length>0)
};
this.hasVisibleChildren=function(){if(!this._children||!(this._children.length>0)){this._hasVisibleChildren=false;
return false
}for(var i=0,n=this._children.length;
i<n;
i++){if(this._children[i].visible){this._hasVisibleChildren=true;
return true
}}this._hasVisibleChildren=false;
return false
};
this.numChildren=function(){return this._children.length
};
this.childPos=function(id){for(var i=0,n=this._children.length;
i<n;
i++){if(this._children[i].id==id){return ++i
}}return false
};
this.hasSiblings=function(){};
this.hasSiblingsDown=function(ignoreCache){if(false&&!ignoreCache){if(typeof(this._hasSiblingsDown)!="undefined"){return this._hasSiblingsDown
}}try{var tot=this.parent.numChildren();
var pos=this.parent.childPos(this.id);
this._hasSiblingsDown=(pos<tot);
return this._hasSiblingsDown
}catch(e){this._hasSiblingsDown=false;
return false
}};
this.hasSiblingsAbove=function(){};
this.getSiblings=function(){try{return this.parent.getChildren()
}catch(e){return new Array
}};
this.getChildren=function(){return this._children
};
this.getParentId=function(){try{return this.parent.id
}catch(e){return false
}};
this.hasParent=function(){return(this.parent)
};
this.attachEvent=function(trigger,yourEvent){if(typeof(this._attachedEvents)=="undefined"){this._attachedEvents=new Array()
}if(typeof(yourEvent)=="string"){if((yourEvent.indexOf("(")==-1)&&(yourEvent.indexOf(" ")==-1)&&(yourEvent.indexOf(";")==-1)){if(typeof(window[yourEvent])=="function"){yourEvent=window[yourEvent]
}}}if(typeof(this._attachedEvents[trigger])=="undefined"){this._attachedEvents[trigger]=new Array(yourEvent)
}else{this._attachedEvents[trigger][this._attachedEvents[trigger].length]=yourEvent
}};
this.hasEventAttached=function(trigger){return((typeof(this._attachedEvents)!="undefined")&&(typeof(this._attachedEvents[trigger])!="undefined"))
};
this.fireEvent=function(trigger){var ret=true;
if(trigger=="onClickCaption"){this.setActive()
}if((typeof(this._attachedEvents)!="undefined")&&(typeof(this._attachedEvents[trigger])!="undefined")){var e=this._attachedEvents[trigger];
if((typeof(e)=="string")||(typeof(e)=="function")){e=new Array(e)
}for(var i=0,n=e.length;
i<n;
i++){if(typeof(e[i])=="function"){var status=e[i](this);
if(status==false){ret=false
}}else{if(typeof(e[i])=="string"){var ev=e[i].replace(/__this\.id__/g,this.id);
eval(ev)
}}}}return ret
};
this.onKeyDown=function(event){if(event==null){return
}if(typeof(event)=="undefined"){return
}if(typeof(event.keyCode)=="undefined"){return
}switch(event.keyCode){case 107:case 39:if(this.isOpen){if(this.hasVisibleChildren()){var treeElm=this.getNextVisibleElement();
if(treeElm!=null){var name=this._tree._objectId+"_e_"+treeElm.id+"_href";
var captionSpan=document.getElementsByName(name);
if(captionSpan.length>0){captionSpan[1].focus()
}else{name=this._tree._objectId+"_e_"+treeElm.id+"_caption2";
captionSpan=document.getElementById(name);
if(captionSpan){captionSpan.focus()
}}}}}else{this.open()
}return false;
case 37:case 109:if(this.isOpen&&(this._children.length>0)){this.close()
}else{var treeElm=this.parent;
if(treeElm!=null){var name=this._tree._objectId+"_e_"+treeElm.id+"_href";
var captionSpan=document.getElementsByName(name);
if(captionSpan.length>0){captionSpan[1].focus()
}else{name=this._tree._objectId+"_e_"+treeElm.id+"_caption2";
captionSpan=document.getElementById(name);
if(captionSpan){captionSpan.focus()
}}}}return false;
case 40:var treeElm=this.getNextVisibleElement();
if(treeElm!=null){var name=this._tree._objectId+"_e_"+treeElm.id+"_href";
var captionSpan=document.getElementsByName(name);
if(captionSpan.length>0){captionSpan[1].focus()
}else{name=this._tree._objectId+"_e_"+treeElm.id+"_caption2";
captionSpan=document.getElementById(name);
if(captionSpan){captionSpan.focus()
}}}return false;
case 38:var treeElm=this.getPreviousVisibleElement();
if(treeElm!=null){var name=this._tree._objectId+"_e_"+treeElm.id+"_href";
var captionSpan=document.getElementsByName(name);
if(captionSpan.length>0){captionSpan[1].focus()
}else{name=this._tree._objectId+"_e_"+treeElm.id+"_caption2";
captionSpan=document.getElementById(name);
if(captionSpan){captionSpan.focus()
}}}return false;
case 32:if(this._tree.useCheckboxSystem){switch(this.isChecked){case 0:var newCheckboxValue=2;
break;
case 2:var newCheckboxValue=0;
break;
case 1:if(this._tree.checkboxSystemIfPartlyThenFull){var newCheckboxValue=2
}else{var newCheckboxValue=0
}break
}this.setCheckboxValue(newCheckboxValue)
}else{if(this._tree.useRadioButton){document.getElementById(this._tree.getRadioButtonName()+"_"+this.getDhtmlCompatibleId()).checked=true
}}return false
}return true
};
this.getPreviousVisibleElement=function(){var treeElm=null;
do{var sib=this.getSiblings();
for(var i=0,n=sib.length;
i<n;
i++){if(sib[i].id==this.id){if(i>0){treeElm=sib[--i];
if(treeElm.isOpen&&treeElm.hasVisibleChildren()){treeElm=treeElm._children[treeElm._children.length-1]
}break
}}}if(treeElm==null){if(typeof(this.parent)=="undefined"){break
}treeElm=this.parent
}}while(false);
return treeElm
};
this.getNextVisibleElement=function(){var treeElm=null;
do{if(this.isOpen&&this.hasVisibleChildren()){treeElm=this._children[0];
break
}if(this.hasSiblingsDown()){var sib=this.getSiblings();
for(var i=0,n=sib.length;
i<n;
i++){if(sib[i].id==this.id){treeElm=sib[++i];
break
}}if(treeElm!=null){break
}}var elm=this.parent;
do{var sib=elm.getSiblings();
for(var i=0,n=sib.length;
i<n;
i++){if(sib[i].id==elm.id){treeElm=sib[++i];
break
}}if(treeElm!=null){break
}if(typeof(elm.parent)=="undefined"){break
}elm=elm.parent
}while(true)
}while(false);
return treeElm
};
this._addError=function(str){if(typeof(this._errorArray)=="undefined"){this._errorArray=new Array(str)
}else{this._errorArray[this._errorArray.length]=str
}};
this.getLastError=function(){if(typeof(this._errorArray)!="undefined"){if(this._errorArray.length>0){return this._errorArray[this._errorArray.length-1]
}}return false
};
this._getVar=function(varName){if(typeof(this[varName])!="undefined"){return this[varName]
}else{if(this._tree.walkTree&&(typeof(this.parent)!="undefined")){return this.parent._getVar(varName)
}else{if(typeof(this._tree[varName])!="undefined"){return this._tree[varName]
}else{return null
}}}};
this.onMouseOver=function(){};
this.onMouseOut=function(){};
this.setCheckboxValue=function(value,fireEvents,doWalk){if(typeof(fireEvents)=="undefined"){fireEvents=true
}if(typeof(doWalk)=="undefined"){doWalk=true
}if(!this.hasChildren()){value=(value)?2:0
}else{if(this.isChecked==0){if(this._tree.checkboxSystemWalkTree&&(this._tree.checkboxSystemWalkTree!=2)&&(this._tree.checkboxSystemWalkTree!=3)&&this.hasChildren()){value=1
}}}this.isChecked=value;
this._checkboxObject.setTo(value,true);
if(fireEvents){if(this.hasEventAttached("onChangeCheckbox")){this.fireEvent("onChangeCheckbox")
}}if(doWalk){if((this._tree.checkboxSystemWalkTree==3)||(this._tree.checkboxSystemWalkTree==1)||(this._tree.checkboxSystemWalkTree==4)){this.parent.updateCheckboxFromChild()
}if((this._tree.checkboxSystemWalkTree==3)||(this._tree.checkboxSystemWalkTree==2)||((this._tree.checkboxSystemWalkTree==4)&&(value==0))){this.checkboxUpdateDown(value)
}}};
this.checkboxEvent=function(value){treeView.clickOnCheckBox(this);
if(!this.hasChildren()){value=(value)?2:0
}else{if(this.isChecked==1){if((!this._tree.checkboxSystemIfPartlyThenFull)||((this._tree.checkboxSystemWalkTree)&&(this._tree.checkboxSystemWalkTree!=2)&&(this._tree.checkboxSystemWalkTree!=3))){value=0
}else{value=2
}}else{if(this.isChecked==0){if(this._tree.checkboxSystemWalkTree&&(this._tree.checkboxSystemWalkTree!=2)&&(this._tree.checkboxSystemWalkTree!=3)&&this.hasChildren()){value=1
}}}}this.isChecked=value;
this._checkboxObject.setTo(value,true);
if(this.hasEventAttached("onChangeCheckbox")){this.fireEvent("onChangeCheckbox")
}if((this._tree.checkboxSystemWalkTree==3)||(this._tree.checkboxSystemWalkTree==1)||(this._tree.checkboxSystemWalkTree==4)){this.parent.updateCheckboxFromChild()
}if((this._tree.checkboxSystemWalkTree==3)||(this._tree.checkboxSystemWalkTree==2)||((this._tree.checkboxSystemWalkTree==4)&&(value==0))){this.checkboxUpdateDown(value)
}};
this.checkboxUpdateDown=function(value){for(var i=0;
i<this._children.length;
i++){this._children[i]._updateCheckboxFromParent(value,true)
}};
this.updateCheckboxVisually=function(){if(typeof(this._checkboxObject)=="object"){try{this._checkboxObject.setTo(this.isChecked)
}catch(e){}}};
this._updateCheckboxFromParent=function(newValue,recursiveDown){var backupValue=this.isChecked;
this.isChecked=(newValue)?2:0;
var hasChanged=(this.isChecked!=backupValue);
if(hasChanged){this.updateCheckboxVisually();
if(this.hasEventAttached("onChangeCheckbox")){this.fireEvent("onChangeCheckbox")
}}if(recursiveDown){this.checkboxUpdateDown(newValue,true)
}};
this.updateCheckboxFromChild=function(){var backupIsChecked=this.isChecked;
var numYes=0;
var numNo=0;
var isPartly=false;
for(var i=0,n=this._children.length;
i<n;
i++){if(this._children[i].isChecked==1){isPartly=true;
this.isChecked=1;
break
}else{if(this._children[i].isChecked){numYes++
}else{numNo++
}}if((numYes>0)&&(numNo>0)){break
}}if(!isPartly){if((numYes>0)&&(numNo>0)){this.isChecked=1
}else{if(numYes>0){this.isChecked=2
}else{this.isChecked=0
}}}if(backupIsChecked!=this.isChecked){this.updateCheckboxVisually();
if(this.hasEventAttached("onChangeCheckbox")){this.fireEvent("onChangeCheckbox")
}}if(typeof(this.parent)=="object"){this.parent.updateCheckboxFromChild()
}};
this._updateLevelAndParent=function(treeElement){if((typeof(treeElement._children)=="object")&&(treeElement._children.length>0)){for(var i=0,n=treeElement._children.length;
i<n;
i++){treeElement._children[i].parent=treeElement;
treeElement._children[i]._level=treeElement._level+1;
this._updateLevelAndParent(treeElement._children[i])
}}};
this._getLinkStyle=function(){if(typeof(this.linkStyle)!="undefined"){return this.linkStyle
}if(typeof(this._tree.linkStyle)!="undefined"){return this._tree.linkStyle
}return""
};
this._cleanCheckboxName=function(checkboxName){var ret="";
for(var i=0;
i<checkboxName.length;
i++){var chr=checkboxName.charCodeAt(i);
if((chr<48)||(chr>57&&chr<65)||(chr>90&&chr<97)||(chr>122)){ret+="_"
}else{ret+=checkboxName.substr(i,1)
}}return ret
};
this._iconHasExtension=function(iconStr){var iconLower=iconStr.toLowerCase();
var iconPos=iconLower.lastIndexOf(".");
if(iconPos>-1){var iconExt=iconLower.substr(iconPos+1);
if((iconExt!="gif")&&(iconExt!="png")&&(iconExt!="jpg")&&(iconExt!="jpeg")){return false
}}else{return false
}return true
};
this._iconHasPath=function(iconStr){if(iconStr.indexOf("://")>-1){return true
}if(iconStr.substr(0,1)=="/"){return true
}return false
}
}Array.prototype.moveUp=function(key){if(this.slice==undefined){return this
}if(key==0){return this
}if(key>=(this.length)){return this
}if(key>1){var newArr=this.slice(0,key-1)
}else{var newArr=new Array
}newArr[newArr.length]=this[key];
newArr[newArr.length]=this[key-1];
var endArr=this.slice(key+1,this.length);
return newArr.concat(endArr)
};
Array.prototype.moveDown=function(key){if(this.slice==undefined){return this
}if(key>=(this.length-1)){return this
}if(key>0){var newArr=this.slice(0,key)
}else{var newArr=new Array
}newArr[newArr.length]=this[key+1];
newArr[newArr.length]=this[key];
if(this.length>(key+2)){var endArr=this.slice(key+2,this.length);
return newArr.concat(endArr)
}return newArr
};
Array.prototype.moveToTop=function(key){if(this.slice==undefined){return this
}if(key==0){return this
}if(key>=(this.length)){return this
}var startArr=new Array(this[key]);
var middleArr=this.slice(0,key);
var endArr=this.slice(key+1,this.length);
return startArr.concat(middleArr,endArr)
};
Array.prototype.moveToBottom=function(key){if(this.slice==undefined){return this
}if(key>=(this.length-1)){return this
}if(key>0){var startArr=this.slice(0,key)
}else{var startArr=new Array
}var middleArr=this.slice(key+1,this.length);
var endArr=new Array(this[key]);
return startArr.concat(middleArr,endArr)
};
function bs_array_maxSizeOfLevel(array,level){if(!array){return 0
}if(array.length==0){return 0
}if(level==1){return array.length
}var ret=0;
for(var i=0;
i<array.length;
i++){if(array[i].length>ret){ret=array[i].length
}}return ret
}function bs_array_toCsv(array,separator){if(typeof(separator)!="string"){separator=";"
}var ret="";
for(var i=0;
i<array.length;
i++){var lineA=new Array();
for(var j=0;
j<array[i].length;
j++){if((array[i][j])&&(array[i][j]["value"])){lineA[j]=array[i][j]["value"]
}}ret+=lineA.join(separator)+"\n"
}return ret
}var ie=document.all!=null;
var moz=!ie&&document.getElementById!=null&&document.layers==null;
function bs_isNull(theVar){if(typeof(theVar)=="undefined"){return true
}if(theVar==null){return true
}return false
}function bs_isObject(theVar){ret=false;
if(typeof(theVar)=="object"){ret=!bs_isNull(theVar)
}return ret
}function bs_isEmpty(theVar){if(bs_isNull(theVar)){return true
}if(theVar==""){return true
}return false
}function bs_typeOf(theVar){ret="undefined";
switch(typeof(theVar)){case"boolean":ret="boolean";
break;
case"number":ret="number";
break;
case"string":ret="string";
break;
case"function":ret="function";
break;
case"object":if(bs_isNull(theVar)){ret="null";
break
}if(theVar.concat&&theVar.join&&theVar.sort&&theVar.pop){ret="array";
break
}break;
case"undefined":default:ret="undefined"
}return ret
}function bs_arrayMerge(obj1,obj2){if(!bs_isObject(obj1)||!bs_isObject(obj2)){return false
}for(var key in obj2){obj1[key]=obj2[key]
}return obj1
}function bs_arrayFlip(aArray){var aHash=new Object();
type=bs_typeOf(aArray);
if(type=="array"){for(var i=0;
i<aArray.length;
i++){aHash[aArray[i]]=true
}}else{if(type=="string"){if(aArray!=""){aHash[aArray]=true
}}}return aHash
}function queryStringToHash(queryString){if(typeof(queryString)=="undefined"){var queryString=window.location.search
}var ret=new Array;
if(bs_isEmpty(queryString)){return ret
}queryString=queryString.substr(1);
if(bs_isEmpty(queryString)){return ret
}var junks=queryString.split("&");
for(var i=0;
i<junks.length;
i++){var x=junks[i].split("=");
if(x.length==2){ret[x[0]]=x[1]
}else{ret[x[0]]=""
}}return ret
}function dump(theVar,doReturn,showFunctions,_out,_indent,_numCall){if(!_indent){_indent=" ";
_bsDumpOverallNumCall=1
}else{_indent+=" ";
_bsDumpOverallNumCall++
}if(_bsDumpOverallNumCall<8){if(_out){var isInternal=true
}else{_out="";
_numCall=1
}var goOn=true;
if(_numCall>10){goOn=false;
if(!doReturn){goOn=confirm("There have been 10 recursive calls so far. Maybe you have an endless loop. Do you want to continue?")
}if(!goOn){_out+=_indent+"error/warning: nesting levels too deep (>10 times)!\n"
}else{_numCall=0
}}if(goOn){switch(typeof(theVar)){case"object":for(var key in theVar){switch(typeof(theVar[key])){case"function":if(typeof(showFunctions)=="boolean"){if(showFunctions){_out+=_indent+'function "'+key+'" => '+theVar[key]+"\n"
}else{_out+=_indent+'function "'+key+"\n"
}}else{if(showFunctions==2){_out+=_indent+'function "'+key+'" => '+theVar[key]+"\n"
}else{if(showFunctions==1){_out+=_indent+'function "'+key+"\n"
}else{}}}break;
case"undefined":break;
case"object":_out+=_indent+key;
if(theVar[key] instanceof Array){_out+=" (Array) => \n"
}else{if(theVar[key] instanceof Date){_out+=" (Date) => "+theVar[key]+"\n"
}else{_out+=" (Object) => \n"
}}_out=dump(theVar[key],doReturn,showFunctions,_out,_indent+"    ",_numCall+1);
break;
case"number":if(theVar instanceof Date){alert("date")
}default:_out+=_indent+typeof(theVar[key])+' "'+key+'" => '+theVar[key]+"\n"
}}break;
default:_out+=_indent+typeof(theVar)+" => "+theVar+"\n"
}}}if(isInternal||doReturn){return _out
}else{alert(_out);
return
}}function Position(x,y){this.x=x;
this.y=y
}function getAbsolutePos(el,stopIfAbsolute){if(bs_isNull(el)){var res=new Position(0,0);
return res
}var res=new Position(el.offsetLeft,el.offsetTop);
if(el.offsetParent){if((stopIfAbsolute!=true)||((el.offsetParent.currentStyle.position!="absolute")&&(el.offsetParent.currentStyle.position!="relative")&&(el.offsetParent.currentStyle.overflow!="auto")&&(el.offsetParent.currentStyle.overflow!="scroll"))){var tmp=getAbsolutePos(el.offsetParent,stopIfAbsolute);
res.x+=tmp.x;
res.y+=tmp.y
}}return res
}if("undefined"!=typeof(HTMLElement)){if("undefined"==typeof(HTMLElement.insertAdjacentElement)){HTMLElement.prototype.insertAdjacentElement=function(where,parsedNode){switch(where){case"beforeBegin":this.parentNode.insertBefore(parsedNode,this);
break;
case"afterBegin":this.insertBefore(parsedNode,this.firstChild);
break;
case"beforeEnd":this.appendChild(parsedNode);
break;
case"afterEnd":if(this.nextSibling){this.parentNode.insertBefore(parsedNode,this.nextSibling)
}else{this.parentNode.appendChild(parsedNode)
}break
}}
}}if(moz){extendEventObject();
emulateAttachEvent();
emulateEventHandlers(["click","dblclick","mouseover","mouseout","mousedown","mouseup","mousemove","keydown","keypress","keyup"]);
emulateCurrentStyle(["left","right","top","bottom","width","height"]);
emulateHTMLModel();
Event.LEFT=1;
Event.MIDDLE=2;
Event.RIGHT=3
}else{Event={};
Event.LEFT=1;
Event.MIDDLE=4;
Event.RIGHT=2
}function extendEventObject(){Event.prototype.__defineSetter__("returnValue",function(b){if(!b){this.preventDefault()
}return b
});
Event.prototype.__defineSetter__("cancelBubble",function(b){if(b){this.stopPropagation()
}return b
});
Event.prototype.__defineGetter__("srcElement",function(){var node=this.target;
while((node!=null)&&(node.nodeType!=1)){node=node.parentNode
}return node
});
Event.prototype.__defineGetter__("fromElement",function(){var node;
if(this.type=="mouseover"){node=this.relatedTarget
}else{if(this.type=="mouseout"){node=this.target
}}if(!node){return
}while(node.nodeType!=1){node=node.parentNode
}return node
});
Event.prototype.__defineGetter__("toElement",function(){var node;
if(this.type=="mouseout"){node=this.relatedTarget
}else{if(this.type=="mouseover"){node=this.target
}}if(!node){return
}while(node.nodeType!=1){node=node.parentNode
}return node
});
Event.prototype.__defineGetter__("offsetX",function(){return this.layerX
});
Event.prototype.__defineGetter__("offsetY",function(){return this.layerY
})
}function emulateAttachEvent(){HTMLDocument.prototype.attachEvent=HTMLElement.prototype.attachEvent=function(sType,fHandler){var shortTypeName=sType.replace(/on/,"");
fHandler._ieEmuEventHandler=function(e){window.event=e;
return fHandler()
};
this.addEventListener(shortTypeName,fHandler._ieEmuEventHandler,false)
};
HTMLDocument.prototype.detachEvent=HTMLElement.prototype.detachEvent=function(sType,fHandler){var shortTypeName=sType.replace(/on/,"");
if(typeof fHandler._ieEmuEventHandler=="function"){this.removeEventListener(shortTypeName,fHandler._ieEmuEventHandler,false)
}else{this.removeEventListener(shortTypeName,fHandler,true)
}}
}function emulateEventHandlers(eventNames){for(var i=0;
i<eventNames.length;
i++){document.addEventListener(eventNames[i],function(e){window.event=e
},true)
}}function emulateAllModel(){var allGetter=function(){var a=this.getElementsByTagName("*");
var node=this;
a.tags=function(sTagName){return node.getElementsByTagName(sTagName)
};
return a
};
HTMLDocument.prototype.__defineGetter__("all",allGetter);
HTMLElement.prototype.__defineGetter__("all",allGetter)
}function extendElementModel(){HTMLElement.prototype.__defineGetter__("parentElement",function(){if(this.parentNode==this.ownerDocument){return null
}return this.parentNode
});
HTMLElement.prototype.__defineGetter__("children",function(){var tmp=[];
var j=0;
var n;
for(var i=0;
i<this.childNodes.length;
i++){n=this.childNodes[i];
if(n.nodeType==1){tmp[j++]=n;
if(n.name){if(!tmp[n.name]){tmp[n.name]=[]
}tmp[n.name][tmp[n.name].length]=n
}if(n.id){tmp[n.id]=n
}}}return tmp
});
HTMLElement.prototype.contains=function(oEl){if(oEl==this){return true
}if(oEl==null){return false
}return this.contains(oEl.parentNode)
}
}function emulateCurrentStyle(properties){HTMLElement.prototype.__defineGetter__("currentStyle",function(){var cs={};
var el=this;
for(var i=0;
i<properties.length;
i++){cs.__defineGetter__(properties[i],encapsulateObjects(el,properties[i]))
}return cs
})
}function encapsulateObjects(el,sProperty){return function(){return document.defaultView.getComputedStyle(el,null).getPropertyValue(sProperty)
}
}function emulateHTMLModel(){function convertTextToHTML(s){s=s.replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<BR>");
while(/\s\s/.test(s)){s=s.replace(/\s\s/,"&nbsp; ")
}return s.replace(/\s/g," ")
}HTMLElement.prototype.insertAdjacentHTML=function(sWhere,sHTML){var df;
var r=this.ownerDocument.createRange();
switch(String(sWhere).toLowerCase()){case"beforebegin":r.setStartBefore(this);
df=r.createContextualFragment(sHTML);
this.parentNode.insertBefore(df,this);
break;
case"afterbegin":r.selectNodeContents(this);
r.collapse(true);
df=r.createContextualFragment(sHTML);
this.insertBefore(df,this.firstChild);
break;
case"beforeend":r.selectNodeContents(this);
r.collapse(false);
df=r.createContextualFragment(sHTML);
this.appendChild(df);
break;
case"afterend":r.setStartAfter(this);
df=r.createContextualFragment(sHTML);
this.parentNode.insertBefore(df,this.nextSibling);
break
}};
HTMLElement.prototype.__defineSetter__("outerHTML",function(sHTML){var r=this.ownerDocument.createRange();
r.setStartBefore(this);
var df=r.createContextualFragment(sHTML);
this.parentNode.replaceChild(df,this);
return sHTML
});
HTMLElement.prototype.__defineGetter__("canHaveChildren",function(){switch(this.tagName){case"AREA":case"BASE":case"BASEFONT":case"COL":case"FRAME":case"HR":case"IMG":case"BR":case"INPUT":case"ISINDEX":case"LINK":case"META":case"PARAM":return false
}return true
});
HTMLElement.prototype.__defineGetter__("outerHTML",function(){var attr,attrs=this.attributes;
var str="<"+this.tagName;
for(var i=0;
i<attrs.length;
i++){attr=attrs[i];
if(attr.specified){str+=" "+attr.name+'="'+attr.value+'"'
}}if(!this.canHaveChildren){return str+">"
}return str+">"+this.innerHTML+"</"+this.tagName+">"
});
HTMLElement.prototype.__defineSetter__("innerText",function(sText){this.innerHTML=convertTextToHTML(sText);
return sText
});
var tmpGet;
HTMLElement.prototype.__defineGetter__("innerText",tmpGet=function(){var r=this.ownerDocument.createRange();
r.selectNodeContents(this);
return r.toString()
});
HTMLElement.prototype.__defineSetter__("outerText",function(sText){this.outerHTML=convertTextToHTML(sText);
return sText
});
HTMLElement.prototype.__defineGetter__("outerText",tmpGet);
HTMLElement.prototype.insertAdjacentText=function(sWhere,sText){this.insertAdjacentHTML(sWhere,convertTextToHTML(sText))
}
}var availableLayersGY=[{"minZ":0,"maxZ":0,"auto":16,"title":"Verkehr","icon":"/images/map/6_0057.png","id":"57","sublayers":[{"minZ":0,"maxZ":0,"auto":16,"title":"Fernverkehr","icon":"/images/map/6_0007.png","id":"7"},{"minZ":0,"maxZ":0,"auto":16,"title":"Nahverkehr","icon":"/images/map/6_0006.png","id":"6"},{"minZ":0,"maxZ":0,"auto":99,"title":"Parkhaus","icon":"/images/map/6_0005.png","id":"5"},{"minZ":0,"maxZ":0,"auto":99,"title":"Autowaschanlage","icon":"/images/map/6_6001.png","id":"6001"},{"minZ":0,"maxZ":0,"auto":99,"title":"Autovermietung","icon":"/images/map/6_0001.png","id":"1"},{"minZ":0,"maxZ":0,"auto":99,"title":"Tankstelle","icon":"/images/map/6_0002.png","id":"2"}]},{"minZ":0,"maxZ":0,"auto":18,"title":"Essen + Trinken","icon":"/images/map/6_0058.png","id":"58","sublayers":[{"minZ":0,"maxZ":0,"auto":18,"title":"Diskothek","icon":"/images/map/6_6002.png","id":"6002"},{"minZ":0,"maxZ":0,"auto":18,"title":"Bar","icon":"/images/map/6_0008.png","id":"8"},{"minZ":0,"maxZ":0,"auto":18,"title":"Cafe","icon":"/images/map/6_0009.png","id":"9"},{"minZ":0,"maxZ":0,"auto":18,"title":"Restaurant","icon":"/images/map/6_0011.png","id":"11"}]},{"minZ":0,"maxZ":0,"auto":18,"title":"Freizeit + Reisen","icon":"/images/map/6_0059.png","id":"59","sublayers":[{"minZ":0,"maxZ":0,"auto":18,"title":"Übernachtung","icon":"/images/map/6_0010.png","id":"10"},{"minZ":0,"maxZ":0,"auto":18,"title":"Touristeninformation","icon":"/images/map/6_0102.png","id":"102"},{"minZ":0,"maxZ":0,"auto":99,"title":"Freizeitparks","icon":"/images/map/6_0127.png","id":"127"},{"minZ":0,"maxZ":0,"auto":99,"title":"Sehenswürdigkeiten","icon":"/images/map/6_6003.png","id":"6003"},{"minZ":0,"maxZ":0,"auto":99,"title":"Konzert / Theater","icon":"/images/map/6_0014.png","id":"14"},{"minZ":0,"maxZ":0,"auto":99,"title":"Museum / Kunst","icon":"/images/map/6_0013.png","id":"13"},{"minZ":0,"maxZ":0,"auto":99,"title":"Kino / Video","icon":"/images/map/6_0012.png","id":"12"},{"minZ":0,"maxZ":0,"auto":99,"title":"Sport","icon":"/images/map/6_0015.png","id":"15"},{"minZ":0,"maxZ":0,"auto":18,"title":"Panoramabilder","icon":"/images/map/6_0033.png","id":"33"},{"minZ":0,"maxZ":0,"auto":18,"title":"WebCams","icon":"/images/map/6_0016.png","id":"16"},{"minZ":0,"maxZ":0,"auto":18,"title":"Freizeittouren","icon":"/images/map/6_5004.png","id":"5004"},{"minZ":0,"maxZ":0,"auto":99,"title":"Skigebiete","icon":"/images/map/6_0201.png","id":"201"}]},{"minZ":0,"maxZ":0,"auto":99,"title":"Gesundheit + Schönheit","icon":"/images/map/6_0062.png","id":"62","sublayers":[{"minZ":0,"maxZ":0,"auto":99,"title":"Allgemeinmedizin","icon":"/images/map/6_6006.png","id":"6006"},{"minZ":0,"maxZ":0,"auto":99,"title":"Facharzt","icon":"/images/map/6_0037.png","id":"37"},{"minZ":0,"maxZ":0,"auto":99,"title":"Zahnmedizin","icon":"/images/map/6_6007.png","id":"6007"},{"minZ":0,"maxZ":0,"auto":99,"title":"Physiotherapeuten","icon":"/images/map/6_6008.png","id":"6008"},{"minZ":0,"maxZ":0,"auto":99,"title":"Apotheken","icon":"/images/map/6_0023.png","id":"23"},{"minZ":0,"maxZ":0,"auto":99,"title":"Schönheit","icon":"/images/map/6_0025.png","id":"25"}]},{"minZ":0,"maxZ":0,"auto":99,"title":"Einkaufen + Shoppen","icon":"/images/map/6_0061.png","id":"61","sublayers":[{"minZ":0,"maxZ":0,"auto":99,"title":"Lebensmittel","icon":"/images/map/6_6014.png","id":"6014"},{"minZ":0,"maxZ":0,"auto":99,"title":"Mode","icon":"/images/map/6_0036.png","id":"36"},{"minZ":0,"maxZ":0,"auto":99,"title":"Kosmetik","icon":"/images/map/6_6037.png","id":"6037"},{"minZ":0,"maxZ":0,"auto":99,"title":"Blumen","icon":"/images/map/6_6027.png","id":"6027"},{"minZ":0,"maxZ":0,"auto":99,"title":"Bank / Geldautomat","icon":"/images/map/6_0027.png","id":"27"},{"minZ":0,"maxZ":0,"auto":99,"title":"Post","icon":"/images/map/6_0029.png","id":"29"}]},{"minZ":0,"maxZ":0,"auto":10,"title":"Wetter","icon":"/images/map/6_0902.png","id":"902"},{"minZ":0,"maxZ":0,"auto":11,"title":"Gemeinden","icon":"/images/map/6_0100.png","id":"100"},{"minZ":0,"maxZ":0,"auto":8,"title":"Stau","icon":"/images/map/6_0901.png","id":"901"}];
var staticLayersGY=[{"minZ":12,"maxZ":19,"id":"903"}];
function adjustContentSizes(extraSpace){var heightMapC=$(window).height()-$("#header").height()-$("#footer").height()-30+extraSpace;
var heightMapContent=(heightMapC>5)?heightMapC:6;
var mapHeight=heightMapContent-30;
nMapHeight=(mapHeight>0)?mapHeight:36;
$(".mapContainer").css({height:nMapHeight});
$(".mapContainer .map").css({height:nMapHeight});
$(".contentHolder").css({height:nMapHeight+26});
var heightArrowMiddle=nMapHeight-76;
$(".slider .arrowMiddle").css({height:heightArrowMiddle});
var widthStreetviewHolder=$(".mapContainer").width()-325;
$("#contentStreetview .streetviewHolder").css({width:widthStreetviewHolder-5});
$("#contentStreetview .streetviewHolder").css({height:this.nMapHeight});
$("#contentStreetview .smallMap").css({height:this.nMapHeight-225});
if((GeoPortalMap!=undefined)&&(GeoPortalMap.streetViewPanorama!=null)){google.maps.event.trigger(GeoPortalMap.streetViewPanorama,"resize")
}}function adjustPanelH(){var panelHeight=nMapHeight-35;
$(".mapContainer .panel").css({height:panelHeight});
$(".mapContainer .panel .panelcontent").css({height:(panelHeight-8)})
}function expandMapToFull(){$(".bodyFlex #header").hide();
$(".bodyFlex .locatebar").hide();
if($(".slider").hasClass("collapse")&&$(".panel .panelMap").hasClass("on")){$(".slider").removeClass("collapse").addClass("expande");
$(".panel .panelMap").hide()
}$("#maxview").show();
$("#expandMapToFull").hide();
$("#reduceMapToNormal").show();
adjustContentSizes($(".bodyFlex #header").height()+$(".bodyFlex .locatebar").height());
adjustPanelH();
return(false)
}function reduceMapToNormal(){$(".bodyFlex #header").show();
$(".bodyFlex .locatebar").show();
$(".slider").removeClass("expande").addClass("collapse");
$(".panel .panelMap").show();
$("#maxview").hide();
$("#reduceMapToNormal").hide();
$("#expandMapToFull").show();
adjustContentSizes(0);
adjustPanelH();
return(false)
}function mapsectorSearchOpener(){$(".mapsectorSearch h2").addClass("active");
$(".mapsectorSearch .closeArea").addClass("active");
$(".mapsectorSearch .areaContent").show();
$(".mapSearch h2").removeClass("active");
$(".mapSearch .closeArea").removeClass("active");
$(".mapSearch .areaContent").hide();
$(".mapsectorSearchOff").css("display","none")
}function mapsectorSearchOn(){$(".mapsectorSearchOff").css("display","none")
}function mapsectorSearchOff(){$(".mapsectorSearchOff").css("display","block");
$(".mapsectorSearch .areaContent:visible").hide();
$(".mapsectorSearch h2").removeClass("active");
$(".mapsectorSearch .closeArea").removeClass("active")
}function routePlanOpener(){var containerElement=$(".panelRoute.accordionArea h2").next();
var headerElement=$(".panelRoute.accordionArea h2");
var closeElement=$(".panelRoute.accordionArea h2").children(".closeArea");
if((containerElement.is(".accordionArea .areaContent"))&&(containerElement.is(":visible"))){return
}if((containerElement.is(".accordionArea .areaContent"))&&(!containerElement.is(":visible"))){$(".accordionArea .areaContent:visible").slideUp("slow");
$(".accordionArea h2").removeClass("active");
$(".accordionArea .closeArea").removeClass("active");
closeElement.addClass("active");
containerElement.slideDown("slow",function(){});
headerElement.addClass("active");
return
}}function mapsectorSearchErrorOn(){$(".layerBox.error").show()
}function mapsectorSearchErrorOff(){$(".layerBox.error").hide()
}function layerTip(){$(".mapsectorSearchOff .openInfo").click(function(e){var posX=e.pageX+17;
var posY=e.pageY-30;
$(".layerBox.tip").css("left",posX).css("top",posY).show()
}).mouseout(function(){});
$(".layerBox.tip a").click(function(){$(".layerBox.tip").hide()
})
}function streetviewON(){$("#contentMap").css("z-index","199");
return false
}function streetviewOFF(){$("#contentMap").css("z-index","201");
return false
}function setObjHandlers(){this.arrToggles=[this.oToggleAddressInput,this.oTogglePoi];
var nCounter=0;
while(this.arrToggles[nCounter]){if(eval(this.arrToggles[nCounter])){$(this.arrToggles[nCounter]).bind("click",this.toggleSector)
}nCounter++
}}function setBodyHandler(){onceFocussed=1
}function defaultTexts(){new InputDefault(".addressBar input");
new InputDefault(".panel input")
}$(function(){window.onresize=function(){adjustContentSizes(0);
adjustPanelH()
};
$(".accordionArea h2").click(function(){var containerElement=$(this).next();
var headerElement=$(this);
var closeElement=$(this).children(".closeArea");
if((containerElement.is(".accordionArea .areaContent"))&&(containerElement.is(":visible"))){return false
}if((containerElement.is(".accordionArea .areaContent"))&&(!containerElement.is(":visible"))){$(".accordionArea .areaContent:visible").slideUp("slow");
$(".accordionArea h2").removeClass("active");
$(".accordionArea .closeArea").removeClass("active");
closeElement.addClass("active");
containerElement.slideDown("slow",function(){});
headerElement.addClass("active");
return false
}});
$(".accordionArea .closeArea").click(function(){$(".accordionArea .areaContent:visible").slideUp("slow",function(){});
$(".accordionArea h2").removeClass("active");
$(".accordionArea .closeArea").removeClass("active")
});
$(".layerBox.error a").click(function(){mapsectorSearchErrorOff()
});
$(document.body).mouseup(function(event){$(event.target).parents(".layerBox").length<=0?$(".layerBox").hide():0
});
$(".slider").click(function(){if($(this).hasClass("collapse")&&$(".panel .panelMap").hasClass("on")){$(this).removeClass("collapse").addClass("expande");
$(".panel .panelMap").hide()
}else{if($(this).hasClass("expande")&&$(".panel .panelMap").hasClass("on")){$(this).removeClass("expande").addClass("collapse");
$(".panel .panelMap").show()
}}});
$(".getRoute .close").click(function(){$(".getRoute .container").hide();
$(".showGetRoute").show();
$(".getRoute").addClass("off")
});
$(".showGetRoute").click(function(){$(".showGetRoute").hide();
$(".getRoute .container").show();
$(".getRoute").removeClass("off")
});
adjustContentSizes(0);
adjustPanelH();
defaultTexts();
setObjHandlers();
textFocus=0;
onceFocussed=0;
layerTip()
});
function ToolTipOverlay(latLng,responseText,map){this.latLng_=latLng;
this.responseText_=responseText;
this.map_=map;
this.div_=null;
this.setMap(map)
}ToolTipOverlay.prototype=new google.maps.OverlayView();
ToolTipOverlay.prototype.onAdd=function(){var overlayProjection=this.getProjection();
var clickedPixel=overlayProjection.fromLatLngToDivPixel(this.latLng_);
var middlePixel=overlayProjection.fromLatLngToDivPixel(this.map_.getCenter());
var needle=null;
if(clickedPixel.x<middlePixel.x){if(clickedPixel.y<middlePixel.y){needle="needleTopl"
}else{needle="needleBottoml"
}}else{if(clickedPixel.y<middlePixel.y){needle="needleTopr"
}else{needle="needleBottomr"
}}var div=document.createElement("DIV");
div.style.border="none";
div.style.borderWidth="0px";
div.style.position="absolute";
div.className="layerTooltip "+needle;
div.innerHTML=this.responseText_;
this.div_=div;
var panes=this.getPanes();
panes.floatPane.appendChild(div)
};
ToolTipOverlay.prototype.draw=function(){var overlayProjection=this.getProjection();
var clickedPixel=overlayProjection.fromLatLngToDivPixel(this.latLng_);
var middlePixel=overlayProjection.fromLatLngToDivPixel(this.map_.getCenter());
var div=this.div_;
div.style.width="230px";
div.style.height="auto";
if(clickedPixel.x<middlePixel.x){div.style.left=clickedPixel.x+"px"
}else{div.style.left=(clickedPixel.x-230)+"px"
}if(clickedPixel.y<middlePixel.y){div.style.top=clickedPixel.y+"px"
}else{div.style.top=(clickedPixel.y-210)+"px";
$(".layerTooltip .container .boxes").attr("style","height:180px;")
}};
ToolTipOverlay.prototype.onRemove=function(){this.div_.parentNode.removeChild(this.div_);
this.div_=null
};
var GeoPortalMap={lat:null,lon:null,z:null,mapType:"Hybrid",showCircle:0,goHome:0,layerWas:"",streetViewByUrl:0,streetViewPitch:0,streetViewYaw:-1,layerPngIcon:"&orOpen=yes&dataProvider=0&orClose=yes",layerTooltip:"&LAY=0",layerIgnoreZoom:0,clickedPoint:null,toolTipOverlay:null,GPSiesStrecke:null,map:null,isInitialMap:false,mapUrl4Bookmark:null,mapZoom4Bookmark:0,mapTypeHash:{},timeoutRefresh:null,ivwOff4Map:1,circleOverlay:null,route:null,routeErrorBox:"#geoPortalNav",routeOption:null,routeStatus:null,streetViewOverlay:null,streetViewPanorama:null,streetViewClient:null,streetViewMap:null,streetViewPosIconOverlay:null,streetViewIconsHash:{},streetViewIconsUrlHash:{},streetViewBlockRecursion:0};
GeoPortalMap.refreshIconLayer=function(){GeoPortalMap.ivwOff4Map=1;
GeoPortalMap.layerIgnoreZoom=1;
var z=GeoPortalMap.map.getZoom();
GeoPortalMap.map.setZoom(z-1);
GeoPortalMap.map.setZoom(z);
GeoPortalMap.layerIgnoreZoom=0;
GeoPortalMap.ivwOff4Map=0
};
GeoPortalMap.handleLayerChange=function(enabledFeeds,refresh){var lyrs1="&dataProvider=0";
var lyrs2="0";
for(var i in enabledFeeds){if(enabledFeeds[i]!="0"){lyrs1=lyrs1+"&dataProvider="+enabledFeeds[i];
lyrs2=lyrs2+","+enabledFeeds[i]
}}GeoPortalMap.layerPngIcon="&orOpen=yes"+lyrs1+"&orClose=yes";
GeoPortalMap.layerTooltip="&LAY="+lyrs2;
if(!refresh){return
}if(GeoPortalMap.timeoutRefresh!=null){window.clearTimeout(GeoPortalMap.timeoutRefresh);
GeoPortalMap.timeoutRefresh=null
}GeoPortalMap.timeoutRefresh=setTimeout(function(){GeoPortalMap.refreshIconLayer()
},100)
};
GeoPortalMap.showTooltip=function(responseText){if(responseText==""){return
}if(GeoPortalMap.toolTipOverlay!=null){GeoPortalMap.toolTipOverlay.setMap(null)
}GeoPortalMap.toolTipOverlay=new ToolTipOverlay(GeoPortalMap.clickedPoint,responseText,GeoPortalMap.map);
var options={disableDoubleClickZoom:true,draggable:false};
GeoPortalMap.map.setOptions(options);
goUtils.emitMessage("c1_map_totip");
var pos1=responseText.indexOf("<!--@@@");
if(pos1!=-1){var pos2=responseText.indexOf("@@@-->",pos1);
var fileId=responseText.substring(pos1+7,pos2);
GeoPortalMap.drawGPSiesTrack(fileId)
}};
GeoPortalMap.hideTooltip=function(){GeoPortalMap.removeGPSiesTrack();
if(GeoPortalMap.toolTipOverlay!=null){GeoPortalMap.toolTipOverlay.setMap(null)
}GeoPortalMap.toolTipOverlay=null;
var options={disableDoubleClickZoom:false,draggable:true};
GeoPortalMap.map.setOptions(options)
};
GeoPortalMap.getTooltip=function(latLng){var distance=4*(40000000/(1<<GeoPortalMap.map.getZoom()))/256;
distance=distance.toFixed(0);
if(distance<10){distance=10
}var parameter="&XCO="+latLng.lng()+"&YCO="+latLng.lat()+"&DIS="+distance+GeoPortalMap.layerTooltip;
if(GeoPortalMap.layerWas!=""){parameter=parameter+"&MDN="+encodeURIComponent(GeoPortalMap.layerWas)
}GeoPortalMap.clickedPoint=latLng;
$.get("/IDA2?PAGE=googleMapToolTip&ACTION=search"+parameter,GeoPortalMap.showTooltip)
};
GeoPortalMap.clickOnMapAction=function(event){if($(".mapContainer .panel a.streetviewLink").hasClass("checkOn")){var z=GeoPortalMap.map.getZoom();
if(z<13){z=z+3;
if(z>13){z=13
}GeoPortalMap.map.setCenter(event.latLng);
GeoPortalMap.map.setZoom(z);
GeoPortalMap.z=z
}else{GeoPortalMap.streetViewClient.getPanoramaByLocation(event.latLng,50,function(data,status){if(status==google.maps.StreetViewStatus.OK){GeoPortalMap.openStreetView(event.latLng)
}else{if(z<15){z=z+3;
if(z>15){z=15
}GeoPortalMap.map.setCenter(event.latLng);
GeoPortalMap.map.setZoom(z);
GeoPortalMap.z=z
}else{GeoPortalMap.showPeekabooBox("Leider kein Street View Bild vorhanden")
}}})
}return
}if(GeoPortalMap.toolTipOverlay==null){GeoPortalMap.getTooltip(event.latLng)
}};
GeoPortalMap.verifyWasArg=function(suchbegriff){if(suchbegriff==""){mapsectorSearchErrorOn();
return(false)
}if(suchbegriff.search(/[a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9]/)!=-1){mapsectorSearchErrorOff();
return(true)
}if(suchbegriff.search(/\*/)==-1){mapsectorSearchErrorOff();
return(true)
}mapsectorSearchErrorOn();
return(false)
};
GeoPortalMap.truncateWasArg=function(suchbegriff){if(suchbegriff.length>22){suchbegriff=suchbegriff.substr(0,18)+" ..."
}return(suchbegriff)
};
GeoPortalMap.doWasSearch=function(synchron){GeoPortalMap.layerWas=$("#wasSuchbegriff").attr("value").replace(/\./," ");
if(!GeoPortalMap.verifyWasArg(GeoPortalMap.layerWas)){return
}$(".mapsectorSearch .wasSuchbegriff").text(GeoPortalMap.truncateWasArg(GeoPortalMap.layerWas));
if(!$(".mapsectorSearch .resultbox .check").hasClass("on")){$(".mapsectorSearch .resultbox .check").addClass("on")
}$(".mapsectorSearch .searchbox").hide();
if(synchron){GeoPortalMap.refreshIconLayer();
$(".mapsectorSearch .resultbox").show()
}else{var misImage=new Image();
misImage.src="/tracking.jsp?PAGE=geoSearch&ACTION=WasSuche&SUBACTION="+encodeURIComponent(GeoPortalMap.layerWas.toLowerCase().substr(0,32));
if(GeoPortalMap.timeoutRefresh!=null){window.clearTimeout(GeoPortalMap.timeoutRefresh);
GeoPortalMap.timeoutRefresh=null
}GeoPortalMap.timeoutRefresh=setTimeout(function(){GeoPortalMap.refreshIconLayer();
$(".mapsectorSearch .resultbox").show()
},100)
}};
GeoPortalMap.newWasSearch=function(){$(".mapsectorSearch .resultbox").hide();
$(".mapsectorSearch .searchbox").show()
};
GeoPortalMap.toggleWasLayer=function(){$(".mapsectorSearch .resultbox .check").toggleClass("on");
if($(".mapsectorSearch .resultbox .check").hasClass("on")){GeoPortalMap.layerWas=$("#wasSuchbegriff").attr("value")
}else{GeoPortalMap.layerWas=""
}if(GeoPortalMap.timeoutRefresh!=null){window.clearTimeout(GeoPortalMap.timeoutRefresh);
GeoPortalMap.timeoutRefresh=null
}GeoPortalMap.timeoutRefresh=setTimeout(function(){GeoPortalMap.refreshIconLayer()
},100)
};
GeoPortalMap.zoomInWas=function(){GeoPortalMap.ivwOff4Map=1;
if(GeoPortalMap.isInitialMap){GeoPortalMap.lon=13.4119;
GeoPortalMap.lat=52.5238;
GeoPortalMap.map.setCenter(new google.maps.LatLng(GeoPortalMap.lat,GeoPortalMap.lon));
GeoPortalMap.map.setZoom(13);
GeoPortalMap.z=13
}else{GeoPortalMap.map.setZoom(13);
GeoPortalMap.z=13
}GeoPortalMap.ivwOff4Map=0;
mapsectorSearchOpener()
};
GeoPortalMap.initWas=function(){if(GeoPortalMap.z<13){mapsectorSearchOff()
}if(GeoPortalMap.z>=13){mapsectorSearchOn();
mapsectorSearchOpener();
if(GeoPortalMap.layerWas!=""){if(GeoPortalMap.layerWas!=" "){$("#wasSuchbegriff").attr("value",GeoPortalMap.layerWas);
GeoPortalMap.doWasSearch(true)
}else{GeoPortalMap.layerWas=""
}}}};
GeoPortalMap.activateRedCircle=function(){if(GeoPortalMap.circleOverlay!=null){GeoPortalMap.circleOverlay.setMap(null);
GeoPortalMap.circleOverlay=null
}GeoPortalMap.circleOverlay=new google.maps.Marker({position:new google.maps.LatLng(GeoPortalMap.lat,GeoPortalMap.lon),map:GeoPortalMap.map,icon:new google.maps.MarkerImage("/images/de/map/common/target_area.png",null,null,new google.maps.Point(35,35)),clickable:false});
GeoPortalMap.latlonCircle=GeoPortalMap.lat+","+GeoPortalMap.lon;
GeoPortalMap.showCircle=1
};
GeoPortalMap.moveendAction=function(){GeoPortalMap.isInitialMap=false;
if(GeoPortalMap.ivwOff4Map==0){goUtils.emitMessage("c1_map_move")
}};
GeoPortalMap.zoomendAction=function(){if(GeoPortalMap.layerIgnoreZoom){return
}GeoPortalMap.isInitialMap=false;
var oldLevel=GeoPortalMap.z;
var newLevel=GeoPortalMap.map.getZoom();
if(newLevel<2){GeoPortalMap.map.setZoom(oldLevel);
return
}if(GeoPortalMap.ivwOff4Map==0){if(oldLevel<newLevel){goUtils.emitMessage("c1_map_zmin")
}if(oldLevel>newLevel){goUtils.emitMessage("c1_map_zmout")
}}treeView.activateLyrsByZoom(oldLevel,newLevel);
if(newLevel>=13){mapsectorSearchOn();
if(GeoPortalMap.layerWas!=""){mapsectorSearchOpener()
}}if(newLevel<13){mapsectorSearchOff()
}GeoPortalMap.z=GeoPortalMap.map.getZoom()
};
GeoPortalMap.maptypechangedAction=function(){if(GeoPortalMap.ivwOff4Map==0){var mapType=GeoPortalMap.map.getMapTypeId();
if(mapType==google.maps.MapTypeId.ROADMAP){goUtils.emitMessage("c1_map_vectr")
}if(mapType==google.maps.MapTypeId.SATELLITE){goUtils.emitMessage("c1_map_arial")
}if(mapType==google.maps.MapTypeId.HYBRID){goUtils.emitMessage("c1_map_hybrd")
}if(mapType==google.maps.MapTypeId.TERRAIN){goUtils.emitMessage("c1_map_physl")
}}};
GeoPortalMap.misTracking=function(page,action){var misImage=new Image();
misImage.src="/tracking.jsp?PAGE="+page+"&ACTION="+action
};
GeoPortalMap.initRouteIds=function(){GeoPortalMap.wayPoints=new Array(3);
GeoPortalMap.wayPoints[0]={title:"von",locId:"von_where",strId:"von_street",status:"on",X:0,Y:0};
GeoPortalMap.wayPoints[1]={title:"nach",locId:"nach_where",strId:"nach_street",status:"on",X:0,Y:0};
GeoPortalMap.wayPoints[2]={title:"ueber",locId:"ueber_where",strId:"ueber_street",status:"off",X:0,Y:0}
};
GeoPortalMap.fillMapTypeHash=function(){GeoPortalMap.mapTypeHash["Hybrid"]=google.maps.MapTypeId.HYBRID;
GeoPortalMap.mapTypeHash["Map"]=google.maps.MapTypeId.ROADMAP;
GeoPortalMap.mapTypeHash["Satellite"]=google.maps.MapTypeId.SATELLITE;
GeoPortalMap.mapTypeHash["Terrain"]=google.maps.MapTypeId.TERRAIN;
GeoPortalMap.mapTypeHash["vector"]=google.maps.MapTypeId.ROADMAP;
GeoPortalMap.mapTypeHash["2"]=google.maps.MapTypeId.ROADMAP;
GeoPortalMap.mapTypeHash["aerial"]=google.maps.MapTypeId.HYBRID;
GeoPortalMap.mapTypeHash["Karte"]=google.maps.MapTypeId.ROADMAP;
GeoPortalMap.mapTypeHash["Satellit"]=google.maps.MapTypeId.SATELLITE;
GeoPortalMap.mapTypeHash["Gelände"]=google.maps.MapTypeId.TERRAIN
};
GeoPortalMap.goHomeAction=function(){var homeInfo=$.cookie("GY_HOME");
if(!isUndefOrNull(homeInfo)&&homeInfo.isNotEmpty()&&homeInfo.match("NONE")==null){var homeHash=homeInfo.split("|");
GeoPortalMap.lon=homeHash[0];
GeoPortalMap.lat=homeHash[1];
GeoPortalMap.z=parseInt(homeHash[2]);
GeoPortalMap.mapType=homeHash[3]
}else{homeInfo=Pref.getHistoryLocation();
if(!isUndefOrNull(homeInfo)&&homeInfo.isNotEmpty()){var urlSuffix=encodeURI(homeInfo);
goUrl.loadURL("/map/"+urlSuffix)
}}};
GeoPortalMap.initNewPosition=function(lat,lon,z,urlSuffix){var lastZoom=GeoPortalMap.z;
GeoPortalMap.ivwOff4Map=1;
GeoPortalMap.hideTooltip();
GeoPortalMap.lat=lat;
GeoPortalMap.lon=lon;
GeoPortalMap.z=z;
GeoPortalMap.initWas();
GeoPortalMap.map.setCenter(new google.maps.LatLng(GeoPortalMap.lat,GeoPortalMap.lon));
GeoPortalMap.map.setZoom(GeoPortalMap.z);
GeoPortalMap.activateRedCircle();
treeView.activateLyrsByZoom(lastZoom,GeoPortalMap.z);
GeoPortalMap.mapUrl4Bookmark=(window.location.href.match(/^(.*?\/map)(\W|$)/))?(RegExp.$1+"/"):"http://www.goyellow.de/map/";
GeoPortalMap.mapUrl4Bookmark=GeoPortalMap.mapUrl4Bookmark+urlSuffix;
GeoPortalMap.mapZoom4Bookmark=GeoPortalMap.z;
GeoPortalMap.ivwOff4Map=0
};
GeoPortalMap.init=function(){GeoPortalMap.fillMapTypeHash();
GeoPortalMap.wayPoints=new Array(3);
GeoPortalMap.wayPoints[0]={title:"von",locId:"von_where",strId:"von_street",status:"on",X:0,Y:0};
GeoPortalMap.wayPoints[1]={title:"nach",locId:"nach_where",strId:"nach_street",status:"on",X:0,Y:0};
GeoPortalMap.wayPoints[2]={title:"ueber",locId:"ueber_where",strId:"ueber_street",status:"off",X:0,Y:0};
var bigMapOptions={draggableCursor:"default",mapTypeControl:true,mapTypeControlOptions:{mapTypeIds:new Array(google.maps.MapTypeId.ROADMAP,google.maps.MapTypeId.SATELLITE,google.maps.MapTypeId.HYBRID,google.maps.MapTypeId.TERRAIN),style:google.maps.MapTypeControlStyle.HORIZONTAL_BAR,position:google.maps.ControlPosition.TOP_RIGHT},panControl:true,panControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP},zoomControl:true,zoomControlOptions:{style:google.maps.ZoomControlStyle.LARGE,position:google.maps.ControlPosition.RIGHT_TOP},scaleControl:true,scaleControlOptions:{position:google.maps.ControlPosition.BOTTOM_LEFT},streetViewControl:false};
GeoPortalMap.map=new google.maps.Map(document.getElementById("geoPortalMap"),bigMapOptions);
if(GeoPortalMap.goHome==1){GeoPortalMap.goHomeAction()
}if(GeoPortalMap.z<2){GeoPortalMap.z=2
}if(GeoPortalMap.z>19){GeoPortalMap.z=19
}GeoPortalMap.map.setCenter(new google.maps.LatLng(GeoPortalMap.lat,GeoPortalMap.lon));
GeoPortalMap.map.setZoom(GeoPortalMap.z);
if((GeoPortalMap.lon==10.5)&&(GeoPortalMap.lat==51.7)){GeoPortalMap.isInitialMap=true
}var mt=GeoPortalMap.mapTypeHash[GeoPortalMap.mapType];
if(mt!=""){GeoPortalMap.map.setMapTypeId(mt)
}else{GeoPortalMap.map.setMapTypeId(google.maps.MapTypeId.HYBRID)
}if(GeoPortalMap.showCircle==1){GeoPortalMap.activateRedCircle()
}GeoPortalMap.initWas();
GeoPortalMap.mapUrl4Bookmark=window.location.href.replace(/\#+/,"");
GeoPortalMap.mapZoom4Bookmark=GeoPortalMap.z;
var adUnitDiv=document.createElement("div");
var adUnitOptions={format:google.maps.adsense.AdFormat.BANNER,position:google.maps.ControlPosition.RIGHT_BOTTOM,publisherId:"pub-5982118445993643",channelNumber:"3924747876",map:GeoPortalMap.map,visible:true};
var adUnit=new google.maps.adsense.AdUnit(adUnitDiv,adUnitOptions);
var treeIconLayerOptions={getTileUrl:function(coord,zoom){return"http://"+goVars.txtFld["apachePngOsaIp"]+"/osa?png=1&x="+coord.x+"&y="+coord.y+"&z="+zoom+"&service=map"+GeoPortalMap.layerPngIcon
},tileSize:new google.maps.Size(256,256),isPng:true};
var treeIconLayerMapType=new google.maps.ImageMapType(treeIconLayerOptions);
GeoPortalMap.map.overlayMapTypes.insertAt(0,treeIconLayerMapType);
var wasIconLayerOptions={getTileUrl:function(coord,zoom){if(GeoPortalMap.layerWas==""){return("/images/map/empty.png")
}if(zoom<13){return("/images/map/empty.png")
}return"http://"+goVars.txtFld["apachePngOsaIp"]+"/osa?png=1&x="+coord.x+"&y="+coord.y+"&z="+zoom+"&service=sub&type=xlst&spec=hidecap&billingInformation=xxx&maxrecord=1000&maidenName="+encodeURIComponent(GeoPortalMap.layerWas)
},tileSize:new google.maps.Size(256,256),isPng:true};
var wasIconLayerMapType=new google.maps.ImageMapType(wasIconLayerOptions);
GeoPortalMap.map.overlayMapTypes.insertAt(1,wasIconLayerMapType);
google.maps.event.addListener(GeoPortalMap.map,"click",GeoPortalMap.clickOnMapAction);
google.maps.event.addListener(GeoPortalMap.map,"dragend",GeoPortalMap.moveendAction);
google.maps.event.addListener(GeoPortalMap.map,"zoom_changed",GeoPortalMap.zoomendAction);
google.maps.event.addListener(GeoPortalMap.map,"maptypeid_changed",GeoPortalMap.maptypechangedAction);
treeView.init();
treeView.activateLyrs(0,GeoPortalMap.z);
GeoPortalMap.route=new google.maps.DirectionsRenderer();
GeoPortalMap.route.setMap(GeoPortalMap.map);
GeoPortalMap.route.setPanel(document.getElementById("routeInfoContent"));
GeoPortalMap.routeErrorBox="#geoPortalNav";
$("#formueber_where").hide();
$("#formueber_street").hide();
GeoPortalMap.streetViewPanorama=new google.maps.StreetViewPanorama(document.getElementById("streetviewImage"));
GeoPortalMap.streetViewClient=new google.maps.StreetViewService();
var smallMapOptions={draggable:false,mapTypeControl:false,panControl:false,zoomControl:true,zoomControlOptions:{style:google.maps.ZoomControlStyle.SMALL,position:google.maps.ControlPosition.TOP_LEFT},scaleControl:false,streetViewControl:false};
GeoPortalMap.streetViewMap=new google.maps.Map(document.getElementById("smallMapImage"),smallMapOptions);
GeoPortalMap.streetViewMap.setMapTypeId(google.maps.MapTypeId.ROADMAP);
GeoPortalMap.streetViewMap.overlayMapTypes.insertAt(0,treeIconLayerMapType);
GeoPortalMap.streetViewMap.overlayMapTypes.insertAt(1,wasIconLayerMapType);
var streetviewLayerOptions={getTileUrl:function(coord,zoom){var X=coord.x%(1<<zoom);
return"http://cbk0.google.com/cbk?output=overlay&"+"zoom="+zoom+"&x="+X+"&y="+coord.y+"&cb_client=api"
},tileSize:new google.maps.Size(256,256),isPng:true};
var streetViewOverlay=new google.maps.ImageMapType(streetviewLayerOptions);
GeoPortalMap.streetViewMap.overlayMapTypes.insertAt(2,streetViewOverlay);
google.maps.event.addListener(GeoPortalMap.streetViewPanorama,"pov_changed",GeoPortalMap.adjustMapMarkerIcon);
google.maps.event.addListener(GeoPortalMap.streetViewPanorama,"position_changed",GeoPortalMap.adjustStreetViewMap);
if(GeoPortalMap.streetViewByUrl){GeoPortalMap.openStreetView(GeoPortalMap.map.getCenter())
}GeoPortalMap.ivwOff4Map=0
};
GeoPortalMap.init4detailPage=function(){GeoPortalMap.fillMapTypeHash();
GeoPortalMap.wayPoints=new Array(3);
GeoPortalMap.wayPoints[0]={title:"",locId:"from_where",strId:"from_street",status:"on",X:0,Y:0};
GeoPortalMap.wayPoints[1]={title:"",locId:"to_where",strId:"to_street",status:"on",X:0,Y:0};
GeoPortalMap.wayPoints[2]={title:"",locId:"notExist",strId:"notExist",status:"off",X:0,Y:0};
var mapOptions={draggableCursor:"default",mapTypeControl:true,mapTypeControlOptions:{mapTypeIds:new Array(google.maps.MapTypeId.ROADMAP,google.maps.MapTypeId.SATELLITE,google.maps.MapTypeId.HYBRID,google.maps.MapTypeId.TERRAIN),style:google.maps.MapTypeControlStyle.HORIZONTAL_BAR,position:google.maps.ControlPosition.TOP_RIGHT},panControl:true,panControlOptions:{position:google.maps.ControlPosition.TOP_LEFT},zoomControl:true,zoomControlOptions:{style:google.maps.ZoomControlStyle.SMALL,position:google.maps.ControlPosition.TOP_LEFT},scaleControl:false,streetViewControl:false};
GeoPortalMap.map=new google.maps.Map(document.getElementById("routeMapContent"),mapOptions);
GeoPortalMap.map.setMapTypeId(google.maps.MapTypeId.ROADMAP);
GeoPortalMap.route=new google.maps.DirectionsRenderer();
GeoPortalMap.route.setMap(GeoPortalMap.map);
GeoPortalMap.route.setPanel(document.getElementById("routeInfoContent"));
GeoPortalMap.routeErrorBox="#unlocatedDetail"
};
GeoPortalMap.openStreetView=function(latlng){var svFeeds={};
svFeeds["1"]=1;
svFeeds["2"]=2;
svFeeds["5"]=5;
svFeeds["6"]=6;
svFeeds["7"]=7;
svFeeds["8"]=8;
svFeeds["9"]=9;
svFeeds["10"]=10;
svFeeds["11"]=11;
svFeeds["12"]=12;
svFeeds["13"]=13;
svFeeds["14"]=14;
svFeeds["15"]=15;
svFeeds["16"]=16;
svFeeds["17"]=17;
svFeeds["23"]=23;
svFeeds["25"]=25;
svFeeds["27"]=27;
svFeeds["29"]=29;
svFeeds["36"]=36;
svFeeds["37"]=37;
svFeeds["100"]=100;
svFeeds["102"]=102;
svFeeds["127"]=127;
svFeeds["251"]=251;
svFeeds["255"]=255;
svFeeds["258"]=258;
svFeeds["261"]=261;
svFeeds["901"]=901;
svFeeds["902"]=902;
svFeeds["6001"]=6001;
svFeeds["6002"]=6002;
svFeeds["6003"]=6003;
svFeeds["6006"]=6006;
svFeeds["6007"]=6007;
svFeeds["6008"]=6008;
svFeeds["6009"]=6009;
svFeeds["6014"]=6014;
svFeeds["6027"]=6027;
svFeeds["6037"]=6037;
streetviewON();
GeoPortalMap.streetViewPanorama.setVisible(true);
GeoPortalMap.handleLayerChange(svFeeds,false);
GeoPortalMap.streetViewMap.setZoom(18);
GeoPortalMap.streetViewJumpToMap(latlng)
};
GeoPortalMap.closeStreetView=function(){if(GeoPortalMap.streetViewByUrl){GeoPortalMap.handleLayerChange(treeView.getEnabledLyrs(),true)
}else{GeoPortalMap.handleLayerChange(treeView.getEnabledLyrs(),false)
}GeoPortalMap.streetViewByUrl=0;
GeoPortalMap.streetViewPanorama.setVisible(false);
streetviewOFF()
};
GeoPortalMap.streetViewToogleCheckBox=function(){if(GeoPortalMap.streetViewOverlay!=null){GeoPortalMap.map.overlayMapTypes.removeAt(2);
GeoPortalMap.streetViewOverlay=null
}if($(".mapContainer .panel a.streetviewLink").hasClass("checkOff")){$(".mapContainer .panel a.streetviewLink").removeClass("checkOff");
$(".mapContainer .panel a.streetviewLink").addClass("checkOn");
var streetviewLayerOptions={getTileUrl:function(coord,zoom){var X=coord.x%(1<<zoom);
return"http://cbk0.google.com/cbk?output=overlay&"+"zoom="+zoom+"&x="+X+"&y="+coord.y+"&cb_client=api"
},tileSize:new google.maps.Size(256,256),isPng:true};
GeoPortalMap.streetViewOverlay=new google.maps.ImageMapType(streetviewLayerOptions);
GeoPortalMap.map.overlayMapTypes.insertAt(2,GeoPortalMap.streetViewOverlay);
$("div#streetviewInfobox").show()
}else{$(".mapContainer .panel a.streetviewLink").removeClass("checkOn");
$(".mapContainer .panel a.streetviewLink").addClass("checkOff")
}};
GeoPortalMap.showPeekabooBox=function(msg){$(".peekabooBox.layerBox .msg").text(msg);
$(".peekabooBox.layerBox").show()
};
$(function(){$(".mapContainer .panel a.streetviewLink").click(function(){GeoPortalMap.streetViewToogleCheckBox()
})
});
GeoPortalMap.streetViewJumpToMap=function(latLng){GeoPortalMap.streetViewBlockRecursion=1;
GeoPortalMap.streetViewMap.setCenter(latLng);
GeoPortalMap.streetViewPanorama.setPosition(latLng);
GeoPortalMap.streetViewClient.getPanoramaByLocation(GeoPortalMap.streetViewMap.getCenter(),50,function(data,status){if(status!=google.maps.StreetViewStatus.OK){GeoPortalMap.showPeekabooBox("Leider kein Street View Bild vorhanden")
}});
GeoPortalMap.streetViewBlockRecursion=0
};
GeoPortalMap.adjustStreetViewMap=function(){if(GeoPortalMap.streetViewBlockRecursion==1){return
}GeoPortalMap.streetViewMap.setCenter(GeoPortalMap.streetViewPanorama.getPosition());
GeoPortalMap.adjustMapMarkerIcon();
GeoPortalMap.getStreetViewNextIcons()
};
GeoPortalMap.adjustMapMarkerIcon=function(){var direction=GeoPortalMap.streetViewPanorama.getPov().heading;
if(direction==undefined){return
}if(GeoPortalMap.streetViewYaw!=-1){GeoPortalMap.streetViewPanorama.setPov({yaw:GeoPortalMap.streetViewYaw,pitch:GeoPortalMap.streetViewPitch});
GeoPortalMap.streetViewYaw=-1;
direction=GeoPortalMap.streetViewPanorama.getPov().heading
}while(direction<0){direction=direction+360
}while(direction>360){direction=direction-360
}var iconFileName="pegMen_n.png";
if(direction>337){iconFileName="pegMen_n.png"
}else{if(direction>292){iconFileName="pegMen_nw.png"
}else{if(direction>247){iconFileName="pegMen_w.png"
}else{if(direction>202){iconFileName="pegMen_sw.png"
}else{if(direction>157){iconFileName="pegMen_s.png"
}else{if(direction>112){iconFileName="pegMen_se.png"
}else{if(direction>67){iconFileName="pegMen_e.png"
}else{if(direction>22){iconFileName="pegMen_ne.png"
}}}}}}}}if(GeoPortalMap.streetViewPosIconOverlay!=null){GeoPortalMap.streetViewPosIconOverlay.setMap(null);
GeoPortalMap.streetViewPosIconOverlay=null
}GeoPortalMap.streetViewPosIconOverlay=new google.maps.Marker({position:GeoPortalMap.streetViewMap.getCenter(),map:GeoPortalMap.streetViewMap,icon:new google.maps.MarkerImage("/images/map/"+iconFileName,null,null,new google.maps.Point(25,25)),clickable:false,draggable:true,raiseOnDrag:false});
google.maps.event.addListener(GeoPortalMap.streetViewPosIconOverlay,"dragend",function(event){GeoPortalMap.streetViewJumpToMap(event.latLng)
})
};
GeoPortalMap.getStreetViewNextIcons=function(){var parameter="&XCO="+GeoPortalMap.streetViewMap.getCenter().lng()+"&YCO="+GeoPortalMap.streetViewMap.getCenter().lat()+GeoPortalMap.layerTooltip;
if(GeoPortalMap.layerWas!=""){parameter=parameter+"&MDN="+encodeURIComponent(GeoPortalMap.layerWas)
}$.get("/IDA2?PAGE=googleSVToolTip&ACTION=search"+parameter,GeoPortalMap.showStreetViewNextIcons)
};
GeoPortalMap.showStreetViewNextIcons=function(html){$(".mapContainer .entriesBox").html(html);
var iconIndex=1;
var pos1=0;
while(iconIndex<5){if(typeof(GeoPortalMap.streetViewIconsHash[iconIndex])=="object"){GeoPortalMap.streetViewIconsHash[iconIndex].setMap(null);
GeoPortalMap.streetViewIconsHash[iconIndex]=null
}iconIndex++
}iconIndex=1;
while(iconIndex<5){pos1=html.indexOf("<!--@@@",pos1);
if(pos1==-1){break
}var pos2=html.indexOf("@@@-->",pos1);
if(pos2==-1){break
}var iconInfo=html.substring(pos1+7,pos2).split("#");
GeoPortalMap.streetViewIconsHash[iconIndex]=new google.maps.Marker({position:new google.maps.LatLng(iconInfo[1],iconInfo[0]),map:GeoPortalMap.streetViewPanorama,icon:new google.maps.MarkerImage("/images/map/5_"+iconInfo[2]+".png",null,null,null,new google.maps.Size(150,150)),title:iconInfo[3]});
GeoPortalMap.streetViewIconsUrlHash[iconIndex]=iconInfo[4];
if(iconIndex==1){google.maps.event.addListener(GeoPortalMap.streetViewIconsHash[iconIndex],"click",function(event){GeoPortalMap.clickStreetViewNextIcons(1)
})
}if(iconIndex==2){google.maps.event.addListener(GeoPortalMap.streetViewIconsHash[iconIndex],"click",function(event){GeoPortalMap.clickStreetViewNextIcons(2)
})
}if(iconIndex==3){google.maps.event.addListener(GeoPortalMap.streetViewIconsHash[iconIndex],"click",function(event){GeoPortalMap.clickStreetViewNextIcons(3)
})
}if(iconIndex==4){google.maps.event.addListener(GeoPortalMap.streetViewIconsHash[iconIndex],"click",function(event){GeoPortalMap.clickStreetViewNextIcons(4)
})
}iconIndex++;
pos1=pos2+7
}};
GeoPortalMap.clickStreetViewNextIcons=function(index){window.open(GeoPortalMap.streetViewIconsUrlHash[index],"_blank")
};
GeoPortalMap.getCoords4InputAddress=function(i,loc,street,inputFieldIdLoc,inputFieldIdStr){if(!loc){loc=""
}if(!street){street=""
}if(loc==goVars.txtFld["cityMap"]){loc=""
}if(street==goVars.txtFld["streetMap"]){street=""
}loc=loc.replace(/\s*\/\s*/g," ");
street=street.replace(/\s*\/\s*/g," ");
street=street.replace(/\+/g,"%2B");
var urlSuffix=encodeURIComponent(loc);
if(street!=""){urlSuffix=urlSuffix+"/"+encodeURIComponent(street)
}urlSuffix=urlSuffix+"/";
var results=goNav.splitLocalityDataFunc(loc);
var zcd=encodeURIComponent(results[0]);
loc=encodeURIComponent(results[1]);
street=encodeURIComponent(street);
var action=((street.length==0)?"locSearch":"streetSearch");
return $.ajax({async:false,url:"/IDA2?MIME=xml&PAGE=ajaxPos&ACTION="+action+"&ZCD="+zcd+"&LOC="+loc+"&STR="+street+"&locField="+inputFieldIdLoc+"&strField="+inputFieldIdStr,success:function(xml){var responseUrl=$(xml).find("url");
if(responseUrl!=undefined&&responseUrl[0]!=undefined&&responseUrl[0].firstChild!=undefined){var responseCoordX=responseCoordY=CoordX=CoordY=0;
responseCoordX=xml.getElementsByTagName("coordinateX");
if(responseCoordX!=undefined&&responseCoordX[0]!=undefined&&responseCoordX[0].firstChild!=undefined){CoordX=responseCoordX[0].firstChild.nodeValue
}responseCoordY=xml.getElementsByTagName("coordinateY");
if(responseCoordY!=undefined&&responseCoordY[0]!=undefined&&responseCoordY[0].firstChild!=undefined){CoordY=responseCoordY[0].firstChild.nodeValue
}if(0<=i&&i<3){GeoPortalMap.wayPoints[i]["X"]=CoordX;
GeoPortalMap.wayPoints[i]["Y"]=CoordY;
GeoPortalMap.wayPoints[i]["point"]=CoordY+","+CoordX
}else{if((CoordX!=0)&&(CoordY!=0)){queryStreet=xml.getElementsByTagName("street");
if(queryStreet!=undefined&&queryStreet[0]!=undefined&&queryStreet[0].firstChild!=undefined){GeoPortalMap.initNewPosition(CoordY,CoordX,17,urlSuffix)
}else{GeoPortalMap.initNewPosition(CoordY,CoordX,13,urlSuffix)
}if(GeoPortalMap.ivwOff4Map==0){goUtils.emitMessage("c1_geosearch")
}}else{urlSuffix=responseUrl[0].firstChild.nodeValue;
urlSuffix=encodeURI(urlSuffix);
goUrl.loadURL("/map/"+urlSuffix)
}return false
}return true
}else{var error=xml.getElementsByTagName("error");
var firstchild=error[0].firstChild;
var content=firstchild.nodeValue;
$(GeoPortalMap.routeErrorBox).empty();
$(GeoPortalMap.routeErrorBox).addClass("layerBox");
$(GeoPortalMap.routeErrorBox).html(content);
$(GeoPortalMap.routeErrorBox).css("visibility","visible");
$(GeoPortalMap.routeErrorBox).show();
var field=null;
if((content.indexOf("Ort nicht gefunden")!=-1)||(content.indexOf("Kein Ort eingegeben")!=-1)){field="where_map";
if(0<=i&&i<3){field=GeoPortalMap.wayPoints[i]["locId"]
}}if(content.indexOf("Straße nicht gefunden")!=-1){field="street_map";
if(0<=i&&i<3){field=GeoPortalMap.wayPoints[i]["strId"]
}}if(field!=null){if(document.getElementById(field)){$("#"+field).addClass("notFound");
$("#"+field).focus()
}}return false
}}})
};
GeoPortalMap.getCoords4Address=function(){var loc=$("#where_map").attr("value");
var street=$("#street_map").attr("value");
$("#where_map").removeClass("notFound");
$("#street_map").removeClass("notFound");
GeoPortalMap.getCoords4InputAddress(-1,loc,street,"where_map","street_map");
return false
};
GeoPortalMap.routeAddVia=function(){$("#formueber_where").show();
$("#formueber_street").show();
$("#formAddUeber").hide();
GeoPortalMap.wayPoints[2]["status"]="on";
new InputDefault(".panel input[id^='ueber_']")
};
GeoPortalMap.getInputValueWithoutDefault=function(fieldId){var value=$("#"+fieldId).attr("value");
if(!value){value=""
}var inputtype=$("#"+fieldId).attr("inputtype");
if(value==goVars.txtFld[inputtype]){value=""
}return value
};
GeoPortalMap.checkWayPoints=function(){for(i=0;
i<GeoPortalMap.wayPoints.length;
i++){$("#"+GeoPortalMap.wayPoints[i]["locId"]).removeClass("notFound");
$("#"+GeoPortalMap.wayPoints[i]["strId"]).removeClass("notFound")
}for(i=0;
i<GeoPortalMap.wayPoints.length;
i++){if(GeoPortalMap.wayPoints[i]["status"]!="off"){var loc=GeoPortalMap.getInputValueWithoutDefault(GeoPortalMap.wayPoints[i]["locId"]);
var str=GeoPortalMap.getInputValueWithoutDefault(GeoPortalMap.wayPoints[i]["strId"]);
if(!GeoPortalMap.getCoords4InputAddress(i,loc,str,GeoPortalMap.wayPoints[i]["locId"],GeoPortalMap.wayPoints[i]["strId"])){return false
}}}return true
};
GeoPortalMap.calculateRoute=function(){GeoPortalMap.clearRoute();
if(GeoPortalMap.checkWayPoints()!=true){return
}GeoPortalMap.routeOption=$("#routeOption").val();
if(GeoPortalMap.routeOption=="DB"){getRoute2EntryWithDB();
return
}document.getElementById("routeInfoContent").firstChild.nodeValue="Route wird berechnet ...";
var travelMode=google.maps.DirectionsTravelMode.DRIVING;
if(GeoPortalMap.routeOption=="fuss"){travelMode=google.maps.DirectionsTravelMode.WALKING
}var avoidHighways=false;
if(GeoPortalMap.routeOption=="nbab"){avoidHighways=true
}var waypoints=[];
if(GeoPortalMap.wayPoints[2]["point"]){waypoints.push({location:GeoPortalMap.wayPoints[2]["point"]})
}var request={avoidHighways:avoidHighways,origin:GeoPortalMap.wayPoints[0]["point"],destination:GeoPortalMap.wayPoints[1]["point"],waypoints:waypoints,travelMode:travelMode};
var directionsService=new google.maps.DirectionsService();
directionsService.route(request,function(response,status){GeoPortalMap.routeStatus=status;
if(status==google.maps.DirectionsStatus.OK){GeoPortalMap.route.setDirections(response);
document.getElementById("routeInfoContent").firstChild.nodeValue="";
$(".getRoute .container").hide();
$(".showGetRoute").show();
$(".getRoute").addClass("off");
if(GeoPortalMap.routeErrorBox=="#unlocatedDetail"){addPrintOptionRoutenplaner()
}}else{document.getElementById("routeInfoContent").firstChild.nodeValue="Fehler:"+status
}})
};
GeoPortalMap.clearRoute=function(){for(i=0;
i<GeoPortalMap.wayPoints.length;
i++){GeoPortalMap.wayPoints[i]["point"]=null;
GeoPortalMap.wayPoints[i]["X"]=0;
GeoPortalMap.wayPoints[i]["Y"]=0
}GeoPortalMap.routeOption=null;
GeoPortalMap.routeStatus=null
};
GeoPortalMap.isRouteActive=function(){return(GeoPortalMap.wayPoints[0]["point"]!=null&&GeoPortalMap.wayPoints[1]["point"]!=null)
};
GeoPortalMap.drawGPSiesTrack=function(fileId){if(fileId&&fileId!=""&&fileId.length>1){var options={map:GeoPortalMap.map,preserveViewport:true};
GeoPortalMap.GPSiesStrecke=new google.maps.KmlLayer("http://www.gpsies.com/files/kmz/"+fileId.substr(0,1)+"/"+fileId+".kmz",options)
}};
GeoPortalMap.removeGPSiesTrack=function(){if(GeoPortalMap.GPSiesStrecke!=null){GeoPortalMap.GPSiesStrecke.setMap(null);
GeoPortalMap.GPSiesStrecke=null
}};
GeoPortalMap.swapHinHer=function(idDisable,idEnable,idHidden,idText,text){var value=$("#"+idText).val();
$("#"+idEnable).removeClass("noLink");
$("#"+idDisable).addClass("noLink");
if(value==""||value=="Startadresse"||value=="Zieladresse"){$("#"+idText).val(text).addClass("default");
$("#"+idHidden).focus()
}document.getElementById(idHidden).setAttribute("name",document.getElementById(idText).getAttribute("name"));
document.getElementById(idText).setAttribute("name",text.substr(0,1))
};
GeoPortalMap.deletetextDBfield=function(idField){var value=$("#"+idField).val();
if(value=="Startadresse"){$("#"+idField).val("")
}else{if(value=="Zieladresse"){$("#"+idField).val("")
}}$("#"+idField).removeClass("default")
};
GeoPortalMap.writetextDBfield=function(idField){var name=$("#"+idField).attr("name");
var value=$("#"+idField).val();
if(name=="S"&&value==""){$("#"+idField).val("Startadresse");
$("#"+idField).addClass("default")
}else{if(name=="Z"&&value==""){$("#"+idField).val("Zieladresse");
$("#"+idField).addClass("default")
}}};
GeoPortalMap.submitDBfromToolTip=function(id){var urlBase="http://www.bahn.de/bin/bopstarter.pl";
var argsFix="?scope=auskunft&et_cid=968&et_lid=490115&partner=999904_282013&searchMode=ADVANCED&dbkanal_004=L01_S01_D001_KPK0008_reiseauskunft_LZ03";
var nameHidden=$("form input#"+id+"HD").attr("name");
var valueHidden=$("form input#"+id+"HD").attr("value");
var nameInput=$("form input#"+id+"LB").attr("name");
var valueInput=$("form input#"+id+"LB").attr("value");
if(nameInput=="S"&&(valueInput=="Startadresse"||valueInput.trim()=="")){alert("Bitte Startadresse eingeben");
return false
}if(nameInput=="Z"&&(valueInput=="Zieladresse"||valueInput.trim()=="")){alert("Bitte Zieladresse eingeben");
return false
}var url=urlBase+argsFix+"&"+nameHidden+"="+encodeURIComponent(valueHidden)+"&"+nameInput+"="+encodeURIComponent(valueInput);
window.open(url,"_blank");
return false
};
GeoPortalMap.initRoute=function(textA,textB,fieldIdPrefix){var oFeldA=$("#"+fieldIdPrefix+"_where");
var oFeldB=$("#"+fieldIdPrefix+"_street");
oFeldA.attr("value",textA);
oFeldB.attr("value",textB);
if(oFeldA.attr("value").length>0){oFeldA.removeClass("default")
}if(oFeldB.attr("value").length>0){oFeldB.removeClass("default")
}routePlanOpener()
};
GeoPortalMap.element2LocOrStr=function(fieldId,text){$("#"+fieldId).attr("value",text);
goUtils.hideElement("geoPortalNav");
if(fieldId=="street_map"){GeoPortalMap.getCoords4Address()
}};
GeoPortalMap.initPrintView=function(){printMap.initPrintView("bigmap","geoPortalMap","routeInfoContent")
};
GeoPortalMap.orderPrint=function(){goUtils.emitMessage("c1_map_print");
GeoPortalMap.misTracking("geoSearch","Print");
goPrint.openPrintWindow("bigmap","/IDA2?addr="+GeoPortalMap.lon+","+GeoPortalMap.lat+"&z="+GeoPortalMap.z);
return false
};
GeoPortalMap.sendMail=function(){var urlHash=GeoPortalMap.createPrettyUrl();
goUtils.emitMessage("map_sendmail");
GeoPortalMap.misTracking("geoSearch","Email form");
goUtils.win.openDefault("/MailformGeoPortal.jsp?url="+encodeURIComponent(urlHash["url"]),565,650);
return false
};
GeoPortalMap.createPrettyUrl=function(){var curMT="Hybrid";
if(GeoPortalMap.map.getMapTypeId()==google.maps.MapTypeId.HYBRID){curMT="Hybrid"
}if(GeoPortalMap.map.getMapTypeId()==google.maps.MapTypeId.ROADMAP){curMT="Map"
}if(GeoPortalMap.map.getMapTypeId()==google.maps.MapTypeId.SATELLITE){curMT="Satellite"
}if(GeoPortalMap.map.getMapTypeId()==google.maps.MapTypeId.TERRAIN){curMT="Terrain"
}var curCenter=GeoPortalMap.map.getCenter();
var curLon=curCenter.lng().toString();
var curLat=curCenter.lat().toString();
var curZoom=GeoPortalMap.map.getZoom();
var url="";
var newParams=new Array();
var diff=(18-curZoom)*(18-curZoom)*0.00065+0.00065;
if(curLat.indexOf(".")+7<curLat.length){curLat=curLat.substring(0,curLat.indexOf(".")+6)
}if(curLon.indexOf(".")+7<curLon.length){curLon=curLon.substring(0,curLon.indexOf(".")+6)
}if(GeoPortalMap.mapUrl4Bookmark!=null&&Math.abs(curLon-GeoPortalMap.lon)<diff&&Math.abs(curLat-GeoPortalMap.lat)<diff){url=GeoPortalMap.mapUrl4Bookmark;
if(curZoom!=GeoPortalMap.mapZoom4Bookmark){newParams.push("z="+curZoom);
url=url.replace(/z\=[^\&]+\&?/,"")
}newParams.push("mt="+curMT);
url=url.replace(/mt\=[^\&]+\&?/,"");
url=url.replace(/\?\s*$/,"");
url=url.replace(/\&\s*$/,"");
for(var i=0;
i<newParams.length;
i=i+1){if(i>0||url.match(/\?\S/)){url=url+"&"+newParams[i]
}else{url=url+"?"+newParams[i]
}}}else{url=(window.location.href.match(/^(.*?\/map)(\W|$)/))?RegExp.$1:"http://www.goyellow.de/map/";
url=url+"/?lon="+curLon+"&lat="+curLat+"&z="+curZoom+"&mt="+curMT
}returnHash={};
returnHash["url"]=url;
returnHash["lat"]=curLat;
returnHash["lon"]=curLon;
return returnHash
};
GeoPortalMap.favorite={init:function(){goUtils.emitMessage("c1_map_bmark");
GeoPortalMap.misTracking("geoSearch","Lesezeichen");
GeoPortalMap.favorite.setValues();
GeoPortalMap.favorite.setDisplays();
GeoPortalMap.favorite.handleSelectables()
},setDisplays:function(){if($.browser.msie){$(".ie","#helpBox.bookmark").show()
}},handleSelectables:function(){$(".selectable","#helpBox.bookmark").click(function(){$(this).select()
})
},setValues:function(){var urlHash=GeoPortalMap.createPrettyUrl();
GeoPortalMap.favorite.url=urlHash["url"];
var anchorLink="<a href='"+urlHash["url"]+"' title='Standort auf der GoYellow-Luftbildkarte anzeigen'>Standort auf der GoYellow-Luftbildkarte anzeigen</a>";
$("#inputBMLink").val(urlHash["url"]);
$("#inputBMAnchorLink").val(anchorLink);
$("#inputBMLatLink").val(urlHash["lat"]);
$("#inputBMLonLink").val(urlHash["lon"])
},create:function(){var title="Telefonbuch - Auskunft - Telefonnummer - Branchenbuch - Kartensuche  GoYellow.de";
if(window.opera&&window.print){var mbm=document.createElement("a");
mbm.setAttribute("rel","sidebar");
mbm.setAttribute("href",GeoPortalMap.favorite.url);
mbm.setAttribute("title",title);
mbm.click()
}else{if(document.all){window.external.AddFavorite(GeoPortalMap.favorite.url,title)
}else{goUtils.help.show("noBookmark",{className:"geoPortalUsage"},"Fehler")
}}return false
}};
function Hash(){this.length=0;
this.items=new Array();
this.removeItem=function(in_key){var tmp_value;
if(typeof(this.items[in_key])!="undefined"){this.length--;
var tmp_value=this.items[in_key];
delete this.items[in_key]
}return tmp_value
};
this.getItem=function(in_key){var test=this.items["test"];
return this.items[in_key]
};
this.setItem=function(in_key,in_value){if(typeof(in_value)!="undefined"){if(typeof(this.items[in_key])=="undefined"){this.items[in_key]=new Array();
this.length++
}this.items[in_key][this.items[in_key].length]=in_value
}return in_value
};
this.hasItem=function(in_key){return typeof(this.items[in_key])!="undefined"
}
}function TreeViewCtrl(){var self=this;
var arTreeV=null;
var autoActivation=new Hash();
var statLayers=new Hash();
var allFeeds=new Hash();
var enabledFeeds={};
var usrActionFlag=0;
var spezLyrs=0;
var layers="";
var spezLayers="";
var treeV=new Bs_Tree();
var lastChild=0;
var lastLayerAction=1;
var refreshDisabled=0;
enabledFeeds["0"]=0;
treeV=new Bs_Tree();
treeV.useCheckboxSystem=true;
treeV.checkboxSystemWalkTree=3;
treeV.checkboxSystemIfPartlyThenFull=false;
treeV.useFolderIcon=true;
treeV.captionBgColor="";
treeV.useAutoSequence=false;
treeV.imageDir="/js/tree/img/";
treeV.imageHeight=16;
treeV.checkboxSystemImgDir="/js/tree/img/";
treeV.walkTree=false;
this.getTreeArray=function(treeViewLayers){var ta=new Array;
var idParentSequence=5000;
var idChildSequence=10000;
for(var i=0;
i<=(treeViewLayers.length-1);
i++){ta[i]=new Array;
ta[i]["id"]=idParentSequence+1;
ta[i]["caption"]=treeViewLayers[i].title;
ta[i]["icon"]=treeViewLayers[i].icon;
ta[i]["dataContainer"]=new Array;
ta[i]["dataContainer"]["feeds"]=treeViewLayers[i].id;
ta[i]["dataContainer"]["minZ"]=treeViewLayers[i].minZ;
ta[i]["dataContainer"]["maxZ"]=treeViewLayers[i].maxZ;
ta[i]["dataContainer"]["auto"]=treeViewLayers[i].auto;
autoActivation.setItem(treeViewLayers[i].auto,idParentSequence+1);
var feedIds=treeViewLayers[i].id.split("!,");
for(var m=0;
m<=(feedIds.length-1);
m++){allFeeds.setItem(feedIds[m],idParentSequence+1)
}idParentSequence++;
if(typeof treeViewLayers[i].sublayers!="undefined"){ta[i]["children"]=new Array;
for(var j=0;
j<=(treeViewLayers[i].sublayers.length-1);
j++){ta[i]["children"][j]=new Array;
ta[i]["children"][j]["id"]=idChildSequence+1;
ta[i]["children"][j]["caption"]=treeViewLayers[i].sublayers[j].title;
ta[i]["children"][j]["icon"]=treeViewLayers[i].sublayers[j].icon;
ta[i]["children"][j]["dataContainer"]=new Array;
ta[i]["children"][j]["dataContainer"]["feeds"]=treeViewLayers[i].sublayers[j].id;
ta[i]["children"][j]["dataContainer"]["minZ"]=treeViewLayers[i].sublayers[j].minZ;
ta[i]["children"][j]["dataContainer"]["maxZ"]=treeViewLayers[i].sublayers[j].maxZ;
ta[i]["children"][j]["dataContainer"]["auto"]=treeViewLayers[i].sublayers[j].auto;
autoActivation.setItem(treeViewLayers[i].sublayers[j].auto,idChildSequence+1);
var feedIds=treeViewLayers[i].sublayers[j].id.split("!,");
for(var n=0;
n<=(feedIds.length-1);
n++){allFeeds.setItem(feedIds[n],idChildSequence+1)
}idChildSequence++
}}}return ta
};
this.setEvents=function(treeArray){for(var i=0;
i<=(treeArray.length-1);
i++){treeArray[i]["onClickCaption"]=self.clickOnNode;
treeArray[i]["onChangeCheckbox"]=self.checkboxChanged;
if(typeof treeArray[i]["children"]!="undefined"){for(var j=0;
j<=(treeArray[i]["children"].length-1);
j++){treeArray[i]["children"][j]["onChangeCheckbox"]=self.checkboxChanged;
treeArray[i]["children"][j]["onClickCaption"]=self.clickOnNode
}}}};
this.setSpecifiedLayers=function(spezLrs){spezLayers=spezLrs
};
this.controlStaticLayers=function(oldLevel,newLevel){var counter=0;
if(oldLevel<newLevel){for(var k=oldLevel+1;
k<=newLevel;
k++){var feeds=statLayers.getItem(k);
if(typeof(feeds)!="undefined"){for(var i=0;
i<=(feeds.length-1);
i++){GeoPortalMap.misTracking("geoSearchAuto","layerOn"+feeds[i]);
var feedIds=feeds[i].split("!,");
for(var j=0;
j<=(feedIds.length-1);
j++){enabledFeeds[feedIds[j]]=feedIds[j];
counter++
}}}}}else{for(var k=oldLevel;
k>newLevel;
k--){var feeds=statLayers.getItem(k);
if(typeof(feeds)!="undefined"){for(var i=0;
i<=(feeds.length-1);
i++){var feedIds=feeds[i].split("!,");
for(var j=0;
j<=(feedIds.length-1);
j++){delete enabledFeeds[feedIds[j]];
counter++
}}}}}if(counter!=0){GeoPortalMap.handleLayerChange(enabledFeeds,true)
}};
this.updateParentBox=function(treeElement){var offPresent=0;
var onPresent=0;
if(treeElement.caption=="root"){return
}for(var i=0;
i<=(treeElement._children.length-1);
i++){if(treeElement._children[i].isChecked==0){offPresent=1
}if(treeElement._children[i].isChecked==2){onPresent=1
}}if((offPresent==1)&&(onPresent==1)){treeElement.setCheckboxValue(1,false,false)
}else{if(offPresent==1){treeElement.setCheckboxValue(0,false,false)
}else{if(onPresent==1){treeElement.setCheckboxValue(2,false,false)
}}}};
this.activateSpecifiedLayers=function(spezLayers){spezLyrs=1;
spezLayers=spezLayers.replace(/!,/g,",");
spezLayers=spezLayers.replace(/ /g,"+");
var lyrs=spezLayers.split(",");
var lastFeed="";
var counter=0;
refreshDisabled=1;
for(var i=0;
i<lyrs.length;
i=i+1){var key=lyrs[i];
var feed=allFeeds.getItem(key);
if(typeof(feed)!="undefined"){if(feed[0]!=lastFeed[0]){var treeElement=treeV.getElement(feed);
treeV.elementOpenWalkUp(treeElement.id);
if(treeElement._children.length==0){treeElement.setCheckboxValue(2,true,false);
counter++;
treeView.updateParentBox(treeElement.parent)
}}lastFeed=feed
}}refreshDisabled=0;
spezLyrs=0;
if(counter!=0){GeoPortalMap.handleLayerChange(enabledFeeds,true)
}};
this.autoLayerCtrl=function(oldLevel,newLevel){var counter=0;
refreshDisabled=1;
if(oldLevel<newLevel){for(var k=oldLevel+1;
k<=newLevel;
k++){var elementIds=autoActivation.getItem(k);
if(typeof(elementIds)!="undefined"){for(var i=0;
i<=(elementIds.length-1);
i++){var treeElement=treeV.getElement(elementIds[i]);
if(treeElement.isChecked!=2){treeV.elementOpenWalkUp(treeElement.id);
GeoPortalMap.misTracking("geoSearchAuto","layerOn"+treeElement.dataContainer.feeds);
if(treeElement._children.length==0){treeElement.setCheckboxValue(2,false,false);
var feedIds=treeElement.dataContainer.feeds.split("!,");
for(var j=0;
j<=(feedIds.length-1);
j++){enabledFeeds[feedIds[j]]=feedIds[j];
counter++
}treeView.updateParentBox(treeElement.parent)
}}}}}}else{for(var k=oldLevel;
k>newLevel;
k--){var elementIds=autoActivation.getItem(k);
if(typeof(elementIds)!="undefined"){for(var i=0;
i<=(elementIds.length-1);
i++){var treeElement=treeV.getElement(elementIds[i]);
if(treeElement.isChecked!=0){treeV.elementCloseWalkDown(treeElement.id);
if(treeElement._children.length==0){treeElement.setCheckboxValue(0,false,false);
var feedIds=treeElement.dataContainer.feeds.split("!,");
for(var j=0;
j<=(feedIds.length-1);
j++){delete enabledFeeds[feedIds[j]];
counter++
}treeView.updateParentBox(treeElement.parent)
}}}}}}refreshDisabled=0;
if(counter!=0){GeoPortalMap.handleLayerChange(enabledFeeds,true)
}};
this.checkboxChanged=function(treeElement,usrAction){usrActionFlag=1;
var feedIds=treeElement.dataContainer.feeds.split("!,");
if(treeElement.isChecked==2){lastLayerAction=2;
if(treeElement._children.length==0){for(var i=0;
i<=(feedIds.length-1);
i++){enabledFeeds[feedIds[i]]=feedIds[i]
}}}else{if(treeElement.isChecked==0){lastLayerAction=0;
if(treeElement._children.length==0){for(var i=0;
i<=(feedIds.length-1);
i++){delete enabledFeeds[feedIds[i]]
}}}else{return
}}if(refreshDisabled==1){return
}if(treeElement._children.length>0){return
}if((lastChild==0)||(treeElement.id==lastChild)){if(lastLayerAction==2){goUtils.emitMessage("c1_map_laon")
}if(lastLayerAction==0){goUtils.emitMessage("c1_map_loff")
}lastLayerAction=1;
lastChild=0;
GeoPortalMap.handleLayerChange(enabledFeeds,true)
}};
this.clickOnNode=function(treeElement){if(treeElement.isChecked==0){GeoPortalMap.misTracking("geoSearchAuto","layerOn"+treeElement.dataContainer.feeds)
}if(treeElement._children.length==0){lastChild=0;
if(treeElement.isChecked!=2){treeElement.setCheckboxValue(2,true,true)
}else{treeElement.setCheckboxValue(0,true,true)
}}else{var i=treeElement._children.length-1;
if(treeElement.isChecked==1){while((i>0)&&(treeElement._children[i].isChecked==0)){i--
}}lastChild=treeElement._children[i].id;
if(treeElement.isOpen){treeV.elementCloseWalkDown(treeElement.id);
if(treeElement.isChecked==0){treeV.elementOpenWalkUp(treeElement.id);
treeElement.setCheckboxValue(2,false,true)
}else{treeElement.setCheckboxValue(0,false,true)
}}else{treeV.elementOpenWalkUp(treeElement.id);
if(treeElement.isChecked==0){treeElement.setCheckboxValue(2,false,true)
}else{treeElement.setCheckboxValue(0,false,true)
}}}};
this.clickOnCheckBox=function(treeElement){if(treeElement.isChecked==0){GeoPortalMap.misTracking("geoSearch","layerOn"+treeElement.dataContainer.feeds)
}if(treeElement._children.length==0){lastChild=0
}else{var i=treeElement._children.length-1;
if(treeElement.isChecked==1){while((i>0)&&(treeElement._children[i].isChecked==0)){i--
}}lastChild=treeElement._children[i].id
}};
this.activateLyrsByZoom=function(oldLevel,newLevel){if(statLayers!=undefined){this.controlStaticLayers(oldLevel,newLevel)
}if(usrActionFlag==0){this.autoLayerCtrl(oldLevel,newLevel)
}};
this.activateLyrs=function(oldLevel,newLevel){if(spezLayers!=""){usrActionFlag=1;
this.activateSpecifiedLayers(spezLayers)
}this.activateLyrsByZoom(oldLevel,newLevel)
};
this.getEnabledLyrs=function(){return enabledFeeds
};
this.init=function(){layers=availableLayersGY;
if(staticLayersGY!=undefined){for(var i=0;
i<=(staticLayersGY.length-1);
i++){statLayers.setItem(staticLayersGY[i].minZ,staticLayersGY[i].id)
}}arTreeV=this.getTreeArray(layers);
this.setEvents(arTreeV);
treeV.initByArray(arTreeV);
treeV.drawInto("treeDiv")
}
}var treeView=new TreeViewCtrl();
var printMap={mapState:null,routeState:null,callback:null};
printMap.initPrintView=function(name,mapDivId,directionDivId,callback){printMap.ivwOff4Map=1;
GeoPortalMap.fillMapTypeHash();
printMap.callback=(callback)?callback:null;
printMap.restoreState4PrintWindow();
mapOptions={mapTypeControl:false,panControl:false,zoomControl:false,scaleControl:false,streetViewControl:false,disableDoubleClickZoom:true,draggable:false,keyboardShortcuts:false,scrollwheel:false};
var map=new google.maps.Map(document.getElementById(mapDivId),mapOptions);
if(this.mapState.curLyrs&&this.mapState.curLyrs.length>0){var treeIconLayerOptions={getTileUrl:function(coord,zoom){return"http://"+goVars.txtFld["apachePngOsaIp"]+"/osa?png=1&x="+coord.x+"&y="+coord.y+"&z="+zoom+"&service=map"+printMap.mapState.curLyrs
},tileSize:new google.maps.Size(256,256),isPng:true};
var treeIconLayerMapType=new google.maps.ImageMapType(treeIconLayerOptions);
map.overlayMapTypes.insertAt(0,treeIconLayerMapType)
}var mt=GeoPortalMap.mapTypeHash[this.mapState.curMT];
map.setMapTypeId(mt);
map.setCenter(this.mapState.curCenter);
map.setZoom(this.mapState.curZoom);
if(this.mapState.coordCircle.length>1){var latlon=this.mapState.coordCircle.split(",");
this.drawRedCircle(map,latlon[0],latlon[1])
}var route=new google.maps.DirectionsRenderer();
route.setMap(map);
route.setPanel(document.getElementById("routeInfoContent"));
var travelMode=google.maps.DirectionsTravelMode.DRIVING;
if(this.routeState.routeOption=="fuss"){travelMode=google.maps.DirectionsTravelMode.WALKING
}var avoidHighways=false;
if(this.routeState.routeOption=="nbab"){avoidHighways=true
}var waypoints=[];
if(this.routeState.waypoints[2]&&this.routeState.waypoints[2]["point"]){waypoints.push({location:this.routeState.wayPoints[2]["point"]})
}var request={avoidHighways:avoidHighways,origin:this.routeState.waypoints[0]["point"],destination:this.routeState.waypoints[1]["point"],waypoints:waypoints,travelMode:travelMode};
var directionsService=new google.maps.DirectionsService();
directionsService.route(request,function(response,status){if(status==google.maps.DirectionsStatus.OK){route.setDirections(response)
}else{document.getElementById("routeInfoContent").firstChild.nodeValue="Fehler:"+status
}})
};
printMap.callbackWithDelay=function(){var timeout=500;
if(isMinFF3_5){timeout=1000
}if(printMap.callback){window.setTimeout("printMap.callback();",timeout)
}};
printMap.drawRedCircle=function(map,lat,lon){var circleOverlay=new google.maps.Marker({position:new google.maps.LatLng(lat,lon),map:map,icon:new google.maps.MarkerImage("/images/de/map/common/target_area.png",null,null,new google.maps.Point(35,35)),clickable:false})
};
printMap.saveState4PrintWindow=function(map,curLyrs,coordCircle,route,waypoints,routeOption){var curMT="Hybrid";
if(map.getMapTypeId()==google.maps.MapTypeId.HYBRID){curMT="Hybrid"
}if(map.getMapTypeId()==google.maps.MapTypeId.ROADMAP){curMT="Map"
}if(map.getMapTypeId()==google.maps.MapTypeId.SATELLITE){curMT="Satellite"
}if(map.getMapTypeId()==google.maps.MapTypeId.TERRAIN){curMT="Terrain"
}var curCenter=map.getCenter();
var curLon=curCenter.lng().toString();
var curLat=curCenter.lat().toString();
var curZoom=map.getZoom();
var mapState=routeState=0;
if(GeoPortalMap.routeStatus==google.maps.DirectionsStatus.OK){routeState=new RouteState("route state",waypoints,GeoPortalMap.routeOption);
routeState.save2Cookie();
this.routeState=routeState;
mapState=new MapState("map state with route",curMT,null,curCenter,curLon,curLat,waypoints[0]["loc"],waypoints[0]["str"],curZoom,curLyrs,coordCircle,true)
}else{mapState=new MapState("map state",curMT,null,curCenter,curLon,curLat,waypoints[0]["loc"],waypoints[0]["str"],curZoom,curLyrs,coordCircle,false)
}mapState.save2Cookie();
this.mapState=mapState
};
printMap.restoreState4PrintWindow=function(){var routeState=null;
var mapState=(new MapState("unknown")).parseCookie();
if(mapState.routeActive==true){routeState=(new RouteState("unknown")).parseCookie()
}this.mapState=mapState;
this.routeState=routeState
};
printMap.deleteState4PrintWindow=function(){Cookie4Print.deleteStateCookies()
};
printMap.preparePrintView=function(map,curLyrs,route,waypoints,routeOption){printMap.saveState4PrintWindow(map,curLyrs,route,waypoints,routeOption)
};
printMap.displayAddr4homepage=function(){var waypoints=this.routeState.waypoints;
for(i=0;
i<waypoints.length;
i++){var divI=$("#"+waypoints[i].title);
if(divI){if(waypoints[i].title=="from"){divI.html("Von: "+waypoints[i].addr)
}if(waypoints[i].title=="to"){divI.html("Nach: "+waypoints[i].addr)
}}}};
printMap.url4OpenPrintWindow=function(url,waypointsWithAddr){printMap.generateUrlHash(url);
url=url.replace(/\?.*$/,"?");
printMap.urlHash["w"]="655";
printMap.urlHash["h"]="655";
var urlParam=printMap.composeUrlFromHash(url);
var lon=(printMap.urlHash["addr"].match(/^\s*([\d\.]+)\,/))?RegExp.$1:"10.5";
var lat=(printMap.urlHash["addr"].match(/\s*\,([\d\.]+)$/))?RegExp.$1:"51.7";
var z=printMap.urlHash["z"];
var curLon=GeoPortalMap.lon;
var curLat=GeoPortalMap.lat;
var diff=(18-z)*(18-z)*0.00065+0.00065;
var locInfoParams="";
if(Math.abs(lon-curLon)<diff&&Math.abs(lat-curLat)<diff){var addr;
if(printMap.mapState.routeActive){addr=printMap.addr.init(waypointsWithAddr[0]["locId"],waypointsWithAddr[0]["strId"],waypointsWithAddr[1]["locId"],waypointsWithAddr[1]["strId"],waypointsWithAddr[2]["locId"],waypointsWithAddr[2]["strId"])
}else{addr=printMap.addr.init("where_map","street_map")
}locInfoParams=addr.createUrlParams()
}var request="/IDA2?ACTION=printMap&MIME=html&"+locInfoParams;
return request
};
printMap.addr={init:function(loc1Id,str1Id,loc2Id,str2Id,loc3Id,str3Id){this.loc1Id=loc1Id;
this.str1Id=str1Id;
this.loc2Id=loc2Id;
this.str2Id=str2Id;
this.loc3Id=loc3Id;
this.str3Id=str3Id;
this.loc1=this.getAttr(loc1Id);
this.str1=this.getAttr(str1Id);
this.loc2=this.getAttr(loc2Id);
this.str2=this.getAttr(str2Id);
this.loc3=this.getAttr(loc3Id);
this.str3=this.getAttr(str3Id);
return this
},getAttr:function(id){return getInputValueWithId(id)
},isRoute:function(){if(this.loc1.length>0&&this.loc2.length>0){return true
}return false
},createUrlParams:function(){var locInfoParams="&LOC="+encodeURIComponent(this.loc1)+"&STR="+encodeURIComponent(this.str1);
if(this.isRoute()){locInfoParams=locInfoParams+"&LOC2="+encodeURIComponent(this.loc2);
locInfoParams=locInfoParams+"&STR2="+encodeURIComponent(this.str2);
if(this.loc3&&this.loc3.length>0){locInfoParams=locInfoParams+"&LOC3="+encodeURIComponent(this.loc3);
locInfoParams=locInfoParams+"&STR3="+encodeURIComponent(this.str3)
}}return locInfoParams
},toString:function(){var val=this.loc1Id+"="+this.loc1+",";
val=val+this.str1Id+"="+this.str1+",";
val=val+this.loc2Id+"="+this.loc2+",";
val=val+this.str2Id+"="+this.str2+",";
val=val+this.loc3Id+"="+this.loc3+",";
val=val+this.str3Id+"="+this.str3;
return val
}};
printMap.generateUrlHash=function(urlRaw){printMap.urlHash={};
printMap.urlOrder=new Array();
paramString=urlRaw.replace(/^.*?\?/,"");
var inParams=paramString.split("&");
var reg=/^([^=]+)\=(.*)$/;
for(var i=0;
i<inParams.length;
i=i+1){var result=reg.exec(inParams[i]);
if(result!=null&&result.length>2&&result[1]!=""){printMap.urlHash[result[1]]=result[2];
printMap.urlOrder.push(result[1])
}}return false
};
printMap.composeUrlFromHash=function(url){var key="";
for(var i=0;
i<printMap.urlOrder.length;
i=i+1){key=printMap.urlOrder[i];
url=url+key+"="+printMap.urlHash[key]+"&"
}url=url.replace(/\&$/,"");
url=encodeURIComponent(url);
url=url.replace(/\+/g,"%2B");
url=url.replace(/\//g,"%2F");
url=encodeURIComponent(url);
return url
};
var Cookie4Print={name:"GY_DRUCK",name_r:"GY_DRUCK_ROUTE",days:"1",domain:"",path:"/",deleteStateCookies:function(){MapState.deleteCookie();
RouteState.deleteCookie()
}};
concat=function(s,seperator,forceSepator){var str=(s)?s:"";
var sep=(seperator)?seperator:"";
var retval=(str.isNotEmpty()||forceSepator==true)?sep:"";
retval=retval+str;
return retval
};
function MapState(name,curMT,curMTs,curCenter,curLon,curLat,curLoc,curStr,curZoom,curLyrs,coordCircle,routeActive){this.name=name;
this.curMT=((curMT&&curMT.length>0)?curMT:"Map");
this.curLon=((curLon&&curLon!=0)?curLon:10.5);
this.curLat=((curLat&&curLat!=0)?curLat:51.7);
this.curCenter=((curCenter)?curCenter:new google.maps.LatLng(this.curLat,this.curLon));
this.curLoc=(curLoc&&curLoc.isNotEmpty())?curLoc:"";
this.curStr=(curStr&&curStr.isNotEmpty())?curStr:"";
this.curAddr=this.curStr+((this.curStr.isEmpty())?"":", ")+this.curLoc;
this.curZoom=((curZoom&&curZoom>2&&curZoom<20)?curZoom:6);
this.curLyrs=curLyrs;
this.coordCircle=(coordCircle)?coordCircle:"";
this.routeActive=routeActive;
this.mapOptions=null
}MapState.prototype.toString=function(){var stateInfo=this.curLat+","+this.curLon+"|"+this.curAddr+"|"+this.curZoom+"|"+this.curMT+"|"+this.curLyrs+"|"+this.coordCircle;
if(this.routeActive==true){stateInfo=stateInfo+"|route=1"
}return stateInfo
};
MapState.prototype.save2Cookie=function(){var stateInfo=this.toString();
$.cookie(Cookie4Print.name,stateInfo,{expires:Cookie4Print.days,path:Cookie4Print.path})
};
MapState.prototype.parseCookie=function(){var stateInfo=$.cookie(Cookie4Print.name);
var lat=lon=addr=loc=str=zoom=mt=lyrs=routeActive=0;
if(!isUndefOrNull(stateInfo)&&stateInfo.isNotEmpty()){var stateHash=stateInfo.split("|");
latlon=stateHash[0].split(",");
lat=latlon[0];
lon=latlon[1];
addr=stateHash[1];
var addrSplitted=addr.split(", ");
if(addrSplitted.length==2){str=addrSplitted[0];
loc=addrSplitted[1]
}else{str="";
loc=addr
}zoom=parseInt(stateHash[2]);
mt=stateHash[3];
lyrs=stateHash[4];
coordCircle=stateHash[5];
var routeBerechnet=(stateHash[6])?stateHash[6].split("="):null;
if(routeBerechnet&&routeBerechnet[1]==1){routeActive=true
}}mapState=new MapState("map state from cookie",mt,null,null,lon,lat,loc,str,zoom,lyrs,coordCircle,routeActive);
return mapState
};
MapState.prototype.deleteCookie=function(){$.cookie(Cookie4Print.name,null,{path:Cookie4Print.path})
};
function RouteState(name,waypoints,routeOption){this.name=name,this.waypoints=waypoints;
this.routeOption=routeOption
}RouteState.prototype.toString=function(){var sep=":";
var routeInfo=this.routeOption+"|"+this.waypoints[0]["title"]+concat(this.waypoints[0]["point"],sep)+concat(this.waypoints[0]["addr"],sep)+"|"+this.waypoints[1]["title"]+concat(this.waypoints[1]["point"],sep)+concat(this.waypoints[1]["addr"],sep)+((this.waypoints[2]&&this.waypoints[2]["point"]&&this.waypoints[2]["point"].length>0)?("|"+this.waypoints[2]["title"]+concat(this.waypoints[2]["point"],sep)):"");
return routeInfo
};
RouteState.prototype.save2Cookie=function(){var routeInfo=this.toString();
$.cookie(Cookie4Print.name_r,routeInfo,{expires:Cookie4Print.days,path:Cookie4Print.path})
};
RouteState.prototype.parseCookie=function(){var routeInfo=$.cookie(Cookie4Print.name_r);
var routeHash=routeInfo.split("|");
var routeOption=routeHash[0];
var waypoints=new Array();
for(i=1;
i<routeHash.length;
i++){var tp=routeHash[i].split(":");
waypoints[i-1]={title:tp[0],"point":tp[1],addr:tp[2],status:"off"}
}routeState=new RouteState("route state from cookie",waypoints,routeOption);
return routeState
};
RouteState.prototype.deleteCookie=function(){$.cookie(Cookie4Print.name_r,null,{path:Cookie4Print.path})
};
