/*-----*/
//去多余的空格
function KillSpace(text){
	var i=0;
	var len=0;
	var lentmp=0;
	var a=0;
	var b=0;
	while (i==0)
	{
		lentmp = text.length;
		text = text.replace(/(^\s*)|(\s*$)/g,"");
		len = text.length;
		if(lentmp==len){
			a=0;
		}else{
			a=1;
		}
	
		lentmp = text.length;
		text = text.replace(/(^\u3000*)|(\u3000*$)/g,"");
		text = text.replace(/(^\ue4c6*)|(\ue4c6*$)/g,"");
		len = text.length;
		if(lentmp==len){
			b=0;
		}else{
			b=1;
		}
		
		if (a==0 && b==0){
			i = 1;
		}else{
			i = 0;
		}

	}
	return text;
}

//计算字节长度
	String.prototype.getBytes = function() {    
    var cArr = this.match(/[^\x00-\xff]/ig);    
    return this.length + (cArr == null ? 0 : cArr.length);    
    }     


//用于截取字符串
String.prototype.Trim = function(){ return this.replace(/^\s*|\s*$/g,"");}

function showsec(id){//显示验证码
  var objImage=document.getElementById(id);
  objImage.src="/photocenter/Captcha.wiki?random="+Math.random();
}

function setCookie(name,value){
 	 var Days = 1; //此 cookie 将被保存 1 天
  var exp  = new Date();    //new Date("December 31, 9998");
  exp.setTime(exp.getTime() + Days*24*60*60*1000);
  document.cookie = name + "="+ escape(value) +";expire="+ exp.toGMTString()+";"+"path=/;"+"domain=.hudong.com;";
 	}
function enterUploadPageCheck(){//验证上传信息
	  createXMLHttpRequest();
	 setCookie('nextURL',document.location.href);
      passUrl="http://photo.hudong.com/photocenter/enterUploadPage";
	  xmlHttp.open("POST", passUrl, true);
   //   xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
      xmlHttp.onreadystatechange = enterUploadPageCheck_callback;
      xmlHttp.send(null);
}
function enterUploadPageCheck_callback(){
	   if (xmlHttp.readyState == 4){
		    if (xmlHttp.status == 200||xmlHttp.status == 0||xmlHttp.status==302){
		    	
				if(xmlHttp.responseXML!=null&&typeof(xmlHttp.responseXML) != "undefined"&&xmlHttp.responseXML.getElementsByTagName("FLAG")[0]!=null)
				{
					var flag = xmlHttp.responseXML.getElementsByTagName("FLAG")[0].firstChild.data;
					var info = xmlHttp.responseXML.getElementsByTagName("INFO")[0].firstChild.data;
					if(flag==62)
					{
						info = "您提交的会员资料正在审理中，请稍候，结果将以站内信方式通知!";
					}
					alert(info);
				}
				else
				{
					window.location.href="http://photo.hudong.com/photocenter/enterUploadPage";
		   		}
			}
		}
	}
	
function personalCheck(){//个人图片管理---验证用户权限
	  createXMLHttpRequest();
	  setCookie('nextURL',document.location.href);
      passUrl="http://photo.hudong.com/photocenter/viewUserSelfPhotoHome";//首页进入个人空间需要提示
	  xmlHttp.open("POST", passUrl, true);
      xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
      xmlHttp.onreadystatechange = personalCheck_callback;
      xmlHttp.send(null);
}


function personalCheck_callback(){
	   if (xmlHttp.readyState == 4){
		    if (xmlHttp.status == 0||xmlHttp.status == 200||xmlHttp.status==302){
				if(xmlHttp.responseXML!=null&&typeof(xmlHttp.responseXML) != "undefined"&&xmlHttp.responseXML.getElementsByTagName("FLAG")[0]!=null)
				{
					var flag = xmlHttp.responseXML.getElementsByTagName("FLAG")[0].firstChild.data;
					var info = xmlHttp.responseXML.getElementsByTagName("INFO")[0].firstChild.data;
					if(flag==62)//错误码
					{
						info = "您提交的会员资料正在审理中，请稍候，结果将以站内信方式通知!";
					}
					alert(info);
				}
				else
				{
					window.location.href="http://photo.hudong.com/photocenter/viewUserSelfPhotoHome";
		   		}
			}
		}
	}

