  function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

  function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }
  var balloonIsOpen;
  balloonIsOpen = 0;
  function doBalloon(obj,msg) {
  	balloonIsOpen = 1;
  	direction = 'north';
  	myX = findPosX (obj);
  	myY = findPosY (obj);
  	myBalloon = document.getElementById('helpballoon');
  	if (myX > 700) { direction = 'east'; 
  		if (myY > 500) { direction = 'south'; }
  	} else {
	  	if (myY > 500) { direction = 'west'; }
  	}
  	if (direction == 'north') {
  		offsetX = 30;
  		offsetY = 30;
  	}
  	if (direction == 'east') {
  		offsetX = -235;
  		offsetY = 30;
  	}
  	if (direction == 'south') {
  		offsetX = -235;
  		offsetY = -250;
  	}
  	if (direction == 'west') {
  		offsetX = 30;
  		offsetY = -250;
  	}
  	newBack = "url(images/helpballoon-" + direction + ".png)";
  	if (myBalloon.style.backgroundImage != newBack) {
  		myBalloon.style.backgroundImage = newBack;
  	}
  	myBalloon.style.left = myX + offsetX;
  	myBalloon.style.top = myY + offsetY;
  	setTimeout("myBalloon.style.display = 'block'",100);
  	setTimeout("helpiframe.location.href = 'helper.php?message=" + msg  + "'",400);
	return 0;
  }
  function hideBalloon () {
  	balloonIsOpen = 0;
  	myBalloon = document.getElementById('helpballoon');
  	setTimeout("dohideBalloon()",500);
  	return 0;
  }
  function dohideBalloon () {
  	if (balloonIsOpen == 0) {
  		 helpiframe.location.href ='about:blank';
  		 myBalloon.style.display = 'none'; 
  	}
  	return 0;
  }