<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NewAccount.aspx.cs" Inherits="edu.jhu.Cas.Web.NewAccount" %>
<%@ Register TagPrefix="uc1" TagName="Trailer" Src="Trailer.ascx" %>
<%@ Register TagPrefix="uc2" TagName="Header" Src="top.ascx" %>

<!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 id="Head1" runat="server">
    <title>Create a new account</title>
    <link href="cjobs.css" rel="stylesheet" />
    <script type="text/javascript">
        function toggle() {
            var radios = document.getElementsByName('radio');

            for (var i = 0, length = radios.length; i < length; i++) {
                if (radios[i].checked) {
                    if (radios[i].value == 'RadioLink') {
                        document.getElementById('userid').disabled = false;
                        document.getElementById('password').disabled = false;
                    }
                    else {
                        document.getElementById('userid').disabled = 'disabled';
                        document.getElementById('password').disabled = 'disabled';
                    }
                }
            }
        }
    </script>
</head>
<body>
    <uc2:Header ID="Header" runat="server" />
    <form id="form1" runat="server">
    <div>
        <div style="margin:5 0 5 0;padding:0 5 0 5;" class="message">
        <%=lmessage %> 
        </div>
        <br />
        <input type="radio" checked="checked" value="RadioCreate" name="radio" onchange="toggle()">Create a new account</input><p />
                <table class="uform" style="padding:0 0 0 0;margin:0 0 0 0;">
                <tr>
                    <th class="bx">
                        User ID</th>
                    <td>
                        <%=newUserId %></td>
                </tr>
                <tr>
                    <th class="bx">
                        Full name</th>
                    <td>
                        <%=newFullName %></td>
                </tr>
            </table>
            <br />
        <input type="radio" value="RadioLink" name="radio" onchange="toggle()">Link with an existing account</input><p />
            <table class="uform" style="padding:0 0 0 0;margin:0 0 0 0;">
                <tr>
                    <th class="bx">
                        User ID</th>
                    <td>
                        <input id="userid" style="width: 100" type="text" name="userid" disabled="disabled"/></td>
                </tr>
                <tr>
                    <th class="bx">
                        Password</th>
                    <td>
                        <input id="password" style="width: 100" type="password" name="password" disabled="disabled"/></td>
                </tr>
            </table>
            <br />
            <asp:Button id="ButtonOK" text="OK" onclick="ButtonOK_Click" runat="server" />
            <asp:Button id="ButtonCancel" text="Cancel" onclick="ButtonCancel_Click" runat="server" />
            <br />
            <br />
    </div>
    </form>
    <uc1:Trailer ID="Trailer1" runat="server" cvsTag="$Name$" cvsRev="$Revision: 144061 $"></uc1:Trailer>
</body>
</html>