function userUpCheck(){//个人图片管理---验证用户权限
	  createXMLHttpRequest();
	  setCookie('nextURL',document.location.href);
      passUrl="http://photo.hudong.com/photocenter/viewRegister";
	  xmlHttp.open("POST", passUrl, true);
      xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
      xmlHttp.onreadystatechange = userUpCheck_callback;
      xmlHttp.send(null);
}

function userUpCheck_callback(){
	   if (xmlHttp.readyState == 4){
		    if (xmlHttp.status == 0||xmlHttp.status == 200||xmlHttp.status==302){
				if(xmlHttp.responseXML!=null&&typeof(xmlHttp.responseXML) != "undefined"&&xmlHttp.responseXML.getElementsByTagName("FLAG")[0]!=null)
				{
					var flag = xmlHttp.responseXML.getElementsByTagName("FLAG")[0].firstChild.data;
					var info = xmlHttp.responseXML.getElementsByTagName("INFO")[0].firstChild.data;
					if(flag==62)//错误码
					{
						info = "您提交的会员资料正在审理中，请稍候，结果将以站内信方式通知!";
					}
					alert(info);
				}
				else
				{
					window.location.href="http://photo.hudong.com/photocenter/viewUserSelfPhotoHome";
		   		}
			}
		}
	}
	
function userLoginInfoSet(tagid){
	  createXMLHttpRequest();
	  if(tagid !=null)
	  {
	  	if(getHdCookie ('hduser')==null){  
	  		var ele=document.getElementById(tagid);
	  		ele.innerHTML="<li><a href=\"javascript:userUpCheck();\"><img src=\"/images/copyright_register.png\"/></a></li>"
	  					+"<li class=\"gray\">互动百科用户升级即可！</li>"
	  					+"<li class=\"mar_t40\"><a target=\"_blank\" href=\"http://tupian.hudong.com\"><img src=\"/images/copyright_fx.png\"/></a></li>"
	  					+"<li class=\"mar_t40 size\"><img src=\"http://static.hudong.com/77/78/00100000001001125385787253913.gif\"/><a href=\"http://www.hudong.com/wiki/%E4%BA%92%E5%8A%A8%E7%99%BE%E7%A7%91%EF%BC%9A%E7%89%88%E6%9D%83%E5%9B%BE%E7%89%87%E5%85%B1%E4%BA%AB%E4%B8%AD%E5%BF%83\" target=\"_blank\">版权声明</a></li>";
	  		
	  	}
		  passUrl="http://photo.hudong.com/photocenter/ajaxCheckUserLogin";
		  xmlHttp.open("POST", passUrl, true);
	      xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
	      xmlHttp.onreadystatechange =function(){userLoginInfoSet_callback(tagid);}; 
	      xmlHttp.send(null);
	  }
	  
      
}



function userLoginInfoSet_callback(tagid){
	   if (xmlHttp.readyState == 4){
		    if (xmlHttp.status == 0||xmlHttp.status == 200||xmlHttp.status==302){
				if(xmlHttp.responseXML!=null&&typeof(xmlHttp.responseXML) != "undefined"&&xmlHttp.responseXML.getElementsByTagName("FLAG")[0]!=null)
				{
					var ele=document.getElementById(tagid);
					var flag = xmlHttp.responseXML.getElementsByTagName("FLAG")[0].firstChild.data;
					if(flag=="ULS")
					{
						var user_iden = xmlHttp.responseXML.getElementsByTagName("USERIDEN")[0].firstChild.data;
						var user_sign = xmlHttp.responseXML.getElementsByTagName("USERSIGN")[0].firstChild.data;
						
						ele.innerHTML="<li class=\"portrait size\">"
								+"<a class=\"bold\" href=\""+"http://photo.hudong.com/photocenter/displayUserPhotoHome\">"+user_sign+"</a>，你好！<label>版权图片共享中心欢迎您！</label>"
								+"<li class=\"mar_t40\"><a target=\"_blank\" href=\"http://tupian.hudong.com\"><img src=\"/images/copyright_fx.png\"></a></li>"
								+"<li class=\"mar_t40 size\"><img src=\"http://static.hudong.com/77/78/00100000001001125385787253913.gif\"> <a href=\"http://www.hudong.com/wiki/%E4%BA%92%E5%8A%A8%E7%99%BE%E7%A7%91%EF%BC%9A%E7%89%88%E6%9D%83%E5%9B%BE%E7%89%87%E5%85%B1%E4%BA%AB%E4%B8%AD%E5%BF%83\" target=\"_blank\">版权声明</a></li>";
					}
					
				}
				else
				{
					var ele=document.getElementById(tagid);
	  				ele.innerHTML="<li><a href=\"javascript:userUpCheck();\"><img src=\"/images/copyright_register.png\"/></a></li>"
	  					+"<li class=\"gray\">互动百科用户升级即可！</li>"
	  					+"<li class=\"mar_t40\"><a target=\"_blank\" href=\"http://tupian.hudong.com\"><img src=\"/images/copyright_fx.png\"/></a></li>"
	  					+"<li class=\"mar_t40 size\"><img src=\"http://static.hudong.com/77/78/00100000001001125385787253913.gif\"/><a href=\"http://www.hudong.com/wiki/%E4%BA%92%E5%8A%A8%E7%99%BE%E7%A7%91%EF%BC%9A%E7%89%88%E6%9D%83%E5%9B%BE%E7%89%87%E5%85%B1%E4%BA%AB%E4%B8%AD%E5%BF%83\" target=\"_blank\">版权声明</a></li>";
		   		}
			}
		}
	}	

