//Find position
function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

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];
  }
}
//var x = new getObj('layername');

var _POPUP_FEATURES = 'scrollbars=1,width=400,height=300';

function raw_popup(url, target, features) {
  if (!features) {
    features = _POPUP_FEATURES;
  }
  if (!target) {
    target = '_blank';
  }
  var w = window.open(url, target, features);
  w.focus();
  return w;
}

function popitup(src, features) {
  return raw_popup(src.getAttribute('href'), src.getAttribute('target') || '_blank', features);
}

function setTableRow(theRow, theRowNum, theAction) {
	setPointer(theRow, theRowNum, theAction, "#F2F2F2", "#F1F8F0", "#BBF9B8");
}

function setField(name, text) {
	s = "document.getElementById('"+name+"').innerHTML = \""+text+"\"";
	eval(s);
}
