function Mark(nfo){

	this.nfo = nfo;

	this.create = function(x,y,id){                           //создать марку
		this.mrk = document.createElement("img");
		this.setSize();
		this.mrk.id = "mk" + id;
		this.mrk.className = "mark";
		this.setParam("width", this.width);
		this.setParam("height", this.height);
		this.setParam("top", y - this.height);
		this.setParam("left", x - this.width);
		this.setParam("id", id);
        this.setParam("globalx", Math.floor((x - this.width)*map.zoom/map.edge));
		this.setParam("globaly", Math.floor((y - this.height)*map.zoom/map.edge));
		this.updatesize();
		this.mrk.onmouseover = function(){allinfo.show("mark",map.mark[this.id.substr(2)].left, map.mark[this.id.substr(2)].top, map.mark[this.id.substr(2)].nfo);}
		this.mrk.onmouseout = function(){allinfo.setInt(500);}
		this.mrk.onclick = function() {map.info=0;}
		map.layer3.appendChild(this.mrk);
        allinfo.show("mark",map.mark[id].left, map.mark[id].top, map.mark[id].nfo);
//		allinfo.setInt(5000);
	}
	// марки закреплены глобально
	this.zooming = function(){
    	this.setParam("left", this.globalx/(map.zoom/map.edge));
 		this.setParam("top", this.globaly/(map.zoom/map.edge));
	}
    this.updatesize = function(){
		this.zooming();
		this.setSize();
        this.setParam("width", this.width);
		this.setParam("height", this.height);
	}
    this.setParam = function(attr, value){             					//параметры marka
     	    if (attr == "width") {
     	        this.width = value;
              	this.mrk.width = value;
          }
     	    if (attr == "height") {
     	        this.height = value;
              	this.mrk.height = value;
          }
          if (attr == "left") {
     	        this.left = value;
              	this.mrk.style.left = value+"px";
          }
     	    if (attr == "top") {
     	        this.top = value;
              	this.mrk.style.top = value+"px";
          }
          if (attr == "globalx") {
     	        this.globalx = value;
          }
     	  if (attr == "globaly") {
     	        this.globaly = value;
          }
          if (attr == "id") {
     	        this.id = value;
          }
        }
    this.setSize = function(){
    	if(map.level<=2){
            this.width = 32;
			this.height = 32;
			this.mrk.src = constants['big_marker_icon'];
		}
        if(map.level>=3){
            this.width = 16;
			this.height = 16;
			this.mrk.src = constants['small_marker_icon'];
		}
	}
}