function uploadSubmit(){//上传图片提交
	  createXMLHttpRequest();
	  
	  var userIden = document.getElementById("photo_userIden").value;
	  
	  var photoSize = document.getElementById("property_size").value;
	  var photoLength = document.getElementById("property_length").value;
	  var photoFormate = document.getElementById("property_formate").value;
	  var photoMD5 = document.getElementById("property_md5").value;
	  var photoURL = document.getElementById("property_url").value;
	  var photoDocs = document.getElementsByName("docList");
	  var photoCategorys = document.getElementsByName("categoryList");
	 
	  
	  var photoTitle = document.getElementById("photo_title").value;
	  var photoDescription = document.getElementById("photo_description").value;

	  if(userIden==''||photoSize==''||photoLength==''||photoFormate==''||photoMD5==''||photoURL==''){
		   alert("请先上传图片后再提交！");
		   return false;
	  }
	  if(KillSpace(photoTitle.Trim()).length==0)
	  {
	  	alert("标题不能为空");
	  	document.form1.photo_title.focus();
	  	return false;
	  }
	  
	  else if(photoTitle.indexOf("/")!=-1||photoTitle.indexOf("%")!=-1||photoTitle.indexOf("+")!=-1||photoTitle.indexOf("!")!=-1||photoTitle.indexOf("@")!=-1||photoTitle.indexOf("#")!=-1
		||photoTitle.indexOf("$")!=-1||photoTitle.indexOf("^")!=-1||photoTitle.indexOf("&")!=-1||photoTitle.indexOf("*")!=-1||photoTitle.indexOf("{")!=-1||photoTitle.indexOf("}")!=-1||
		photoTitle.indexOf("<")!=-1||photoTitle.indexOf(">")!=-1||photoTitle.indexOf("[")!=-1||photoTitle.indexOf("]")!=-1||photoTitle.indexOf("(")!=-1||photoTitle.indexOf(")")!=-1)
	  {
	  	alert("标题中不能含有@，%，、等特殊字符！");
		document.form1.photo_title.focus();
		return false;
	  }
	  else if(photoTitle.getBytes()>40)
	  {
	  	alert("标题超长！");
		document.form1.photo_title.focus();
		return false;
	  }
	  
	  if(photoDescription.getBytes()>1000)
	  {
	  	alert("图片描述超长！");
		document.form1.photo_description.focus();
		return false;
	  }
	  var docStr="";
	  var categoryStr="";
	  if(photoDocs!=null)
	  {
	  	for(var i = 0;i<photoDocs.length;i++)
	  	{
	  		if(photoDocs[i].value.indexOf(";")!=-1&&photoDocs[i].value!='')
	  		{
	  			alert("相关词条不能包含';'");
	  			return false;
	  		}
	  		docStr+="&docList="+encodeURI(photoDocs[i].value);
	  	}
	  }
	  
	  if(photoCategorys!=null)
	  {
	  	for(var j = 0;j<photoCategorys.length;j++)
	  	{
	  		if(photoCategorys[j].value.indexOf(";")!=-1&&photoCategorys[j].value!='')
	  		{
	  			alert("开放分类不能包含';'");
	  			return false;
	  		}
	  		categoryStr+="&categoryList="+encodeURI(photoCategorys[j].value);
	  	}
	  	
	  }
	 
      passUrl="photocenter/ajaxCheckLoadPhoto?property.size="+encodeURI(photoSize)+"&property.length="+encodeURI(photoLength)+"&property.formate="+encodeURI(photoFormate)+"&property.md5="+encodeURI(photoMD5)+"&property.url="+encodeURI(photoURL)+"&photo.title="+encodeURI(photoTitle)+"&photo.description="+encodeURI(photoDescription)+docStr+categoryStr;
	  xmlHttp.open("POST", passUrl, true);
      xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
      xmlHttp.onreadystatechange = uploadSubmit_callback;
      xmlHttp.send(null);
}

