
var newClass = function() {
	return function() {
		return this.init.apply(this, arguments);
	}
};

Map = newClass();
Map.prototype = {

 init: function() {
	var t = this;
    t.lastId = null;

    $("div.OpisMus").find("a").click(function(){
      t.hideall();
      if(t.lastId !== this)
      {
         t.showEl(this,"class");
         $(this).toggleClass("SelectOM");
      } else {
         t.lastId = null;
      }
      return false;
   });

   $("#photo_map").find("area").click(function(){
     t.hideall();
     if(t.lastId !== this)
     {
        t.showEl(this,"id");
        $(".TextMuseumTable").find("a."+$(this).attr("id")).toggleClass("SelectOM")
     } else {
        t.lastId = null;
     }
     return false;
   });

   $("div.CloseInfo").find("a").click(function(){
     t.hideall();
     t.lastId = null;
     return false;
   });
  },

  hideall: function(){
    $("div.ListElementIM").find("div.ElementIM").hide(500);
    $(".TextMuseumTable").find("a").removeClass("SelectOM");
  },

  showEl: function(obj,atr){
    var t = this;
    $("div."+ $(obj).attr(atr)).show(700);
    t.lastId = obj;
  }
};
