function setTypeSize(oInt,oForm,Obj)
{	document.getElementById(oForm).getElementsByTagName('input')[0].value=oInt;

	var Elems=document.getElementById(oForm).getElementsByTagName('div');
	for(var i=0;i<Elems.length;i++)
	{		Elems[i].style.backgroundColor='white';
		Elems[i].style.color='black';
	}

	if(!oInt || oInt==0)
	{		Obj.style.backgroundColor='blue';
		Obj.style.color='white';
	}
	if(oInt==1)
	{		Obj.style.backgroundColor='blue';
		Obj.style.color='white';
	}
	if(oInt==2)
	{		Obj.style.backgroundColor='blue';
		Obj.style.color='white';
	}
}

function openTypeWin(WinId,WinPos)
{	if (WinPos)
	{
		var bounds = getBounds(WinPos);

		document.getElementById(WinId).style.top = 0+'px'; //bounds.top + 'px';
		document.getElementById(WinId).style.left = bounds.left+bounds.width-130 + 'px';
    }
	else
	{
		document.getElementById(WinId).style.top = 0+'px'; //Math.round(screen.height/2-document.getElementById(WinId).offsetHeight) + 'px';
		document.getElementById(WinId).style.left = Math.round(screen.width/2-document.getElementById(WinId).offsetWidth/2) + 'px';
    }
}

function getBounds(element)
{
  var left = element.offsetLeft;
  var top = element.offsetTop;
  for (var parent = element.offsetParent; parent; parent = parent.offsetParent)
  {
    left += parent.offsetLeft;
    top += parent.offsetTop;
  }
  return {left: left, top: top, width: element.offsetWidth, height: element.offsetHeight};
}