function uploadSubmit_callback(){
	   if (xmlHttp.readyState == 4){
		    if (xmlHttp.status == 0||xmlHttp.status == 200){
				if(xmlHttp.responseXML!=null&&typeof(xmlHttp.responseXML) != "undefined"&&xmlHttp.responseXML.getElementsByTagName("FLAG")[0]!=null)
				{
					var flag = xmlHttp.responseXML.getElementsByTagName("FLAG")[0].firstChild.data;
					var info = xmlHttp.responseXML.getElementsByTagName("INFO")[0].firstChild.data;
					alert(info);
				}
				else
				{
					document.form1.submit();
				}
				
				
			}
		}
	}
	
	
function updateSubmit(){//修改图片提交
	  createXMLHttpRequest();
	  
	  var photoDocs = document.getElementsByName("docList");
	  var photoCategorys = document.getElementsByName("categoryList");
	 
	  
	  var photoTitle = document.getElementById("photo_title").value;
	  var photoDescription = document.getElementById("photo_description").value;
	  if(KillSpace(photoTitle.Trim()).length==0)
	  {
	  	alert("标题不能为空");
	  	document.form1.photo_title.focus();
	  	return false;
	  }
	  
	  else if(photoTitle.indexOf("/")!=-1||photoTitle.indexOf("%")!=-1||photoTitle.indexOf("+")!=-1||photoTitle.indexOf("!")!=-1||photoTitle.indexOf("@")!=-1||photoTitle.indexOf("#")!=-1
		||photoTitle.indexOf("$")!=-1||photoTitle.indexOf("^")!=-1||photoTitle.indexOf("&")!=-1||photoTitle.indexOf("*")!=-1||photoTitle.indexOf("{")!=-1||photoTitle.indexOf("}")!=-1||
		photoTitle.indexOf("<")!=-1||photoTitle.indexOf(">")!=-1||photoTitle.indexOf("[")!=-1||photoTitle.indexOf("]")!=-1||photoTitle.indexOf("(")!=-1||photoTitle.indexOf(")")!=-1)
	  {
	  	alert("标题中不能含有@，%，、等特殊字符！");
		document.form1.photo_title.focus();
		return false;
	  }
	  else if(photoTitle.getBytes()>40)
	  {
	  	alert("标题超长！");
		document.form1.photo_title.focus();
		return false;
	  }
	  
	  if(photoDescription.getBytes()>1000)
	  {
	  	alert("图片描述超长！");
		document.form1.photo_description.focus();
		return false;
	  }
	  var docStr="";
	  var categoryStr="";
	  if(photoDocs!=null)
	  {
	  	for(var i = 0;i<photoDocs.length;i++)
	  	{
	  		if(photoDocs[i].value.indexOf(";")!=-1&&photoDocs[i].value!='')
	  		{
	  			alert("相关词条不能包含';'");
	  			return false;
	  		}
	  		docStr+="&docList="+encodeURI(photoDocs[i].value);
	  	}
	  }
	  
	  if(photoCategorys!=null)
	  {
	  	for(var j = 0;j<photoCategorys.length;j++)
	  	{
	  		if(photoCategorys[j].value.indexOf(";")!=-1&&photoCategorys[j].value!='')
	  		{
	  			alert("开放分类不能包含';'");
	  			return false;
	  		}
	  		categoryStr+="&categoryList="+encodeURI(photoCategorys[j].value);
	  	}
	  	
	  }
	 
      passUrl="photocenter/ajaxCheckUpdatePhoto?photo.title="+encodeURI(photoTitle)+"&photo.description="+encodeURI(photoDescription)+docStr+categoryStr;
	  xmlHttp.open("POST", passUrl, true);
      xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
      xmlHttp.onreadystatechange = updateSubmit_callback;
      xmlHttp.send(null);
}

