function createContent() {
    var link = newnode("div", { marginTop: "2em", marginBottom: "2em" }, 0, [
        newnode("img", { verticalAlign: "middle", paddingRight: "7px" },
            { src: getFullImgSrc("img/infostore/infostore_save.gif") }),
        newnode("a", 0, { href: "#" }, [addTranslated(
            _("Download updater for the Connector for Microsoft Outlook"))])]);
    addDOMEvent(link, "click", function(e) {
        stopEvent(e);
        $("dlIframe").src =
            AjaxRoot + "/updater/installer/oxupdater-install.exe?session=" + session;
    });
    return newnode("div", 0, 0, [link,
        newnode("div", 0, 0, [addTranslated(
            _("When activating this option an installation wizard will be launched."))]),
        newnode("div", 0, 0, [addTranslated(
            _("Follow the instructions and install the updater."))]),
        newnode("div", 0, 0, [addTranslated(
            _("The updater will inform you of any updates for the Connector for Microsoft Outlook."))]),
        newnode("div", 0, 0, [addTranslated(
            _("You can download the updates from within the updater."))]),
        newnode("div", { height: "1em" }, 0, []),
        newnode("div", { fontWeight: "bold" }, 0, [addTranslated(
            _("Connector for Microsoft Outlook"))]),
        newnode("div", 0, 0, [addTranslated(
            _("Enables offline access to e-mail, calendar, tasks, and contacts folders. Any changes that are made using Microsoft Outlook offline will be automatically synchronized the next time you go online:"))]),
        newnode("div", 0, 0, [addTranslated(
            _("Client PC operating system: Windows XP, Windows Vista, Windows 7"))]),
        newnode("div", 0, 0, [addTranslated(
            _("Supported Outlook versions (Connector for Microsoft Outlook): Microsoft Outlook 2003, Microsoft Outlook 2007"))]),
        newnode("div", 0, 0, [addTranslated(
            _("Supported Outlook versions (Connector 2 for Microsoft Outlook): Microsoft Outlook 2003, Microsoft Outlook 2007, Outlook 2010 "))])
    ]);
}

var node = new ox.Configuration.LeafNode("configuration/outlook.updater",
                                         _("Connector for Microsoft Outlook"));

if (configGetKey("modules")["com.openexchange.wizard"]) {
    var imgpath = "../../plugins/com.openexchange.oxupdater/images/";
    var tab = {
        name: "oxupdater",
        enabled: false,
        visible: true,
        position: 0,

        headerImage: newnode("img", { padding: "5px" },
                                    { src: getFullImgSrc(imgpath + "wizard_d.png") }),

        welcome_node: newnode("tr", 0 , 0, [
            newnode("td", { paddingTop: "5px", paddingleft: "5px" }, 0, [
                newnode("img", 0, { className: "wizzardGridBox",
                                    src: getFullImgSrc(imgpath + "wizard_mini.png") })
            ]),
            newnode("td", { paddingTop: "5px" }, 0, [
                addTranslated(_("Download Updater"))
            ])
        ]),
        
        content: createContent(),

        draw: function(wizard) {
            $("popup.wizzard.next").value = _("Next");
            $("popup.wizzard.back").value = _("Previous");
            
            var title = $("popup.wizzard.header").getElementsByTagName("span")[0];
            removeChildNodes(title);
            if (!this.title) {
                this.title = addTranslated(format(
                    //#. %d is the step number.
                    //#, c-format
                    _("Step %d. Download Updater"), this.position));
            }
            title.appendChild(this.title);
            
            var header = document.getElementById("wizzardHeaderTitle");     
            removeChildNodes(header);
            header.appendChild(document.createTextNode(_("Connector for Microsoft Outlook")));
            
            this.headerImage.src = getFullImgSrc(imgpath + "wizard.png");

            var base = document.getElementById("wizzardConten");
            removeChildNodes(base);
            base.appendChild(this.content);
        },
        next: function(callback) {
            this.headerImage.src = getFullImgSrc(imgpath + "wizard.png");
            callback();
        },
        previous: function(callback) {
            this.headerImage.src = getFullImgSrc(imgpath + "wizard_d.png");
            callback();
        }
    };
    temporary.services.provide("com.openexchange.wizard", tab);
}

var coou = "com.openexchange.oxupdater";
var menuID = "com.openexchange.synchronization.menu";
var menu = new MenuNodes.Section("com.openexchange.synchronization",
    _("Synchronization"), -1);
var button = new MenuNodes.Button(_("Microsoft Outlook"));
button.icon = "img/infostore/infostore_save.gif";
button.disabledIcon = "img/infostore/infostore_save_d.gif";
button.click = function() { triggerEvent("OX_Switch_View", node.id); };
menu.add(button);
menu.show("portal");

var page = new ox.Configuration.Page(node, _("Connector for Microsoft Outlook"), false);
page.viewModified = function() { return false; };
var widget = new ox.UI.Widget();
widget.content = createContent();
widget.addContent = function() { this.parent.addRow(this.content); };
page.addWidget(widget);
