<%@ Page Language="C#" validateRequest="false" AutoEventWireup="true" CodeBehind="AppTest.aspx.cs" Inherits="ACS.Radix.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .tabHeader {
            border-width: thin;
            border-style: solid;
            border-bottom-style: none;
            border-color: darkgray;
            text-decoration: none;
            color: black;
            display: inline-block;
            padding: 8px;
            background-color: silver;
        }

        .tabHeaderActive {
            background-color: lightblue !important;
        }

        .tab {
            border-width: thin;
            border-style: solid;
            border-color: darkgray;
            padding: 8px;
        }

        .buttonCell {
            padding-right: 8px;
        }

        .resultBox {
            width: 100%;
            height: 500px;
        }
    </style>
    <script type='text/javascript'>

        function setTabVisible(tabID, tabHeaderID, activeID) {
            if (tabID.toUpperCase() == activeID.toUpperCase()) {
                document.getElementById(tabID).style.display = 'block';
                document.getElementById(tabHeaderID).className = 'tabHeader tabHeaderActive';
            }
            else {
                document.getElementById(tabID).style.display = 'none';
                document.getElementById(tabHeaderID).className = 'tabHeader';
            }
        }

        function activateTab(tabID, clearMemo) {
            setTabVisible('tab1', 'tabHeader1', tabID);
            setTabVisible('tabTest', 'tabHeaderTest', tabID);
            setTabVisible('tab2', 'tabHeader2', tabID);
            setTabVisible('tab3', 'tabHeader3', tabID);
            document.getElementById('activeTab').value = tabID;

            if (clearMemo == true)
                document.getElementById('meResult').value = '';
        }

    </script>

</head>
<body>
    <form id="form1" runat="server">
        <input id="activeTab" runat="server" type="hidden" />
        <div>
            <a id="tabHeader1" href="javascript:activateTab('tab1', true)" class="tabHeader">Servicetest</a>
            <a id="tabHeaderTest" href="javascript:activateTab('tabTest', true)" class="tabHeader">Test</a>
            <a id="tabHeader2" href="javascript:activateTab('tab2', true)" class="tabHeader">Config</a>
            <a id="tabHeader3" href="javascript:activateTab('tab3', true)" class="tabHeader">Other</a>
        </div>
        <div id="tab1" class="tab">
            <table>
                <tr>
                    <td class="buttonCell">
                        <asp:Button ID="btTestRunning" runat="server" Text="Webservice OK?" OnClick="btTestRunning_Click" />
                    </td>
                </tr>
            </table>
        </div>
        <div id="tabTest" class="tab">
            <table>
                <tr>
                    <td class="buttonCell">
                        <asp:Label ID="laUser" runat="server" Text="Radix User"></asp:Label>
                    </td>
                    <td class="buttonCell">
                        <asp:TextBox ID="edUser" runat="server"></asp:TextBox>
                    </td>
                    <td class="buttonCell">
                        <asp:Label ID="laPass" runat="server" Text="Radix Password"></asp:Label>
                    </td>
                    <td class="buttonCell">
                        <asp:TextBox ID="edPassword" runat="server" TextMode="Password"></asp:TextBox>
                    </td>
                    <td class="buttonCell">
                        <asp:CheckBox ID="cbCheckRol" runat="server" Text="Role anzeigen" />
                    </td>
                    <td class="buttonCell">
                        <asp:CheckBox ID="cbReadStammdaten" runat="server" Text="Stammdatenanzahl anzeigen" />
                    </td>
                    <td class="buttonCell">
                        <asp:Button ID="btTest" runat="server" Text="Kontrolle" OnClick="btTest_Click" />
                    </td>
                    <td class="buttonCell">
                        <asp:Button ID="btnCheckExchange" runat="server" Text="Test Exchange Settings" OnClick="btnCheckExchange_Click" />
                    </td>
                </tr>
            </table>
        </div>
        <div id="tab2" class="tab">
            <table>
                <tr>
                    <td class="buttonCell">
                        <asp:Button ID="btnSaveConfig" runat="server" Text="Save Config" OnClick="btnSaveConfig_Click" />
                    </td>
                    <td class="buttonCell">
                        <asp:Button ID="btnChangeConfig" runat="server" Text="Change Config" OnClick="btnChangeConfig_Click" />
                    </td>
                </tr>
            </table>
        </div>
        <div id="tab3" class="tab">
            <table>
                <tr>
                    <td class="buttonCell">
                        <asp:Button ID="btnProtokoll" runat="server" Text="Get protocol" OnClick="btnProtokoll_Click" />
                    </td>                                          
                    <td class="buttonCell">
                        <asp:Button ID="btnHTMLConvert" runat="server" Text="Convert To HTML" OnClick="btnHTMLConvert_Click" />
                    </td>
                    <td class="buttonCell">
                        <asp:Button ID="btnHTMLConvertToText" runat="server" Text="Convert HTML to Text" OnClick="btnHTMLConvertToText_Click" />
                    </td>
                </tr>
            </table>
        </div>

        <script type="text/javascript">
            var startTab = document.getElementById('activeTab').value;
            if (startTab == '')
                startTab = 'tab1';
            activateTab(startTab);
        </script>
        <br />
        <asp:TextBox ID="meResult" runat="server" TextMode="MultiLine" ClientIDMode="Static" CssClass="resultBox"
            ></asp:TextBox>
        <br />
    </form>
</body>
</html>
