  function scrollIntoView(a) {
    document.getElementsByName(a)[0].scrollIntoView(true);
    if (navigator.userAgent.indexOf("MSIE")==-1){
      document.getElementsByName(a)[0].parentNode.scrollTop-=20;
      }
    else {
      document.getElementsByName(a)[0].parentNode.scrollLeft=0;
      };
    };

  function findPos(obj) {
    var curleft = curtop = 0;
    if (obj.offsetParent) {
      do {
        curleft += obj.offsetLeft;
        curtop += obj.offsetTop;
        }
      while (obj = obj.offsetParent);
      return [curleft,curtop];
      };
    };

  function showSubmenu(submenu,plek) {
    document.getElementById(submenu).style.visibility='visible';
    document.getElementById(plek).style.visibility='hidden';
    };

  function popupSubmenu(submenu,plek) {
    document.getElementById(submenu).style.left=findPos(document.getElementById(plek))[0]+'px';
    document.getElementById(submenu).style.top=findPos(document.getElementById(plek))[1]+'px';
    showSubmenu(submenu,plek);
    };

  function hideSubmenu(submenu,plek) {
    showSubmenu(plek,submenu);
    };

  function outDiv(e,divId) {
    if (!e) var e = window.event;
    var reltg = (e.relatedTarget) ? e.relatedTarget : e.toElement;
    while (reltg!=null && reltg.nodeName != 'BODY' && reltg.id != divId) reltg= reltg.parentNode;
    if (reltg== null || reltg.nodeName == 'BODY') return true; // Mouseout took place when mouse actually left layer
    return false;
    };


function testIt(obj) {
	for (var i in obj)
	{
		alert(i+' : ' + obj[i])
	}
  }

function setOpacity(id, opacityAsInt) {
  var opacityAsDecimal = opacityAsInt;
  if (opacityAsInt > 100)
    opacityAsInt = opacityAsDecimal = 100
  else if (opacityAsInt < 0) opacityAsInt = opacityAsDecimal = 0; 
  opacityAsDecimal /= 100;
  if (opacityAsInt < 1) opacityAsInt = 1; // IE7 bug, text smoothing cuts out if 0
  document.getElementById(id).style.opacity = (opacityAsDecimal);
  document.getElementById(id).style.filter  = "alpha(opacity=" + opacityAsInt + ")";
  };

function growOpacity(id) {
  for (var op=1; op<= 50; op++) {
    setTimeout("setOpacity('"+id+"',"+op*2+")",op*20);
    };
  }; 


