</head>
<body>
-<div id="spacer1" style="background: #aaaaaa"><br></div>
-<div id="tab_bar" style="background: #aaaaaa"> </div>
-<div id="spacer2" style="background: #aaaaaa"><br></div>
-<div id="main"></div>
+<div id="thetop" style="position:fixed;width:100%;height:15%;top:0%;left:0%">
+<div id="spacer1" style="background:#aaaaaa"><br></div>
+<div id="tab_bar" style="background:#aaaaaa"> </div>
+<div id="spacer2" style="background:#aaaaaa"><br></div>
+</div>
+
+<div id="main" style="position:fixed;width:100%;height:85%;top:15%;left:0%;overflow:auto;background:#ffffff"></div>
<script type="text/javascript">
var gexp_divs = new Array();
var num_gexp_divs = 0;
var shown_div = '';
+var my_name = '';
function SendSomething(which_div, sendform, recipient) {
thetext = document.forms[sendform].elements['sendthis'].value;
$(which_div).innerHTML = $(which_div).innerHTML
+ '<b>'
+ '<font color=\"#FF0000\">'
- + 'Me (FIXME)'
+ + my_name
+ '</font>'
+ ':</b> '
+ thetext
$('main').innerHTML =
$('main').innerHTML
+ '<div id=\"tab_' + which_div + '\" style=\"display:none;cursor:pointer\">'
- + '<div id=\"' + which_div + '\"></div>'
+ + '<div id=\"' + which_div + '\">'
+ + '</div>'
+ '<div id=\"response_' + which_div + '\">'
+ '<br><form method=\"post\" action=\"null\" name=\"sendform_' + which_div + '\" '
+ 'onSubmit=\"return SendSomething(\'' + which_div + '\', \'sendform_'
+ ':</b> '
+ the_message
+ '<br />\n';
+
+ // Scroll to the bottom of the tab
+ $(which_div).scrolltop = $(which_div).scrollHeight - $(which_div).clientHeight;
}
// This is called periodically to check for new incoming messages
);
}
-// ...and here's how we cause it to be called periodically.
+// Perform some initialization.
+parms = 'g_cmd=GREG _SELF_&r=' + Math.random();
+new Ajax.Request('../ajax_servcmd',
+ {
+ method: 'get',
+ parameters: parms,
+ onSuccess: GrabMyName
+ }
+);
+
+// Learn my name.
+function GrabMyName(greg_xmlresponse) {
+
+ // It isn't really XML. It's a Citadel server response.
+ greg_response = greg_xmlresponse.responseText;
+
+ if (greg_response.substring(0, 1) != '1') {
+ return;
+ }
+
+ // Extract fields...
+ breakpos = greg_response.indexOf('\n');
+ result = greg_response.substring(0, breakpos);
+ my_name = result.substring(4);
+}
+
+
+// Cause FetchNewMsgs() to be called periodically.
new PeriodicalExecuter(FetchNewMsgs, 3);
</script>