




























function hide_block_popup(hide_caption, block_content, options) {
  if(options.noPopup) return [];
  block_content.unshift(_mkel("h2", hide_caption));
  var pu = element_to_popup(block_content, options);
  var contents;
  if(options.initialContentElement) {
    contents = [options.initialContentElement.cloneNode(true)];
  } else {
    contents = [hide_caption];
  }
  var link;
  if(options.fakeAnchor) {
    link = contents[0];
    link.style.cursor = "pointer";
  } else {
    link =  _mkel("a", { href: '#' }, contents);
  }
  link.onclick = function(e) {
    
    if(options.clickThrough) {
      e = e || window.event;
      if(e.originalTarget !== e.currentTarget) return true;
    }
    
    if(pu.parentNode && pu.parentNode === document.body) {
    } else {
      document.body.appendChild(pu);
      position_centred(e, pu);
      if(options.onLoad) options.onLoad.call(pu);
    }
    return false;
  };
  if(!options.noWrapper) {
    link =  _mkel("div", {
        style: {
          width: "100%",
          textAlign: "center",
          paddingBottom: "5px"
        }
      }, [
        _mkel("img", {
          src: "/images/icon_info.png", 
          style: {
            padding: "0px 10px 0px 0px",
            marginBottom: "-3px"
          },
          alt: "Information"
        }),
        link
      ]);
  }
  return [ link ];
}











function element_to_popup(element, options) {
  var popup_style = {
    position: "absolute"
  };
  function shadow_filter(spec) {
    return "progid:DXImageTransform.Microsoft.Shadow(" + spec + ")";
  }
  if(options.shadow) {
    if(broken_windows_browser) {
      popup_style.filter = [
        shadow_filter("color=black, strength=5"), 
        shadow_filter("color=black, strength=2, direction=135"), 
        shadow_filter("color=black, strength=2, direction=315")
      ].join(" ");
    } else {
      popup_style.MozBoxShadow =
        popup_style.webkitBoxShadow = 
          popup_style.BoxShadow = "-4px 4px 11px black";
    }
  }
  var icon = options.skipIcon ? "" :
    _mkel("img", {src: "/images/icon_large_info.png", alt: "Information"});
  var pu = _mkel("div", {
      style: popup_style,
      className: "ftpinfopopup"
    }, [
    _mkel("a", {
      href: "#",
      title: "close",
      onclick: function() {
        pu.parentNode.removeChild(pu);
        return false;
      }
    }, [
      _mkel("img", {src: "/images/pop-close.png", className: "closebtn"})
    ]),
    _mkel("div", {style: {clear: "both"}}),
    icon,
    _mkel("div", {className: "popright"}, element)
  ]);
  return pu;
}

