<script language="JavaScript">
function submit_form(value)
{
    parent.frm_input.document.inputform.chat_input.value = value;
    parent.frm_input.document.inputform.submit();
}

function get_nick()
{
    var nick = '';
    for(i=0; i<parent.frm_nicklist.document.nicklist.nick.length; i++)
         if(parent.frm_nicklist.document.nicklist.nick[i].checked)
             nick = parent.frm_nicklist.document.nicklist.nick[i].value;    
    return(nick);
}

function handle_quit()
{
    submit_form('/quit');
}

function handle_change_nick()
{
    newnick = prompt("Please enter your new nick name:","");
    submit_form('/nick '+newnick);
}

function handle_whois()
{
    nick = get_nick();

    if(nick != '')
    {
        submit_form('/whois '+nick);
    }
}

function handle_op()
{
    nick = get_nick();
    
    if(nick.substr(0, 1) == '@')
    {
        mode = '-o';
    }
    else
    {
        mode = '+o';
    }
    submit_form('/mode '+mode+' '+nick);
}

function handle_topic()
{
    newtopic = prompt("Please enter the new topic:","");
    submit_form('/topic '+newtopic);
}

function handle_kick()
{
    reason = prompt("Enter the reason for kicking the selected user:","");
    nick = get_nick();
    submit_form('/kick '+nick+' '+reason);
}
</script>
        <table border="0" cellpadding="1" cellspacing="0" bgcolor="#000080" width="100%">
          <tr valign="top"> 
            <td colspan="2"> 
              <table width="100%" border="0" cellspacing="0" cellpadding="0" align="right">
                <tr> 
                  <td align="left" bgcolor="#000080" height="16"><font color="#FFFFFF" size="-1"><b>&nbsp;Actions</b></font></td>
                  <td align="left" bgcolor="#F0F8FF" height="16"><img height=18 src="templates/end.gif" width=45></td>
                </tr>
                <tr valign="top"> 
                  <td bgcolor="#F0F8FF" colspan="2"> 
                    <table width="100%" border="0" bgcolor="#F0F8FF">
                      <tr valign="top"> 
                        <td bgcolor="#F0F8FF"> 
                          <p><a href="javascript:handle_quit();">Quit</a> | <a href="javascript:handle_change_nick();">Change Nick</a> | <a href="javascript:handle_whois();">WhoIs</a><br>{OP_ACTIONS}</p>
                        </td>
                      </tr>
                    </table>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
        </table>