var R_MAPTYPE_CONTROL_BUTTON_WIDTH=102;var R_MAPTYPE_CONTROL_BUTTON_HEIGHT=29;var R_MAPTYPE_CONTROL_BUTTON_SPACE=1;var R_MAPTYPE_CONTROL_ACTIVE_COLOR="#87cc2d";var R_MAPTYPE_CONTROL_DEACTIVE_COLOR="white";function ReallyMapTypeControl(){}ReallyMapTypeControl.prototype=new GControl();ReallyMapTypeControl.prototype.buttonElements=[];ReallyMapTypeControl.prototype.initialize=function(B){mapTypes=B.getMapTypes();this.container=document.createElement("div");this.container.style.height="30px";for(var A=0;A<mapTypes.length;A++){this.addMapType_(mapTypes[A])}GEvent.addListener(B,"maptypechanged",GEvent.callback(this,function(){var D=B.getCurrentMapType();for(var C=0;C<this.buttonElements.length;C++){if(this.buttonElements[C].type==D){this.buttonElements[C].button.style.color=R_MAPTYPE_CONTROL_ACTIVE_COLOR;ReallyMapTypeControl.setBgImage_(this.buttonElements[C].button,"/user_data/css/images/gmap/img_btn_maptype.png")}else{this.buttonElements[C].button.style.color=R_MAPTYPE_CONTROL_DEACTIVE_COLOR;ReallyMapTypeControl.setBgImage_(this.buttonElements[C].button,"/user_data/css/images/gmap/img_btn_maptype.png")}}}));GEvent.addListener(B,"addmaptype",GEvent.callback(this,this.addMapType_));GEvent.addListener(B,"removemaptype",GEvent.callback(this,this.removeMapType_));B.getContainer().appendChild(this.container);return(this.container)};ReallyMapTypeControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_BOTTOM_RIGHT,new GSize(2,-4))};ReallyMapTypeControl.prototype.addMapType_=function(B){for(var A=0;A<this.buttonElements.length;A++){if(this.buttonElements[A].type==B){return }}var C=this.createButtonElement(B.getName());C.style.left=(this.buttonElements.length*(R_MAPTYPE_CONTROL_BUTTON_WIDTH+R_MAPTYPE_CONTROL_BUTTON_SPACE))+"px";this.buttonElements.push({type:B,button:C});this.container.style.width=(this.buttonElements.length*(R_MAPTYPE_CONTROL_BUTTON_WIDTH+R_MAPTYPE_CONTROL_BUTTON_SPACE))+"px";this.container.appendChild(C);GEvent.addDomListener(C,"click",GEvent.callbackArgs(this,function(D){map.setMapType(D)},B))};ReallyMapTypeControl.prototype.removeMapType_=function(B){for(var A=0;A<this.buttonElements.length;A++){if(this.buttonElements[A].type==B){GEvent.clearListeners(this.buttonElements[A].button,"click");this.container.removeChild(this.buttonElements[A].button);this.buttonElements.splice(A,1);this.container.style.width=(this.buttonElements.length*(R_MAPTYPE_CONTROL_BUTTON_WIDTH+R_MAPTYPE_CONTROL_BUTTON_SPACE))+"px";for(;A<this.buttonElements.length;A++){this.buttonElements[A].button.style.left=(A*(R_MAPTYPE_CONTROL_BUTTON_WIDTH+R_MAPTYPE_CONTROL_BUTTON_SPACE))+"px"}break}}};ReallyMapTypeControl.prototype.createButtonElement=function(C,B){var A=document.createElement("div");A.appendChild(document.createTextNode(C));A.style.width="102px";A.style.height="29px";if(B){A.style.color=R_MAPTYPE_CONTROL_ACTIVE_COLOR;ReallyMapTypeControl.setBgImage_(A,"/user_data/css/images/gmap/img_btn_maptype.png")}else{A.style.color=R_MAPTYPE_CONTROL_DEACTIVE_COLOR;ReallyMapTypeControl.setBgImage_(A,"/user_data/css/images/gmap/img_btn_maptype.png")}A.style.font="small Arial";A.style.margin="0px";A.style.lineHeight="25px";A.style.textAlign="center";A.style.verticalAlign="bottom";A.style.cursor="pointer";A.style.position="absolute";return(A)};ReallyMapTypeControl.setBgImage_=function(B,C){var A=navigator.appVersion;if(A.match("MSIE 6.0")||A.match("MSIE 5.")){B.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+C+"', sizingMethod='crop')"}else{B.style.background="url("+C+") no-repeat left top"}};var R_ZOOM_CONTROL_BUTTON_WIDTH=26;var R_ZOOM_CONTROL_BUTTON_HEIGHT=26;var R_ZOOM_CONTROL_BUTTON_SPACE=4;var R_ZOOM_CONTROL_SLIDER_SPACE=8;var R_ZOOM_CONTROL_SLIDER_WIDTH=26;var R_ZOOM_CONTROL_SLIDER_HEIGHT=120;var R_ZOOM_CONTROL_HANDLE_WIDTH=26;var R_ZOOM_CONTROL_HANDLE_HEIGHT=10;function ReallyZoomControl(){}ReallyZoomControl.prototype=new GControl();ReallyZoomControl.prototype.initialize=function(F){this.container=document.createElement("div");this.drag=null;var C=this.createButtonElement("img_btn_up.png",R_ZOOM_CONTROL_BUTTON_WIDTH+R_ZOOM_CONTROL_BUTTON_SPACE,0);this.container.appendChild(C);GEvent.addDomListener(C,"click",function(){F.panDirection(0,1)});var G=this.createButtonElement("img_btn_left.png",0,R_ZOOM_CONTROL_BUTTON_HEIGHT+R_ZOOM_CONTROL_BUTTON_SPACE);this.container.appendChild(G);GEvent.addDomListener(G,"click",function(){F.panDirection(1,0)});var H=this.createButtonElement("img_btn_center.png",R_ZOOM_CONTROL_BUTTON_WIDTH+R_ZOOM_CONTROL_BUTTON_SPACE,R_ZOOM_CONTROL_BUTTON_HEIGHT+R_ZOOM_CONTROL_BUTTON_SPACE);this.container.appendChild(H);GEvent.addDomListener(H,"click",function(){F.returnToSavedPosition()});var E=this.createButtonElement("img_btn_right.png",(R_ZOOM_CONTROL_BUTTON_WIDTH+R_ZOOM_CONTROL_BUTTON_SPACE)*2,R_ZOOM_CONTROL_BUTTON_HEIGHT+R_ZOOM_CONTROL_BUTTON_SPACE);this.container.appendChild(E);GEvent.addDomListener(E,"click",function(){F.panDirection(-1,0)});var B=this.createButtonElement("img_btn_down.png",R_ZOOM_CONTROL_BUTTON_WIDTH+R_ZOOM_CONTROL_BUTTON_SPACE,(R_ZOOM_CONTROL_BUTTON_HEIGHT+R_ZOOM_CONTROL_BUTTON_SPACE)*2);this.container.appendChild(B);GEvent.addDomListener(B,"click",function(){F.panDirection(0,-1)});var D=this.createButtonElement("img_btn_zoomin.png",R_ZOOM_CONTROL_BUTTON_WIDTH+R_ZOOM_CONTROL_BUTTON_SPACE,((R_ZOOM_CONTROL_BUTTON_HEIGHT+R_ZOOM_CONTROL_BUTTON_SPACE)*3)+R_ZOOM_CONTROL_SLIDER_SPACE);this.container.appendChild(D);GEvent.addDomListener(D,"click",function(){F.zoomIn()});var A=this.createButtonElement("img_btn_zoomout.png",R_ZOOM_CONTROL_BUTTON_WIDTH+R_ZOOM_CONTROL_BUTTON_SPACE,((R_ZOOM_CONTROL_BUTTON_HEIGHT+R_ZOOM_CONTROL_BUTTON_SPACE)*4)+R_ZOOM_CONTROL_SLIDER_SPACE);this.container.appendChild(A);GEvent.addDomListener(A,"click",function(){F.zoomOut()});F.getContainer().appendChild(this.container);return(this.container)};ReallyZoomControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(15,15))};ReallyZoomControl.prototype.createZoomElement_=function(C){var B=document.createElement("div");B.style.width=R_ZOOM_CONTROL_SLIDER_WIDTH+"px";B.style.height=R_ZOOM_CONTROL_SLIDER_HEIGHT+"px";B.style.left=R_ZOOM_CONTROL_BUTTON_WIDTH+R_ZOOM_CONTROL_BUTTON_SPACE+"px";B.style.top=((R_ZOOM_CONTROL_BUTTON_HEIGHT+R_ZOOM_CONTROL_BUTTON_SPACE)*4)+R_ZOOM_CONTROL_SLIDER_SPACE+"px";B.style.backgroundColor="white";B.style.cursor="pointer";B.style.position="relative";B.style.zIndex=10;var A=R_ZOOM_CONTROL_SLIDER_HEIGHT-R_ZOOM_CONTROL_HANDLE_HEIGHT;var D=document.createElement("div");D.style.width=R_ZOOM_CONTROL_HANDLE_WIDTH+"px";D.style.height=R_ZOOM_CONTROL_HANDLE_HEIGHT+"px";D.style.position="absolute";D.style.backgroundColor="red";D.style.zIndex=1000;D.style.top=(A-((A*C.getZoom())/17))+"px";GEvent.addListener(C,"zoomend",GEvent.callback(D,function(F,E){GLog.write("New zoom level "+E);this.style.top=(A-((A*E)/17))+"px"}));GEvent.addDomListener(D,"mousedown",GEvent.callback(this,function(E){GLog.write("Mouse down");this.drag={begin:ReallyZoomControl.getMousePosition(E),left:B.left,top:B.top}}));GEvent.addDomListener(D,"mouseup",GEvent.callback(this,function(E){GLog.write("Mouse up");this.drag=null}));GEvent.addDomListener(D,"mousemove",GEvent.callback(this,function(F){if(this.drag!=null){var G=ReallyZoomControl.getMousePosition(F);G.x-=this.drag.left;G.y-=this.drag.top;var E=(G.y*17)/A;C.setZoom(E);GLog.write("Position: "+(G.left)+", "+(G.top))}}));GEvent.addDomListener(D,"dragend",GEvent.callback(D,function(){GLog.write("Drag end")}));B.appendChild(D);return(B)};ReallyZoomControl.prototype.screenToSlider_=function(B,A){var C={x:B-zoomSliderElement,y:A};return(C)};ReallyZoomControl.prototype.createButtonElement=function(E,A,D){var C=document.createElement("div");C.style.color="black";C.style.width=R_ZOOM_CONTROL_BUTTON_WIDTH+"px";C.style.height=R_ZOOM_CONTROL_BUTTON_HEIGHT+"px";C.style.font="small Arial";C.style.textAlign="center";C.style.cursor="pointer";C.style.position="absolute";C.style.left=""+A+"px";C.style.top=""+D+"px";var B=navigator.appVersion;if(B.match("MSIE 6.0")||B.match("MSIE 5.")){C.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/user_data/css/images/gmap/"+E+"', sizingMethod='crop')"}else{C.style.background="url(/user_data/css/images/gmap/"+E+") no-repeat left top"}return(C)};ReallyZoomControl.getMousePosition=function(A){var C=0;var B=0;if(!A){var A=window.event}if(A.pageX||A.pageY){C=A.pageX;B=A.pageY}else{if(A.clientX||A.clientY){C=A.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);B=A.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)}}GLog.write("Position: "+C+","+B);return({x:C,y:B})};var ReallyScrollBar=new Class({initialize:function(F,B,C,A,G,E,D){this.content=$(F);this.track=$(B);this.thumb=$(C);this.down=$(G);this.up=$(A);this.scrollBar=$(E);this.slider=new Slider(B,C,{mode:"vertical",onChange:function(H){log("Slider step changed to "+H);this.content.scrollTo(0,H)}.create({bind:this})});$$(this.content,this.track).addEvent("mousewheel",function(I){I=new Event(I).stop();var H=this.slider.step-I.wheel*30;this.slider.set(H)}.create({bind:this}));$(document.body).addEvent("mouseleave",function(){this.slider.drag.stop()}.create({bind:this}));this.up.addEvent("click",function(){this.slider.set(this.slider.step-30)}.create({bind:this}));this.down.addEvent("click",function(){this.slider.set(this.slider.step+30)}.create({bind:this}));this.update();log("ReallyScrollBar initialized")},set:function(A){this.slider.set(A)},setSteps:function(A){if(A>0){this.scrollBar.style.visibility="visible";this.slider.setOptions({steps:A});this.slider.set(0)}else{this.scrollBar.style.visibility="hidden"}},update:function(){this.setSteps(this.content.getSize().scrollSize.y-this.content.getSize().size.y)}});function ExtInfoWindow(A,B,C,D){this.html_=C;this.marker_=A;this.infoWindowId_=B;this.options_=D==null?{}:D;this.ajaxUrl_=this.options_.ajaxUrl==null?null:this.options_.ajaxUrl;this.callback_=this.options_.ajaxCallback==null?null:this.options_.ajaxCallback;this.beakOffset_=this.options_.beakOffset==null?0:this.options_.beakOffset;this.borderSize_=this.options_.borderSize==null?this.beakOffset_:this.options_.borderSize;this.paddingX_=this.options_.paddingX==null?0+this.borderSize_:this.options_.paddingX+this.borderSize_;this.paddingY_=this.options_.paddingY==null?0+this.borderSize_:this.options_.paddingY+this.borderSize_;this.map_=null;this.container_=document.createElement("div");this.container_.style.position="relative";this.container_.style.display="none";if(this.options_.width!=null){this.container_.style.width=this.options_.width+"px"}this.contentDiv_=document.createElement("div");this.contentDiv_.id=this.infoWindowId_+"_contents";this.contentDiv_.innerHTML=this.html_;this.contentDiv_.style.display="block";this.contentDiv_.style.visibility="hidden";this.wrapperDiv_=document.createElement("div")}ExtInfoWindow.prototype=new GOverlay();ExtInfoWindow.prototype.initialize=function(map){this.map_=map;this.defaultStyles={containerWidth:this.map_.getSize().width/2,borderSize:1};this.wrapperParts={tl:{t:0,l:0,w:0,h:0,domElement:null},t:{t:0,l:0,w:0,h:0,domElement:null},tr:{t:0,l:0,w:0,h:0,domElement:null},l:{t:0,l:0,w:0,h:0,domElement:null},r:{t:0,l:0,w:0,h:0,domElement:null},bl:{t:0,l:0,w:0,h:0,domElement:null},b:{t:0,l:0,w:0,h:0,domElement:null},br:{t:0,l:0,w:0,h:0,domElement:null},beak:{t:0,l:0,w:0,h:0,domElement:null},close:{t:0,l:0,w:0,h:0,domElement:null}};for(var i in this.wrapperParts){var tempElement=document.createElement("div");tempElement.id=this.infoWindowId_+"_"+i;tempElement.style.visibility="hidden";document.body.appendChild(tempElement);tempElement=document.getElementById(this.infoWindowId_+"_"+i);var tempWrapperPart=eval("this.wrapperParts."+i);tempWrapperPart.w=parseInt(this.getStyle_(tempElement,"width"));tempWrapperPart.h=parseInt(this.getStyle_(tempElement,"height"));document.body.removeChild(tempElement)}for(var i in this.wrapperParts){if(i=="close"){this.wrapperDiv_.appendChild(this.contentDiv_)}var wrapperPartsDiv=null;if(this.wrapperParts[i].domElement==null){wrapperPartsDiv=document.createElement("div");this.wrapperDiv_.appendChild(wrapperPartsDiv)}else{wrapperPartsDiv=this.wrapperParts[i].domElement}wrapperPartsDiv.id=this.infoWindowId_+"_"+i;wrapperPartsDiv.style.position="absolute";wrapperPartsDiv.style.width=this.wrapperParts[i].w+"px";wrapperPartsDiv.style.height=this.wrapperParts[i].h+"px";wrapperPartsDiv.style.top=this.wrapperParts[i].t+"px";wrapperPartsDiv.style.left=this.wrapperParts[i].l+"px";this.wrapperParts[i].domElement=wrapperPartsDiv}this.map_.getPane(G_MAP_FLOAT_PANE).appendChild(this.container_);this.container_.id=this.infoWindowId_;var containerWidth=this.getStyle_(document.getElementById(this.infoWindowId_),"width");this.container_.style.width=(containerWidth==null?this.defaultStyles.containerWidth:containerWidth);this.map_.getContainer().appendChild(this.contentDiv_);this.contentWidth=this.getDimensions_(this.container_).width;this.contentDiv_.style.width=this.contentWidth+"px";this.contentDiv_.style.position="absolute";this.container_.appendChild(this.wrapperDiv_);GEvent.bindDom(this.container_,"mousedown",this,this.onClick_);GEvent.bindDom(this.container_,"dblclick",this,this.onClick_);GEvent.bindDom(this.container_,"DOMMouseScroll",this,this.onClick_);GEvent.trigger(this.map_,"extinfowindowopen");if(this.ajaxUrl_!=null){this.ajaxRequest_(this.ajaxUrl_)}};ExtInfoWindow.prototype.onClick_=function(A){if(navigator.userAgent.toLowerCase().indexOf("msie")!=-1&&document.all){window.event.cancelBubble=true;window.event.returnValue=false}else{A.stopPropagation()}};ExtInfoWindow.prototype.remove=function(){if(this.map_.getExtInfoWindow()!=null){GEvent.trigger(this.map_,"extinfowindowbeforeclose");GEvent.clearInstanceListeners(this.container_);if(this.container_.outerHTML){this.container_.outerHTML=""}if(this.container_.parentNode){this.container_.parentNode.removeChild(this.container_)}this.container_=null;GEvent.trigger(this.map_,"extinfowindowclose");this.map_.setExtInfoWindow_(null)}};ExtInfoWindow.prototype.copy=function(){return new ExtInfoWindow(this.marker_,this.infoWindowId_,this.html_,this.options_)};ExtInfoWindow.prototype.redraw=function(F){if(!F||this.container_==null){return }var E=this.contentDiv_.offsetHeight;this.contentDiv_.style.height=E+"px";this.contentDiv_.style.left=this.wrapperParts.l.w+"px";this.contentDiv_.style.top=this.wrapperParts.tl.h+"px";this.contentDiv_.style.visibility="visible";this.wrapperParts.tl.t=0;this.wrapperParts.tl.l=0;this.wrapperParts.t.l=this.wrapperParts.tl.w;this.wrapperParts.t.w=(this.wrapperParts.l.w+this.contentWidth+this.wrapperParts.r.w)-this.wrapperParts.tl.w-this.wrapperParts.tr.w;this.wrapperParts.t.h=this.wrapperParts.tl.h;this.wrapperParts.tr.l=this.wrapperParts.t.w+this.wrapperParts.tl.w;this.wrapperParts.l.t=this.wrapperParts.tl.h;this.wrapperParts.l.h=E;this.wrapperParts.r.l=this.contentWidth+this.wrapperParts.l.w;this.wrapperParts.r.t=this.wrapperParts.tr.h;this.wrapperParts.r.h=E;this.wrapperParts.bl.t=E+this.wrapperParts.tl.h;this.wrapperParts.b.l=this.wrapperParts.bl.w;this.wrapperParts.b.t=E+this.wrapperParts.tl.h;this.wrapperParts.b.w=(this.wrapperParts.l.w+this.contentWidth+this.wrapperParts.r.w)-this.wrapperParts.bl.w-this.wrapperParts.br.w;this.wrapperParts.b.h=this.wrapperParts.bl.h;this.wrapperParts.br.l=this.wrapperParts.b.w+this.wrapperParts.bl.w;this.wrapperParts.br.t=E+this.wrapperParts.tr.h;this.wrapperParts.close.l=this.wrapperParts.tr.l+this.wrapperParts.tr.w-this.wrapperParts.close.w-this.borderSize_;this.wrapperParts.close.t=this.borderSize_;this.wrapperParts.beak.l=this.borderSize_+(this.contentWidth/2)-(this.wrapperParts.beak.w/2);this.wrapperParts.beak.t=this.wrapperParts.bl.t+this.wrapperParts.bl.h-this.beakOffset_;for(var D in this.wrapperParts){if(D=="close"){this.wrapperDiv_.insertBefore(this.contentDiv_,this.wrapperParts[D].domElement)}var C=null;if(this.wrapperParts[D].domElement==null){C=document.createElement("div");this.wrapperDiv_.appendChild(C)}else{C=this.wrapperParts[D].domElement}C.id=this.infoWindowId_+"_"+D;C.style.position="absolute";C.style.width=this.wrapperParts[D].w+"px";C.style.height=this.wrapperParts[D].h+"px";C.style.top=this.wrapperParts[D].t+"px";C.style.left=this.wrapperParts[D].l+"px";this.wrapperParts[D].domElement=C}var H=this.marker_;var G=this.map_;GEvent.addDomListener(this.wrapperParts.close.domElement,"click",function(){G.closeExtInfoWindow()});var B=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());this.container_.style.position="absolute";var A=this.marker_.getIcon();this.container_.style.left=(B.x-(this.contentWidth/2)-A.iconAnchor.x+A.infoWindowAnchor.x)+"px";this.container_.style.top=(B.y-this.wrapperParts.bl.h-E-this.wrapperParts.tl.h-this.wrapperParts.beak.h-A.iconAnchor.y+A.infoWindowAnchor.y+this.borderSize_)+"px";this.container_.style.display="block";if(this.map_.getExtInfoWindow()!=null){this.repositionMap_()}};ExtInfoWindow.prototype.resize=function(){var A=this.contentDiv_.cloneNode(true);A.id=this.infoWindowId_+"_tempContents";A.style.visibility="hidden";A.style.height="auto";document.body.appendChild(A);A=document.getElementById(this.infoWindowId_+"_tempContents");var E=A.offsetHeight;document.body.removeChild(A);this.contentDiv_.style.height=E+"px";var B=this.contentDiv_.offsetWidth;var D=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());var C=this.wrapperParts.t.domElement.offsetHeight+this.wrapperParts.l.domElement.offsetHeight+this.wrapperParts.b.domElement.offsetHeight;var G=this.wrapperParts.t.domElement.offsetTop;this.wrapperParts.l.domElement.style.height=E+"px";this.wrapperParts.r.domElement.style.height=E+"px";var F=this.wrapperParts.b.domElement.offsetTop-E;this.wrapperParts.l.domElement.style.top=F+"px";this.wrapperParts.r.domElement.style.top=F+"px";this.contentDiv_.style.top=F+"px";windowTHeight=parseInt(this.wrapperParts.t.domElement.style.height);F-=windowTHeight;this.wrapperParts.close.domElement.style.top=F+this.borderSize_+"px";this.wrapperParts.tl.domElement.style.top=F+"px";this.wrapperParts.t.domElement.style.top=F+"px";this.wrapperParts.tr.domElement.style.top=F+"px";this.repositionMap_()};ExtInfoWindow.prototype.repositionMap_=function(){var J=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getNorthEast());var A=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getSouthWest());var H=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());var P=0;var N=0;var L=this.paddingX_;var K=this.paddingY_;var D=this.marker_.getIcon().infoWindowAnchor;var C=this.marker_.getIcon().iconAnchor;var F=this.wrapperParts.t.domElement;var I=this.wrapperParts.l.domElement;var Q=this.wrapperParts.b.domElement;var G=this.wrapperParts.r.domElement;var B=this.wrapperParts.beak.domElement;var M=H.y-(-D.y+C.y+this.getDimensions_(B).height+this.getDimensions_(Q).height+this.getDimensions_(I).height+this.getDimensions_(F).height+this.paddingY_);if(M<J.y){N=J.y-M}else{var R=H.y+this.paddingY_;if(R>=A.y){N=-(R-A.y)}}var O=Math.round(H.x+this.getDimensions_(this.container_).width/2+this.getDimensions_(G).width+this.paddingX_+D.x-C.x);if(O>J.x){P=-(O-J.x)}else{var E=-(Math.round((this.getDimensions_(this.container_).width/2-this.marker_.getIcon().iconSize.width/2)+this.getDimensions_(I).width+this.borderSize_+this.paddingX_)-H.x-D.x+C.x);if(E<A.x){P=A.x-E}}if(P!=0||N!=0&&this.map_.getExtInfoWindow()!=null){this.map_.panBy(new GSize(P,N))}};ExtInfoWindow.prototype.ajaxRequest_=function(A){var C=this.map_;var B=this.callback_;GDownloadUrl(A,function(E,D){var F=document.getElementById(C.getExtInfoWindow().infoWindowId_+"_contents");if(E==null||D==-1){F.innerHTML='<span class="error">ERROR: The Ajax request failed to get HTML content from "'+A+'"</span>'}else{F.innerHTML=E}if(B!=null){B()}C.getExtInfoWindow().resize();GEvent.trigger(C,"extinfowindowupdate")})};ExtInfoWindow.prototype.getDimensions_=function(C){var G=this.getStyle_(C,"display");if(G!="none"&&G!=null){return{width:C.offsetWidth,height:C.offsetHeight}}var B=C.style;var F=B.visibility;var D=B.position;var A=B.display;B.visibility="hidden";B.position="absolute";B.display="block";var H=C.clientWidth;var E=C.clientHeight;B.display=A;B.position=D;B.visibility=F;return{width:H,height:E}};ExtInfoWindow.prototype.getStyle_=function(B,C){var E=false;C=this.camelize_(C);var D=B.style[C];if(!D){if(document.defaultView&&document.defaultView.getComputedStyle){var A=document.defaultView.getComputedStyle(B,null);D=A?A[C]:null}else{if(B.currentStyle){D=B.currentStyle[C]}}}if((D=="auto")&&(C=="width"||C=="height")&&(this.getStyle_(B,"display")!="none")){if(C=="width"){D=B.offsetWidth}else{D=B.offsetHeight}}return(D=="auto")?null:D};ExtInfoWindow.prototype.camelize_=function(C){var E=C.split("-"),A=E.length;if(A==1){return E[0]}var D=C.charAt(0)=="-"?E[0].charAt(0).toUpperCase()+E[0].substring(1):E[0];for(var B=1;B<A;B++){D+=E[B].charAt(0).toUpperCase()+E[B].substring(1)}return D};GMap.prototype.ExtInfoWindowInstance_=null;GMap.prototype.ClickListener_=null;GMap.prototype.InfoWindowListener_=null;GMarker.prototype.openExtInfoWindow=function(B,D,A,C){if(B==null){throw"Error in GMarker.openExtInfoWindow: map cannot be null";return false}if(D==null||D==""){throw"Error in GMarker.openExtInfoWindow: must specify a cssId";return false}B.closeInfoWindow();if(B.getExtInfoWindow()!=null){B.closeExtInfoWindow()}if(B.getExtInfoWindow()==null){B.setExtInfoWindow_(new ExtInfoWindow(this,D,A,C));if(B.ClickListener_==null){B.ClickListener_=GEvent.addListener(B,"click",function(E){if(!E&&B.getExtInfoWindow()!=null){B.closeExtInfoWindow()}})}if(B.InfoWindowListener_==null){B.InfoWindowListener_=GEvent.addListener(B,"infowindowopen",function(E){if(B.getExtInfoWindow()!=null){B.closeExtInfoWindow()}})}B.addOverlay(B.getExtInfoWindow())}};GMarker.prototype.closeExtInfoWindow=function(A){if(A.getExtInfWindow()!=null){A.closeExtInfoWindow()}};GMap2.prototype.getExtInfoWindow=function(){return this.ExtInfoWindowInstance_};GMap2.prototype.setExtInfoWindow_=function(A){this.ExtInfoWindowInstance_=A};GMap2.prototype.closeExtInfoWindow=function(){if(this.ExtInfoWindowInstance_!=null){this.removeOverlay(this.ExtInfoWindowInstance_);if(this.ExtInfoWindowInstance_!=null){this.ExtInfoWindowInstance_.remove()}this.ExtInfoWindowInstance_=null}};var geocoder=null;var map=null;var mgr=null;var gdir=null;var beginIcon;var endIcon;var beginMarker=null;var endMarker=null;var slider=null;var addressInput=null;function loadGoogleMap(A){if(A=="fi"){LANG_CUSTOMERSERVICE="Asiakaspalvelu";BROWSER_SUPPORT="K�ytt�m�si selain ei ole yhteensopiva Google Mapsin kanssa.";LOCATION_NOT_FOUND="Antamaasi l�ht�osoitetta ei l�ytynyt. Osoite voi olla suhteellisen uusi tai virheellinen";ROUTE_NOT_FOUND="Reitti� ei l�ytynyt."}else{LANG_CUSTOMERSERVICE="Customer service";BROWSER_SUPPORT="Your browser does not support Google Maps.";LOCATION_NOT_FOUND="No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.";ROUTE_NOT_FOUND="The GDirections object could not compute directions between the points mentioned in the query. This is usually because there is no route available between the two points, or because we do not have data for routing in that region."}if(!GBrowserIsCompatible()){document.getElementById("map").innerHTML="<center><h3>"+BROWSER_SUPPORT+"</h3></center>"}else{if(map==null){log("Creating map...");mapOptions={};map=new GMap2(document.getElementById("map"),mapOptions);map.addControl(new ReallyZoomControl());map.addControl(new ReallyMapTypeControl());map.enableDoubleClickZoom();gdir=new GDirections(map);GEvent.addListener(gdir,"addoverlay",gdirOnAddOverlay);GEvent.addListener(gdir,"error",gdirOnError);GEvent.addListener(gdir,"load",gdirOnLoad);map.setCenter(new GLatLng(60.158457,24.93456),15);log("Creating geocoder...");geocoder=new GClientGeocoder();geocoder.setBaseCountryCode("FI");beginIcon=new GIcon();beginIcon.image="http://www.really.fi/user_data/css/images/gmap/img_gm_mark_startpoint.png";beginIcon.iconSize=new GSize(28,28);beginIcon.iconAnchor=new GPoint(14,14);beginIcon.infoWindowAnchor=new GPoint(14,14);endIcon=new GIcon();endIcon.image="http://www.really.fi/user_data/css/images/gmap/img_gm_mark_really.png";endIcon.iconSize=new GSize(28,28);endIcon.iconAnchor=new GPoint(14,14);endIcon.infoWindowAnchor=new GPoint(0,-24);endMarker=new GMarker(new GLatLng(60.158457,24.93456),{icon:endIcon});GEvent.addListener(endMarker,"click",function(){endMarker.openExtInfoWindow(map,"reallyWindow","<h1>REALLY?</h1>Really Helsinki Oy<br/>Pursimiehenkatu 26 C, 5. krs<br />00150 Helsinki<br/>"+LANG_CUSTOMERSERVICE+": 0207&nbsp;205&nbsp;290",{borderSize:12,beakOffset:-2,paddingX:5,paddingY:5,width:200})});map.addOverlay(endMarker);GEvent.trigger(endMarker,"click")}}}function gdirOnLoad(){var P=$("dirsummary");var M=$("dirsteps");var B=new Element("tbody");P.setHTML(gdir.getSummaryHtml());while(M.hasChildNodes()){M.removeChild(M.firstChild)}var E=gdir.getNumRoutes();for(var O=0;O<E;O++){var Q=gdir.getRoute(O);var J=Q.getNumSteps();log("Number of steps on route #"+O+": "+J);for(var N=0;N<J;N++){var D=Q.getStep(N);var H=new Element("tr",{events:{click:GEvent.callback(D,function(){if(map.getExtInfoWindow()!=null){map.closeExtInfoWindow()}map.showMapBlowup(this.getLatLng())})}});var F=new Element("td",{"class":"dirstepidx"}).setText(""+(N+1)+".");var A=new Element("td",{"class":"dirstepdesc"}).setHTML(D.getDescriptionHtml());var C=new Element("td",{"class":"dirstepdist"}).setHTML(D.getDistance().html);H.appendChild(F);H.appendChild(A);H.appendChild(C);B.appendChild(H)}}M.appendChild(B);var K=$("dir");var S=$("dirscrollup");var R=$("dirscrolldown");var I=$("dirthumb");var L=$("dirscroll");var T=$("dirscrollbar");if(slider==null){slider=new ReallyScrollBar(K,L,I,S,R,T,{})}else{slider.update()}var G=$("loadingImg");if(G!=null){G.style.visibility="hidden"}}function gdirOnError(){var A=gdir.getStatus().code;switch(A){case G_GEO_UNKNOWN_ADDRESS:alert(LOCATION_NOT_FOUND);break;case G_GEO_BAD_REQUEST:alert("A directions request could not be successfully parsed.");break;case G_GEO_SERVER_ERROR:alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.");break;case G_GEO_MISSING_QUERY:alert("The HTTP q parameter was either missing or had no value. For geocoding requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.");break;case G_GEO_UNKNOWN_ADDRESS:alert("No corresponding geographic location could be found for the specified address. This may be due to the fact that the address is relatively new, or it may be incorrect.");break;case G_GEO_UNAVAILABLE_ADDRESS:alert("The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons.");break;case G_GEO_UNKNOWN_DIRECTIONS:alert(ROUTE_NOT_FOUND);break;case G_GEO_BAD_KEY:alert("The given key is either invalid or does not match the domain for which it was given.");break;case G_GEO_TOO_MANY_QUERIES:alert("The given key has gone over the requests limit in the 24 hour period.");break;default:alert("An unknown error occurred.\nError code: "+A)}var B=$("loadingImg");if(B!=null){B.style.visibility="hidden"}}function gdirOnAddOverlay(){if(beginMarker!=null){map.removeOverlay(beginMarker)}beginMarker=gdirReplaceMarker(gdir.getMarker(0),{icon:beginIcon});map.removeOverlay(gdir.getMarker(gdir.getNumRoutes()))}function gdirReplaceMarker(B,A){newMarker=new GMarker(B.getLatLng(),A);map.addOverlay(newMarker);map.removeOverlay(B);GEvent.addListener(newMarker,"click",function(){GEvent.trigger(B,"click")});return(newMarker)}var ReallyAddressInput=new Class({options:{minLength:4,zIndex:50,delay:400,observerOptions:{},onOver:Class.empty,onSelect:Class.empty,onSelection:Class.empty,onShow:Class.empty,onHide:Class.empty,onBlur:Class.empty,onFocus:Class.empty,separator:", ",separatorSplit:/\s*[,;]\s*/},initialize:function(A,C,B){this.setOptions(B);this.address=$(A);this.select=new Element("ul",{id:"addressSelect",styles:{display:"none"}}).inject(this.address,"after");this.sitelang=C;this.address.setProperty("autocomplete","off");this.address.addEvent("blur",function(){this.hasFocus=false;this.hideSelect(true);this.fireEvent("onBlur",[this.address])}.create({bind:this,delay:100}));this.address.addEvent("focus",function(){this.hasFocus=true;this.showSelect();this.fireEvent("onFocus",[this.address])}.create({bind:this,delay:100}));this.address.addEvent("keydown",function(D){if(!D){this.prefetch();return(true)}D=new Event(D);if(!D.key||D.shift){return(true)}switch(D.key){case"enter":if(this.address.value!=this.listValue){return(true)}if(this.visible&&this.selected){this.choiceSelect(this.selected);return !!(this.options.autoSubmit)}return(false);case"up":if(!this.prefetch()&&this.queryValue!==null){if(this.selected){this.choiceOver(this.selected.getPrevious(),true)}else{this.choiceOver(this.select.getLast(),true)}}return(false);case"down":if(!this.prefetch()&&this.queryValue!==null){if(this.selected){this.choiceOver(this.selected.getNext(),true)}else{this.choiceOver(this.select.getFirst(),true)}}return(false);case"tab":case"esc":this.hideSelect(true);return(true)}return(true)}.bind(this));this.observer=new Observer(this.address,this.prefetch.bind(this),{delay:this.options.delay});this.queryValue=null},prefetch:function(){var B=this.address.value,A=B;if(A.length<this.options.minLength){this.hideSelect()}else{if(A===this.queryValue||(this.visible&&A==this.selectedValue)){if(this.visible){return(false)}this.showSelect()}else{this.queryValue=A;this.query()}}return(true)},query:function(){geocoder.getLocations(this.queryValue,function(C){if(!C||C.Status.code!=200){this.select.innerHTML="";this.hideSelect(true)}else{switch(C.Placemark.length){case 0:this.select.innerHTML="";this.hideSelect(true);return ;default:this.select.innerHTML="";for(var D=0;D<C.Placemark.length;D++){var A=C.Placemark[D];var B=new Element("li",{"class":"addressLine"});B.inputValue=A.address;B.innerHTML=A.address;this.addChoiceEvents(B);this.select.appendChild(B)}log("display: "+this.select.style.display);this.showSelect()}}}.bind(this))},setSelection:function(A){var B=this.selected.inputValue;this.observer.setValue(B);this.listValue=B;this.fireEvent("onSelection",[this.element,this.selected,B])},showSelect:function(){this.selected=null;this.selectedValue=null;var A=this.select.getFirst();if(!A){return }if(!this.visible){this.visible=true;this.select.style.display="block";this.fireEvent("onShow",[this.element,this.choices])}if(A.inputValue==this.queryValue){this.choiceOver(A,this.typeAhead)}},hideSelect:function(A){if(A){var B=this.address.value;this.observer.setValue(B)}if(!this.visible){return }this.visible=false;this.observer.clear();this.select.style.display="none";this.fireEvent("onHide",[this.element,this.choices])},choiceOver:function(A,B){if(!A||A==this.selected){return }$$(this.select.getChildren()).removeClass("addressLineSelected");this.selected=A.addClass("addressLineSelected");this.fireEvent("onSelect",[this.address,this.selected,B]);if(!B){return }this.selectedValue=this.selected.inputValue;this.setSelection()},choiceSelect:function(A){if(A){this.choiceOver(A)}this.setSelection();this.queryValue=false;this.hideSelect()},addChoiceEvents:function(A){return A.addEvents({mouseover:this.choiceOver.bind(this,[A]),click:this.choiceSelect.bind(this,[A])})}});ReallyAddressInput.implement(new Options);ReallyAddressInput.implement(new Events);function setFromAddress(A,B){var C=$("loadingImg");if(C!=null){C.style.visibility="visible"}gdir.load("from: "+A+" to: 60.158457, 24.93456",{locale:B,getSteps:true})}function createScrollBar(F,B,G,A,H){var E=new Slider(B,G,{mode:"vertical",onChange:function(I){F.scrollTo(0,I)}});$$(F,B).addEvent("mousewheel",function(J){J=new Event(J).stop();var I=E.step-J.wheel*30;E.set(I)});$(document.body).addEvent("mouseleave",function(){E.drag.stop()});var C=$(A);C.addEvent("click",function(){E.set(E.step-30)});var D=$(H);D.addEvent("click",function(){E.set(E.step+30)});return(E)}function log(A){};