function updateSubmit_callback(){
	   if (xmlHttp.readyState == 4){
		    if (xmlHttp.status == 0||xmlHttp.status == 200){
				if(xmlHttp.responseXML!=null&&typeof(xmlHttp.responseXML) != "undefined"&&xmlHttp.responseXML.getElementsByTagName("FLAG")[0]!=null)
				{
					var flag = xmlHttp.responseXML.getElementsByTagName("FLAG")[0].firstChild.data;
					var info = xmlHttp.responseXML.getElementsByTagName("INFO")[0].firstChild.data;
					alert(info);
				}
				else
				{
					document.form1.submit();
				}
			}
		}
	}	
	
function setTop()//取消跳转
{
	if(document.location != top.location)
		{
			top.location = document.location;
		}
		else
		{
			window.location.href = "http://photo.hudong.com";
		}
}

//上传图片提交
function doSubmitImg(){
	  var faceico =document.getElementById("photofile").value.Trim();
	  if(faceico==""){
	  	alert("图片地址不能为空!");
	  	return false;
	  	}
	  	if(userIden=="")
	  	{
	  	alert("无法取得用户信息!");
	  	return false;
	  	}
	  var patn = /\.jpg$|\.jpeg$|\.gif$|\.png$/i;
	  var x = document.getElementById("photofile");
    if(!patn.test(x.value)){
	  alert("图片格式有误!");
	  return false;
	  }
	  document.photoFileForm.submit();
	}
	
function AutoResizeImage(objImg){
	var maxWidth=140;
	var maxHeight=140;
	var img = new Image();
	img.src = objImg.src;
	var hRatio;
	var wRatio;
	var Ratio = 1;
	var w = img.width;
	var h = img.height;
	wRatio = maxWidth / w;
	hRatio = maxHeight / h;
	if (maxWidth ==0 && maxHeight==0){
		Ratio = 1;
	}else if (maxWidth==0){
		if (hRatio<1) {
			Ratio = hRatio;
		}
	}else if (maxHeight==0){
		if (wRatio<1){
			Ratio = wRatio;
		}
	}else if (wRatio<1 || hRatio<1){
		Ratio = (wRatio<=hRatio?wRatio:hRatio);
	}
	if (Ratio<1){
		w = w * Ratio;
		h = h * Ratio;
	}
	objImg.height = h;
}	
	
//重置下载连接	
function uploadImg(){
	var uploadTd=document.getElementById("picTd");
	uploadTd.innerHTML='<iframe name="insertIframe" frameborder="0" width="500" height="30" scrolling="no" src="/inc/insert_iframe.jsp"></iframe>';
	var photo_size = document.getElementById('property_size');
    var photo_length = document.getElementById('property_length');
    var photo_formate = document.getElementById('property_formate');
    var photo_multimediaMd5 = document.getElementById('property_md5');
    var photo_URL = document.getElementById('property_url');
    if(photo_size!=null&&photo_length!=null&&photo_formate!=null&&photo_multimediaMd5!=null&&photo_URL!=null)
    {
    	photo_size.value='';
    	photo_length.value='';
    	photo_formate.value='';
    	photo_multimediaMd5.value='';
    	photo_URL.value='';
    }
    
}

function downloadPhoto(photoId){//修改图片提交
	  createXMLHttpRequest();  
//	  var photoId = document.getElementById("photoId");
	 if(photoId.value==''||photoId==null)
	 {
	 	return false;
	 }
      passUrl="/photocenter/checkDownloadPower?multimediaId="+photoId;
	  xmlHttp.open("POST", passUrl, true);
      xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
      xmlHttp.onreadystatechange = function(){downloadPhoto_callback(photoId);};
      xmlHttp.send(null);
}

