function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
	this.obj = getObjNN4(document,name);
	this.style = this.obj;
  }
}

function getObjNN4(obj,name)
{
	var x = obj.layers;
	var foundLayer;
	for (var i=0;i<x.length;i++)
	{
		if (x[i].id == name)
		 	foundLayer = x[i];
		else if (x[i].layers.length)
			var tmp = getObjNN4(x[i],name);
		if (tmp) foundLayer = tmp;
	}
	return foundLayer;
}

function overBrigade(brigade)
{
	brigade.className = 'brigade_over';
}

function outBrigade(brigade)
{
	brigade.className = 'brigade';
}

var dialog = '';
function showDialog(url,w,h)
{
	if (!dialog.closed && dialog.location)
	{
		dialog.location.href = url;
	}
	else
	{
		LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
		 TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
		 h += 0;
		 w += 0;
		settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,noresizable';
		dialog = window.open(url,'_blank',settings);
		if (!dialog.opener) dialog.opener = self;
	}
	if (window.focus) 
	{
		dialog.focus();
	}
	return false;
}

