﻿
/*足球：%u8DB3%u7403
  篮球：%u7BEE%u7403
  电竞俱乐部：%u7535%u7ADE%u4FF1%u4E50%u90E8
  两次escape
  足球：%25u8DB3%25u7403
  篮球：%25u7BEE%25u7403
  电竞俱乐部：%25u7535%25u7ADE%25u4FF1%25u4E50%25u90E8
  */
/*约战导航*/
function setFrombattle()
{

	var t=unescape(unescape(gC('loginName')));
	var s='';
	if (t!=''&&t!='0'){
		/*if(document.location.href.indexOf("battle_create1")>0||document.location.href.indexOf("battle_manage1.asp")>0){
			if(gC("userTeam")==""||gC("userTeam")=="0"){
				//Tip.Cusfirm("你还没有创建球队，你是否要创建球队？","question",false,[['创建',function(){document.location.href='/team/team_create.asp';Tip.Cancel();}],['取消',function(){document.location.href='/battle/index.asp';Tip.Cancel();}]]);
				//alert("您还没有创建球队---权限错误");
			}
		}*/	
		if(g('indexlogin')){
			g('indexlogin').innerHTML='<a href="/space/blog.asp?id='+gC("userId")+'" target="_blank">账户</a>/<a href="javascript:User.Logout();">退出</a>';
			return;
		}
		if(!g('log_userFormbattle')){return;}
		getUserInfo();
	}
	else{
		return;
			s='<table width="719" border="0" cellspacing="0" cellpadding="0"><tr><td width="480"><table width="333" border="0" cellspacing="0" cellpadding="0"><tr><td height="24" ><!--已有 <span class="regAll" id="battleuserall">&nbsp;</span> 人入住商都体育社区--><span class="regAll">商都网BBS用户可直接登陆</span></td></tr><tr><td height="24" ><a href="/space/blog.asp?id=3883" class="yellowAll" style="color:#0000ee;" target="_blank">河南足球协会</a>&nbsp;&nbsp;<a href="/space/blog.asp?id=4487" class="yellowAll" style="color:#0000ee;" target="_blank">郑州足球协会</a></td></tr></table></td><td width="239"><table width="239" border="0" align="right" cellpadding="0" cellspacing="0"><tr><td width="47"><img src="/images/home/p_top01.jpg" width="40" height="40" /></td><td width="182" class="HOME12lan"><a href="#" class="HOME12lan">欢迎您</a><br /> <a href="javascript:void(0)" class="HOME12lan" onclick="userMustlogin()">登陆</a> │<a href="/reg.asp" class="HOME12lan">注册</a></td></tr></table></td></tr></table>';
			g('log_userFormbattle').innerHTML=s;
			setTimeout(function(){getalluser()},100);
			sC("userId","0");
			sC("loginName","0");
			sC("userLevel","0");
			sC("userAuth","0");
			sC("userTeam","0"); 
			sC("userName","0"); 
	}
}
function userMustlogin()
{
	User.Gru='|root|admin|operator|user|';
	User.Check(true);
}
function getUserInfo()
{//0username,1nickName,2email,3contect,4bday,5userset,6website,7icq,8qq,9yahoo,10msn,11skype,12location,13customstatus,14avatar,15realname,16mobile,17phone,18address")
	 var u=rt+'pro/user.asp?op=getProfile&id='+gC("userId");
	 var x=function(o){
		 var t=aRP(unescape(o.responseText)).split('$');
		 var s='<table width="719" border="0" cellspacing="0" cellpadding="0"><tr><td width="480"><table width="476" border="0" cellspacing="0" cellpadding="0"><tr><td height="24"><!--已有 <span class="regAll" id="battleuserall">&nbsp;</span> 人入住商都体育社区--><span class="regAll">商都网BBS用户可直接登陆</span></td></tr><tr><td height="24"><a href="/space/blog.asp?id=3883" class="yellowAll" style="color:#0000ee;" target="_blank">河南足球协会</a>&nbsp;&nbsp;<a href="/space/blog.asp?id=4487" class="yellowAll" style="color:#0000ee;" target="_blank">郑州足球协会</a></td></tr></table></td><td width="219"><table width="219" border="0" align="right" cellpadding="0" cellspacing="0"><tr><td width="47"><a href="/space/blog.asp?id='+gC('userId')+'">'+getUserHead(t[14],40)+'</a>';
		 s+='</td><td class="HOME12lan"><a href="/space/blog.asp?id='+gC('userId')+'" class="HOME12lan" id="personspacelogin">'+t[0]+'</a><br /><a href="/space/blog.asp?id='+gC('userId')+'" id="personspacelogin" class="HOME12lan">个人主页</a> │ <a href="/space/profile_manage.asp" class="HOME12lan">设置</a> │ <a href="javascript:void(0);" class="HOME12lan" onclick="User.Logout();">退出</a></td></tr></table></td></tr></table>';
		 g('log_userFormbattle').innerHTML=s;
		 //alert("对象："+g('log_userFormbattle'));
		 setTimeout(function(){getalluser()},100);
	 }
	 gD(u,x);
}
/*侧边栏的操作*/
/*队伍*/
var LeftBar=new function()
{
	var bar=this;
	function isCreateTeamT()
	{
		var u='/app/sns_Unite.aspx?op=getIdByUser&uid='+gC('userId');//userCount$能管理的球队总数$创建球队的总数
		var x=function(o){
			var t=aRP(unescape(o.responseText)).split('$');
			if(t[1]=="0")
			{
				document.location.href="/team/team_create.asp";
			}
			else
			{
				document.location.href="/team/team_personlist.asp?uid="+gC("userId");
			}
		}
		gD(u,x);
	}
	function isCreateTeamA()//相册
	{
		var u='/app/sns_Unite.aspx?op=getIdByUser&uid='+gC('userId');
		var x=function(o){
			var t=aRP(unescape(o.responseText)).split('$');
			if(t[1]=="0")
			{
				document.location.href="/team/team_create.asp";
			}
			else
			{
				document.location.href="/team/team_personlist.asp?uid="+gC("userId");
			}
		}
		gD(u,x);
	}
	function isCreateTeamP()//话题
	{
		var u='/app/sns_Unite.aspx?op=getIdByUser&uid='+gC('userId');
		var x=function(o){
			var t=aRP(unescape(o.responseText)).split('$');
			if(t[1]=="0")
			{
				document.location.href="/team/team_create.asp";
			}
			else
			{
				document.location.href="/team/team_personlist.asp?uid="+gC("userId");
			}
		}
		gD(u,x);
	}
	function isCreateTeamM()//球队管理
	{
		var u='/app/sns_Unite.aspx?op=getIdByUser&uid='+gC('userId');
		var x=function(o){
			var t=aRP(unescape(o.responseText)).split('$');
			if(t[1]=="0")
			{
				document.location.href="/team/team_create.asp";
			}
			else
			{
				document.location.href="/team/team_personlist.asp?uid="+gC("userId");
			}
		}
		gD(u,x);
	}
	function isCreateTeamC()//创建球队
	{
		var u='/app/sns_Unite.aspx?op=getIdByUser&uid='+gC('userId');
		var x=function(o){
			var t=aRP(unescape(o.responseText)).split('$');
			if(t[2]=="0")
			{
				document.location.href="/team/team_create.asp";
			}
			else
			{
				Tip.Warn("您已经创建过球队,请不要重复创建","wrong",false,2);
			}
		}
		gD(u,x);
	}
	function isCreateTeamSubBattle()//发布约战
	{
		var u='/app/sns_Unite.aspx?op=getIdByUser&uid='+gC('userId');
		var x=function(o){
			var t=aRP(unescape(o.responseText)).split('$');
			if(t[1]=="0")
			{
				Tip.Warn("你还没有创建球队，请先创建球队","right",false,2);
			}
			else
			{
				document.location.href="/team/team_personlist.asp?uid="+gC("userId");
			}
		}
		gD(u,x);
	}
	function isCreateTeamBattleMan()//约战管理
	{
		var u='/app/sns_Unite.aspx?op=getIdByUser&uid='+gC('userId');
		var x=function(o){
			var t=aRP(unescape(o.responseText)).split('$');
			if(t[1]=="0")
			{
				Tip.Warn("你还没有创建球队，请先创建球队","right",false,2);
			}
			else
			{
				document.location.href="/team/team_personlist.asp?uid="+gC("userId");
			}
		}
		gD(u,x);
	}
	function isVenueLogin(){//我的场馆管理
		document.location.href="/venue/venue_manage.asp";
	}
	function isBlogLogin(){//我的博客发布
		document.location.href="/space/blog_create.asp";
	}
	function isPersonBlog(){//我的博客
		document.location.href="/space/blog.asp?id="+gC("userId");
	}
	function isAlbumlogin(){//我的相册发布
		document.location.href="/album/album_list.asp?id="+gC("userId");
	}
	function isEventloginsub(tag){//我的活动发布
		document.location.href="/event/event_create.asp?tag="+escape(tag);
	}
	function isEventPerson(){//我的活动
		document.location.href="/event/event_list.asp?uid="+gC("userId");
	}
	function isEventTag(tag){//tag活动
		document.location.href="/event/event_list.asp?tag="+escape(tag);
	}
	function isTopicLoginsub(){//发布我的话题
		document.location.href="/topic/topic_create.asp";
	}
	function isTopicPerson(){//我的话题
		document.location.href="/topic/topic_list.asp?uid="+gC("userId");
	}
	function isTopicTag(tag){
		document.location.href="/topic/topic_list.asp?tag="+escape(tag);
	}
	function isGroupPerson(){
		document.location.href="/group/group_list.asp?uid="+gC("userId");
	}
	function isGroupPersonsub(tag){
		document.location.href="/group/group_create.asp?tag="+escape(tag);
	}
	function isGroupTag(tag){
		document.location.href="/group/group_list.asp?tag="+escape(tag);
	}
	this.LeftisCommonBlog=function(){//所有博客
		if(document.location.href.split('/')[4].split('#')[0]=='blog_all.asp'){
			document.location.href='/space/blog_all.asp#all_1';
			document.location.reload();
		}
		else{
			document.location.href='/space/blog_all.asp#all_1';
		}
	}
	this.teamInfo=function(){//我的球队
		User.Gru='|root|admin|operator|user|';
		User.Pass=isCreateTeamT;
		User.Check(true);
	}
	this.joinTeam=function(){//我参与的球队
		User.Gru='|root|admin|operator|user|';
		User.Pass=function(){document.location.href='/team/team_list.asp?uid='+gC("userId")};
		User.Check(true);
	}
	this.teamManage=function()//球队管理
	{
		User.Gru='|root|admin|operator|user|';
		User.Pass=isCreateTeamM;
		User.Check(true);
	}
	this.teamAlbum=function()//球队相册
	{
		User.Gru='|root|admin|operator|user|';
		User.Pass=isCreateTeamA;
		User.Check(true);
	}
	this.teamTopic=function()//球队日志
	{
		User.Gru='|root|admin|operator|user|';
		User.Pass=isCreateTeamP;
		User.Check(true);
	}
	this.teamCreate=function()//创建球队
	{
		User.Gru='|root|admin|operator|user|';
		User.Pass=isCreateTeamC;
		User.Check(true);
	}
	this.teamCreatebySubBatt=function()//发布约战
	{
		User.Gru='|root|admin|operator|user|';
		User.Pass=isCreateTeamSubBattle;
		User.Check(true);
	}
	this.teamCreatebyBattleManage=function()//约战管理
	{
		User.Gru='|root|admin|operator|user|';
		User.Pass=isCreateTeamBattleMan;
		User.Check(true);
	}
	this.personVenue=function(){//我的地点
		User.Gru='|root|admin|operator|user|';
		User.Pass=isVenueLogin;
		User.Check(true);
	}
	this.personBlogsub=function(){//发布博客
		User.Gru='|root|admin|operator|user|';
		User.Pass=isBlogLogin;
		User.Check(true);
	}
	this.personBlog=function(){//我的博客
		User.Gru='|root|admin|operator|user|';
		User.Pass=isPersonBlog;
		User.Check(true);
	}
	this.personAlbumSub=function(){//我的相册新建
		User.Gru='|root|admin|operator|user|';
		User.Pass=isAlbumlogin;
		User.Check(true);
	}
	this.personEventsub=function(tag){//发布活动
		User.Gru='|root|admin|operator|user|';
		User.Pass=function(){isEventloginsub(tag);};
		User.Check(true);
	}
	this.personEvent=function(){//我的活动
		User.Gru='|root|admin|operator|user|';
		User.Pass=isEventPerson;
		User.Check(true);
	}
	this.EventTag=function(tag){
		isEventTag(tag);
	}
	this.personTopicsub=function(){
		User.Gru='|root|admin|operator|user|';
		User.Pass=isTopicLoginsub;
		User.Check(true);
	}
	this.personTopic=function(){
		User.Gru='|root|admin|operator|user|';
		User.Pass=isTopicPerson;
		User.Check(true);
	}
	this.personTopicTag=function(tag){
		isTopicTag(tag);
	}
	this.personGroup=function(){//我的群组
		User.Gru='|root|admin|operator|user|';
		User.Pass=isGroupPerson;
		User.Check(true);
	}
	this.GroupTag=function(tag){//相关的群组
		isGroupTag(tag);
	}
	this.personGroupSub=function(tag){//创建群组
		User.Gru='|root|admin|operator|user|';
		User.Pass=function(){isGroupPersonsub(tag);};
		User.Check(true);
	}
	this.Serach=function(){
		if(g('leftBarSerach')){
			document.location.href='/search.asp?kw='+escape(g('leftBarSerach').value);
		}
	}
}
function getalluser()//绑定全局信息和ID
{//0userCount,能管理的球队的总数，创建球队的总数
	var u='/app/sns_Unite.aspx?op=getIdByUser&uid='+gC('userId');
	 var x=function(o){
	 var t=aRP(unescape(o.responseText)).split('$');
		if(g('battleuserall')){
			g('battleuserall').innerHTML=t[0];
		 }
	 }
	 gD(u,x);
}
/*登陆*/
 if(g('log_userFormbattle'))
{
	setFrombattle();
	updateOnline();//更新在线用户状态
}
function logout(){
	var u=rt+'pro/user.asp?op=logout&id='+gC("userId");
	var x=function(o){
		if (g('log_userForm'))
		{	
			setForm();
		}
		else if(g('log_userFormbattle'))
		{
			setFrombattle();
			setTimeout(function(){getalluser()},800)
		}
		var s=document.location.href;
		setTimeout(function(){document.location.reload();},800);
	}
	gD(u,x);
}
/*更新点击量*/
function updatePoint()
{
	var u='/app/spt_users.aspx?op=uppoint&uid='+gC("userId");
	var x=function(o)
	{
		if(o.responseText=='false'){
		}
		else{
		}
	}
	gD(u,x);
}
/*更新空间访问量*/
function UpdateSpaceCount(uid){
	if(uid==""||!uid||uid=="0"){return;}
	var u='/app/spt_users.aspx?op=updateSpace&uid='+uid;
	var x=function(o){
		var t=aRP(unescape(o.responseText)).split('|');
		if(t[0]=="true"){
			//TODO:成功
		}
		else{
			//TODO:失败
		}
	}
	gD(u,x);
}
/*绑定当前在线用户数量和你在一起的的在线人数个数*/
function bandOnlineCount()
{
	var la='';
	if(document.location.href.split('/').length>4)
	{
		la=document.location.href.split('/')[3];
	}
	var u='/app/online.aspx?op=getcount&uid='+gC("userId")+"&location="+la;
	var x=function(o)
	{
		var t=aRP(unescape(o.responseText)).split('$');
		if(t[0]!="false")
		{//locationcount$allUserCount$
			if (g('online_count'))
			{
				g('online_count').innerHTML='当前'+t[1]+'人在线 '+t[0]+' 人和你在一起';
			}
		}
	}
	gD(u,x);
}
 bandOnlineCount();//绑定在线人数
