﻿            Melder=function(MainDiv)
                {
                
                Melder.backgroundColor='#c5c5c5';
                Melder.borderColor='#c5c5ff';
                
                var parent = MainDiv.parentNode;

                var wrapper = document.createElement( 'div' );
                wrapper.style.cssText = MainDiv.style.cssText;
                parent.insertBefore( wrapper, MainDiv );

                parent.removeChild( MainDiv );
                wrapper.appendChild( MainDiv );
                MainDiv.style.cssText = 'position: relative; width: 100%; height: 100%;';

                this.overlay=document.createElement('div');
                wrapper.appendChild( this.overlay );
                this.visibleStyle = 'position: relative; top: -55%; background-color: ' + Melder.backgroundColor + '; width: 40%; text-align: center; margin-left: auto; margin-right: auto; padding: 2em; border: 0.08in ridge ' + Melder.borderColor + '; z-index: 100; opacity: .75; ';
                this.invisibleStyle = 'display: none;';
                this.overlay.style.cssText = this.invisibleStyle;
                };

            Melder.prototype.Set=function(message)
                {
                this.overlay.innerHTML = message;
                this.overlay.style.cssText = this.visibleStyle;
                };

            Melder.prototype.Clear=function()
                {
                this.overlay.style.cssText = this.invisibleStyle;
                };

            Melder.SetBackgroundColor=function(color)
                {
                Melder.backgroundColor=color;
                };
                
            Melder.SetBorderColor=function(color)
                {
                Melder.borderColor=color;
                };
              
           function createMarker(stat,point,html,icon,idobj,name)
                        {
                        var marker = new GMarker(point, {icon:icon});
                        if(stat==1){GEvent.addListener(marker, "click", function(){ortlink(idobj);});}
                        else{GEvent.addListener(marker, "click", function(){oblink(idobj);});}
                        GEvent.addListener(marker, 'mouseover', function()
                                                           { 
                                                           tooltip.innerHTML = html;
                                                           var point=maps.getCurrentMapType().getProjection().fromLatLngToPixel(maps.getBounds().getSouthWest(),maps.getZoom());
                                                           var offset=maps.getCurrentMapType().getProjection().fromLatLngToPixel(marker.getPoint(),maps.getZoom());
                                                           var anchor=marker.getIcon().iconAnchor;
                                                           var width=marker.getIcon().iconSize.width; 
                                                           var pos = new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(offset.x - point.x - anchor.x + width,- offset.y + point.y +anchor.y));
                                                           pos.apply(tooltip);
                                                           tooltip.style.display='block';
                                                           });
                        GEvent.addListener(marker,'mouseout', function(){tooltip.style.display='none';}); 
                        return marker;
                        }
                        
            function firstshow()
                        {
                         if(ir=='')
                         {mshow(1);mhide(2);mhide(3);}
                         else 
                         {mhide(1);mshow(2);mshow(3);}
                        }
                           
            function mshow(category) 
                         {
                         if(category==1){for(var i=0;i<gmarkersA.length;i++){gmarkersA[i].show();}}
                         if(category==2){for(var i=0;i<gmarkersB.length;i++){gmarkersB[i].show();}}
                         if(category==3){for(var i=0;i<gmarkersC.length;i++){gmarkersC[i].show();}}
                          }
    
            function mhide(category)
                        {
                        if(category==1){for(var i=0;i<gmarkersA.length;i++){gmarkersA[i].hide();}}
                        if(category==2){for(var i=0;i<gmarkersB.length;i++){gmarkersB[i].hide();}}
                        if(category==3){for(var i=0;i<gmarkersC.length;i++){gmarkersC[i].hide();}}
                        }           
                                    
            function onshow(cadegory)
                            {
                             if(ir!=''){mapback();}
                             mhide(1);mhide(2);mhide(3);
                             mshow(cadegory);
                            } 
            
            function showall()
                           {
                            //divgr.style.display='none';
                            mhide(1);mshow(2);mshow(3);
                           }
            
            function setm(){maps.setMapType(G_NORMAL_MAP);}
            function sets(){maps.setMapType(G_SATELLITE_MAP);}
            function seth(){maps.setMapType(G_HYBRID_MAP);}                  
            function setp(){maps.setMapType(G_PHYSICAL_MAP);}
                        
            function zoomon(){maps.zoomIn();setTimeout("firstshow();",1000);}
            function zoomoff(){maps.zoomOut();setTimeout("firstshow();",1000);}
            function setst(){}
            function noop(){}

