var StyleBus = new OpenLayers.StyleMap({
  "default": new OpenLayers.Style({
    graphic: true,
    strokeColor: "#00ff00",
    strokeWidth: 4,
    strokeOpacity: .8,
    graphicZIndex: 1
  }),
  "select": new OpenLayers.Style({
    strokeColor: "#ff0000",
    graphicZIndex: 2
  })
});

var StyleBusOut = new OpenLayers.StyleMap({
  "default": new OpenLayers.Style({
    graphic: true,
    strokeColor: "#0000ff",
    strokeWidth: 4,
    strokeOpacity: .8,
    graphicZIndex: 1
  }),
  "select": new OpenLayers.Style({
    strokeColor: "#ff0000",
    graphicZIndex: 2
  })
});

var StyleBusSeason = new OpenLayers.StyleMap({
  "default": new OpenLayers.Style({
    graphic: true,
    strokeColor: "#00ffff",
    strokeWidth: 4,
    strokeOpacity: .8,
    graphicZIndex: 1
  }),
  "select": new OpenLayers.Style({
    strokeColor: "#ff0000",
    graphicZIndex: 2
  })
});

var StyleRail = new OpenLayers.StyleMap({
  "default": new OpenLayers.Style({
    graphic: true,
    strokeColor: "#ff0000",
    strokeWidth: 6,
    strokeOpacity: .7,
    graphicZIndex: 1
  }),
  "select": new OpenLayers.Style({
    strokeColor: "#ff0000",
    graphicZIndex: 2
  })
});

var StyleBounarySuburb = new OpenLayers.StyleMap({
  "default": new OpenLayers.Style({
    graphic: true,
    strokeColor: "#ffff00",
    strokeWidth: 2,
    strokeOpacity: 1,
    graphicZIndex: 1,
    fillColor: "green",
    fillOpacity: .2,
    strokeDashstyle: "dashdot",
 //   label: 'name',
    fontSize: "14px",
    fontColor: "#FF0",
    fontFamily: "PT Serif, Times New Roman, Arial"
  }),
  "select": new OpenLayers.Style({
    fillColor: "#ff0000",
    graphicZIndex: 2
  })
});

function style_BounarySuburb(feature) {
            feature.style = OpenLayers.Util.extend(
{   strokeColor: "#ffff00",
    strokeWidth: 2,
    strokeOpacity: 1,
    graphicZIndex: 1,
    fillColor: "green",
    fillOpacity: .4,
    strokeDashstyle: "dashdot",
    fontSize: "20px",
    fontColor: "#000",
    fontWeight: "bold",
    labelAlign: "c",
    fontFamily: "PT Serif, Times New Roman, Arial"
},null);
	      feature.style.label = feature.attributes.name.replace("микрорайон","");
}

function style_BusRouteRail(feature) {
            feature.style = OpenLayers.Util.extend(
{   graphic: true,
    strokeColor: "#FF0000",
    strokeWidth: 5,
    strokeOpacity: .7,
    graphicZIndex: 2,
    fontSize: "12px",
    fontColor: "#FFF",
    fontWeight: "normal",
    labelAlign: "l",
    fontFamily: "PT Sans, Arial, Times New Roman"
},null);
	      
	      if (feature.attributes.railway == "halt" || feature.attributes.railway == "halt") {
		feature.style.externalGraphic = "/img/bus_station.png";
		feature.style.graphicWidth = 16;
		feature.style.graphicHeight = 16;
		feature.style.pointRadius = 10;
		feature.style.label = feature.attributes.name;
		feature.style.labelYOffset = 10;
		feature.style.labelXOffset = 10;
		feature.style.fillColor = "#FFF";
		feature.style.graphicTitle = feature.attributes.name;
	      }
}
function style_BusRouteLocalf(feature) {
            feature.style = OpenLayers.Util.extend(
{   graphic: true,
    strokeColor: "#00ff00",
    strokeWidth: 4,
    strokeOpacity: .8,
    graphicZIndex: 2,
    fontSize: "14px",
    fontColor: "#FFF",
    fontWeight: "normal",
    labelAlign: "l",
    fontFamily: "PT Sans, Arial, Times New Roman"
},null);
	      
	      if (feature.attributes.highway == "bus_stop" || feature.attributes.amenity == "bus_station") {
		feature.style.externalGraphic = "/img/bus_station.png";
		feature.style.graphicWidth = 16;
		feature.style.graphicHeight = 16;
		feature.style.pointRadius = 10;
		feature.style.label = feature.attributes.name;
		feature.style.labelYOffset = 10;
		feature.style.labelXOffset = 10;
		feature.style.fillColor = "#FFF";
		feature.style.graphicTitle = feature.attributes.name;
	      }
}
function style_BusRouteLocalb(feature) {
            feature.style = OpenLayers.Util.extend(
{   graphic: true,
    strokeColor: "#00ff00",
    strokeWidth: 4,
    strokeOpacity: .8,
    graphicZIndex: 2,
    fontSize: "14px",
    fontColor: "#FFF",
    fontWeight: "normal",
    labelAlign: "l",
    fontFamily: "PT Sans, Arial, Times New Roman"
},null);
	      
	      if (feature.attributes.highway == "bus_stop" || feature.attributes.amenity == "bus_station") {
		feature.style.externalGraphic = "/img/bus_station.png";
		feature.style.graphicWidth = 16;
		feature.style.graphicHeight = 16;
		feature.style.pointRadius = 10;
		feature.style.label = feature.attributes.name;
		feature.style.labelYOffset = -10;
		feature.style.labelXOffset = 10;
		feature.style.fillColor = "#FFF";
		feature.style.graphicTitle = feature.attributes.name;
	      }
}

