var edit_album163_in_blog=false;
var jst_album_163_list=new String('\
  {if albums163.length <= 0}\
   {if viewType == "edit"}\
     {if edit_album163_in_blog}\
     <div class="mng c05"><span class="g_c_ul c05 a_a c_c" onclick=\'newAlbum163();return false;\'>创建相册</span>&nbsp;<span class="bd1c">|</span>&nbsp;<span class="a_a c_c g_c_ul c05" href="http://${hostName|parentDomain}/album163/all/edit/">管理相册</span></div>\
     {else}\
     <div class="mng c05"><span class="a_a c_c g_c_ul c05" href="http://photo.163.com/photos/${hostname}/?u=${hostname}" target="_blank">管理相册</span>{if yxpPermitted != 0}&nbsp;<span class="bd1c">|</span>&nbsp;<span class="a_a c_c g_c_ul c05" href="http://yxp.163.com/photo/ep.html" target="_blank">网上冲印</span></div>{else}</div>{/if}\
     {/if}\
   {/if}\
   <div class="c07 g_t_14 g_c_vmgin">暂无相册</div>\
  {else}\
     {if viewType == "edit"}\
    {if edit_album163_in_blog}\
    <div class="mng c05"><span class="g_c_ul c05 a_a c_c" onclick=\'newAlbum163();return false;\'>创建相册</span>&nbsp;<span class="bd1c">|</span>&nbsp;<span class="a_a c_c g_c_ul c05" href="http://${hostName|parentDomain}/album163/all/edit/">管理相册</span></div>\
    {else}\
    <div class="mng c05"><span class="a_a c_c g_c_ul c05" href="http://photo.163.com/photos/${hostname}/?u=${hostname}" target="_blank">管理相册</span>{if yxpPermitted != 0}&nbsp;<span class="bd1c">|</span>&nbsp;<span class="a_a c_c g_c_ul c05" href="http://yxp.163.com/photo/ep.html" target="_blank">网上冲印</span></div>{else}</div>{/if}\
    {/if}\
   {else}\
     <div class="mng g_c_noul a_a c_c c05" href="http://${hostName|parentDomain}/album163/all/"><span style="text-decoration:underline;font-size:12px">更多...</span></div>\
   {/if}\
   {if pageIdx > 0}\
     <div class="escp"><div id="_$_prev_albums_163" class="btn brd01 g_htc_selitm" onclick="showAlbumListByPage163(${pageIdx - 1});return false;"><span class="n_ f26">&nbsp;</span><span id="_$_next_albums_tip" class="txt c09">前&nbsp;4&nbsp;个</span></div></div>\
   {/if}\
   <div class="case">\
     {for _a in albums163}\
      {if _a.id!=null}\
     <div class="itm bd01 g_htc_hvr g_h_1">\
      <div id="wrapper_album_163_${_a.id}" class="g_htc_item" onclick="selectAlbum163(\'${_a.id}\', \'wrapper_album_163_${_a.id}\');return false;">\
       <div class="tag0">\
        {if _a.privacy != 1}<span class="n_ f28">&nbsp;</span>{/if}\
       </div>\
       <div class="p_ p29e" >\
         <img id="_$_cover_163_${_a.id}" src="${_a.coverUrl}" style="display:none" onload="resizeCoverImg163(this, ${_a.coverWidth}, ${_a.coverHeight}, 93, 101)" onerror="this.src=\'http://b.bst.126.net/style/common/album_face.gif\'">\
       </div>\
       <div class="g_t_hide g_c_mvdn g_t_14">${_a.name.substring(0,6)}(${_a.count})</div>\
      </div>\
    </div>\
   {/if}\
  {/for}\
  </div>\
  {if !isLastPage}\
  <div class="escp"><div id="_$_next_albums_163" class="btn brd01 g_htc_selitm" onclick="showAlbumListByPage163(${pageIdx + 1});return false;"><span class="n_ f27">&nbsp;</span><span id="_$_next_albums_tip" class="txt c09">后&nbsp;4&nbsp;个</span></div></div>\
  {/if}\
 {/if}\
 <div class="underline brd01" style="width:160px;position:relative;left:-2px;">&nbsp;</div>\
');
var jst_photo_163_list=new String('\
 {if photos163.length <= 0}\
  <div style="font-size:14px">该网易相册现无相片{if viewType == "edit" && migStat != 2}，<a href="http://photo.163.com/upload.php?aid=${albumId}" target="_blank" style="text-decoration:underline">请先上传</a>{/if}</div>\
 {else}\
  <table style="width:100%;margin-top:15px;">\
   {var x=0}\
   {for photo in photos163}\
   {if x % 4 ==0}<tr>{/if}\
   <td align="center" valign="bottom" width="25%">\
    <div style="margin-bottom:40px;">\
     <a href="http://${hostname|parentDomain}/prevPhoto163.do?photoIdx=${photo.index}&albumId=${albumId}" target="_blank"><img width="${photo.thumbWidth}" height="${photo.thumbHeight}" src="${photo.thumbUrl}"></a>\
     <div id="desc_163_${photo.id}" class="c07 g_t_12 g_t_hide" style="margin-top:5px;width:130px;height:14px;" {if viewType=="edit" && edit_album163_in_blog}title="点击即可编辑" alt="点击即可编辑" onclick="editPhoto163Desc(${photo.id}, \'manage_photo_163_${photo.id}\')"{/if}>{if photo.desc!=null && photo.desc != "" && photo.desc != " " }${photo.desc}{else}<i class="c09">暂无描述</i>{/if}</div>\
     {if viewType == "edit"}\
      {if edit_album163_in_blog}\
       <div class="g_t_12 g_t_right c05" style="width:130px;margin-top:5px;"><span class="g_c_hand" id="manage_photo_163_${photo.id}" onclick="showPhoto163ManMenu(${photo.id}, \'manage_photo_163_${photo.id}\');return false;">[&nbsp;<span style="text-decoration:underline">管理</span><span class="n_ n32">]</span></span></div>\
      {else}\
       <div class="g_t_12 g_t_right c05" style="width:130px;margin-top:5px;"><span class="a_a c_c g_c_ul g_c_hand" id="manage_photo_163_${photo.id}" href="http://photo.163.com/photos/${hostname}/${albumId}/${photo.id}/?u=${hostname}" target="_blank">管理</span></div>\
      {/if}\
     {else}\
      <div class="g_t_12 g_t_right c05" style="margin-top:4px;"><span class="a_a c_c c05 g_c_ul" onclick="downloadPhoto163ToMobile(${photo.id})">下载到手机</span></div>\
     {/if}\
    </div>\
   </td>\
   {if x % 4 ==3}</tr>{/if}\
   {var x=x+1}\
   {/for}\
   {if x%4==1}\
    <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>\
   {/if}\
   {if x%4==2}\
    <td>&nbsp;</td><td>&nbsp;</td></tr>\
   {/if}\
   {if x%4==3}\
    <td>&nbsp;</td></tr>\
   {/if}\
  </table>\
 {/if}\
');
var jst_photo_163_list_large=new String('\
 {if photos163.length <= 0}\
  <div style="font-size:14px">该网易相册现无相片{if viewType == "edit" && migStat != 2}，<a href="http://photo.163.com/upload.php?aid=${albumId}" target="_blank" style="text-decoration:underline">请先上传</a>{/if}</div>\
 {else}\
  {for photo in photos163}\
   <div class="case brd01" id="wrapper_p_163_${photo.id}">\
     <div class="item g_t_wrap">\
     <div class="imgwrap"><a href="http://${hostname|parentDomain}/prevPhoto163.do?photoIdx=${photo.index}&albumId=${albumId}" target="_blank">\
     <img width="{if photo.width>600}600{else}${photo.width}{/if}" src="${photo.thumbUrl}" id="photo_small${photo.id}" /> \
     <img onload="onBigImageReady(\'photo_small${photo.id}\', \'photo_big${photo.id}\');" style="display: none;" width="{if photo.width>600}600{else}${photo.width}{/if}" src="${photo.url}" id="photo_big${photo.id}"/> \
     </a></div>\
     {if viewType == "edit"}\
      {if edit_album163_in_blog}\
       <div class="desc col1 g_t_wrap c07"><span id="desc_163_${photo.id}" style="font-size:14px;line-height:135%;" title="点击即可编辑" alt="点击即可编辑">{if photo.desc!=null && photo.desc!="" && photo.desc!=" "}${photo.desc}{else}<i class="c09">点击这里添加相片描述</i>{/if}</span>&nbsp;<span id="_$_pho_desc_edt_ico_${photo.id}" class="g_t_left" style="line-height:20px;position:absolute;"></span></div>\
       <div class="g_t_12 g_t_right c05"><span class="g_c_hand" onclick="showPhoto163ManMenu(${photo.id}, \'manage_photo_163_${photo.id}\');return false;">[&nbsp;<span style="text-decoration:underline" id="manage_photo_163_${photo.id}">管理</span><span class="n_ n32">]</span></span></div>\
      {else}\
       <div class="desc col1 g_t_wrap c07" id="desc_163_${photo.id}" style="font-size:14px;line-height:135%;">{if photo.desc!=null}${photo.desc}{/if}</div>\
       <div class="g_t_12 g_t_right c05"><span class="a_a c_c g_c_ul g_c_hand" id="manage_photo_163_${photo.id}" href="http://photo.163.com/photos/${hostname}/${albumId}/${photo.id}/?u=${hostname}" target="_blank">管理</span></div>\
      {/if}\
     {else}\
      <div class="desc col1 g_t_wrap c07" id="desc_163_${photo.id}" style="font-size:14px;line-height:135%;">{if photo.desc!=null}${photo.desc}{/if}</div>\
      <div class="g_t_12 g_t_right c05"><span class="a_a c_c c05 g_c_ul" onclick="downloadPhoto163ToMobile(${photo.id})">下载到手机</span></div>\
     {/if}\
    </div>\
   </div>\
  {/for}\
 {/if}\
');
var jst_album_163_info=new String('\
 <div class="menu">\
   <div class="fun {if viewMode!=\'small\'} vmwide{else} vmsmall{/if}">\
      <span class="c08">查看：</span>\
    <a href="#" {if viewMode==\'small\'}style="cursor:default" class="c07 g_noul"{else}class="c06"{/if} onclick="switchViewType163Photos(\'small\');return false;">小图</a>&nbsp;&nbsp;\
    <a href="#" {if viewMode==\'large\'}style="cursor:default" class="c07 g_noul"{else}class="c06"{/if} onclick="switchViewType163Photos(\'large\');return false;">大图</a>\
   </div>\
    </div>\
 <div class="c07"><span style="font-size: 24px;font-weight:bold" id="_$_album_title" {if viewType=="edit"} title="点击即可编辑" alt="点击即可编辑"{/if}>${album.name}</span>{if viewType=="edit"}<span id="_$_alb_edt_ico" class="g_t_left" style="line-height:40px;"></span>{/if}</div>\
 {if viewType == "edit"}\
  {if edit_album163_in_blog}\
   <div class="fun" id="_$_album_operator">\
    <span class="c05 g_c_hand" style="font-size:12px;" onclick="showAlbum163ManMenu(${album.id}, \'_$_open_menu_link\');return false;">[&nbsp;<span class="c05 g_t_12 g_c_ul" id="_$_open_menu_link">管理此相册</span><span class="n_ n32">]</span></span>&nbsp;\
   </div>\
   <div class="desc c07 g_t_wrap"><span id="_$_album_desc" style="line-height:135%" title="点击即可编辑" alt="点击即可编辑">{if album.desc!=null && album.desc!="" && album.desc!=" "}${album.desc|showBr}{else}<i class="c09">点击这里添加相册描述</i>{/if}</span><span id="_$_alb_desc_edt_ico"></span></div>\
  {else}\
   <div class="fun" id="_$_album_operator">\
    <span class="a_a c_c c05 g_c_hand" style="font-size:12px;" href="http://photo.163.com/photos/${hostname}/${album.id}/?u=${hostname}" target="_blank">管理此相册</span>&nbsp;\
   </div>\
   <div class="desc c07 g_t_wrap" id="_$_album_desc" style="line-height:135%">{if album.desc!=null}${album.desc|showBr}{/if}</div>\
  {/if}\
 {else}\
 <div class="desc c07 g_t_wrap" id="_$_album_desc" style="line-height:135%">{if album.desc!=null}${album.desc|showBr}{/if}</div>\
 {/if}\
');
var jst_album_comment_163=new String('\
 <div>\
  <div id="_$_ap_163_bar" class="g_tab_btn00 g_t_12">\
   <div class="bdl">\
    <a href="javascript:;" class="c05 g_c_hand" onclick="copyAlbum163Url(\'Hello, world!\');return false;">复制此相册网址&nbsp;</a>\
   </div>\
   <div id="_$_open_comment" class="bdl">\
    <a href="javascript:;" class="c05 g_c_hand" id="_$_comment_163_count" onclick="showHideComment163(\'_$_comment_area\');return false;">相册评论(0)</a>\
   </div>\
   <div id="_$_album_from" class="c08" style="float:left;">\
    来源：<a href="http://photo.163.com/photos/${hostName}/?u=${hostName}" target="_blank" class="c06">网易相册</a>\
   </div>\
   <br class="g_p_clear"/>\
  </div>\
 </div>\
');
var _$_template_edit_album_163_dialog;
var _$_edit_album_163_dialog;
var _$_template_album_163_menu;
var _$_album_163_menu_div;
var _$_template_photo_163_menu;
var _$_photo_163_menu_div;
var _$_template_del_album_163_dialog;
var _$_del_album_163_dialog_div;
var _$_template_edit_photo_163_desc_dialog;
var _$_edit_photo_163_desc_dialog_div;
var _$_template_photo_163_confirm_dialog;
var _$_photo_163_confirm_dialog_div;
function showEditAlbum163Box(album163,isNewAlbum){
if(!_$_edit_album_163_dialog){
var title=(isNewAlbum?"创建新相册":"修改相册属性");
_$_edit_album_163_dialog=
jsWindowManager.createWindow('_$_edit_album_163_dialog',{
className:'',width:480,heigth:20,title:title,
onTop:true,afterCloseFunc:function(){},
notKeepPos:true});
}
_$_edit_album_163_dialog.panel.innerHTML=_$_template_edit_album_163_dialog.process({album163:album163,isNewAlbum:isNewAlbum});
_$_edit_album_163_dialog.showWindow();
var albumNameInput=$('albumname');
if(albumNameInput){
albumNameInput.focus();
}
}
function closeEditAlbum163Box(){
if(_$_edit_album_163_dialog){
_$_edit_album_163_dialog.hiddenWindow('_$_edit_album_163_dialog');
}
}
function prepareChangePrivacy(level){
var r1=$('password_row');
var r2=$('confirm_password_row');
if(level==2){
if(r1){
r1.style.display='';
}
if(r2){
r2.style.display='';
}
}else{
if(r1){
r1.style.display='none';
}
if(r2){
r2.style.display='none';
}
}
}
var _$_album_163_types=new Array(12);
for(i=0;i<_$_album_163_types.length;i++){
_$_album_163_types[i]=new Array();
}
_$_album_163_types[0][0]=new Option("日常生活","1");
_$_album_163_types[0][1]=new Option("旅行","2");
_$_album_163_types[0][2]=new Option("聚会","3");
_$_album_163_types[0][3]=new Option("婚庆","4");
_$_album_163_types[0][4]=new Option("节日","5");
_$_album_163_types[0][5]=new Option("美女写真","6");
_$_album_163_types[0][6]=new Option("人体摄影","7");
_$_album_163_types[0][7]=new Option("网友自拍","8");
_$_album_163_types[0][8]=new Option("演艺明星","9");
_$_album_163_types[0][9]=new Option("体育明星","10");
_$_album_163_types[0][10]=new Option("政坛名人","11");
_$_album_163_types[0][11]=new Option("其它","12");
_$_album_163_types[1][0]=new Option("现代建筑","40");
_$_album_163_types[1][1]=new Option("文化遗产","41");
_$_album_163_types[1][2]=new Option("自然风景","42");
_$_album_163_types[1][3]=new Option("其它","43");
_$_album_163_types[2][0]=new Option("哺乳类","80");
_$_album_163_types[2][1]=new Option("鸟类","81");
_$_album_163_types[2][2]=new Option("鱼类","82");
_$_album_163_types[2][3]=new Option("昆虫","83");
_$_album_163_types[2][4]=new Option("其它","84");
_$_album_163_types[3][0]=new Option("计算机","120");
_$_album_163_types[3][1]=new Option("军事","121");
_$_album_163_types[3][2]=new Option("太空","122");
_$_album_163_types[3][3]=new Option("其它","123");
_$_album_163_types[4][0]=new Option("邮票","160");
_$_album_163_types[4][1]=new Option("钱币","161");
_$_album_163_types[4][2]=new Option("饰物","162");
_$_album_163_types[4][3]=new Option("玩具","163");
_$_album_163_types[4][4]=new Option("模型","164");
_$_album_163_types[4][5]=new Option("书法","165");
_$_album_163_types[4][6]=new Option("绘画","166");
_$_album_163_types[4][7]=new Option("篆刻","167");
_$_album_163_types[4][8]=new Option("其它","168");
_$_album_163_types[5][0]=new Option("CG","200");
_$_album_163_types[5][1]=new Option("素材","201");
_$_album_163_types[5][2]=new Option("其它","202");
_$_album_163_types[6][0]=new Option("时政","240");
_$_album_163_types[6][1]=new Option("文化","241");
_$_album_163_types[6][2]=new Option("战争","242");
_$_album_163_types[6][3]=new Option("社会","245");
_$_album_163_types[6][4]=new Option("其它","246");
_$_album_163_types[7][0]=new Option("狗","280");
_$_album_163_types[7][1]=new Option("猫","281");
_$_album_163_types[7][2]=new Option("金鱼","282");
_$_album_163_types[7][3]=new Option("鸟","284");
_$_album_163_types[7][4]=new Option("其它","285");
_$_album_163_types[8][0]=new Option("花卉","320");
_$_album_163_types[8][1]=new Option("树木","321");
_$_album_163_types[8][2]=new Option("其它","322");
_$_album_163_types[9][0]=new Option("搞笑","360");
_$_album_163_types[9][1]=new Option("游戏","361");
_$_album_163_types[9][2]=new Option("动漫","362");
_$_album_163_types[9][3]=new Option("人体彩绘","363");
_$_album_163_types[9][4]=new Option("电影海报","364");
_$_album_163_types[9][5]=new Option("其它","365");
_$_album_163_types[10][0]=new Option("家居","400");
_$_album_163_types[10][1]=new Option("汽车","401");
_$_album_163_types[10][2]=new Option("手机","402");
_$_album_163_types[10][3]=new Option("数码产品","403");
_$_album_163_types[10][4]=new Option("服饰","405");
_$_album_163_types[10][5]=new Option("其它","404");
_$_album_163_types[11][0]=new Option("奥运","440");
_$_album_163_types[11][1]=new Option("篮球","441");
_$_album_163_types[11][2]=new Option("足球","442");
_$_album_163_types[11][3]=new Option("其它","443");
function changeMainType(x){
var temp=$("newcate");
for(m=temp.options.length-1;m>0;m--){
temp.options[m]=null;
}
for(i=0;i<_$_album_163_types[x].length;i++){
temp.options[i]=new Option(_$_album_163_types[x][i].text,_$_album_163_types[x][i].value);
}
temp.options[0].selected=true;
}
function checkNewAlbum163Input(){
}
var jst_edit_album_163_dialog=new String('\
<form onsubmit="javascript:return checkNewAlbum163Input()" method="post" action="/pholder_edit_pro.php" name="double">\
 <div style="width: 480px; padding-bottom: 10px;">\
  <table style="table-layout: auto;">\
   <tr><td colspan="2"/></tr>\
   <tr><td class="c07" style="padding-left: 20px;" colspan="2">修改目录名称/描述</td></tr>\
   <tr><td class="c07" width="100px" align="right">目录名称</td>\
    <td>\
     <input type="text" value="${album163.name}" maxlength="30" size="35" name="albumname" id="albumname"/>\
    </td>\
   </tr>\
   <tr><td valign="top" width="100px" align="right" class="c07">目录描述</td>\
    <td>\
     <textarea style="font-size:12px;" cols="40" name="albumdesc" id="albumdesc" rows="5">${album163.desc}</textarea>\
    </td>\
   </tr>\
   <tr><td width="100px"; align="right" class="c07">目录类型\
   <td>\
    <select onchange="changeMainType(this.options.selectedIndex)" size="1" name="bigclass" id="bigclass" nohide="true">\
     <option selected="">人物</option>\
     <option>地理</option>\
     <option>野生动物</option>\
     <option>科技</option>\
     <option>静物</option>\
     <option>设计</option>\
     <option>新闻</option>\
     <option>宠物</option>\
     <option>植物</option>\
     <option>娱乐</option>\
     <option>生活亮点</option>\
     <option>体育</option>\
    </select>\
    <select size="1" name="newcate" id="newcate" nohide="true" style="width:120px;">\
    <option selected="" value="1">日常生活</option><option value="2">旅行</option><option value="3">聚会</option><option value="4">婚庆</option><option value="5">节日</option><option value="6">美女写真</option><option value="7">人体摄影</option><option value="8">网友自拍</option><option value="9">演艺明星</option><option value="10">体育明星</option><option value="11">政坛名人</option><option value="12">其它</option></select>\
    </script>\
   </td></tr>\
   <tr><td colspan="2" align="center">\
    <span style="color:#ff6600;">建议您将不同类型的照片放在不同的目录中。</span>\
   </td></tr>\
   <tr><td class="c07" style="padding-left: 20px;" colspan="2">修改目录属性</td></tr>\
   <tr><td width="100px" align="right" class="c07">公开目录</td><td><input type="radio" onclick="prepareChangePrivacy(1)" {if album163.privacy == "1"}checked=""{/if} value="1" name="lvl" id="lvl_1"/><label for="lvl_1">完全公开</label></td></tr>\
   <tr><td width="100px" align="right" class="c07">私人目录</td><td><input type="radio" onclick="prepareChangePrivacy(0)" {if album163.privacy == "0"}checked=""{/if} value="0" name="lvl" id="lvl_0"/><label for="lvl_0">完全私有</label></td></tr>\
   <tr><td width="100px" align="right" class="c07">半公开目录</td><td><input type="radio" onclick="prepareChangePrivacy(2)" {if album163.privacy == "2"}checked=""{/if} value="2" name="lvl" id="lvl_2"/><label for="lvl_2">需要密码验证</label></td></tr>\
   <tr id="password_row" style="display:none"><td width="100px" align="right" style="padding-bottom:0px;"><font style="color:#ff6600;">密&nbsp;&nbsp;码</font></td>\
   <td style="padding-bottom:0px;"><input type="password" maxlength="12" name="password" id="password" style="height:14px;font-size:12px"/></td>\
   </tr>\
   <tr id="confirm_password_row" style="display:none"><td width="100px" align="right"><font style="color:#ff6600;">确认密码</font></td>\
   <td><input type="password" maxlength="12" id="confirm_password" style="height:14px;font-size:12px"/></td>\
   </tr>\
   <tr>\
    <td colspan="2" align="center">\
     <input type="button" class="btncm btnok" {if album163.id < 0}value="确 定"{else}value="修  改"{/if} name="create" onclick="submitChangeAlbum163(${album163.id})" />&nbsp;&nbsp;\
     <input type="button" class="btncm btncc" value="取  消" name="cancel" onclick="closeEditAlbum163Box()" />\
    </td>\
   </tr>\
   <tr><td height="20" colspan="2"/></tr>\
  </table>\
 </div>\
</form>\
');
var jst_del_album_163_dialog=new String('\
<div class="g_lay_com g_crd_7" style="position:absolute;width:190px;padding-bottom:10px;">\
 <span title="关闭" class="close n_ n7" onclick="return hideAlbum163Del();return false;">&nbsp;</span>\
 <div class="g_c_mvdn g_h_25 clr00">\
  <div class="g_t_center g_t_bold">确定要删除相册吗？</div>\
   </div>\
   <div class="g_t_center">\
  <input id="confirm4AlOp" type="button" class="btncm btnok" value="确 定" onclick="return delAlbum163(${album163.id})"/>&nbsp;&nbsp;\
        <input type="button" class="btncm btncc" value="取 消" onclick="return hideAlbum163Del()"/>\
    </div>\
</div>\
');
var jst_album_163_man_menu=new String('\
<div style="width: 110px;" class="g_lay_com g_crd_0">\
 <div class="menu">\
  <div onclick="editAlbum163(${album163.id});return false;" class="item g_f_hov">修改相册属性&nbsp;</div>\
  <div onclick="showAlbum163Del(${album163.id}, \'_$_open_menu_link\');return false;" class="item g_f_hov" >删除相册&nbsp;</div>\
 </div>\
</div>\
');
var jst_photo_163_man_menu=new String('\
<div style="width: 100px;" class="g_lay_com g_crd_0">\
 <div class="menu">\
  <div onclick="editPhoto163Desc(${photo163.id}, \'manage_photo_163_${photo163.id}\');return false;" class="item g_f_hov">修改描述</div>\
  <div onclick="showPhotoConfirmDialog(${photo163.id}, \'manage_photo_163_${photo163.id}\', 1, \'确实要将该相片设为相册封面吗？\', 260);return false;" class="item g_f_hov">设为封面</div>\
  <div onclick="downloadPhoto163ToMobile(${photo163.id});return false;" class="item g_f_hov">下载到手机</div>\
  <div onclick="showPhotoConfirmDialog(${photo163.id}, \'manage_photo_163_${photo163.id}\', 2, \'确实要删除该相片吗？\', 250);return false;" class="item g_f_hov">删除相片</div>\
 </div>\
</div>\
');
var jst_edit_photo_163_desc_dialog=new String('\
<div class="g_lay_com g_crd_7" style="position:absolute;width:250px;padding-bottom:10px;">\
 <span title="关闭" class="close n_ n7" onclick="return hideEditPhotoDescDialog();return false;">&nbsp;</span>\
 <div class="g_c_mvdn g_h_25 clr00">\
  <div class="g_t_left">请输入相片描述:</div>\
   </div>\
 <div id="photodesc_${photo163.id}">\
  {var photo163Desc = photo163.desc.replace(/<br[^>]*>/ig, \'\\n\')}\
  <textarea id="photo_163_desc" rows="3" cols="20">${photo163Desc}</textarea>\
 </div>\
   <div class="g_t_center">\
  <input id="editPhoto163Ok" type="button" class="btncm btnok" value="确 定" onclick="return editPhoto163DescOk(${photo163.id});"/>&nbsp;&nbsp;\
        <input type="button" class="btncm btncc" value="取 消" onclick="return hideEditPhotoDescDialog();"/>\
    </div>\
</div>\
');
var jst_photo_163_confirm_dialog=new String('\
<div class="g_lay_com g_crd_7" style="position:absolute;width:${dialogWidth}px;padding-bottom:10px;">\
 <span title="关闭" class="close n_ n7" onclick="return hideConfirmDialog();return false;">&nbsp;</span>\
 <div class="g_c_mvdn g_h_25 clr00">\
  <div class="g_t_center g_t_bold" style="margin-top:5px;">${tipText}</div>\
   </div>\
   <div class="g_t_center">\
  <input id="confirmOk" type="button" class="btncm btnok" value="确 定" onclick="return confirmPhotoOpOk(${photo163.id}, ${opcode})"/>&nbsp;&nbsp;\
        <input type="button" class="btncm btncc" value="取 消" onclick="return hideConfirmDialog()"/>\
    </div>\
</div>\
');
var _$_template_album_163_list;
var _$_template_photo_163_list;
var _$_template_photo_163_list_large;
var _$_cur_album_page_163=0;
var _$_g_albumList163=[];
var _$_selected_album_163_idx=-1;
var _$_data_page_manager_album_163=null;
var _$_album_count_per_page=4;
var _$_photo_per_page_163=12;
var _$_photo_per_page_163_large=4;
var _$_template_album_163_info;
var _$_template_album_163_comment;
var _$_photo_list_mode='small';
var viewType=(UD.visitorRank==10000)?'edit':'prev';
var hostName=UD.hostName;
var hashPage=1;
function BlindUpDownAlbumList163(call){
$('_$_album_list_163').innerHTML="数据加载中...";
if($('_$_album_list_163')&&$('_$_album_list_163').style.display=='none'){
Effect.BlindDown('_$_album_list_163',{duration:0.2,userCallBack:function(){if(call){getAlbumList163();}}});
}else{
Effect.BlindUp('_$_album_list_163',{duration:0.2,userCallBack:function(){}});
}
return false;
}
function setAlbumListCbk(curAlbumId,albumList){
_$_g_albumList163=albumList;
}
function setPhotoListCbk(curAlbumId,curPhotoId,photoList){
var curAlbum163=_$_g_albumList163[_$_selected_album_163_idx];
var album163=getAlbum163ById(curAlbumId);
if(curAlbum163&&album163&&curAlbum163.id==album163.id){
album163.photoList=photoList;
getPhoto163Cbk(album163.photoList,hashPage);
}
}
function getAlbumList163(){
if(_$_g_albumList163){
var pageIdx=Math.floor(_$_selected_album_163_idx/_$_album_count_per_page);
showAlbumListByPage163(pageIdx>=0?pageIdx:0);
}
}
function showAlbumListByPage163(pageIdx){
if(_$_g_albumList163){
var albumList163=_$_g_albumList163;
var pageNum=0;
if(albumList163.length>0){
pageNum=Math.floor((albumList163.length-1)/_$_album_count_per_page);
}
var isLastPage=(pageIdx>=pageNum)?true:false;
var beginIdx=pageIdx*_$_album_count_per_page;
var endIdx=(pageIdx+1)*_$_album_count_per_page;
if(endIdx>albumList163.length){
endIdx=albumList163.length;
}
var data=[];
for(var i=beginIdx;i<endIdx;++i){
data.push(albumList163[i]);
}
if(!_$_template_album_163_list){
_$_template_album_163_list=TrimPath.parseTemplate(jst_album_163_list);
}
$('_$_album_list_163').innerHTML=_$_template_album_163_list.process({albums163:data,pageIdx:pageIdx,isLastPage:isLastPage,viewType:viewType,hostname:UD.hostName});
var album163=_$_g_albumList163[_$_selected_album_163_idx];
if(album163){
var elem=$('wrapper_album_163_'+album163.id);
if(elem){
Element.addClassName(elem.parentNode,"selitm c07 g_t_bold");
window.$$_last_select=elem.parentNode;
}
}
}
}
function resizeCoverImg163(img,width,height,parentWidth,parentHeight){
if(width>height){
img.style.width=75+"px";
var resizeHeight=Math.floor((75*height/width));
img.style.height=resizeHeight+"px";
img.style.marginTop=Math.floor((parentHeight-resizeHeight)/2)+"px";
img.style.marginLeft=Math.floor((parentWidth-75)/2)+"px";
}else{
img.style.height=75+"px";
var resizeWidth=Math.floor((75*width/height));
img.style.width=Math.floor((75*width/height))+"px";
img.style.marginTop=Math.floor((parentHeight-75)/2)+"px";
img.style.marginLeft=Math.floor((parentWidth-resizeWidth)/2)+"px";
}
img.style.display='';
}
function getAlbum163ById(albumId){
if(!_$_g_albumList163){
return null;
}else{
for(var i=0;i<_$_g_albumList163.length;++i){
if(albumId==_$_g_albumList163[i].id){
return _$_g_albumList163[i];
}
}
}
return null;
}
function getAlbum163IdxById(albumId){
if(!_$_g_albumList163){
return-1;
}else{
for(var i=0;i<_$_g_albumList163.length;++i){
if(albumId==_$_g_albumList163[i].id){
return i;
}
}
}
return-1;
}
function selectAlbum163(albumId,wrapperElemId){
var album163=getAlbum163ById(albumId);
if(album163){
_$_selected_album_163_idx=getAlbum163IdxById(albumId);
hideComment();
refreshAlbum163CommentTab(album163);
showAlbum163PhotoList(album163,1);
showHideComment163('_$_comment_area');
return true;
}
return false;
}
function refreshAlbum163CommentTab(album163){
if(!album163){
return;
}
_$_comments=null;
if(!_$_template_album_163_comment){
_$_template_album_163_comment=TrimPath.parseTemplate(jst_album_comment_163);
}
$('_$_album_comment_tab').innerHTML=_$_template_album_163_comment.process({hostName:UD.hostName});
toggleAlbumCommentTab(true);
}
function showAlbum163PhotoList(album163,toPage){
if(album163){
_$_data_page_manager_album_163=null;
if(album163.photoList){
getPhoto163Cbk(album163.photoList,toPage);
}else{
var script=document.createElement("script");
var src='http://photo.163.com/api/photos.php?user='+hostName+'&albumId='+album163.id+'&type=js';
if(UD.visitorRank==10000){
src+='&from=host';
}else{
src+='&from=guest';
}
hashPage=toPage;
script.src=src;
document.body.appendChild(script);
}
}
}
function getPhoto163Cbk(photoList163,toPage){
if(_$_g_albumList163){
var album=_$_g_albumList163[_$_selected_album_163_idx];
album.photoList=photoList163;
var pageSize=(_$_photo_list_mode=='small')?_$_photo_per_page_163:_$_photo_per_page_163_large;
var markArea=[
{markId:'_$_page_mark_bottom',totalId:'_$_total_bottom'},
{markId:'_$_page_mark_top',totalId:'_$_total_top'}
];
var apCount=album.count;
_$_data_page_manager_album_163=null;
_$_data_page_manager_album_163=new NetEase.DataPage(album.photoList,{resourceID:album.id,
pageSize:pageSize,moreDataFunc:moreDataFuncPhoto163,afterCallBack:show163PhotoList,
totalLength:apCount,objName:'_$_data_page_manager_album_163',
dofirst:closeAllPopWindow163,markArea:markArea,markLength:11,hiddenMark:false,newPageMark:true});
if(toPage){
_$_data_page_manager_album_163.moveToPage(toPage);
}else{
_$_data_page_manager_album_163.moveToPage(1);
}
_$_data_page_manager_album_163.refreshMark();
showHidePageMarkAlbum163();
refreshAlbum163Info(album);
}
}
function showHidePageMarkAlbum163(){
if(_$_data_page_manager_album_163.getLastPage()<=1){
$('_$_page_mark_top').innerHTML='<br />';
$('_$_page_mark_bottom').innerHTML='<br />';
}
}
function refreshAlbum163Info(album163){
if(!_$_template_album_163_info){
_$_template_album_163_info=TrimPath.parseTemplate(jst_album_163_info);
}
$('_$_album_info').innerHTML=_$_template_album_163_info.process({album:album163,hostname:UD.hostName,viewMode:_$_photo_list_mode,viewType:viewType});
regPlaceEditAlbum163s();
}
function moreDataFuncPhoto163(resourceID,offset,limit,callback){
}
function show163PhotoList(photoStream,start,end){
if(!_$_template_photo_163_list){
_$_template_photo_163_list=TrimPath.parseTemplate(jst_photo_163_list);
}
if(!_$_template_photo_163_list_large){
_$_template_photo_163_list_large=TrimPath.parseTemplate(jst_photo_163_list_large);
}
var photoToShow=photoStream.slice(start,end+1);
for(var i=0;i<photoToShow.length;++i){
photoToShow[i].index=start+i;
}
if($('_$_photo_list_content')){
var album163Id=null;
if(_$_g_albumList163[_$_selected_album_163_idx]){
album163Id=_$_g_albumList163[_$_selected_album_163_idx].id;
}
if(_$_photo_list_mode=='small'){
$('_$_photo_list_content').innerHTML='<div class="g_abm_list g_abm_list_c2" id="_$_photos">'+
_$_template_photo_163_list.process({photos163:photoToShow,hostname:UD.hostName,albumId:album163Id,viewType:viewType,migStat:UD.migStat})+'</div>';
}else{
$('_$_photo_list_content').innerHTML='<div class="g_abm_list g_abm_list_c1" id="_$_photos">'+
_$_template_photo_163_list_large.process({photos163:photoToShow,hostname:UD.hostName,albumId:album163Id,viewType:viewType,migStat:UD.migStat})+'</div>';
}
regPlaceEditPhotos(photoToShow);
}
}
function showHideComment163(containerId){
var commDiv=$(containerId);
if(commDiv){
if(commDiv.style.display=='none'){
var album163=_$_g_albumList163[_$_selected_album_163_idx];
if(!_$_comments&&album163){
$('_$_comments').innerHTML='正在加载评论...';
$('_$_comment_editor').style.display='none';
loadAlbum163Comment(album163);
}
Effect.BlindDown(containerId,{duration:0.2,userCallBack:function(){}});
$('_$_open_comment').className='bdl bdr s';
$('_$_ap_163_bar').className+=' bdb';
}else{
Effect.BlindUp(containerId,{duration:0.2,userCallBack:function(){}});
$('_$_open_comment').className='bdl bdr';
$('_$_ap_163_bar').className=$('_$_ap_163_bar').className.replace(/\sbdb/,'');
}
}
return false;
}
function loadAlbum163Comment(album163){
AlbumMisc.getAPComment163List(album163.id,3,0,_$_comment_page_size,true,{
callback:function(comments){
loadAlbum163CommentCbk(album163,comments);
}
});
}
function loadAlbum163CommentCbk(album163,comments){
if(comments==null){
dwrlog('服务器操作失败 请重试!')
return false;
}
if(comments[0].apId<=0){
album163.commentCount=comments[0].spam;
comments.shift();
}
for(var i=0;i<comments.length;++i){
comments[i].publisherAvatar=comments[i].publisherAvatarUrl;
}
var tmpVisitorNickname=UD.visitorNickname.unescape_freemark();
var supportDeleteComment=true;
var allowComment=jstData.comRank;
if(UD.migStat==2){
supportDeleteComment=false;
allowComment=100000;
}
if(!_$_comments){
var option={
bCanClose:true,bSupportDeleteComment:supportDeleteComment,
bNeedCheckLogin:false,bNeedCheckRight:true,iAllowComment:allowComment,iPageSize:_$_comment_page_size,
iHostId:UD.hostId,sHostName:UD.hostName,iVisitorId:UD.visitorId,sVisitorName:UD.visitorName,
sVisitorNickname:tmpVisitorNickname,sVisitorAvatar:UD.visitorAvatar,iVisitorRank:UD.visitorRank,sVisitorIP:UD.visitorIP,bShowSpaceUrl:true,
iInputWidth:460,iEditorWidth:0,iEditorHeight:90,fnOpenCommentEffect:null,
fnAddComment:addNewComment163,oAddCommentParams:{parentId:album163.id},
fnDelComment:delComment163,oDelCommentParams:{parentId:album163.id},
fnMoreData:getComments163ByPage,
fnAfterAddComment:afterAddComment163,oAfterAddCommentParams:{parentId:album163.id,album163:album163},
fnAfterDelComment:afterDelComment163,oAfterDelCommentParams:{parentId:album163.id,album163:album163},fnReportBad:reportBad,
fnCloseComments:closeComments,sObjName:'_$_comments',bDefaultPubClose:false,iEditorMaxLen:_$_comment_max_len,
sUrlPrefix:g_urlPrefix
};
_$_comments=new NetEase.CommentPublishAlbum(comments,album163.id,album163.commentCount,'_$_comments','_$_comment_editor',option);
$('_$_comment_163_count').innerHTML='相册评论('+album163.commentCount+')';
if(UD.migStat==2){
$('_$_comment_editor').style.display='none';
}else{
$('_$_comment_editor').style.display='';
}
}
}
function addNewComment163(newComment,params,postAddCommentFunc){
var filterType=0;
var valcodeelem=$("valcode"+params.valcodeid);
var valcode;
if(valcodeelem!=null)
valcode=valcodeelem.value;
else
valcode=-1;
Comm={};
Comm.apId=newComment.parentId;
Comm.commentType=3;
Comm.content=newComment.content;
Comm.publisherName=newComment.publisherName;
Comm.publisherNickname=newComment.publisherNickname;
Comm.publisherAvatarUrl=newComment.publisherAvatarUrl;
Comm.ip=newComment.ip;
Comm.ipName=newComment.ipName;
Comm.replyToUserId=newComment.replyToUserId;
if(!Comm.replyToUserId)Comm.replyToUserId=0;
if(UD.visitorRank<Const.Rank.Friend){
var match=checkOtherSiteUrl(newComment.content);
if(match){
alert(Local.Message.Blog[0]);
postAddCommentFunc(null);
return false;
}
}
AlbumMisc.addAPComment163(Comm,filterType,''+params.valcodeid,valcode,{
callback:function(dataFromServer){
dataFromServer.publisherAvatar=dataFromServer.publisherAvatarUrl;
postAddCommentFunc(dataFromServer);
},
errorHandler:function(errorString,ex){
if(captchaWarning(ex,"$$_comsubmithint"+newComment.parentId)){
postAddCommentFunc(null);
return false;
}
var filterType=filterWarning(ex);
if(filterType==-1){
postAddCommentFunc(null);
return false;
}
postAddCommentFunc(null);
}
});
}
function afterAddComment163(comm,param){
param.album163.commentCount+=1;
if($('_$_comment_163_count')){
$('_$_comment_163_count').innerHTML='相册评论('+param.album163.commentCount+')';
}
}
function getComments163ByPage(albumId,limit,offset,postPageCommentFunc){
AlbumMisc.getAPComment163List(albumId,3,offset,limit,false,{
callback:function(comments){
for(var i=0;i<comments.length;++i){
comments[i].publisherAvatar=comments[i].publisherAvatarUrl;
}
postPageCommentFunc(comments);
}
});
}
function reportBad(report,postReportFunc){
PreUserReportBean.addUserReport(report,postReportFunc);
}
function copyAlbum163Url(){
if(_$_selected_album_163_idx>=0&&_$_g_albumList163[_$_selected_album_163_idx]){
copyToClipboard('http://'+DomainMap.getParentDomain(hostName)+'/prevAlbum163sInUser.do?album163Id='+_$_g_albumList163[_$_selected_album_163_idx].id);
}
}
function displayAlbum163(albumId){
if(_$_g_albumList163){
displayAlbum163AfterReady(albumId);
}
}
function displayWhenNoAlbum(){
if($('_$_album_info')){
$('_$_album_info').style.display='none';
}
if($('_$_album_comment_tab')){
$('_$_album_comment_tab').style.display='none';
}
if($('_$_comment_area')){
$('_$_comment_area').style.display='none';
}
showAlbumListByPage163(0);
show163PhotoList([],0,0);
if($('_$_album_list_163')&&$('_$_album_list_163').style.display=='none'){
Effect.BlindDown('_$_album_list_163',{duration:0.2,userCallBack:function(){}});
}
}
function displayAlbum163AfterReady(albumId){
BlindUpDownAlbumList163(true);
var ok=selectAlbum163(parseInt(albumId),'wrapper_album_163_'+albumId);
if(!ok){
location.href='http://'+DomainMap.getParentDomain(hostName)+'/album163/';
}else{
showAlbumListByPage163(Math.floor(_$_selected_album_163_idx/_$_album_count_per_page));
}
}
function refreshAlbum163Page(albumId){
if($('_$_album_info')){
$('_$_album_info').style.display='';
}
if($('_$_album_comment_tab')){
$('_$_album_comment_tab').style.display='';
}
if($('_$_comment_area')){
$('_$_comment_area').style.display='';
}
closeAllPopWindow163();
if(albumId){
var ok=selectAlbum163(parseInt(albumId),'wrapper_album_163_'+albumId);
if(!ok){
location.href='http://'+DomainMap.getParentDomain(hostName)+'/album/';
}else{
showAlbumListByPage163(Math.floor(_$_selected_album_163_idx/_$_album_count_per_page));
}
if($('_$_album_list_163')&&$('_$_album_list_163').style.display=='none'){
Effect.BlindDown('_$_album_list_163',{duration:0.2,userCallBack:function(){}});
}
}
}
function switchViewType163Photos(mode){
if(_$_g_albumList163&&_$_g_albumList163.length>0){
if(_$_photo_list_mode!=mode){
_$_photo_list_mode=mode;
var album163=_$_g_albumList163[_$_selected_album_163_idx];
refreshAlbum163Info(album163);
if(!_$_data_page_manager_album_163){
showAlbum163PhotoList(album163,1);
}else{
var t=Math.floor(_$_photo_per_page_163/_$_photo_per_page_163_large);
if(mode=='large'){
var toPage=(_$_data_page_manager_album_163.getCurPage()-1)*t+1;
}else{
var toPage=Math.floor((_$_data_page_manager_album_163.getCurPage()-1)/t)+1;
}
showAlbum163PhotoList(album163,toPage);
}
}
}
return false;
}
function closeComments(){
var id='_$_comment_area';
var commDiv=$(id);
if(commDiv){
Effect.BlindUp(id,{duration:0.2,userCallBack:function(){}});
$('_$_open_comment').className='bdl bdr';
if($('_$_ap_163_bar')){
$('_$_ap_163_bar').className=$('_$_ap_163_bar').className.replace(/\sbdb/,'');
}
}
}
function hideComment(){
if($('_$_comment_area')){
$('_$_comment_area').style.display='none';
}
}
function toggleAlbumCommentTab(show){
if($('_$_album_comment_tab')){
if(show){
$('_$_album_comment_tab').style.display='';
}else{
$('_$_album_comment_tab').style.display='none';
}
}
}
function closeAllPopWindow163(){
if(_$_edit_album_163_dialog){
_$_edit_album_163_dialog.hiddenWindow('_$_edit_album_163_dialog');
}
if(_$_album_163_menu_div){
_$_album_163_menu_div.style.display='none';
}
if(_$_photo_163_menu_div){
_$_photo_163_menu_div.style.display='none';
}
if(_$_del_album_163_dialog_div){
_$_del_album_163_dialog_div.style.display='none';
}
if(_$_edit_photo_163_desc_dialog_div){
_$_edit_photo_163_desc_dialog_div.style.display='none';
}
if(_$_photo_163_confirm_dialog_div){
_$_photo_163_confirm_dialog_div.style.display='none';
}
}
function getPhoto163FromCurAlbum(photo163Id){
var album163=_$_g_albumList163[_$_selected_album_163_idx];
var photo163=null;
if(album163&&album163.photoList){
photo163=album163.photoList.find(
function(e){
return e.id==photo163Id
}
);
}
return photo163;
}
function downloadPhoto163ToMobile(photo163Id){
var photo163=getPhoto163FromCurAlbum(photo163Id);
downloadToMobile(photo163,closeAllPopWindow163);
}
function g_onloadFunc(album163IdFromUrl){
if(album163IdFromUrl!=null&&album163IdFromUrl!=''){
displayAlbum163(album163IdFromUrl);
}else if(_$_g_albumList163&&_$_g_albumList163.length>0){
var album163ToDisplay=null;
for(var i=0;i<_$_g_albumList163.length;++i){
if(_$_g_albumList163[i].count>0&&_$_g_albumList163[i].privacy=="1"){
album163ToDisplay=_$_g_albumList163[i];
break;
}
}
if(album163ToDisplay){
displayAlbum163(album163ToDisplay.id);
}else{
displayAlbum163(_$_g_albumList163[0].id);
}
}else{
displayWhenNoAlbum();
}
}
function delComment163(commentId,params,postDelCommentFunc){
}
function afterDelComment163(param){
}
function regPlaceEditAlbum163s(){
}
function regPlaceEditPhotos(photoToShow){
}
