
function dellogo()
{openWindow('logo_del_dialog.php?pid='+photo_pid,330,180,'删除照片');}
function dellogo_do(v_pid)
{document.dellogoform.pid.value=v_pid;document.setlogoform.from.value=$("returnlink").href;document.dellogoform.submit();}
function setlogo()
{openWindow('logo_set_dialog.php?pid='+photo_pid,330,180,'设置为当前头像');}
function setlogo_do(v_pid)
{document.setlogoform.pid.value=v_pid;document.dellogoform.from.value=window.location.href;document.setlogoform.submit();}
function logophotoinit()
{var obj=$("photo1");obj.width=$("realwidth").value;obj.height=$("realheight").value;var obj=$("photo2");obj.width=$("realwidth").value;obj.height=$("realheight").value;showLogoMoreInfo();var viewmode=getViewMode();if(viewmode=="part")
{partviewmode();}
else
{wholeviewmode();}
resetmask();photodivonmouseout();logoshowiconlist(photo_puid,photo_pid,photo_pos);}
function logofindpid(v_puid,v_pid)
{var i;var ret=-1;if(photo_list.length)
{ret=-2;}
for(i=0;i<photo_list.length;i++)
{if(photo_list[i]!=null)
{if(parseInt(photo_list[i]["pid"])==parseInt(v_pid)&&parseInt(photo_list[i]["uid"])==parseInt(v_puid))
{return i;}}
else
{ret=-3;}}
return ret;}
function showLogoMoreInfo()
{markdata=photo_pid+"_"+photo_puid;var photodata=markdata+"_"+photo_pos;var sethash=true;if(back_ajax&&parseInt(back_ajax,10)==1)
{sethash=false;back_ajax=0;}
if(sethash)
{clickDirect(photodata,true);}
$("comment_noright1").innerHTML='';$("comment_noright2").innerHTML='';$("comment_noright1").innerHTML='仅<a href="/home/?uid='+photo_puid+'" class="sl">'+user_list["_"+photo_puid]["real_name"]+'</a>的好友可以对此发表评论';$("comment_noright2").innerHTML='<a href="/home/?uid='+photo_puid+'" class="sl">'+user_list["_"+photo_puid]["real_name"]+'</a>关闭了评论功能';$("comment").innerHTML='<br /><br /><br /><br /><br /><br />';h("comment_hasright");initComment(photo_vuid,photo_puid,"4",photo_pid);getCommentList();if(parseInt(user_list["_"+photo_puid]["comment_right"])==1)
{$("comment_hasright").style.display="block";}
else if(parseInt(user_list["_"+photo_puid]["comment_right"])==-1)
{$("comment_noright1").style.display="block";}
else
{$("comment_noright2").style.display="block";}
initZanInfo(photo_vuid,photo_puid,"4",photo_pid,parseInt(user_list["_"+photo_puid]["comment_right"]));showLogoExifInfo();}
function showLogoExifInfo()
{var pugid=photo_pid+"_"+photo_puid+"_0";if(typeof(exif_list[pugid])=="undefined")
{getLogoGUAInfo("exif",pugid);return;}
$("exif").innerHTML='';if(exif_list[pugid]!=""&&exif_list[pugid]["EXIF"]!="0"){if(exif_list[pugid]["Make"]&&exif_list[pugid]["Make"]!=""){$("exif").innerHTML+='厂商 '+exif_list[pugid]["Make"]+'<br>';}
if(exif_list[pugid]["Model"]&&exif_list[pugid]["Model"]!=""){$("exif").innerHTML+='型号 '+exif_list[pugid]["Model"]+'<br>';}
if(exif_list[pugid]["DateTimeOriginal"]&&exif_list[pugid]["DateTimeOriginal"]!=""){$("exif").innerHTML+='日期 '+exif_list[pugid]["DateTimeOriginal"]+'<br>';}
if(exif_list[pugid]["Width"]&&exif_list[pugid]["Width"]!=""){$("exif").innerHTML+='大小 '+exif_list[pugid]["Width"]+' x '+exif_list[pugid]["Height"]+'<br>';}
if(exif_list[pugid]["FocalLength"]&&exif_list[pugid]["FocalLength"]!=""){$("exif").innerHTML+='焦距 '+exif_list[pugid]["FocalLength"]+'<br>';}
if(exif_list[pugid]["ApertureValue"]&&exif_list[pugid]["ApertureValue"]!=""){$("exif").innerHTML+='光圈 '+exif_list[pugid]["ApertureValue"]+'<br>';}
if(exif_list[pugid]["ExposureTime"]&&exif_list[pugid]["ExposureTime"]!=""){$("exif").innerHTML+='曝光时间 '+exif_list[pugid]["ExposureTime"]+'<br>';}
if(exif_list[pugid]["ISOSpeedRatings"]&&exif_list[pugid]["ISOSpeedRatings"]!=""){$("exif").innerHTML+='感光度 '+exif_list[pugid]["ISOSpeedRatings"]+'<br>';}
if(exif_list[pugid]["Flash"]&&exif_list[pugid]["Flash"]!=""){$("exif").innerHTML+='闪光灯 '+exif_list[pugid]["Flash"]+'<br>';}}
if($("exif").innerHTML==''){$("exif").innerHTML='该照片无EXIF信息';}}
function logoshowiconlist(v_puid,v_pid,v_start)
{var pos=logofindpid(v_puid,v_pid);if(pos<0)
{if(pos!=-2)
{logoiconlistget(v_start);}
return;}
photo_pos=pos;prev_pos2=(pos+photo_total-2)%photo_total;if(photo_list[prev_pos2]==null)
{logoiconlistget(prev_pos2);return;}
prev_pos=(pos+photo_total-1)%photo_total;if(photo_list[prev_pos]==null)
{logoiconlistget(prev_pos);return;}
next_pos=(pos+1)%photo_total;if(photo_list[next_pos]==null)
{logoiconlistget(next_pos);return;}
next_pos2=(pos+2)%photo_total;if(photo_list[next_pos2]==null)
{logoiconlistget(next_pos2);return;}
var a_wh;$("totaldiv").innerHTML=(photo_pos+1)+'/'+photo_total;if(prev_pos!=photo_pos)
{$("prevlinkdiv").innerHTML='<a href="javascript:viewprevlogo();" class="sl" title="上一张">上一张</a>';$("nextlinkdiv").innerHTML='<a href="javascript:viewnextlogo();" class="sl" title="下一张">下一张</a>';}
else
{$("prevlinkdiv").innerHTML='';$("nextlinkdiv").innerHTML='';}
var v_html='';if(prev_pos2!=photo_pos&&prev_pos2!=next_pos&&prev_pos2!=prev_pos&&prev_pos2!=next_pos2)
{a_wh=getPhotoWH(photo_list[prev_pos2]["width"],photo_list[prev_pos2]["height"]);v_html+='<div class="zp_r_on" onclick="javascript:viewlogo('+prev_pos2+');" onmouseover="this.className=\'zp_r_on\';" onmouseout="this.className=\'zp_r_on\';" style="width:'+a_wh[0]+'px; height:'+a_wh[1]+'px;background: url('+photo_list[prev_pos2]["small"]+') center no-repeat;"></div>';}
if(prev_pos!=photo_pos&&prev_pos!=next_pos)
{a_wh=getPhotoWH(photo_list[prev_pos]["width"],photo_list[prev_pos]["height"]);v_html+='<div class="zp_r_on" onclick="javascript:viewlogo('+prev_pos+');" onmouseover="this.className=\'zp_r_on\';" onmouseout="this.className=\'zp_r_on\';" style="width:'+a_wh[0]+'px; height:'+a_wh[1]+'px;background: url('+photo_list[prev_pos]["small"]+') center no-repeat;"></div>';}
a_wh=getPhotoWH(photo_list[photo_pos]["width"],photo_list[photo_pos]["height"]);v_html+='<div style="border:1px solid #999999;margin:5px auto 5px auto; padding:1px;width:'+a_wh[0]+'px; height:'+a_wh[1]+'px;background: url('+photo_list[photo_pos]["small"]+') center no-repeat;"></div>';if(next_pos!=photo_pos)
{a_wh=getPhotoWH(photo_list[next_pos]["width"],photo_list[next_pos]["height"]);v_html+='<div class="zp_r_on" onclick="javascript:viewlogo('+next_pos+');" onmouseover="this.className=\'zp_r_on\';" onmouseout="this.className=\'zp_r_on\';" style="width:'+a_wh[0]+'px; height:'+a_wh[1]+'px;background: url('+photo_list[next_pos]["small"]+') center no-repeat;"></div>';}
if(next_pos2!=photo_pos&&next_pos2!=next_pos&&next_pos2!=prev_pos)
{a_wh=getPhotoWH(photo_list[next_pos2]["width"],photo_list[next_pos2]["height"]);v_html+='<div class="zp_r_on" onclick="javascript:viewlogo('+next_pos2+');" onmouseover="this.className=\'zp_r_on\';" onmouseout="this.className=\'zp_r_on\';" style="width:'+a_wh[0]+'px; height:'+a_wh[1]+'px;background: url('+photo_list[next_pos2]["small"]+') center no-repeat;"></div>';}
$("iconlist").innerHTML=v_html+'<div class="w80">&nbsp;</div>';var r_pid=photo_list[photo_pos]["pid"];var r_albumid=photo_list[photo_pos]["albumid"];var r_uid=photo_list[photo_pos]["uid"];}
function logoonclick(evnt)
{var photopos1=getpos($("photodiv1"));var photopos2=getpos($("photodiv2"));var x=1;if(evnt)
{x=(parseInt(evnt.clientX)-photopos1.left-photopos2.left)/$("photo1").width;}
if(x>0.5)
{viewnextlogo();}
if(x<=0.5)
{viewprevlogo();}}
function logoiconlistget(v_start)
{var url="/photo/logoiconlist.php";var pars="uid="+photo_uid+"&type="+logo_type+"&start="+(Math.floor(v_start/100)*100);var myAjax=new Ajax.Request(url,{method:"post",parameters:pars,onComplete:function(req){logoiconlistajaxshow(req);}});}
function logoiconlistajaxshow(req)
{eval("r="+req.responseText);if(parseInt(r["ret"]))
{return;}
photo_total=parseInt(r["total"]);if(!photo_total)
{return;}
var i;for(i=photo_list.length;i<photo_total;i++)
{photo_list[i]=null;}
var start=parseInt(r["start"]);for(i=0;i<r["list"].length;i++)
{photo_list[i+start]=r["list"][i];}
if(g_new_pos)
{viewlogo(g_new_pos);g_new_pos=0;}
logoshowiconlist(photo_puid,photo_pid,(start+100)%photo_total);}
function viewprevlogo()
{viewlogo((photo_pos+photo_total-1)%photo_total);}
function viewnextlogo()
{viewlogo((photo_pos+1)%photo_total);}
function viewlogo(new_pos)
{if(new_pos>=photo_total)
{return;}
if(photo_list[new_pos]==null)
{return;}
photo_pid=parseInt(photo_list[new_pos]["pid"]);photo_puid=parseInt(photo_list[new_pos]["uid"]);photo_pos=parseInt(new_pos);var waitpic=new Image();waitpic.onload=function(){$("photo1").src=waitpic.src;$("photo2").src=waitpic.src;}
waitpic.src="http://img1.kaixin001.com.cn/i2/photo/null.gif";markdata="0_0_0";tagobj=null;taging=false;zoomlevel=0;$("realwidth").value=photo_list[photo_pos]["width"];$("realheight").value=photo_list[photo_pos]["height"];initloadingdiv();s("loadingdiv");$("phototitlediv").innerHTML='<strong class="f13" style="color:#333;">'+photo_list[photo_pos]["title"]+'</strong>';$("newwindow").href="/photo/showpic.php?url="+encodeURIComponent(photo_list[photo_pos]["big"])+"&title="+encodeURIComponent(photo_list[photo_pos]["title-uri"]);logophotoinit();var waitpic2=new Image();waitpic2.onload=function(){$("photo1").src=photo_list[photo_pos]["big"];$("photo2").src=photo_list[photo_pos]["big"];}
waitpic2.src="http://img1.kaixin001.com.cn/i2/photo/null.gif";}
function logo_setlogo()
{var str=window.location.href.split("#");window.location="/set/resetlogo.php?id="+encodeURIComponent(photo_list[photo_pos]["pid"])+"&back="+encodeURIComponent(str[0]);}
function getLogoGUAInfo(v_type,v_id)
{var url="/photo/item.php";var pars="type="+v_type+"&id="+v_id+"&rotate="+photo_list[photo_pos]["rotate"];var myAjax=new Ajax.Request(url,{method:"post",parameters:pars,onComplete:function(req){getLogoGUAInfoajaxshow(req);}});}
function getLogoGUAInfoajaxshow(req)
{eval("r="+req.responseText);if(parseInt(r["ret"]))
{return;}
if(r["type"]=="exif")
{exif_list[r["id"]]=r["data"][r["id"]];showLogoExifInfo();return;}
else
{return;}
showLogoMoreInfo();}