<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7">
<link href="{$conf.url}/templates/{$conf.template}/css/celive.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="{$conf.url}/js/jquery.js"></script>
<script type="text/javascript" src="{$conf.url}/js/ajaxfileupload.js"></script>

<title>{$conf.company} {$lang.live_server} - Powered by CElive</title>
{$xajax_live}
{$ctrlenter}
{literal} 
<script type="text/javascript">
function putValue() {
	var now=new Date();
	parent.window.chat_display.document.getElementById('ChatHistory').innerHTML+='<font color=green>'+document.form1.name.value+' '+now.getHours()+':'+now.getMinutes()+':'+now.getSeconds()+'</font><br />'+document.form1.detail.value+'<br />';
	document.form1.detail.value="";
	document.form1.detail.focus();
}

function set_t_value(value)
{
	document.getElementById("detail").value=value;
	document.getElementById("detail").focus();
}

function ajaxFileUpload()
{
	$("#loading")
	.ajaxStart(function(){
		$(this).show();
	})
	.ajaxComplete(function(){
		$(this).hide();
	});

	$.ajaxFileUpload
	(
		{
			url:'doajaxfileupload.php',
			secureuri:false,
			fileElementId:'fileToUpload',
			dataType: 'json',
			success: function (data, status)
			{
				if(typeof(data.error) != 'undefined')
				{
					if(data.error != '')
					{
						alert(data.error);
					}else
					{						
						set_t_value(data.msg);
						xajax_Postdata(xajax.getFormValues(form1));putValue();document.form1.detail.focus();
					}
				}
			},
			error: function (data, status, e)
			{
				alert(e);
			}
		}
	)
	
	return false;

}
function wait(t){ 
	var i=1; 
	t.disabled=false; 
	var timer=setInterval(function(){
		i++;
		if(i>4){
			//alert('您说话太快了，歇息一下吧！');
			t.disabled=true;			
			i=1;
			clearInterva(timer);
		}
	},1000) 
} 
</script>
{/literal}
</head>

<body onLoad="form1.detail.focus();">

<!-- 页底 -->
<div id="footer">
<form id="form1" name="form1">
<input type="hidden" name="name" id="name" value="{$name}" />
<input type="hidden" name="chatid" id="chatid" value="{$chatid}" />

<div class="footer_content">
<textarea id="detail" class="input_box" style="overflow-y:auto;" name="detail" class="s_box" onKeyUp="javascript:return ctrlEnter(event);"></textarea>
<div class="btn_box"><a onClick="xajax_Postdata(xajax.getFormValues('form1'));putValue();document.form1.detail.focus();" class="send enter_btn"></a></div>
 </div>
</form>
</div>

</body>
</html>
