function dinamic_menu(){
	this.start=0;
	this.opened=0;
	this.containsDOM= function (container, containee) {
	  var isParent = false;
	  do {
	    if ((isParent = container == containee))
	      break;
	    containee = containee.parentNode;
	  }
	  while (containee != null);
	  return isParent;
	};
	this.checkMouseEnter= function  (element, evt) {
	  if (element.contains && evt.fromElement) {
	    return !element.contains(evt.fromElement);
	  }
	  else if (evt.relatedTarget) {
	    return !containsDOM(element, evt.relatedTarget);
	  }
	};
	this.checkMouseLeave= function (element, evt) {
	  if (element.contains && evt.toElement) {
	    return !element.contains(evt.toElement);
	  }
	  else if (evt.relatedTarget) {
	    return !containsDOM(element, evt.relatedTarget);
	  }
	};
	this.ShowSecondMenu= function (m, k) {};
	this.DecorateCell= function (m,k) {};
	this.MouseOver= function (m)
	{
		if (this.start!=0 && m!=this.start && this.opened==0)
		{
			this.DecorateCell(this.start,false);
			this.ShowSecondMenu(this.start, false);
		}
		if (this.opened!=0 && this.opened!=m)
		{
			this.DecorateCell(this.opened,false);
			this.ShowSecondMenu(this.opened, false);
		}
		this.DecorateCell(m,true);
		this.ShowSecondMenu(m, true);
		this.opened = m;
	};
	this.MouseOut= function ()
	{
		if (this.opened!=0)
		{
			this.DecorateCell(this.opened,false);
			this.ShowSecondMenu(this.opened,false);
		}
		if (this.start!=0)
		{
			this.DecorateCell(this.start,true);
			this.ShowSecondMenu(this.start,true);
		}
		this.opened = 0;
	};
}