<!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   name="robots" content="noindex, nofollow" />
<meta   http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>加好友 - <jcms:site.name/></title>
<script type="text/javascript" src="../_libs/jquery.tools.pack.js"></script>
<script type="text/javascript" src="../_data/jcmsV4.x.js"></script>
<link   type="text/css" rel="stylesheet" href="../_data/jcmsV4.x.css" />


<style type="text/css">
@import url(../style/member/style.css);
</style>
<script type="text/javascript">
var adduserid = q("adduserid");
var addusername = decodeURIComponent(q("addusername"));
(function(){
	$(document).ready(function(){
		$("#txtUserId").val(adduserid);
		$("#txtUserName").val(addusername);
		$('#friendaddForm').ajaxForm({
			beforeSubmit: JumbotCms.AjaxFormSubmit,
			success :function(data){
				JumbotCms.Eval(data);
			}
		}); 
		$.formValidator.initConfig({onError:function(msg){alert(msg);}});
		$("#txtUserName")
			.formValidator({tipid:"tipUserName",onshow:"",onfocus:"请输入对方用户名",oncorrect:"OK"})
			.InputValidator({min:4,max:20,onerror:"用户名非法"})
			.RegexValidator({regexp:"username",datatype:"enum",onerror:"汉字或字母开头,不支持符号"})
			.AjaxValidator({
			type : "get",
			url:		"friendadd_ajax.aspx?oper=checkname&time="+(new Date().getTime()),
			datatype : "json",
			success : function(d){	
				if(d.result == "1")
				{
					$("#txtUserId").val(d.returnval);
					return true;
				}
				else
				{
					$("#txtUserId").val("0");
					return false;
				}
			},
			buttons: $("#btnSave"),
			error: function(){alert("服务器没有返回数据，可能服务器忙，请重试");},
			onerror : "用户名不存在或为你本人",
			onwait : "正在校验用户名的合法性，请稍候..."
		}).DefaultPassed();
	});
	//Form验证
	JumbotCms.AjaxFormSubmit=function(item){
		try{
			if(jQuery.formValidator.PageIsValid('1'))
			{
				JumbotCms.Loading.show("正在处理，请稍等...");
				return true;
			}else{
				return false;
			}
		}catch(e){
			return false;
		}
	};
})();
</script>
</head>
<body>
<iframe frameborder="0" scrolling="no" src="../user/index_default.aspx?do=header" width="100%" height="76" marginwidth="0" marginheight="0" hspace="0" vspace="0" id="ifheader"></iframe>
<!--顶部结束,中框架开始-->
<div id="wrap">
	<div id="main">
		<div id="app_sidebar">
			<ul class="app_list" id="default_userapp">
				<li class="currently"><img src="../style/member/ico_home.gif"><a href="../user/index_default.aspx">个人中心首页</a></li>
			</ul>
			<ul class="app_list" id="my_userapp">
				<li class="hr"></li>
				<li><img src="../style/member/ico_contribute.gif"><a href="../user/contribute_default.aspx" target="_blank">我的投稿</a><em></em></li>
				<li><img src="../style/app/message.gif"><a href="../user/pmlist_default.aspx">短信</a><em><a href="../user/pmsend_default.aspx">发送</a></em></li>
				<li><img src="../style/app/friend.gif"><a href="../user/friendlist_default.aspx">好友</a><em><a href="../user/friendadd_default.aspx">添加</a></em></li>
				<li><img src="../style/app/mtag.gif"><a href="../mtag/index_default.aspx">群组</a><em><a href="../mtag/threadlist_default.aspx">话题</a></em></li>
				<li><img src="../style/app/favorite.gif"><a href="../user/favorite_default.aspx">收藏夹</a></li>
				
			</ul>
		</div>
		<div id="mainarea">
			<form id="friendaddForm" name="form1" method="post" action="?act=save" class="ajaxshowdiv">
				<h2 class="title"><img src="../style/app/friend.gif">好友</h2>
				<div class="tabs_header">
					<ul class="tabs">
						<li class="active"><a><span>加好友</span></a></li>
						<li><a href="../user/friendlist_default.aspx"><span>返回好友列表</span></a></li>
					</ul>
				</div>
				<div class="c_form">
					<table cellspacing="0" cellpadding="3">
						<tr>
							<th><label for="txtUserName">对方用户名：<input type="hidden" id="txtUserId" name="txtUserId" value="0" /></label></th>
							<td><input type="text" id="txtUserName" name="txtUserName" value="" style="width:120px;" class="t_input" tabindex="1" />
								<span id="tipUserName" style="width: 200px"></span>
							</td>
						</tr>
						<tr>
							<th>&nbsp;</th>
							<td><input type="submit" name="btn_submit" id="btn_submit" value="添加" class="submit" />
							</td>
						</tr>
			
					</table>
				</div>
			</form>
		</div>
		<div id="bottom"></div>
	</div>
	<div id="footer" title=""> </div>
</div>
<iframe frameborder="0" scrolling="no" src="../user/index_default.aspx?do=footer" width="100%" height="50" marginwidth="0" marginheight="0" hspace="0" vspace="0" id="iffooter"></iframe>
</body>
</html>
