
var DHTML = (document.getElementById || document.all || document.layers);

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 = document.layers[name];
   	this.style = document.layers[name];
  }
}

function opacity(op_id,opacity,sec_id,newcolor)
{
	if (!DHTML) return;
	var x = new getObj(op_id);
	var y = new getObj(sec_id);
	x.style.filter = 'alpha(opacity='+opacity+')'
	var temp = opacity / 100;
	x.style.opacity = temp;
	y.style.backgroundColor = newcolor;
}

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function opaquelayer(lid,lyr,opacity,newcolor,calledby_hmu)
{
	var bid = new getObj(lyr);
	var newX = findPosX(lid);	

	bid.style.top = '52px';
	if(calledby_hmu)
	{
		newX += calledby_hmu;
	}
	newX+= 1;
	bid.style.left = newX + 'px';
	bid.style.filter = 'alpha(opacity='+opacity+')'
	var temp = opacity / 100;
	bid.style.opacity = temp;
	if(newcolor)
	{
		lid.style.backgroundColor = newcolor;
	}
}
