function CloseLivechatLayer(id) {
	$("#"+id).remove();
}
function ShowLivechatLayer(ID,LiveIDStr) {
	$(document.body).append('<div class="lrc_online-qq-bd" id="lrc_bd_'+LiveIDStr+'"><div class="lrc_live_ct_newtop"><img src="/images/live_ctnew_top.png" alt="" border="0" /><div class="lrc_live_ct_closebtn"><a rel="nofollow" href="#here" onClick=\'CloseLivechatLayer("lrc_bd_'+LiveIDStr+'")\'><img src="/images/live_ct_closebtn.png" alt="" border="0" /></a></div></div><div class="lrc_live_ct_newmid" id="'+LiveIDStr+'"><div align="center" style="margin:10px"><img src="/images/loader.gif"/></div></div><div class="lrc_live_ct_newbot"><img src="/images/live_ctnew_bot.png" alt="" border="0" /></div></div>');
    var offsetobj=$("#lrc_online_qq_hd_"+LiveIDStr).offset();
	var top=offsetobj.top;
	var left=offsetobj.left;
	if($.browser.msie) {
	$("#lrc_bd_"+LiveIDStr).css("top",top+20);
	}
	else {
		$("#lrc_bd_"+LiveIDStr).css("top",top+8);
	}
	$("#lrc_bd_"+LiveIDStr).css("left",left);
	$("#lrc_bd_"+LiveIDStr).slideDown();
	 $.post("/livechat/load.php",
       { AccountIDS:LiveIDStr,BoxID:ID},
       function(data){
         $("#"+LiveIDStr).html(data);
       } 
    ); 
	
	
}

function OnlyOneChat(LiveID) {
	var rs = $.ajax({
	url: "/livechat/onlyone_check.php",
	type:"POST",
	data:"AccountID="+LiveID,
	async: false   
	}).responseText;
	 if(rs.indexOf("Offline")!=-1) {
			$.nyroModalManual({url: "/ticket.php"}); 
		 }
		 else {
		  window.open ('/livechat/livechat.php?LiveID=livechat_'+LiveID, 'newwindow', 'height=340, width=550, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no');
 
	}
	
	
}
