function move_box(an, box) {
  var cleft = -385;
  var ctop = 0;
  var obj = an;
  while (obj.offsetParent) {
    cleft += obj.offsetLeft;
    ctop += obj.offsetTop;
    obj = obj.offsetParent;
  }// end while
  box.style.left = cleft + 'px';
  ctop += an.offsetHeight + 8;
  if (document.body.currentStyle && document.body.currentStyle['marginTop']) {
    ctop += parseInt(document.body.currentStyle['marginTop']);
  }// end if
  box.style.top = ctop + 'px';
}// end function

function show_hide_box(an, width, height, borderStyle) {
  var href = an.href;
  var boxdiv = document.getElementById(href);

  //alert ('boxdiv = ' + boxdiv);

  if (boxdiv != null) {
    if (boxdiv.style.display=='none') {
      move_box(an, boxdiv);
      boxdiv.style.display='block';
    } else
      boxdiv.style.display='none';
    return false;
  }

  boxdiv = document.createElement('div');
  boxdiv.setAttribute('id', href);
  boxdiv.style.display = 'block';
  boxdiv.style.position = 'absolute';
  boxdiv.style.width = width + 'px';
  boxdiv.style.height = height + 'px';
  boxdiv.style.border = borderStyle;
  boxdiv.style.backgroundColor = 'transparent';
	boxdiv.style.zIindex = 99;
  //boxdiv.style.backgroundColor = '#fff';
  var close_button = '<a href="#" onClick="document.getElementById(\''+href+'\').style.display=\'none\'; return false;" style="background-color:#c0c0c0; border:solid red 1px; font-size:14px; font-weight:bold; position:absolute; right:1; top:1; text-decoration:none; font-family:arial; padding:1px 4px 1px 4px; z-index:5;">X</a>';
  //alert(close_button);
  boxdiv.innerHTML = close_button;

  var contents = document.createElement('iframe');
  contents.scrolling = 'no';
  contents.frameBorder = '0';
  contents.style.width = width + 'px';
  contents.style.height = height + 'px';
  contents.src = href;
  boxdiv.appendChild(contents);
  document.body.appendChild(boxdiv);
  move_box(an, boxdiv);

  return false;
}// end function