/*更新积分*/
function updatePoint()
{
	var u='/app/spt_users.aspx?op=upmark&uid='+gC("userId");
	var x=function(o)
	{
		if(o.responseText=='false')
		{
		}
		else
		{
		}
	}
	gD(u,x);
}
/*更新好友数量*/
function updatePoint()
{
	var u='/app/spt_users.aspx?op=upfriendcount&uid='+gC("userId");
	var x=function(o)
	{
		if(o.responseText=='false')
		{
		}
		else
		{
		}
	}
	gD(u,x);
}
/*updateOnline*/
function updateOnline()//更新在线用户状态
{
	if(gC("userId")==""||gC("userId")=="0")
	{
		return;
	}
	var u='/pro/user.asp?op=track&id='+gC('userId');
	var x=function(o)
	{
		if(o.responseText=='false'){
			//TODO:操作失败
		}
		else{
			//TODO:操作完成
		}
	}
	gD(u,x);
}
/*访客*/
function updateVisit()
{
	if(gC("userId")==""||gC("userId")=="0"&&gC("userId")!=gU("id"))
	{
		return;
	}
	var u='/app/sptvisit.aspx?op=create&sid='+gC("userId")+"&rid="+gU("id")+"&attr=blog";
	var x=function(o)
	{
		if(o.responseText=='false'){
		}
		else{
		}
	}
	gD(u,x);
}
if(document.location.href.split('/')[3]=="space"){
	updateVisit();
}
/*校验博客是否允许品论*/
//false:不允许评论，login：登陆评论，true：匿名评论
function checkisComment()
{
	var u='/app/spt_blogComment.aspx?op=isComment&postid='+gU("id");
	var x=function(o)
	{
		//if(o.responseText=='false')
		return o.responseText
	}
	gD(u,x);
}
/*校验是否登陆*/
function checkUserLogin(func,funclose)
{
	User.Gru='|root|admin|operator|user|';
	if(func!=""){User.Pass=func;}
	else{User.Pass=setFrombattle;}
	if(funclose!=""){User.Close=funclose;}
	User.Check(true);
}
/*tips*/
function uPtips(id)
{
	g(id).style.top='99999px';
	g(id).style.display='none';
}
function failTips(id,msg,inid)
{
	var x=parseInt((gPS()[2]-110)/2);
	var y=parseInt((ie?document.documentElement.scrollTop:window.pageYOffset)+(gPS()[3]-83)/2);
	g(id).style.top=y+'px';
	g(id).style.left=x+'px';
	g(inid).innerHTML=msg;
	g(id).style.display='';
}
/*日志列表图片缩放*/
function fixImgMax(img)
{
	img=img.replace(/class="fixImgMax"/g,'');
	img=img.replace(/height="\d+"/g,'');
	img=img.replace(/width="\d+"/g,'');
	img=img.replace(/<img/g,'<img class="fixImgMax" onload="fitImg(this,600,1000)"');
	return img;
}
/*日志正文图片缩放}*/
function fixImgContentMax(img)
{
	img=img.replace(/height="\d+"/g,'');
	img=img.replace(/width="\d+"/g,'');
	img=img.replace(/<img/g,'<img onload="fitImg(this,600,1500)" ');
	return img;
}
/*日志正文图片缩放*/
var imgaddAreg=new RegExp('<img[^<>]+>?','i');
var imgaddHref=new RegExp('<img[^<>]+src="([^"<>]+)"?','i');
function getimg(content)
{
	var imgs='';
	var pa=/<img[^<>]+>?/gi;
	var imgsArray=content.match(pa);
	if(imgsArray)
	{
		for(var i=0;i<imgsArray.length;i++)
		{
			imgs+=imgsArray[i]+"$";
		}
	}
	return imgs;
}
function getimgsrc(content,width)
{
	var s='';
	var pa=/<img[^<>]+src="([^"<>]+)"?/gi;
	var imgs='';
	if(content.match(pa))
	{
		var lt=content.match(pa);
		var imgs1=null;
		for(var i=0;i<lt.length;i++)
		{
			imgs1=lt[i].match(pa);
			imgs+='<a target="blank" href="'+RegExp.$1+'" title="在新窗口显示原始尺寸"><img width="'+width+'px;" src="'+RegExp.$1+'" onload="fitImg(this,'+width+',1500)" /></a>$';
		}
	}
	return imgs;
}
function fixhref(content,width)
{
	//var pa=/<a[^<>]+>?<img[^<>]+(\/a>?)/i;
	if(!width){width=600;}
	var imgs=getimg(content);
	var imgs1=getimgsrc(content,width);
	for (var i=0;i<imgs.split('$').length-1 ;i++ )
	{
		//content=content.replace(pa,'');
		//alert(content);
		content=content.replace(imgs.split('$')[i],imgs1.split('$')[i]);
	}
	return content;
}
/*日志列表图片缩放
function fixImgMax(img)
{
	img=img.replace(/class="fixImgMax"/g,'');
	img=img.replace(/height="\d+"/g,'');
	img=img.replace(/width="\d+"/g,'');
	img=img.replace(/<img/g,'<img class="fixImgMax" ');
	return img;
}*/
/*日志评论回复*/
function blogcommentRe(content)
{//[quote][b]huabinglan[/b]: fdgdf[/quote]是啊
	content=content.replace(/\[/g,'<');
	content=content.replace(/[\]]/g,'>');
	content=commentPhotoReplace(content);
	content=content.replace(/<quote>/g,'<div style="background-color:#e6f0fa; border: 1px solid rgb(170, 210, 244);  line-height:24px; text-indent:10px;padding-top:4px;">');
	content=content.replace(/<b>/g,'<span class="fixie"></span>&nbsp;&nbsp;');
	content=content.replace(/<\/b>/g,'');
	content=content.replace(/<\/quote>/g,'</div><br />');
	//alert(content);
	return content;
}
/*后台评论管理*/
function adminComment(content)
{
	content=content.replace(/\[/g,'<');
	content=content.replace(/[\]]/g,'>');
	content=commentPhotoReplace(content);
	return content;
}
/*日志回复的回复*/
function reblogcommentRe(content)
{
	var s=content
	s=content.replace("[/quote]",'$');
	if(s.split('$').length>1)
	{
			s=s.split('$')[1];
	}
	return s;
}
/*全选*/
//checkbox 的全选操作
function selectAll(O,n,suff)
{
	var T=O.checked;
	for(var i=1;i<=n;i++)
	{
		g('checkbox'+suff+i).checked=T;
	}
}
/*获取全选的value*/
function getSelect(n,suff)
{
	var s='';
	for (var i=1;i<=n;i++)
	{
		s+=g('checkbox'+suff+i).checked?'$'+g('checkbox'+suff+i).value:'';
	}
	return s.substring(1);
}
/*获取url#后面的参数*/
function gHN()
{//person_cp_type_catype
	var array=new Array();
	array=gH();
	if(array.length==0)
	{
		array=["person","1","type","catype"];
	}
	else if(array.length==1)
	{
		if(array[0]=="")
		{
			array[0]="person";
		}
		array[1]="1";
		array[2]="type";
		array[3]="catype";
	}
	else if(array.length==2)
	{
		array[2]="type";
		array[3]="catype";
	}
	else if (array.length==3)
	{
		array[3]="catype";
	}
	return array;
}
/*tab刷新和翻页刷新*/
function gUtype(person,cp,type,bgid)
{//规则：#person_cp_type
	if(type=="undefined"||type==""||!type){type="1";}
	if(bgid=="undefined"||bgid==""||!bgid){bgid="1";}
	var array=[person,cp,type,bgid];
	var s=document.location.href.split('#');
	var h='';
	h+=s[0]+"#";
	if(s.length>1)
	{
		if(s[1]!="")
		{
			for(var i=0;i<s[1].split('_').length;i++)
			{
				if(array[i]!="")
				{
					h+=array[i]+"_";
				}
				else
				{
					h+=s[1].split('_')[i]+"_";
				}
			}
			for(var i=s[1].split('_').length;i<4;i++)
			{
				if(array[i]!=""){h+=array[i]+"_";}
			}
		}
	}
	else if(person!=""&&cp!="")
	{
		h+=person+"_"+cp+"_";
	}
	return h.substring(0,(h.length-1));
}
/*评论头像*/
function commentPhotoReplace(content)
{
	var t=content;
	t=t.replace(/<emu:1;>/g,'<img src=/images/expression/1.gif />&nbsp;');
	t=t.replace(/<emu:2;>/g,'<img src=/images/expression/2.gif />&nbsp;');
	t=t.replace(/<emu:3;>/g,'<img src=/images/expression/3.gif />&nbsp;');
	t=t.replace(/<emu:4;>/g,'<img src=/images/expression/4.gif />&nbsp;');
	t=t.replace(/<emu:5;>/g,'<img src=/images/expression/5.gif />&nbsp;');
	t=t.replace(/<emu:6;>/g,'<img src=/images/expression/6.gif />&nbsp;');
	t=t.replace(/<emu:7;>/g,'<img src=/images/expression/7.gif />&nbsp;');
	t=t.replace(/<emu:8;>/g,'<img src=/images/expression/8.gif />&nbsp;');
	t=t.replace(/<emu:9;>/g,'<img src=/images/expression/9.gif />&nbsp;');
	t=t.replace(/<emu:10;>/g,'<img src=/images/expression/10.gif />&nbsp;');
	t=t.replace(/<emu:11;>/g,'<img src=/images/expression/11.gif />&nbsp;');
	t=t.replace(/<emu:12;>/g,'<img src=/images/expression/12.gif />&nbsp;');
	t=t.replace(/<emu:13;>/g,'<img src=/images/expression/13.gif />&nbsp;')
	t=t.replace(/<emu:14;>/g,'<img src=/images/expression/14.gif />&nbsp;')
	t=t.replace(/<emu:15;>/g,'<img src=/images/expression/15.gif />&nbsp;')
	t=t.replace(/<emu:16;>/g,'<img src=/images/expression/16.gif />&nbsp;')
	t=t.replace(/<emu:17;>/g,'<img src=/images/expression/17.gif />&nbsp;')
	t=t.replace(/<emu:18;>/g,'<img src=/images/expression/18.gif />&nbsp;')
	t=t.replace(/<emu:19;>/g,'<img src=/images/expression/19.gif />&nbsp;')
	t=t.replace(/<emu:20;>/g,'<img src=/images/expression/20.gif />&nbsp;')
	t=t.replace(/<emu:21;>/g,'<img src=/images/expression/21.gif />&nbsp;')
	t=t.replace(/<emu:22;>/g,'<img src=/images/expression/22.gif />&nbsp;')
	t=t.replace(/<emu:23;>/g,'<img src=/images/expression/23.gif />&nbsp;')
	t=t.replace(/<emu:24;>/g,'<img src=/images/expression/24.gif />&nbsp;')
	t=t.replace(/<emu:25;>/g,'<img src=/images/expression/25.gif />&nbsp;')
	t=t.replace(/<emu:26;>/g,'<img src=/images/expression/26.gif />&nbsp;')
	t=t.replace(/<emu:27;>/g,'<img src=/images/expression/27.gif />&nbsp;')
	t=t.replace(/<emu:28;>/g,'<img src=/images/expression/28.gif />&nbsp;')
	t=t.replace(/<emu:29;>/g,'<img src=/images/expression/29.gif />&nbsp;')
	t=t.replace(/<emu:30;>/g,'<img src=/images/expression/30.gif />&nbsp;')
	return t;
}
/*清除表情*/
function ReplaceImgFace(content)
{
	var t=content;
	t=t.replace(/<img src=\/images\/expression\/1.gif \/>/,'');
	return content;
}
/*打印字符串*/
function printCommentPhoto(O,innerId)
{	
	var s='<div id="expression" style="position: absolute;  -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; z-index: 9999; left: 241px; top: 1030px; display:none;"><ul>';
	for(var i=1;i<31;i++)
	{
		s+='<li><img src="/images/expression/'+i+'.gif" onclick="setFaceText(\'[emu:'+i+';]\',\''+innerId+'\')" style="cursor:pointer;"/></li>';
	}
	s+='</ul></div>';
	g(O).innerHTML=s;
	setTimeout(function(){$e(document.body,'click',uPcommentPhoto)},100);
}
function setFaceText(message,O)
{
	g(O).value=g(O).value+message;
	//g(O).innerHTML=g(O).innerHTML+message;
}
function uPcommentPhoto()
{
	g('expression').style.top='9999px';
	g('expression').style.display='none';
	removeEventHandler(document.body,'click', uPcommentPhoto);
}
/*改变块级元素的height*/
function changeDivHeight(O,add)//add:add;sub
{
	if(parseInt(g(O).style.height.split('p')[0])<70)
	{
		g(O).style.height="80px";
		return;
	}
	else
	{
		g(O).style.height=parseInt(g(O).style.height.split('p')[0])+add+"px";
	}
}
/**/
//取消事件传入的参数值要跟绑定时完全一样才可以
function removeEventHandler(obj,EventType,Handler)
{
	//如果是FF
	if(obj.removeEventListener){
	   obj.removeEventListener(EventType,Handler,false);
	}
	//如果是IE
	else if(obj.detachEvent){
	   obj.detachEvent('on'+EventType,Handler);
	}
	else{
	   obj['on'+EventType] = Handler;
	}
}
/*动态打印省份和城市*/
function printProvice(O,cityobj)//打印省份
{
	var u='/app/xml.aspx?op=page';
	var x=function(o){
		var t=aRP(unescape(o.responseText)).split('$');
		var s='<select name="selectcity" id="printProId" style="color:#666666;width:80px;" onchange="printCity(this.value,\''+cityobj+'\')"><option value="">请选择</option>';
		for (var i=0;i<t.length-1;i++){
			s+='<option value="'+t[i]+'">'+t[i]+'</option>';
		}
		s+='</select>';
		g(O).innerHTML=s;
	}
	gD(u,x);
}
function printCity(name,O,city)//打印城市
{
	var u='/app/xml.aspx?op=list&cityname='+escape(name);
	var x=function(o){
		var t=aRP(unescape(o.responseText)).split('$');
		var s='<select name="selectarea" id="printCityId" style="color:#666666;width:80px;"><option value="">选择地区</option>';
		for (var i=0;i<t.length-1;i++){
			if(city!="")
			{
				if(city==t[i])
				{
					s+='<option value="'+t[i]+'" selected="selected">'+t[i]+'</option>';
				}
				else
				{
					s+='<option value="'+t[i]+'">'+t[i]+'</option>';
				}
			}
			else
			{
				s+='<option value="'+t[i]+'">'+t[i]+'</option>';
			}
		}
		s+='</select>';
		g(O).innerHTML=s;
	}
	gD(u,x);
}
/*导航搜索下拉菜单*/
var ToolBarSerach=new function(){
	var serach=this;
	this.showSearchMenu=function(){//搜索下拉菜单
		if(g('nav_searchMenu').style.display=='none'){
			g('nav_searchMenu').style.display='';
			g('nav_search').className='nav_search01';
		}
		else{
			g('nav_searchMenu').style.display='none';
			g('nav_search').className='nav_search';
		}
	}
	this.SerachOper=function(){//event,album,space,group,topic,venue,team,battle,gym(健身),wild,
		if(document.location.href.indexOf("article")>-1){
			document.location.href="/article_list.asp?kw="+escape(g('toolBarSerach').value);
			return;
		}
		var file=document.location.href.split('/')[3];
		if(document.location.href.split('/').length<4){file="";}
		switch(file)
		{
			case "event"://w
				document.location.href="/event/event_list.asp?tag="+escape('活动')+"&kw="+escape(g('toolBarSerach').value);
				break;
			case "album"://w
				document.location.href="/album/album_list.asp?tag=&kw="+escape(g('toolBarSerach').value)+"#common";
				break;
			case "space"://w
				document.location.href="/space/blog_all.asp?kw="+escape(g('toolBarSerach').value);
				break;
			case "group"://w
				document.location.href="/group/group_list.asp?kw="+escape(g('toolBarSerach').value);
				break;
			case "topic":
				document.location.href="/topic/topic_list.asp?kw="+escape(g('toolBarSerach').value);
				break;
			case "venue"://w
				document.location.href="/venue/venue_list.asp?kw="+escape(g('toolBarSerach').value);
				break;
			case "team"://w
				document.location.href="/team/team_list.asp?kw="+escape(g('toolBarSerach').value);
				break;
			default:
				document.location.href="/search.asp?kw="+escape(g('toolBarSerach').value);
				break;
		}
	}
}
/*博客列表打印图片处理*/
function BlogContent(content){//获取发表日志时的前2张图片
	var pa='';
	var pa=/<img[^<>]+src="\/uploadfile([^"<>]+)"?/gi;
	var imgs=new Array();
	imgs[0]='';
	imgs[1]='';
	if(content.match(pa)){
		var lt=content.match(pa);
		var imgs1=null;
		if(lt.length>0){
			imgs1=lt[0].match(pa);
			imgs[0]="/uploadfile"+RegExp.$1;
		}
		if(lt.length>1){
			imgs1=lt[1].match(pa);
			imgs[1]="/uploadfile"+RegExp.$1;
		}
	}
	return imgs;
}
function fromatContent1(content)
{
	var s='';
	var pa=/<img[^<>]+src="\/uploadfile([^"<>]+)"?/gi;
	var imgs=new Array();
	imgs[0]='';
	imgs[1]='';
	if(content.match(pa))
	{
		var lt=content.match(pa);
		var imgs1=null;
		if(lt.length>0)
		{
			imgs1=lt[0].match(pa);
			imgs[0]=RegExp.$1;
		}
		if(lt.length>1)
		{
			imgs1=lt[1].match(pa);
			imgs[1]=RegExp.$1;
		}
	}
	if(imgs[0]!='')
	{
		s+='<img src='+imgs[0]+' class="fixImgMax" align="texttop"/>';
		if(imgs[1]=='')
		{
			s+='<br />';
		}
	}
	if(imgs[1]!='')
	{
		s+='<img src='+imgs[1]+' class="fixImgMax" align="texttop"/><br />';
	}
	return;
	pa=/<img[^<>]+>?/gi;
	content=content.replace(pa,'');
	content=content.replace(/<p>&nbsp;<\/p>/g,'');
	content=content.replace(/<p>/g,'<br />');
	content=content.replace(/<\/p>/g,'');
	pa=/<p>|<\/p>|(<br[\s\/]*>)+|[\n\r]+/gi;
	var con=content.match(pa);
	content=content.replace(pa,'$'); 
	if(con)
	{
		if(con.length<2)
		{
			for(var i=0;i<content.split('$').length;i++)
			{
				if(content.split('$')[i]!="")
				{
					s+=content;
				}
			}
		}
		else
		{
			var j=0;
			for(var i=0;i<content.split('$').length;i++)
			{
				if(content.split('$')[i]!="&nbsp;")
				{
					j++;
					if(j<=3)
					{
						s+=content.split('$')[i];
					}
					else
					{
						break;
					}
					
				}
			}
		}
	}
	else
	{
		s+=content;
	}
	return s.replace(/\$/g,'');
}
/*相册分类对应关系*/
var albumCategory=["","个人","时尚","户外","健身"];
/*gotoPage*/
function goToPageU(oid,m,cmd,cp,type){
	var v=parseInt(g(oid).value);
	if (!isNaN(v)&&v>0&&v<=m){
		document.location.href=gUtype(type,v,'0','0');
		cmd(v-cp);
		//trunPage1.pPg(v-cp)
	}
}
/*搜索*/
function TeamserchArea(event)
{
	if(ie)
	{
		document.location.href='/team/team_list.asp?op=serch&area='+escape(event.srcElement.innerHTML);
	}
	else
	{
		document.location.href='/team/team_list.asp?op=serch&area='+escape(event.target.innerHTML);
	}
}
/*左侧导航*/
var LastLeftID = "";
function menuFix(){
	var obj = document.getElementById("left_Nav").getElementsByTagName("li");
	for (var i=0; i<obj.length; i++){
		obj[i].onmouseover=function(){
		this.className+=(this.className.length>0? " ": "") + "sfhover";
		}
		obj[i].onMouseDown=function(){
		this.className+=(this.className.length>0? " ": "") + "sfhover";
		}
		obj[i].onMouseUp=function(){
		this.className+=(this.className.length>0? " ": "") + "sfhover";
		}
		obj[i].onmouseout=function(){
		this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
		}
	}
}
var MenuTimeOut=null;

