<script type="text/javascript">
//<![CDATA[
<!-- // Hide JS from HTML Validator
// Added like this to allow those without JS to still function nicely.
var chat_display = "{$this->ipsclass->vars['chat_display']}";
var chat_pad     = parseInt( "{$this->ipsclass->vars['chat_poppad']}" );
var chat_height  = parseInt( "{$this->ipsclass->vars['chat_height']}" );
var chat_width   = parseInt( "{$this->ipsclass->vars['chat_width']}" );
var popped       = parseInt( "{$this->ipsclass->input['pop']}" );
var chat_tol;
var chat_tol_time = 60 * 1000; // 60 seconds
chat_pad     = chat_pad ? chat_pad : 50;
chat_height += chat_pad;
chat_width  += chat_pad;
if ( chat_display != 'self' && popped != 1 )
{
	window.open( ipb_var_base_url + 'autocom=chatsigma&pop=1','Chat','width='+chat_width+',height='+chat_height+',resizable=yes,scrollbars=yes');
	// Bounce back to board index
	locationjump();
}
//]]>
//-->
</script>
<div class="borderwrap">
	<div class="maintitle"><{CAT_IMG}>&nbsp;{$this->ipsclass->lang['chat_title']}</div>
	<div class="tablepad" align="center">
	 <div style='border:8px outset #BCD0ED;width:{$w}px;' id="chatwrap">
		<applet codebase="http://{$server}/current/" code="Client.class" archive="scclient_$lang.zip" width="$w" height="$h" MAYSCRIPT>
			<param name="room" value="$acc_no">
			<param name="cabbase" value="scclient_$lang.cab">
			<param name="username" value="$user">
			<param name="password" value="$pass">
			<param name="autologin" value="yes">
		</applet>
	  </div>
	</div>
</div>
<br />
<div class="borderwrap">
	<div class="maintitle"><{CAT_IMG}>&nbsp;{$this->ipsclass->lang['chat_help']}</div>
	<div class="tablepad">
		{$this->ipsclass->lang['chat_help_text']}
	</div>
</div>
<script type="text/javascript">
//<![CDATA[
// Set timeout loop to update session's table.
if ( use_enhanced_js )
{
	chat_ping_session();
}
function chat_ping_session()
{
	do_request_function = function()
	{
		if ( ! xmlobj.readystate_ready_and_ok() )
		{
			return;
		}
		
		var returned = xmlobj.xmlhandler.responseText;
		
		if ( returned == 'ok' )
		{
			chat_tol = setTimeout( 'chat_ping_session()', chat_tol_time );
		}
	}
	
	xmlobj = new ajax_request();
	xmlobj.onreadystatechange( do_request_function );
	xmlobj.process( ipb_var_base_url + 'autocom=chatsigma&code=update' );
}
//]]>
</script>