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>\
');
if(NetEase==undefined){
var NetEase={};
}
NetEase.MultipleSortable=Class.create();
NetEase.MultipleSortable.prototype={
initialize:function(){
this.options=Object.extend({
elementArray:[],
selectedCss:'',
containerId:false,
sel_box_class:'drag_sel',
cursor:null,
enableSelBox:true,
sel_div:null,
isDragging:false,
margin:5,
vertical:true,
cursorPositions:[],
cursorTarget:-1,
startX:0,
startY:0,
elementRectArray:[],
bodyElem:document.body,
UDBody:$('blog-163-com-body'),
afterSelectElemCbk:null,
afterUnSelectElemCbk:null,
afterSortElemCbk:null,
ignoredMouseDown:false,
isMovingElem:false,
scrollStep:40,
ifW3cLftBtnWhenMove:false,
cursorOffset:-2,
cursorRectEnlargement:0
},arguments[0]||{});
this.mouseCursorSet=false;
},
__init:function(){
if(!this.options.sel_div){
this.options.sel_div=document.createElement('div');
this.options.sel_div.style.position='absolute';
this.options.sel_div.style.zIndex=1000;
this.options.sel_div.style.display='none';
this.options.sel_div.className=this.options.sel_box_class;
}
if(!this.options.cursor){
this.options.cursor=document.createElement('div');
this.options.cursor.style.position='absolute';
this.options.cursor.style.width='10px';
this.options.cursor.style.height='100px';
this.options.cursor.innerHTML='<div class="brd01 g_p_left" style="width:3px;height:124px;border-style:solid;border-width:2px 2px 2px 0px"></div><div class="brd01 g_p_left" style="width:3px;height:124px;border-style:solid;border-width:2px 0px 2px 2px"></div><div style="clear:both"></div>';
this.options.cursor.style.zIndex=1001;
this.options.cursor.style.display='none';
}
this.options.bodyElem.appendChild(this.options.sel_div);
this.options.bodyElem.appendChild(this.options.cursor);
if(Browser.isIE()){
document.ondrag=document.onselectstart=function(){
return false;
}
}else{
Element.addClassName(this.options.bodyElem,'cannot_sel');
}
document.onmousemove=this.__mouseMove.bind(this);
document.onmousedown=this.__mouseDown.bind(this);
document.onmouseup=this.__mouseUp.bind(this);
this.__initElems(false);
},
__initElems:function(elemList){
if(elemList){
this.options.elementArray=elemList;
}
var clickFunc=function(elem){
elem.onmousedown=function(e){
this.clickOnElem(e,elem);
}.bind(this)
}.bind(this)
this.options.elementArray.each(
clickFunc
);
this.__calAllBoundingBox();
},
__calAllBoundingBox:function(){
var pos=[0,0];
if(this.options.elementArray[0]){
var baseElem=this.options.elementArray[0].offsetParent;
if(baseElem){
pos=Position.cumulativeOffset(baseElem);
}
}
this.options.elementRectArray=[];
this.options.cursorPositions=[];
for(var i=0;i<this.options.elementArray.length;++i){
var posMe=[this.options.elementArray[i].offsetLeft,this.options.elementArray[i].offsetTop];
this.options.elementRectArray.push({
x1:pos[0]+posMe[0],
x2:pos[0]+posMe[0]+this.options.elementArray[i].offsetWidth,
y1:pos[1]+posMe[1],
y2:pos[1]+posMe[1]+this.options.elementArray[i].offsetHeight
});
var margin=this.options.margin;
var cursorRectEnlargement=this.options.cursorRectEnlargement;
if(this.options.vertical){
this.options.cursorPositions.push({
x1:this.options.elementRectArray[i].x1-2*margin-cursorRectEnlargement,
x2:this.options.elementRectArray[i].x1+cursorRectEnlargement,
y1:this.options.elementRectArray[i].y1,
y2:this.options.elementRectArray[i].y2
});
}else{
this.options.cursorPositions.push({
x1:this.options.elementRectArray[i].x1,
x2:this.options.elementRectArray[i].x2,
y1:this.options.elementRectArray[i].y1-2*margin-cursorRectEnlargement,
y2:this.options.elementRectArray[i].y1+cursorRectEnlargement
});
}
if(this.options.vertical){
this.options.cursorPositions.push({
x1:this.options.elementRectArray[i].x2-cursorRectEnlargement,
x2:this.options.elementRectArray[i].x2+2*margin+cursorRectEnlargement,
y1:this.options.elementRectArray[i].y1,
y2:this.options.elementRectArray[i].y2
});
}else{
this.options.cursorPositions.push({
x1:this.options.elementRectArray[i].x1,
x2:this.options.elementRectArray[i].x2,
y1:this.options.elementRectArray[i].y2-cursorRectEnlargement,
y2:this.options.elementRectArray[i].y2+2*margin+cursorRectEnlargement
})
}
}
},
__release:function(){
this.options.bodyElem.removeChild(this.options.sel_div);
this.options.bodyElem.removeChild(this.options.cursor);
document.onmousemove=Prototype.emptyFunction;
document.onmousedown=Prototype.emptyFunction;
document.onmouseup=Prototype.emptyFunction;
},
__mouseDown:function(e){
if(parseInt(navigator.appVersion)>3){
var evt=navigator.appName=="Netscape"?e:event;
if(this.options.ignoredMouseDown){
if(this.__isLeftButtonDown(evt)){
this.options.ifW3cLftBtnWhenMove=true;
}
this.options.ignoredMouseDown=false;
return false;
}
var auxKey=this.isAuxKeyPressed(evt);
if(this.__isLeftButtonDown(evt)){
this.options.ifW3cLftBtnWhenMove=true;
this.enableSelDiv(evt);
this.__calAllBoundingBox();
}
if(!auxKey.ctrlPressed){
this.clearAllSelect();
}
return false;
}
},
__mouseMove:function(e){
if(parseInt(navigator.appVersion)>3){
var evt=navigator.appName=="Netscape"?e:event;
var auxKey=this.isAuxKeyPressed(evt);
if(this.__isLeftButtonDownWnenMove(evt)){
if(this.options.isDragging){
this.drawSelDiv(evt);
}else{
this.drawSelectCursor(evt);
}
}
return false;
}
},
__mouseUp:function(e){
if(parseInt(navigator.appVersion)>3){
var evt=navigator.appName=="Netscape"?e:event;
var auxKey=this.isAuxKeyPressed(evt);
if(this.__isLeftButtonDown(evt)){
this.options.ifW3cLftBtnWhenMove=false;
this.clearSelDiv(evt);
this.__hideCursor();
if(this.options.cursorTarget>=0){
var tempArray=[];
var tempTarget=this.options.cursorTarget;
for(var i=0;i<this.options.elementArray.length;++i){
if(this.options.elementArray[i].isSelected){
if(i<this.options.cursorTarget){
--tempTarget;
}
}
}
if(tempTarget<0){
tempTarget=0;
}
for(var i=0;i<this.options.cursorTarget;++i){
if(!this.options.elementArray[i].isSelected){
if(tempArray.length>=tempTarget){
break;
}else{
tempArray.push(this.options.elementArray[i]);
}
}
}
for(var i=0;i<this.options.elementArray.length;++i){
if(this.options.elementArray[i].isSelected){
tempArray.push(this.options.elementArray[i]);
}
}
for(var i=this.options.cursorTarget;i<this.options.elementArray.length;++i){
if(!this.options.elementArray[i].isSelected){
tempArray.push(this.options.elementArray[i]);
}
}
this.options.elementArray=tempArray;
if(this.options.containerId){
var container=$(this.options.containerId);
this.__removeAllChild(container);
for(var i=0;i<this.options.elementArray.length;++i){
container.appendChild(this.options.elementArray[i]);
}
}
this.options.cursorTarget=-1;
if(this.options.afterSortElemCbk){
this.options.afterSortElemCbk(this.options.containerId,this.options.elementArray);
}
}
}
if(this.mouseCursorSet){
var container=$(this.options.containerId);
if(container){
container.style.cursor='default';
}
this.mouseCursorSet=false;
}
return false;
}
},
__removeAllChild:function(container){
var firstChild=container.firstChild;
var curChild=firstChild;
while(curChild){
container.removeChild(curChild);
curChild=curChild.nextSibling;
}
},
__isLeftButtonDown:function(evt){
return(Browser.isIE()&&evt.button==1)||(Browser.isFirefox()&&evt.button==0);
},
__isLeftButtonDownWnenMove:function(evt){
return(Browser.isIE()&&evt.button==1)||(Browser.isFirefox()&&this.options.ifW3cLftBtnWhenMove);
},
enableSelDiv:function(evt){
if(this.options.enableSelBox){
this.options.isDragging=true;
this.options.sel_div.style.display='';
this.options.startX=evt.clientX;
this.options.startY=evt.clientY;
}
},
drawSelDiv:function(evt){
if(this.options.enableSelBox){
var left=this.options.startX;
if(left>evt.clientX){
left=evt.clientX;
}
var top=this.options.startY;
if(top>evt.clientY){
top=evt.clientY;
}
var width=Math.abs(this.options.startX-evt.clientX);
var height=Math.abs(this.options.startY-evt.clientY);
this.options.sel_div.style.left=left+'px';
this.options.sel_div.style.top=top+'px';
this.options.sel_div.style.width=width+'px';
this.options.sel_div.style.height=height+'px';
left+=this.options.UDBody.scrollLeft;
top+=this.options.UDBody.scrollTop;
for(var i=0;i<this.options.elementRectArray.length;++i){
if(this.intersect({x1:left,x2:left+width,y1:top,y2:top+height},this.options.elementRectArray[i])){
this.selectElem(this.options.elementArray[i]);
}else{
var auxKey=this.isAuxKeyPressed(evt);
if(!auxKey.ctrlPressed){
this.unSelectElem(this.options.elementArray[i]);
}
}
}
}
},
drawSelectCursor:function(evt){
if(this.options.isMovingElem){
if(!this.mouseCursorSet){
var container=$(this.options.containerId);
if(container){
container.style.cursor='move';
}
this.mouseCursorSet=true;
}
var matric=this.getBrowserClientSize();
var left=evt.clientX+this.options.UDBody.scrollLeft;
var top=evt.clientY+this.options.UDBody.scrollTop;
this.options.cursorTarget=-1;
for(var i=0;i<this.options.cursorPositions.length;++i){
if(this.innerInPosition({x:left,y:top},this.options.cursorPositions[i])){
this.options.cursorTarget=(i%2==1)?((i+1)/2):(i/2);
if(matric.clientHeight-evt.clientY<this.options.scrollStep){
this.options.UDBody.scrollTop+=this.options.scrollStep;
}else if(evt.clientY<this.options.scrollStep){
this.options.UDBody.scrollTop-=this.options.scrollStep;
}
var cursorX=this.options.cursorPositions[i].x1-this.options.UDBody.scrollLeft;
var cursorY=this.options.cursorPositions[i].y1-this.options.UDBody.scrollTop;
if(this.options.vertical){
cursorX+=Math.floor(this.options.margin/2)+this.options.cursorOffset+this.options.cursorRectEnlargement;
}else{
cursorY+=Math.floor(this.options.margin/2)+this.options.cursorOffset+this.options.cursorRectEnlargement;;
}
this.__showCursor((cursorX),cursorY);
break;
}
}
if(this.options.cursorTarget<0){
this.__hideCursor();
}
}
},
__showCursor:function(left,top){
this.options.cursor.style.display='';
this.options.cursor.style.left=left+'px';
this.options.cursor.style.top=top+'px';
},
__hideCursor:function(){
this.options.cursor.style.display='none';
},
getBrowserClientSize:function(){
var myWidth=0,myHeight=0;
if(typeof(window.innerWidth)=='number'){
myWidth=window.innerWidth;
myHeight=window.innerHeight;
}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){
myWidth=document.documentElement.clientWidth;
myHeight=document.documentElement.clientHeight;
}else if(this.options.bodyElem&&(this.options.bodyElem.clientWidth||this.options.bodyElem.clientHeight)){
myWidth=this.options.bodyElem.clientWidth;
myHeight=this.options.bodyElem.clientHeight;
}
return{clientWidth:myWidth,clientHeight:myHeight};
},
clearSelDiv:function(evt){
this.options.isDragging=false;
this.options.sel_div.style.display='none';
this.options.sel_div.style.width='0px';
this.options.sel_div.style.height='0px';
this.options.startX=0;
this.options.startY=0;
},
intersect:function(rect1,rect2){
var t1=Math.min(rect1.x2,rect2.x2);
var t2=Math.max(rect1.x1,rect2.x1);
var t3=Math.min(rect1.y2,rect2.y2);
var t4=Math.max(rect1.y1,rect2.y1);
return t1>t2&&t3>t4;
},
innerInPosition:function(point,rect){
return point.x>=rect.x1&&point.x<=rect.x2&&point.y>=rect.y1&&point.y<=rect.y2;
},
isAuxKeyPressed:function(evt){
var ctrlPressed=0;
var altPressed=0;
var shiftPressed=0;
if(navigator.appName=="Netscape"&&parseInt(navigator.appVersion)==4){
var mString=(evt.modifiers+32).toString(2).substring(3,6);
shiftPressed=(mString.charAt(0)=="1");
ctrlPressed=(mString.charAt(1)=="1");
altPressed=(mString.charAt(2)=="1");
self.status="modifiers="+e.modifiers+" ("+mString+")"
}else{
shiftPressed=evt.shiftKey;
altPressed=evt.altKey;
ctrlPressed=evt.ctrlKey;
}
return{ctrlPressed:ctrlPressed,altPressed:altPressed,shiftPressed:shiftPressed};
},
clickOnElem:function(e,elem){
if(parseInt(navigator.appVersion)>3){
this.__calAllBoundingBox();
var evt=navigator.appName=="Netscape"?e:event;
var auxKey=this.isAuxKeyPressed(evt);
this.options.isMovingElem=true;
if(auxKey.ctrlPressed){
if(elem){
if(elem&&!elem.isSelected){
this.selectElem(elem);
}else if(elem){
this.unSelectElem(elem);
this.options.isMovingElem=false;
}
}
}else if(auxKey.shiftPressed){
if(elem){
var lastIdx=1.0e+10;
for(var i=0;i<this.options.elementArray.length;++i){
if(this.options.elementArray[i].isSelected&&lastIdx>i){
lastIdx=i;
}
}
this.clearAllSelect();
var thisIdx=this.findIdxByElem(elem);
if(lastIdx>=0){
if(thisIdx>lastIdx){
for(var i=lastIdx;i<=thisIdx;++i){
this.selectElem(this.options.elementArray[i]);
}
}else{
for(var i=thisIdx;i<=lastIdx;++i){
this.selectElem(this.options.elementArray[i]);
}
}
}else{
this.selectElem(elem);
}
}
}else{
if(elem&&!elem.isSelected){
this.clearAllSelect();
this.selectElem(elem);
}
}
this.options.ignoredMouseDown=true;
return false;
}
},
selectElem:function(elem){
Element.addClassName(elem,this.options.selectedCss);
this.options.isMovingElem=true;
var idx=this.findIdxByElem(elem);
elem.isSelected=true;
if(this.options.afterSelectElemCbk){
this.options.afterSelectElemCbk(elem);
}
},
findIdxByElem:function(elem){
var ret=-1;
for(var i=0;i<this.options.elementArray.length;++i){
var e=this.options.elementArray[i];
if(elem&&e&&elem.id&&e.id){
if(elem.id==e.id){
ret=i;
}
}
}
return ret;
},
clearAllSelect:function(){
this.options.isMovingElem=false;
this.options.elementArray.each(
function(elem){
Element.removeClassName(elem,this.options.selectedCss);
elem.isSelected=false;
}.bind(this)
);
},
unSelectElem:function(elem){
Element.removeClassName(elem,this.options.selectedCss);
elem.isSelected=false;
if(this.options.afterUnSelectElemCbk){
this.options.afterUnSelectElemCbk(elem);
}
}
}
var _$_g_albumList163=[];
var _$_max_cover_size=75;
var _$_wrapper_height=100;
function setAlbumListCbk(curAlbumId,albumList){
_$_g_albumList163=albumList;
}
function processAlbum163List(isEdit){
_$_g_albumList163.each(function(album163){
var UrlInBlog='http://'+DomainMap.getParentDomain(UD.hostName)+'/'+(isEdit?'edit':'prev')+'Album163sInUser.do?album163Id='+album163.id;
album163.UrlInBlog=UrlInBlog;
var w=album163.coverWidth;
var h=album163.coverHeight;
if(w>h){
if(w>_$_max_cover_size){
album163.coverWidth=_$_max_cover_size;
album163.coverHeight=Math.floor(_$_max_cover_size*h/w);
}
}else{
if(h>_$_max_cover_size){
album163.coverHeight=_$_max_cover_size;
album163.coverWidth=Math.floor(_$_max_cover_size*w/h);
}
}
album163.coverMarginTop=Math.floor((_$_wrapper_height-album163.coverHeight)/2);
});
}
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;
}
var _$_template_prev_albums_163_all;
function g_onloadFun(){
if(!_$_template_prev_albums_163_all){
_$_template_prev_albums_163_all=TrimPath.parseTemplate(jst_prev_albums_163_all);
}
var div=$('_$_prev_album_163_all');
if(div){
processAlbum163List(false);
div.innerHTML=_$_template_prev_albums_163_all.process({album163List:_$_g_albumList163});
}
}
var jst_prev_albums_163_all='\
{if album163List.length <= 0}\
 暂无相册\
{/if}\
{for album163 in album163List}\
<div id="wrapper_${album163.id}" class="g_p_left g_img_01n163">\
 <div class="g_c_hand p_ p29e" onclick=\'window.open("${album163.UrlInBlog}", "_self")\'>\
  <img width="${album163.coverWidth}px" height="${album163.coverHeight}px" id="${album163.id}" src="${album163.coverUrl}" style="margin-top:${album163.coverMarginTop}px;"/>\
 </div>\
 <div style="font-size: 14px; margin-top: 3px;" class="g_t_hide c07" id="name_${album163.id}">${album163.name.substring(0,6)}</div>\
 <div class="g_t_hide c09">\
       ${album163.count}张相片\
 </div>\
</div>\
{/for}\
';
if(dwr==null)var dwr={};
if(dwr.engine==null)dwr.engine={};
if(DWREngine==null)var DWREngine=dwr.engine;
if(AlbumBean163==null)var AlbumBean163={};
AlbumBean163._path='/dwr';
AlbumBean163.getAlbum163=function(p0,callback){
dwr.engine._execute(AlbumBean163._path,'AlbumBean163','getAlbum163',p0,false,callback);
}
AlbumBean163.getAlbum163ById=function(p0,p1,callback){
dwr.engine._execute(AlbumBean163._path,'AlbumBean163','getAlbum163ById',p0,p1,false,callback);
}
AlbumBean163.getPhoto163=function(p0,p1,callback){
dwr.engine._execute(AlbumBean163._path,'AlbumBean163','getPhoto163',p0,p1,false,callback);
}