function downloadPhoto_callback(photoId){
	   if (xmlHttp.readyState == 4){
		    if (xmlHttp.status == 0||xmlHttp.status == 200){
				if(xmlHttp.responseXML!=null&&typeof(xmlHttp.responseXML) != "undefined"&&xmlHttp.responseXML.getElementsByTagName("FLAG")[0]!=null)
				{
					var flag = xmlHttp.responseXML.getElementsByTagName("FLAG")[0].firstChild.data;
					var info = xmlHttp.responseXML.getElementsByTagName("INFO")[0].firstChild.data;
					alert(info);
				}
				else
				{
					window.location.href="http://photo.hudong.com/photocenter/download?multimediaId="+photoId;
				}
				
				
			}
		}
	}
	
	
	
	ajaxGetPageList = function(page_now_num){ //读取人物关系前的操作函数
	$.ajax({
		dataType: 'xml',
		type: 'GET',
		url: 'http://photo.hudong.com/photocenter/hotPhotoList',
		data: 'pageNum='+page_now_num+'&pageSize=20',
		success: function(xml) {

			var flag = $(xml).find("FLAG").text();
			var page_now = $(xml).find("PAGE_NOW").text();
			var page_next = $(xml).find("PAGE_NEXT").text();
			var page_prv = $(xml).find("PAGE_PRV").text();
			var page_last = $(xml).find("PAGE_LAST").text();
			var page_first = $(xml).find("PAGE_FIRST").text();
			
			var page_sliders = new Array();
			$(xml).find("PAGE_SLIDER_NUM").each(function(i){
				page_sliders[i] = $(this).text();
			});
			var $page_constant = $('#page_constant');//写入标签
			var $pagelist_info = $('#pagelist_info');//写入标签
			
			var page_list_html  = "";//保存页面信息
			var page_info_html = "";//保存分页信息
			
			if($('#page_constant').length<0&&$('#pagelist_info').length<0 )
			{
				alert('未找到要写入内容的位置!');
				return;
			}
			else
			{
				if(flag=='HOT_PHOTOLIST')
				{
					
					//------------分页处理--开始------------------------------
					page_info_html+="<a onclick='javascript:ajaxGetPageList("+page_first+")'>首页</a>";
					page_info_html+="<a onclick='javascript:ajaxGetPageList("+page_prv+")'>上一页</a>";
					
					for(var i =0;i<page_sliders.length;i++)
					{
						if(page_sliders[i]==page_now)
						{
							page_info_html+="<a onclick='javascript:ajaxGetPageList("+page_sliders[i]+")'>"+page_sliders[i]+"</a>";
						}
						else
						{
							page_info_html+="<a onclick='javascript:ajaxGetPageList("+page_sliders[i]+")'>["+page_sliders[i]+"]</a>";
						}
						
					}
					page_info_html+="<a onclick='javascript:ajaxGetPageList("+page_next+")'>下一页</a>";
					page_info_html+="<a onclick='javascript:ajaxGetPageList("+page_last+")'>末页</a>";
					//------------分页处理-结束--------------------------------
					
					//--------页面信息处理----
					$(xml).find("PHOTO").each(function(i){
					var photo_id = $(this).children("PHOTO_ID").text();
					var photo_src = $(this).children("PHOTO_SRC").text();
					var photo_title = $(this).children("PHOTO_TITLE").text();
					if(photo_title.length>=11)
					{
						photo_title = photo_title.substring(0,8)+"..";
					}
					var photo_useriden = $(this).children("PHOTO_USERIDEN").text();
					var photo_usersign = $(this).children("PHOTO_USERSIGN").text();
					page_list_html+="<li><a href='http://photo.hudong.com/photo_"+photo_id+"' target='_blank' class='a-img1'><img alt='"+photo_title+"' src='"+photo_src+"'/></a><a href='http://photo.hudong.com/photo_"+photo_id+"' target='_blank'>"+photo_title+"</a><p>上传作者：<a target='_blank' href='http://photo.hudong.com/photocenter/displayUserPhotoHome?userIden="+photo_useriden+"'>"+photo_usersign+"</a></p></li>";
					
				});
					$page_constant.html(page_list_html);//将信息写到页面
					$pagelist_info.html(page_info_html);
				}
				else
				{
					alert('请求连接错误！');
				}
			}
			
			
		},
		beforeSend:function()
		{
			if($('#page_constant').length<0&&$('#pagelist_info').length<0 )
			{
				alert('未找到要写入内容的位置!');
				return;
			}
			else
			{
				$('#page_constant').html("<p align='center'><img alt='loading' src='http://photo.hudong.com/photocenter/images/loading2.gif'/></p>");
			}
		},
		error: function(){
			alert('由于网络等诸多问题，数据读取失败，请重试');
		} 
	});
}
	
	
	
	
