function idle() {}

function showHint(_input, box_id, text, offset, redraw, timeout){

//  alert("1showHint" + _input + " " + box_id + " " + text + " " +offset+ " "+redraw);

  var dy=-30;

  if (document.box_id != null  && !redraw){
		hideHint();
		document.box_id=null;
  }

  var kx=1.0;
  var ky=1.0;

  if( typeof( window.innerWidth ) == 'number' ) {
		//   	alert('FireFox');
		kx=0.98;
		ky=1.2;
  }

  document.box_id=box_id;
  document.active_field = _input;

  var x = findPosX(_input) + offset * kx;
  var y = findPosY(_input) + dy * ky; 


  var celm = document.getElementById('hint_frame_text');
  if (celm)
      celm.innerHTML=text;

  celm = document.getElementById(document.box_id);
  celm.style.top=y + 'px';
  celm.style.left=x + 'px';
  celm.style.display='';


  document.offsetX=offset;
//  document.offsetY=-dy;
  document._input=_input;
  document._text = text;

	if (timeout && timeout > 0)
		setTimeout(hideHint, timeout);
}

function RedrawHint() {
	if (document.box_id==null) return;
	showHint(document._input, document.box_id, document._text, document.offsetX, true);
}

function hideHint(doit){
  
  if (null == document.box_id){
		return;
  }

  var celm = document.getElementById(document.box_id);
  celm.style.display='none';
  document.box_id=null;
  document.active_field = null;
}

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 findPosY(obj)
{
    var curtop = 0;
    if (obj.offsetParent)
    {
        while (obj.offsetParent)
        {
            curtop += obj.offsetTop
            obj = obj.offsetParent;
        }
    }
    else if (obj.y)
        curtop += obj.y;
    return curtop;
}