var UserId = 0;
var myMarker = null;
function SetUserId(valUserId) {
    UserId = valUserId;
   // alert(UserId);
}
var theme = {
    markerOptions: [
    { icon: new GIcon({ image: "../Images/maps/marker8.png",
        iconSize: new GSize(25, 33),
        iconAnchor: new GPoint(11, 33),
        infoWindowAnchor: new GPoint(11, 2),
        infoShadowAnchor: new GPoint(18, 25)
    }),
        labelClass: 'maptimize_marker_0',
        labelOffset: new GSize(-10, -28)
    },
    { icon: new GIcon({ image: "../Images/maps/marker88.png",
        iconSize: new GSize(25, 33),
        iconAnchor: new GPoint(11, 33),
        infoWindowAnchor: new GPoint(11, 2),
        infoShadowAnchor: new GPoint(18, 25)
    }),
        labelClass: 'maptimize_marker_1',
        labelOffset: new GSize(-11, -26)
    },
    { icon: new GIcon({ image: "../Images/maps/marker88.png",
        iconSize: new GSize(29, 33),
        iconAnchor: new GPoint(11, 33),
        infoWindowAnchor: new GPoint(11, 2),
        infoShadowAnchor: new GPoint(18, 25)
    }),
        labelClass: 'maptimize_marker_2',
        labelOffset: new GSize(-11, -27)
    },
    { icon: new GIcon({ image: "../Images/maps/my-icon.png",
        iconSize: new GSize(33, 33),
        iconAnchor: new GPoint(11, 33),
        infoWindowAnchor: new GPoint(15, 3),
        infoShadowAnchor: new GPoint(18, 25)
    }),
        labelClass: 'maptimize_marker_1',
        labelOffset: new GSize(-10, -28)
    },
     { icon: new GIcon({ image: "../Images/maps/markerF.png",
         iconSize: new GSize(25, 33),
         iconAnchor: new GPoint(11, 33),
         infoWindowAnchor: new GPoint(11, 2),
         infoShadowAnchor: new GPoint(18, 25)
     }),
         labelClass: 'maptimize_marker_0',
         labelOffset: new GSize(-10, -28)
     },
  ],

    clusterOptions: [
  { icon: new GIcon({ image: "../Images/maps/5.png",
      iconSize: new GSize(50, 50),
      iconAnchor: new GPoint(25, 25),
      infoWindowAnchor: new GPoint(25, 25),
      infoShadowAnchor: new GPoint(25, 25)
  }),
      labelClass: 'maptimize_cluster_0',
      labelOffset: new GSize(-25, -25)
  },
  { icon: new GIcon({ image: "../Images/maps/4.png",
      iconSize: new GSize(55, 55),
      iconAnchor: new GPoint(28, 28),
      infoWindowAnchor: new GPoint(28, 28),
      infoShadowAnchor: new GPoint(28, 28)
  }),
      labelClass: 'maptimize_cluster_1',
      labelOffset: new GSize(-27, -30)
  },
  { icon: new GIcon({ image: "../Images/maps/3.png",
      iconSize: new GSize(62, 62),
      iconAnchor: new GPoint(31, 31),
      infoWindowAnchor: new GPoint(31, 31),
      infoShadowAnchor: new GPoint(31, 31)
  }),
      labelClass: 'maptimize_cluster_2',
      labelOffset: new GSize(-31, -32)
  },
  { icon: new GIcon({ image: "../Images/maps/2.png",
      iconSize: new GSize(71, 71),
      iconAnchor: new GPoint(35, 35),
      infoWindowAnchor: new GPoint(35, 35),
      infoShadowAnchor: new GPoint(35, 35)
  }),
      labelClass: 'maptimize_cluster_3',
      labelOffset: new GSize(-35, -35)
  },
  { icon: new GIcon({ image: "../Images/maps/1.png",
      iconSize: new GSize(85, 85),
      iconAnchor: new GPoint(42, 42),
      infoWindowAnchor: new GPoint(42, 42),
      infoShadowAnchor: new GPoint(42, 42)
  }),
      labelClass: 'maptimize_cluster_4',
      labelOffset: new GSize(-42, -42)
  }
  ],

    createMarker: function (marker) {
        //return new GMarker(marker.getGLatLng(), Theme.Default.markerOptions);
        //    marker.getProperty('company');

        //    var options = theme.markerOptions[0];
        //    options.labelText = 1;
        //    
        //    return new Maptimize.LabeledMarker(marker.getGLatLng(), options);

        var properties = marker.getProperty('company');
        var options = theme.markerOptions[0];
        options.labelText = 1;

        //var MarkerId = marker.getProperty("id");
        //NOTE: Property is the column name 
        //called company in the 
        //CSV file generated by admin.

        //dont delete this comment
//        if (UserId == marker.getId().toString()) {
//            options = theme.markerOptions[3];
//            options.labelText = '';
//            return new Maptimize.LabeledMarker(marker.getGLatLng(), options);
//        }
        //dont delete this comment

        if (properties == "Landmarks") {
            options = theme.markerOptions[4];
            options.labelText = 1;

            return new Maptimize.LabeledMarker(marker.getGLatLng(), options);
        }
        else {
            //alert(marker.getId());

            return new Maptimize.LabeledMarker(marker.getGLatLng(), options);
        }
    },

    createCluster: function (cluster) {
        var count = cluster.getPointsCount(),
        index = parseInt(Math.log(count) / Math.log(10));

        if (cluster.canExpandOnMap()) {
            options = theme.clusterOptions[index];
        }
        else {
            options = theme.markerOptions[index];
        }

        options.labelText = count;
//dont delete this comment by aarti
//        cluster.requestIds(function (ids) {
//            var i = 0;
//            for (i = 0; i < ids.length; i++) {
//                if (UserId == ids[i]) {
//                   
//                }
//                
//            }
           
 //       });
        //dont delete this comment by aarti
        return new Maptimize.LabeledMarker(cluster.getGLatLng(), options);
    }
};

