// A function to create the marker and set up the event window

	  // A function to create clicking, rollover polygons. 
      function createbasegons(pts,strokeColor, strokeWeight, strokeOpacity, fillColor, fillOpacity,label,concathtml,lat,lng,header,category,Polytype) {
	  	
		
        // Set up the polygon
		var polygon = new GPolygon(pts,strokeColor, strokeWeight, strokeOpacity, fillColor, fillOpacity);
	
		
		//var bob1 = bob.replace("\(", "");
		//var bob2 = bob1.replace("\)", "");
		
		// Set up the Elabel to show the areas title
		var mylabel = new ELabel(polygon.getBounds().getCenter(), label, "style2", new GSize(-40,22), 80 );
		
        GEvent.addListener(polygon, "click", function() {
          //map.openInfoWindowHtml(gon.getBounds().getCenter(), concathtml, {maxWidth:175,autoScroll:true});
          tooltip.style.visibility="hidden"
		  //map.openInfoWindowHtml(gon.getBounds().getCenter(), concathtml, {maxWidth:175,autoScroll:true});
	    });
        GEvent.addListener(polygon, "mouseover", function() {
          polygon.setFillStyle({opacity:0.3});
          tooltip.style.visibility="hidden"
		  //map.openInfoWindowHtml(gon.getBounds().getCenter(), label, {maxWidth:175,autoScroll:true});
		  
		  // An ELabel with all optional parameters in use 
   
			//label.setPoint(gon.getBounds().getCenter());
      		map.addOverlay(mylabel);
        });
        GEvent.addListener(polygon, "mouseout", function() {
          polygon.setFillStyle({opacity:0});
          tooltip.style.visibility="hidden"
		  map.removeOverlay(mylabel);
		 
        });
         // Store various info as gon properties
        polygon.mycategory = category;
        polygon.mytype = Polytype;
        polygon.myname = label;
        polygon.mylat = lat;
        polygon.mylng = lng;
        polygon.myheader = header;
        basemarkerslinespolys.push(polygon);
        return polygon;
      }
	
	  
