﻿/*相册相关操作*/
var albumManage=new function()
{
	var album=this;
	/*大家和好友的相册*/
this.friendAlbum=function(u,O,pl,l,id){//0albumid,1userid,2username,3title,4description,5logo,6pasword,7imgcount,8views,9type,10createdatetime,11statue,12teamname
		l=l?l:99;
		var pg=this;
		var cid=timeStr();
		this.cp=1;
		this.pPg=function(e){
			g(O).innerHTML=dl;
			pg.cp=pg.cp+e;
			var U=u+'&cp='+pg.cp;
			var x=function(o){
				var t=aRP(unescape(o.responseText)).split('|');
				document.title="相册 - 商都体育频道";
				if(t[0]=="0")
				{
					var s='<span>暂无相册</span>';
					if(gU("kw")!=""){
						s+='&nbsp;&nbsp;<a href="/search.asp?kw='+gU("kw")+'">搜索其他</a>';
					}
					g(O).innerHTML=s;
					return;
				}
				var s='<table border="0" cellpadding="0" cellspacing="0">';
				var m=t.length;
				for (var i=1;i<m;i++){
					var e=t[i].split('$');
					if(i%3==1)
					{
						s+='<tr>';
					}
					s+='<td width="185" valign="top"><table width="172" border="0"  cellpadding="0" cellspacing="0"> <tr> <td height="119" align="center"  style="padding-right:30px;background:url(/images/blue/album_bg.jpg) no-repeat;"><a href="/album/album.asp?id='+e[0]+'&uid='+e[1]+'">';
					if(trim(e[5])=="")
					{
						s+='<img src="/images/home/al_photo03.jpg"  class="fixImg"/>';
					}
					else if(trim(e[5]).split('/')[0]!="space")
					{
						s+='<img src="'+ImgAttachment(trim(e[5]),"_150_113")+'" class="fixImg" />';
					}
					else if(trim(e[5]).split('/')[0]=="space"){
						s+='<img src="/bbs/'+ImgAttachment(trim(e[5]).replace(/_thumbnail/g,'').replace(/\.\./,''),"_150_113")+'" class="fixImg" />';
					}
					s+='</a></td> </tr> <tr> <td style="line-height:24px; padding-bottom:15px; padding-left:5px;padding-top:4px;"><a href="/album/album_list.asp?id='+e[1]+'" class="aListTag">'+e[2]+'的相册</a><br />';
					if(gC('userLevel')=='root'||gC('userLevel')=='admin'||gC('userLevel')=="operator")
					{
						s+='<input type="checkbox" id="checkbox_album'+i+'" value="'+e[0]+'" />';
					}
					s+=' <a href="/album/album.asp?id='+e[0]+'&uid='+e[1]+'" class="font12zlan">'+e[3]+'</a>('+e[7]+')';
					if(gC('userLevel')=='root'||gC('userLevel')=='admin'||gC('userLevel')=="operator")
					{
						s+='<br />';
						if(e[11]=="1")
						{
							s+='<a href="javascript:void(0)" onclick="albumManage.recoBlogAdmin('+e[0]+',0,\'0\')"">取消推荐</a>';
						}
						else
						{
							s+='<a href="javascript:void(0)" onclick="albumManage.recoBlogAdmin('+e[0]+',0,\'1\')"">推荐</a>';
						}
					}
					s+='</td></tr> </table></td>';
					if(i%3==0)
					{
						s+='</tr>';
					}
				}
				if(i%3!=1)
				{
					s+='</tr>';
				}
				if(gC('userLevel')=='root'||gC('userLevel')=='admin'||gC('userLevel')=="operator")
				{
					s+='<tr><td>&nbsp;&nbsp;<input type="checkbox" id="selectAlbumAll" onclick="albumManage.selectAll(this,'+(t.length-1)+',\'_album\')"/>&nbsp;&nbsp;<label>全选</label>&nbsp;&nbsp;<a href="javascript:void(0)" onclick="albumManage.recoBlogAdmin(false,'+(t.length-1)+',\'1\')">推荐</a>&nbsp;&nbsp;<a href="javascript:void(0)" onclick="albumManage.recoBlogAdmin(false,'+(t.length-1)+',\'0\')">取消推荐</a></td></tr>';
				}
				s+='</table>';
				m=parseInt(t[0]/pl);
				if ((t[0]%pl)>0){m++;}
				s+='<table width="100%" style="float:left;"><tr><td style="height:33px;text-align:center;background:none;border:0px;" colspan="2" class="fy">[共'+m+'页，当前在第'+pg.cp+'页]';
				if (t[0].split('$')[0]>pl){
					if (pg.cp>1){s+='&nbsp;&nbsp;<a href="'+gUtype('common',(pg.cp-1),'0')+'" onclick="trunPage'+id+'.pPg(-1)"><<<上一页</a>';}
					if (pg.cp<m){s+='&nbsp;&nbsp;<a href="'+gUtype('common',(pg.cp+1),'0')+'" onclick="trunPage'+id+'.pPg(1)">下一页>>></a>';}
					s+='&nbsp;&nbsp;跳转到:<select id="chgPage"><option value="0">当前页</option>';
					for (var i=1;i<=m;i++){
						s+='<option value="'+i+'">第'+i+'页</option>';
					}
					s+='</select>';
				}
				s+='&nbsp;&nbsp;<input type="text" size="3" id="goPage_'+cid+'"/><a href="javascript:void(0);" onclick="goToPageU(\'goPage_'+cid+'\','+m+',trunPage1.pPg,'+pg.cp+',\'common\')">Go</a>';
				s+='</td></tr></table>';
				g(O).innerHTML=s;
				if (g('chgPage')){
					g('chgPage').onchange=function(){
						document.location.href=gUtype('common',g('chgPage').value,'0');
						pg.pPg(parseInt(g('chgPage').value)-pg.cp);
					}
				}
			}
			gD(U,x);
		}
	}
	/*我的相册*/
	this.getmyPersonList=function(u,O,pl,l,id)
	{// 0albumid,1albumcateid,2userid,3username,4title,5logo,6password,7imgcount,8views,9type,10createdatetime,11status
		l=l?l:99;
		var pg=this;
		 this.cp=1;
		this.pPg=function(e){
			g(O).innerHTML=dl;
			pg.cp=pg.cp+e;
			var U=u+'&cp='+pg.cp;
			var x=function(o){
				var t=aRP(unescape(o.responseText)).split('|');
				if(t[0]=="0")//0|uid$username
				{
					g('teamalbumname').innerHTML='&nbsp;&nbsp;<a href="/space/blog.asp?id='+t[1].split('$')[0]+'">'+t[1].split('$')[1]+'的空间</a> - 相册';
					if(gC("userId")==t[1].split('$')[0]){
						g('firstalbum').innerHTML="我的相册";
						g('isCreateAlbum').style.display='';
						g('myalbum').style.display='none';
						g('isCreateAlbum').style.display='';
					}
					else{
						g('firstalbum').innerHTML=t[1].split('$')[1]+"的相册";
						g('myalbum').style.display='';
						g('isCreateAlbum').style.display='none';
					}
					document.title=trim(t[1].split('$')[1])+"的相册 - 相册 - 商都体育频道"
					g(O).innerHTML='<span>暂时没有创建相册</span>';
					return;
				}


				document.title=trim(t[1].split('$')[3])+"的相册 - 相册 - 商都体育频道"
				g('teamalbumname').innerHTML='&nbsp;&nbsp;<a href="/space/blog.asp?id='+t[1].split('$')[2]+'">'+t[1].split('$')[3]+'的空间</a> - 相册';
				if(gC("userId")==t[1].split('$')[2]){
					g('firstalbum').innerHTML="我的相册";
					g('myalbum').style.display='none';
					g('isCreateAlbum').style.display='';
				}
				else{
					g('firstalbum').innerHTML=t[1].split('$')[3]+"的相册";
					g('myalbum').style.display='';
				}
				var s='<table border="0" cellspacing="0" cellpadding="0">';
				var m=t.length;
				for (var i=1;i<m;i++){
					var e=t[i].split('$');
					if(i%4==1)
					{
						s+='<tr>';
					}
					s+='<td width="196"><table width="196" border="0" cellspacing="0" cellpadding="0"><tr><td width="191" class="aListTag"><table border="0" cellspacing="0" cellpadding="0" style="margin-bottom:8px;border:1px solid #CCCCCC;" height="123" width="160"><tr><td align="center"><a href="javascript:seeAllPhotoPage(\''+e[0]+'\',\''+e[9]+'\',\''+e[2]+'\')">';
					if(trim(e[5])=="")
					{
						s+='<img src="/images/blue/album_bg03.jpg" width="150" height="113" onload="fitImg(this,150,113)"/>';
					}
					else if (trim(e[5]).split('/')[0]!="space")
					{
						s+='<img src="'+ImgAttachment(trim(e[5]).replace(/_thumbnail/g,'').replace(/\.\./,''),"_150_113")+'" width="150" height="113" onload="fitImg(this,150,113)"/>';
					}
					else
					{
						s+='<img src="/bbs/'+ImgAttachment(trim(e[5]),"_150_113")+'" width="150" height="113"/>';
					}
					s+='</a></td></tr></table>';
					if(gC('userLevel')=='root'||gC('userLevel')=='admin'||gC('userLevel')=="operator")
					{
						s+='<input type="checkbox" id="checkbox_album'+i+'" value="'+e[0]+'" />';
					}
					s+=' <a href="javascript:seeAllPhotoPage(\''+e[0]+'\',\''+e[9]+'\',\''+e[2]+'\')" ';
					if(e[9]=='1')
					{
						s+=' class="lockLink"';
					}
					else
					{
						s+=' class="aTitle"';
					}
					s+=' >'+gBS(trim(e[4]),22)+'</a><br />创建时间：'+e[10].split(' ')[0]+'<br /> '+e[7]+'张图片 ';
					if(gC('userLevel')=='root'||gC('userLevel')=='admin'||gC('userLevel')=="operator")
					{
						if(e[11]=="1")
						{
							s+='<a href="javascript:void(0)" onclick="albumManage.recoBlogAdmin('+e[0]+',0,\'0\')"">取消推荐</a>';
						}
						else
						{
							s+='<a href="javascript:void(0)" onclick="albumManage.recoBlogAdmin('+e[0]+',0,\'1\')"">推荐</a>';
						}
					}
					if(gC('userId')==e[2])
					{
						s+='&nbsp;&nbsp;<a href="javascript:editAlbum(\''+e[0]+'\',\''+e[2]+'\');" class="team_12lv">编辑</a>&nbsp;&nbsp;<a href="javascript:void(0);" class="team_12lv"  onclick="Tip.Cusfirm(\'您确定要删除吗？\',\'question\',false,[[\'确定\',function(){deleteAlbum('+e[0]+',\'truebutton\');Tip.Cancel();}],[\'取消\',function(){Tip.Cancel();}]])">删除</a><br />';
					}
					s+='</td></tr></table></td>';
					if(i%4==0)
					{
						s+='</tr>';
					}
				}
				if(i%3!=1)
				{
					s+='</tr>';
				}
				if(gC('userLevel')=='root'||gC('userLevel')=='admin'||gC('userLevel')=="operator")
				{
					s+='<tr><td>&nbsp;&nbsp;<input type="checkbox" id="selectAlbumAll" onclick="albumManage.selectAll(this,'+(t.length-1)+',\'_album\')"/>&nbsp;&nbsp;<label>全选</label>&nbsp;&nbsp;<a href="javascript:void(0)" onclick="albumManage.recoBlogAdmin(false,'+(t.length-1)+',\'1\')">推荐</a>&nbsp;&nbsp;<a href="javascript:void(0)" onclick="albumManage.recoBlogAdmin(false,'+(t.length-1)+',\'0\')">取消推荐</a></td></tr>';
				}
				s+='</table>';
				m=parseInt(t[0]/pl);
				if ((t[0]%pl)>0){m++;}
				s+='<table width="100%" style="float:left;"><tr><td style="height:33px;text-align:center;background:none;border:0px;" colspan="2" class="fy">[共'+m+'页，当前在第'+pg.cp+'页]';
				if (t[0].split('$')[0]>pl){
					if (pg.cp>1){s+='&nbsp;&nbsp;<a href="'+gUtype('album',(pg.cp-1),'')+'" onclick="trunPage'+id+'.pPg(-1)"><<<上一页</a>';}
					if (pg.cp<m){s+='&nbsp;&nbsp;<a href="'+gUtype('album',(pg.cp+1),'')+'" onclick="trunPage'+id+'.pPg(1)">下一页>>></a>';}
					s+='&nbsp;&nbsp;跳转到:<select id="chgPage"><option value="0">当前页</option>';
					for (var i=1;i<=m;i++){
						s+='<option value="'+i+'">第'+i+'页</option>';
					}
					s+='</select>';
				}
				s+='</td></tr></table>';
				g(O).innerHTML=s;
				if (g('chgPage')){
					g('chgPage').onchange=function(){
						document.location.href=gUtype('album',g('chgPage').value,'');
						pg.pPg(parseInt(g('chgPage').value)-pg.cp);
					}
				}
			}
			gD(U,x);
		}
	}
	this.selectAll=function(O,n,suff)
	{
		var T=O.checked;
		for(var i=1;i<=n;i++)
		{
			g('checkbox'+suff+i).checked=T;
		}
	}
	/*获取全选的value*/
	this.getSelect=function(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);
	}
	/*推荐相册*/
	this.recoBlogAdmin=function(id,len,reco)
	{
		var id=id?id:album.getSelect(len,'_album');
		if(id=="")
		{
			return;
		}
		var u='/app/album.aspx?op=recoPage&id='+id+"&status="+reco;
		var x=function(o){
		var t=aRP(unescape(o.responseText)).split('$');
			if(t[0]=="true")
			{
				Tip.Warn("您的操作完成了","right",false,2);
				setTimeout(function(){trunPage1.pPg(parseInt(gHN()[1])-1)},2200);
			}
			else
			{
				Tip.warn("更新失败，请检查网络并重试","wrong",false,2);
			}
		}
		gD(u,x);
	}
	/*查看别人的相册*/
	this.getPersonList=function(u,O,pl,l,id)
	{////0albumid,1albumcateid,2userid,3username,4title,5logo,6password,7imgcount,8views,9type,10createdatetime
		l=l?l:99;
		var pg=this;
		 this.cp=1;
		this.pPg=function(e){
			g(O).innerHTML=dl;
			pg.cp=pg.cp+e;
			var U=u+'&cp='+pg.cp;
			var x=function(o){
				var t=aRP(unescape(o.responseText)).split('|');
				if(t[0]=="0")
				{
					var ss='<table width="753" border="0" cellspacing="0" cellpadding="0"><tr><td height="165">没有可预览的相册。</td></tr></table>';
					g(O).innerHTML=ss;
					return;
				}
				var s='<table width="784" border="0" cellspacing="0" cellpadding="0">';
				var m=t.length;
				for (var i=1;i<m;i++){
					var e=t[i].split('$');
					if(i%4==1)
					{
						s+='<tr>';
					}
					s+='<td width="196"><table width="196" border="0" cellspacing="0" cellpadding="0"><tr><td width="191" class="aListTag"><table width="100" border="0" cellpadding="0" cellspacing="0" class="al_photo01"><tr><td><a href="/team/teamAlbum/battle_team_showalbumlist.asp?id='+e[0]+'">';
					if(trim(e[5])=="")
					{
						s+='<img src="/images/blue/album_bg.jpg" width="150" height="113" onload="fitImg(this,150,113)"/>';
					}
					else
					{
						s+='<img src="/bbs/'+trim(e[5])+'" class="fixImg" />';
					}
					s+='</a></td></tr></table><a href="/team/teamAlbum/battle_team_album.asp" class="aTitle">'+e[3]+'</a><br /> 创建时间：'+e[10].split(' ')[0]+'<br /> '+e[7]+'张图片<br /></td></tr></table></td>';
					if(i%4==0)
					{
						s+='</tr>';
					}
				}
				if(i%3!=1)
				{
					s+='</tr>';
				}
				s+='</table>';
				m=parseInt(t[0]/pl);
				if ((t[0]%pl)>0){m++;}
				s+='<table width="100%" style="float:left;"><tr><td style="height:33px;text-align:center;background:none;border:0px;" colspan="2" class="fy">[共'+m+'页，当前在第'+pg.cp+'页]';
				if (t[0].split('$')[0]>pl){
					if (pg.cp>1){s+='&nbsp;&nbsp;<a href="'+gUtype('album',(pg.cp-1),'')+'" onclick="trunPage'+id+'.pPg(-1)"><<<上一页</a>';}
					if (pg.cp<m){s+='&nbsp;&nbsp;<a href="'+gUtype('album',(pg.cp+1),'')+'" onclick="trunPage'+id+'.pPg(1)">下一页>>></a>';}
					s+='&nbsp;&nbsp;跳转到:<select id="chgPage"><option value="0">当前页</option>';
					for (var i=1;i<=m;i++){
						s+='<option value="'+i+'">第'+i+'页</option>';
					}
					s+='</select>';
				}
				s+='</td></tr></table>';
				g(O).innerHTML=s;
				if (g('chgPage')){
					g('chgPage').onchange=function(){
						page(pg.pPg,pg.cp);
						document.location.href=gUtype('album',pg.cp,'');
					}
				}
			}
			gD(U,x);
		}
	}
	/*查看某个相册的图片*/
	this.getPhotoList=function(u,O,pl,l,id)
	{//0photoid,1filename,2attachment,3filesize,4title,5description,6postdate,7albumid,8userid,9username,10views,11commentstatus,12tagstatus,13comments,14isattachment,15width,16height
		l=l?l:99;
		var pg=this;
		 this.cp=1;
		this.pPg=function(e){
			g(O).innerHTML=dl;
			pg.cp=pg.cp+e;
			var U=u+'&cp='+pg.cp;
			var x=function(o){
				var t=aRP(unescape(o.responseText)).split('|');
				if(t[0]=="0")
				{
					var ss='<table width="753" border="0" cellspacing="0" cellpadding="0"><tr><td height="165">没有可预览的相册。</td></tr></table>';
					g(O).innerHTML=ss;
					return;
				}
				var s='<table width="784" border="0" cellspacing="0" cellpadding="0">';
				var m=t.length;
				g('userspace').innerHTML='<a href="/space/profile.asp?id='+t[1].split('$')[8]+' class="aListTag" >'+t[1].split('$')[9]+'的空间</a>';
				g('userAllAlbum').innerHTML='<a href="/team/teamalbum/battle_team_person.asp?id='+t[1].split('$')[8]+' class="aListTag" >'+t[1].split('$')[9]+'的全部相册</a>';
				for (var i=1;i<m;i++){
					var e=t[i].split('$');
					if(i%4==1)
					{
						s+='<tr>';
					}//w150,h120
					e[3]=parseInt(e[3])/1000+"."+parseInt(e[3])%1000;
					s+='<td width="196" height="165"><table width="172" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td width="172" height="155" align="center" class="al_tdx"><a href="/album/photo.asp?pid='+e[0]+'&id='+gU('id')+'">';
					if(trim(e[1]).split('/')[0]=="space")
					{
						s+='<img src="/bbs/'+e[1]+'" fixImg />';
					}
					else
					{
						s+='<img src="'+trim(e[1])+'" class="fixImg" style="max-height:150px;max-width:150px"/>';
					}
					s+='</a><br /><span class="font12hui">'+(parseInt(e[3])/1)+'K</span><br /><a href="/space/profile.asp?id='+e[8]+'" class="font12zlan">'+e[4]+'</a></td></tr></table></td>';
					if(i%4==0)
					{
						s+='</tr>';
					}
				}
				if(i%3!=1)
				{
					s+='</tr>';
				}
				s+='</table>';
				m=parseInt(t[0]/pl);
				if ((t[0]%pl)>0){m++;}
				s+='<table width="100%" style="float:left;"><tr><td style="height:33px;text-align:center;background:none;border:0px;" colspan="2" class="fy">[共'+m+'页，当前在第'+pg.cp+'页]';
				if (t[0].split('$')[0]>pl){
					if (pg.cp>1){s+='&nbsp;&nbsp;<a href="'+gUtype('album',(pg.cp-1),'')+'" onclick="trunPage'+id+'.pPg(-1)"><<<上一页</a>';}
					if (pg.cp<m){s+='&nbsp;&nbsp;<a href="'+gUtype('album',(pg.cp+1),'')+'" onclick="trunPage'+id+'.pPg(1)">下一页>>></a>';}
					s+='&nbsp;&nbsp;跳转到:<select id="chgPage"><option value="0">当前页</option>';
					for (var i=1;i<=m;i++){
						s+='<option value="'+i+'">第'+i+'页</option>';
					}
					s+='</select>';
				}
				s+='</td></tr></table>';
				g(O).innerHTML=s;
				if (g('chgPage')){
					g('chgPage').onchange=function(){
						page(pg.pPg,pg.cp);
						document.location.href=gUtype('album',pg.cp,'');
					}
				}
			}
			gD(U,x);
		}
	}
	/*滚动查看*/
	var maxWidth=0;
	var imgcount=0;
	this.scrollPhoto=function(O,pid)
	{	//0photoid,1filename,2attachment,3filesize,4title,5description,6postdate,7albumid,8userid,9username,10views,11commentstatus,12tagstatus,13comments,14isattachment,15width,16height，17teamname,18albumtitle,19imgcount
		var eqpid=0;
		var str='';
		var imgStep=112;
		var u='/app/album.aspx?op=listPhoto&mp=0&albumid='+gU("id")+"&photoid="+gU("pid")+"&uid="+gC("userId");
		var x=function(o){
			var t=aRP(unescape(o.responseText)).split('|');
			if(t[0]=="false"){
				alert(t);
				Tip.Warn("您无权查看该相册，即将返回","wrong",false,1);
				//setTimeout(function(){document.location.href="/album/album_list.asp#common";},1200);
				return;
			}
			document.title="相册 - "+trim(t[1].split('$')[9])+" - 商都体育频道"
			var s='<div id="photo_al01" style="margin-left:0px;"><ul style="padding:0px; margin:0px;">';
			g('teamalbumname').innerHTML='<a href="/team/team.asp?id='+t[1].split('$')[8]+'" class="font12zlan">'+t[1].split('$')[17]+'</a>';
			g('teamalbumname').innerHTML='<a href="/album/album_list.asp?id='+t[1].split('$')[8]+'">相册</a> - <a href="/album/album.asp?id='+gU('id')+'">'+t[1].split('$')[18]+'</a>';
			g('usernameAlbum').innerHTML='<a href="/album/album_list.asp?id='+t[1].split('$')[8]+'">'+t[1].split('$')[18]+'</a>';
			g('usernameAlbum').innerHTML='<a href="/album/album.asp?id='+t[1].split('$')[7]+'&uid='+t[1].split('$')[8]+'">'+t[1].split('$')[18]+'</a>';
			if(gC("userId")==t[1].split('$')[8])
			{
				g('userAddPhoto').innerHTML='<a href="/album/album.asp?id='+t[1].split('$')[7]+'&uid='+t[1].split('$')[8]+'">添加照片</a>';
				g('userAddAlbum').innerHTML='<a href="/album/album_list.asp?id='+t[1].split('$')[8]+'">添加相册</a>';
			}
			g('photoCount').innerHTML=t.length-1;
			g('spaceindex').innerHTML='<a href="/space/blog.asp?id='+t[1].split('$')[8]+'">'+t[1].split('$')[9]+'的空间</a>';
			UpdateSpaceCount(t[1].split('$')[8]);//更新访问量
			imgcount=t.length;
			for (var i=1;i<t.length;i++){
				var A=t[i].split('$');
				var photoTitle='';
				if(trim(A[4])!=""){
					photoTitle=trim(A[4]);
				}
				else{
					photoTitle=trim(A[2]);
				}
				var e='';
				if((i+1)<t.length)
				{
					e=t[i+1].split('$');
				}
				else
				{
					e=t[i].split('$');
				}
				if(A[0]==pid)
				{

					g('photoNo').innerHTML=i;
					var  seeebig='';
					if(trim(A[1]).split('/')[0]=="space"){
						seebig='/bbs/'+trim(A[1]).replace(/_thumbnail/g,'').replace(/\.\./,'');
					}
					else{
						seebig=A[1];
					}
					g('seebigImg').href=seebig;
					g('photoDes').innerHTML=A[5];
					var albumTitlesrc='';
					if(trim(A[4])!=""){
							albumTitlesrc+=A[4]+'</a>';
					}
					else{
						albumTitlesrc+=A[2];
					}
					
					g('photoDessic').innerHTML=albumTitlesrc;
					s+='<li class="al_p01">';
					if(trim(A[1]).split('/')[0]=="space")
					{
						s+='<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td height="76" align="center"><img src="/bbs/'+ImgAttachment(trim(A[1]),"_150_113")+'" class="fixImg" onclick="albumManage.getImgSrc(\''+A[0]+'\')" style="cursor:pointer;" title="'+photoTitle+'" onload="fitImg(this,76,76)"/></li></td></tr></table>';
						str='';
						str='<img src="/bbs/'+trim(A[1]).replace(/_thumbnail/g,'').replace(/\.\./,'').replace('.','_600_0.')+'" ';
						if(i==(t.length-1))
						{
							str+='onclick="albumManage.getImgSrc(\''+t[1].split('$')[0]+'\')';
							//str+=' onclick=""';
						}
						else
						{
							str+='onclick="albumManage.getImgSrc(\''+t[i+1].split('$')[0]+'\')"';
						}
						str+=' style="cursor:pointer;" title="'+photoTitle+'"/>';
						g('showPhoto').innerHTML=str;
						if (trim(A[4])=="")
						{
							g('filename').innerHTML=trim(A[2]);
						}
						else
						{
							g('filename').innerHTML=trim(A[4]);
						}
					}
					else
					{
						s+='<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td height="76" align="center"><img src="'+ImgAttachment(trim(A[1]).replace(/_thumbnail/g,'').replace(/\.\./,''),"_150_113")+'" onload="fitImg(this,76,76)" width="76" height="76" style="cursor:pointer;" title="'+photoTitle+'"/></li></td></tr></table>';
						str='';
						str='<img src="'+ImgAttachment(trim(A[1]).replace(/_thumbnail/g,'').replace(/\.\./,''),"_600_0")+'"  title="'+photoTitle+'"';
						if(i==(t.length-1))
						{	
							str+=' onclick="albumManage.getImgSrc(\''+t[1].split('$')[0]+'\')" style="cursor:pointer;"/>';
						}
						else
						{
							str+=' onclick="albumManage.getImgSrc(\''+t[i+1].split('$')[0]+'\')" style="cursor:pointer;"/>';
						}
						g('showPhoto').innerHTML=str;
						if (trim(A[4])=="")
						{
							//document.title=trim(e[2]);
							g('filename').innerHTML=trim(A[2]);
						}
						else
						{
							//document.title=trim(A[4]);
							g('filename').innerHTML=trim(A[4]);
						}
					}
					
					eqpid=i;
					g('filesize').innerHTML=parseInt(A[3])/1000+"K";
					g('update').innerHTML=A[6].split(' ')[0];
					g('views').innerHTML=A[10];
					g('commentcount').innerHTML=A[13];
				}
				else
				{
					s+='<li class="al_p02">';
					if(trim(A[1]).split('/')[0]=="space")
					{
						s+='<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td height="76" align="center"><img src="/bbs/'+ImgAttachment(trim(A[1]),"_150_113")+'"  onload="fitImg(this,76,76)" width="76" height="76" onclick="albumManage.getImgSrc(\''+A[0]+'\')" style="cursor:pointer;" title="'+photoTitle+'"/></li></td></tr></table>';
					}
					else
					{
						s+='<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td height="76" align="center"><img src="'+ImgAttachment(trim(A[1]).replace(/_thumbnail/g,'').replace(/\.\./,''),"_150_113")+'" width="76" height="76" onload="fitImg(this,76,76)" onclick="albumManage.getImgSrc(\''+A[0]+'\')" style="cursor:pointer;" title="'+photoTitle+'"/></li></td></tr></table>';
					}
				}
			}
			s+='</ul></div>';
			g(O).innerHTML=s;
			g('photo_al01').style.width=t.length*imgStep+'px';
			 maxWidth=t.length*imgStep;
			var scroLeft=0;
			if(eqpid<4)
			{
				scroLeft=eqpid*imgStep;
			}
			else
			{
				//scroLeft=4*imgStep;
				scroLeft=334;
			}
			setTimeout(function(){g('photo_al01').style.marginLeft="-"+(eqpid*imgStep-scroLeft)+"px"},400);
		}
		gD(u,x);
	}
	
	/*滚动函数*/
	this.scrollHiddenDiv=function(div, scrollwidth)
	{
		if(imgcount<7)
		{
			return;
		}
		var offset=parseInt(g(div).style.marginLeft)+parseInt(scrollwidth);
		if (offset<(668-maxWidth))
		{
			offset=668-maxWidth;
		}
		else if (offset>0)
		{
			offset=0;
		}
		g(div).style.marginLeft =offset+"px";
	}
	/*滚动相关*/
	this.getImgSrc=function(pid)
	{
		document.location.href='/album/photo.asp?id='+gU('id')+'&pid='+pid;
	}
}