function DoMenuTime(emid){
	MenuTimeOut=setTimeout(function(){DoMenu(emid)},200);
}

function DoMenu(emid){
	 var obj = document.getElementById(emid); 
	 if(obj){
		 obj.className = (obj.className.toLowerCase() == "expanded"?"expanded":"expanded");//emid的展开，收缩
		 if((LastLeftID!="") && (emid!=LastLeftID)){ //关闭上一个Menu
		  document.getElementById(LastLeftID).className = "collapsed";//收缩样式
		 }
		 LastLeftID = emid;
	 }
}

function GetMenuID(){
	 var MenuID="";
	 var _paramStr=new String(window.location.href);
	 var _sharpPos = _paramStr.indexOf("#");
	 if(_sharpPos >= 0&&_sharpPos<_paramStr.length-1){
		 _paramStr = _paramStr.substring(_sharpPos + 1, _paramStr.length);
	 }
	 else{
		_paramStr = "";
	 }
	 if(_paramStr.length > 0){
		  var _paramArr = _paramStr.split("&");
		  if(_paramArr.length>0){
			var _paramKeyVal = _paramArr[0].split("=");
				if (_paramKeyVal.length>0){
					MenuID = _paramKeyVal[1];
			}
		  }
	 }
	 if(MenuID!=""){
		DoMenu(MenuID)
	 }
}
GetMenuID(); //*这两个function的顺序要注意一下，不然在Firefox里GetMenuID()不起效果
if(document.getElementById("left_Nav")){
	menuFix();
}
/*缩略图相关函数*/
function  ImgAttachment(imgPath,hw){
	if(imgPath.split('.')[1]!="jpg"){
		return imgPath;
	}
	else{
		return imgPath.replace(".",hw+".");
	}
}