var _FScache = null;
var _FSiframe = null;
var _FSbtnClose = null;

var uri = "http://quants.factsheetslive.com/funds/DE000A0RKY52/portrait";

var FSopen = function() {
    if (!_FScache) {
        _FScache = new Element("div").setStyle({position: "absolute", top: "0px", left: "0px", zIndex: 99, background: "black", opacity: 0.7});
        _FSiframe = new Element("iframe", {src: uri, frameborder: "no"}).setStyle({position: "absolute", width: "700px", top: "20px", zIndex: 100, border: "1px solid #333333"});
        _FSbtnClose = new Element("div").setStyle({position: "absolute", width: "100px", top: "31px", zIndex: 101, background: "white", textAlign: "right", padding: "5px 0px"});
        _FSbtnClose.update("<a href=\"#\" onclick=\"FSclose()\" class=\"FSlink\"><span>Schlie&szlig;en</span><img src=\"close.gif\" alt=\"\" style=\"border: 0px none; margin: 0px 10px -3px 5px\" /></a>");
        Element.insert(document.body, _FScache);
        Element.insert(document.body, _FSiframe);
        Element.insert(document.body, _FSbtnClose);
    }
    _FScache.show();
    _FSiframe.show();
    _FSbtnClose.show();
    FSresize();
};
var FSclose = function() {
    if (!_FScache) return;
    _FSbtnClose.hide();
    _FSiframe.hide();
    _FScache.hide();
};
var FSresize = function() {
    var v = document.viewport.getDimensions();
    if (_FScache) _FScache.setStyle({width: v.width + "px", height: v.height + "px"});
    if (_FSiframe) _FSiframe.setStyle({height: (v.height - 40) + "px", left: (v.width - 700) / 2 + "px"});
    if (_FSbtnClose) _FSbtnClose.setStyle({left: (v.width - (v.width - 700) / 2 - 100 - 9) + "px"});
}
Element.observe(window, "resize", FSresize);