function style_BusRouteOutf(feature) {
            feature.style = OpenLayers.Util.extend(
{   graphic: true,
    strokeColor: "#0000ff",
    strokeWidth: 4,
    strokeOpacity: .8,
    graphicZIndex: 2,
    fontSize: "14px",
    fontColor: "#FFF",
    fontWeight: "normal",
    labelAlign: "l",
    fontFamily: "PT Sans, Arial, Times New Roman"
},null);
	      
	      if (feature.attributes.highway == "bus_stop" || feature.attributes.amenity == "bus_station") {
		feature.style.externalGraphic = "/img/bus_station.png";
		feature.style.graphicWidth = 16;
		feature.style.graphicHeight = 16;
		feature.style.pointRadius = 10;
		feature.style.label = feature.attributes.name;
		feature.style.labelYOffset = 10;
		feature.style.labelXOffset = 10;
		feature.style.fillColor = "#FFF";
		feature.style.graphicTitle = feature.attributes.name;
	      }
}

function style_BusRouteOutb(feature) {
            feature.style = OpenLayers.Util.extend(
{   graphic: true,
    strokeColor: "#0000ff",
    strokeWidth: 4,
    strokeOpacity: .8,
    graphicZIndex: 2,
    fontSize: "14px",
    fontColor: "#FFF",
    fontWeight: "normal",
    labelAlign: "l",
    fontFamily: "PT Sans, Arial, Times New Roman"
},null);
	      
	      if (feature.attributes.highway == "bus_stop" || feature.attributes.amenity == "bus_station") {
		feature.style.externalGraphic = "/img/bus_station.png";
		feature.style.graphicWidth = 16;
		feature.style.graphicHeight = 16;
		feature.style.pointRadius = 10;
		feature.style.label = feature.attributes.name;
		feature.style.labelYOffset = -10;
		feature.style.labelXOffset = 10;
		feature.style.fillColor = "#FFF";
		feature.style.graphicTitle = feature.attributes.name;
	      }
}

function style_BusRouteSeasonf(feature) {
            feature.style = OpenLayers.Util.extend(
{   graphic: true,
    strokeColor: "#00FFFF",
    strokeWidth: 4,
    strokeOpacity: .8,
    graphicZIndex: 2,
    fontSize: "14px",
    fontColor: "#FFF",
    fontWeight: "normal",
    labelAlign: "l",
    fontFamily: "PT Sans, Arial, Times New Roman"
},null);
	      
	      if (feature.attributes.highway == "bus_stop" || feature.attributes.amenity == "bus_station") {
		feature.style.externalGraphic = "/img/bus_station.png";
		feature.style.graphicWidth = 16;
		feature.style.graphicHeight = 16;
		feature.style.pointRadius = 10;
		feature.style.label = feature.attributes.name;
		feature.style.labelYOffset = 10;
		feature.style.labelXOffset = 10;
		feature.style.fillColor = "#FFF";
		feature.style.graphicTitle = feature.attributes.name;
	      }
}
function style_BusRouteSeasonb(feature) {
            feature.style = OpenLayers.Util.extend(
{   graphic: true,
    strokeColor: "#00FFFF",
    strokeWidth: 4,
    strokeOpacity: .8,
    graphicZIndex: 2,
    fontSize: "14px",
    fontColor: "#FFF",
    fontWeight: "normal",
    labelAlign: "l",
    fontFamily: "PT Sans, Arial, Times New Roman"
},null);
	      
	      if (feature.attributes.highway == "bus_stop" || feature.attributes.amenity == "bus_station") {
		feature.style.externalGraphic = "/img/bus_station.png";
		feature.style.graphicWidth = 16;
		feature.style.graphicHeight = 16;
		feature.style.pointRadius = 10;
		feature.style.label = feature.attributes.name;
		feature.style.labelYOffset = -10;
		feature.style.labelXOffset = 10;
		feature.style.fillColor = "#FFF";
		feature.style.graphicTitle = feature.attributes.name;
	      }
}

function on_bus_stop_hover(feature) {
            var text ="";
	    if (feature.attributes.highway == "bus_stop") {
            for (var key in feature.attributes) {
		if( key == 'name' ){
		  text += "<strong>" + feature.attributes[key] + "</strong><br/>";
		} else if( key == 'alt_name' ){
		  text += "<i>(" + feature.attributes[key] + ")</i><br/>";
		} else if( key == 'description' ) {
		  text += feature.attributes[key] + "<br/>"
		  }
              }
             document.getElementById("description").style.visibility = "visible";
             $("description").innerHTML = text;
	   }
        } 

function off_bus_stop_hover(feature) {
            var text ="";
           document.getElementById("description").style.visibility = "hidden";
           $("description").innerHTML = text;
        }   

