$(document).ready(function(){ 
	// jQuery 自定义函数
	$.extend({

		jQueryLogin : function ( _userid, _passwd, _cookie ){
		    $.post(
		  	      'ajaxlogin.php',
		  	      {
			  	    act:"YitaiLogin",
		  	    	MemberID:_userid,
		  	    	MemberPassWord:_passwd,
					iscookie:_cookie
		  	      },
		  	      function (data) //回传函数
		  	      {
						eval(data);
						
						if (mID == '') {
							alert(msg);
							return;
						}
						try {
							//$("#welcome_name_li").innerHTML="欢迎您:"+msg;
							document.getElementById('welcome_name_li').innerHTML="欢迎您:"+msg;
							onUserLogin(mEtelNo, mPasswd, mPermitPublish);
						}catch(e){
						}
						try {
							nodeng();
						}catch(e){
						}
						
						if (ShopFlag != '1' && index_title < 50) {
							try {
							//if(objExists('mainFrame.mainFrame14.regshoptitle')){
								mainFrame.mainFrame14.document.getElementById('regshoptitle').style.display='';
							//}
							}catch(e){
							}
						}
						if (index_title == 1000) {
							try{
							//if(objExists('mainFrame.loginb2ctitle')){
								mainFrame.document.getElementById('loginb2ctitle').style.display='';
							//}
							}catch(e){
							}
						}
						try{
							mainFrame.document.getElementById('friendFrame').src="friends.php";
							//mainFrame.mainFrame14.frames.item('mainframe_shop').location.reload(); // 在火狐下不行
							//mainFrame.mainFrame14.frames.item('mainframe_shop').location.href='all_topic.action';
							mainFrame.mainFrame14.frames['mainFrame_yt'].location.reload();
						}catch(e){
						}
						var m='尊敬的乙太国际会员：\n您还没有登录“乙太天下通终端通讯软件”吧？\n请下载安装“乙太天下通终端通讯软件”，然后用您的注册帐号和密码登录“乙太天下通”，您即可享受乙太公司为您提供的优质视讯服务了。\n“乙太天下通”为三网融合的视音频应用软件，属乙太国际首创。\n乙太国际竭诚为您架起沟通创造价值的高效服务平台，力图使地球变成一间屋，使您感受天涯若比邻的亲和......';
						//alert(m);
						checkETelLogin(m);
		  	      }
		  	);
		},
		jCallService : function ( _serviceid ){
		    $.post(
		  	      'xmlrpc/callservice.php',
		  	      {
			  	    act:"CallService",
			  	    serviceid:_serviceid
		  	      },
		  	      function (data) //回传函数
		  	      {
						if(data.replace(/(^\s*)|(\s*$)/g,"") == "ok") {
							alert("正在呼叫客服......");
						}
		  	      }
		  	);
		}
	});

});

function CallService(sid)
{
	if (top.mID == '') {
		alert('您必须先登录，才能和客服进行在线通话！');
		tanceng();
		return false;
	}
	if (confirm('在线呼叫在线客户将会呼叫到您的手机，是否确定现在呼叫在线客服！')){
		$.jCallService(sid);
	}
	return false;
}

