Cytw.hompy={subFolderListType:1,subFolderListYear:null,subFolderListMonth:null,subFolderListday:null,mh_id:"",mh_name:"",relation:null,onedit:false,editOnPosting:false,ContentListType:0,folder_type:null,menuid:null,folderid:null,postid:null,pageno:null,autoSaveI:null,subFolderListTypeChangeReload:false,wideviw:null,clickWideviw:null,movePostFolderList:null,MH_LoadingBlock:$("MH_LoadingBlock"),arr_T_loadingShow:[],menuinfo:null,isHome2:0,link_type:0,seepass:null,resetDateInfo:function(){this.subFolderListMonth=null;this.subFolderListYear=null;this.subFolderListday=null;},putD:function(_1){var _2="";if($("debug_area")){for(var i=0;i<arguments.length;i++){_2+=arguments[i]+":";}$("debug_area").value+=_2+"\n";}},getUrl:function(){hompy.putD(hompy.menuid,hompy.folderid,hompy.postid);if(hompy.menuid==-3){hompy.menuid=-1;}var _4=Object.toQueryString({menuid:hompy.menuid,folderid:hompy.folderid,postid:hompy.postid});window.clipboardData.setData("text",hompy.domain+"?"+_4);},showLoading:function(_5){if($("MH_LoadingBlock")&&$("MH_LoadingBlock").getAttribute("_dont_show")!=1){$("MH_LoadingBlock").show();$("MH_LoadingBlock").setAttribute("_flag",_5);}},hideLoading:function(){$("MH_LoadingBlock").hide();$("MH_LoadingBlock").setAttribute("_dont_show",0);},contentsFrameId:"MH_Contents_Frame",getNodeUpdateCount:function(id){var _7=$(id);var _8=_7.getAttribute("_updateCount");if(!_8){_7.setAttribute("_updateCount",1);_8=1;}else{_7.setAttribute("_updateCount",++_8);}return _8;},checkSubFolderListType:function(){switch(parseInt(this.subFolderListType)){case 1:$("MH_Folders_Frame").className="FolderList";$("checkAllFolder").show();break;case 2:$("MH_Folders_Frame").className="DateList";break;}},folderChoose:function(_9,_a,_b,_c){if(!_9){_9=hompy.menuid;}if(_9==10&&this.ContentListType!=0){this.ContentListType=1;}if(hompy.ContentListType==4){this.ContentListType=0;}_b=(_b)?_b:1;$A($("MH_Folders_Frame").getElementsByClassName("Selected")).each(function(_d){_d.removeClassName("Selected");});if(_a){if($("folder_"+_a)){$("folder_"+_a).addClassName("Selected");}$("checkAllFolder").removeClassName("Selected");}else{$("checkAllFolder").addClassName("Selected");hompy.resetDateInfo();}if(this.subFolderListType==2){if($("folder_"+_a)){_9=$("folder_"+_a).getAttribute("_menu");}}else{hompy.folderid=_a;}if(!_c||_c.last_postid==null){if(!hompy.onedit){hompy.show_bbs_list(_9,_a,_b);}}if(_c&&_c.last_postid!=null){hompy.show_bbs_list(_9,_a,_b,null,null,{last_postid:_c.last_postid});}this.folderid=_a;this.postid=null;hompy.putD("folderChoose");},getLeftFolderList:function(_e,_f,_10){hompy.subFolderListType=1;var _11=Object.toQueryString({listBy:hompy.subFolderListType,year:hompy.subFolderListYear,month:hompy.subFolderListMonth,day:hompy.subFolderListday,folderid:(_f)?_f:"",menuid:_e});mhp.updateNode(("MH_Notebook_subArea"),{xmlUrl:"/ps2/ps_subarea.php?mh_id="+hompy.mh_id,xmlParm:_11});if(_10&&Cytw.lang.isFunction(_10.onComplete)){var _12=function(obj){_10.onComplete(obj);};}else{var _12=function(obj){};}sTargetNodeName=(hompy.subFolderListType==1)?"MH_Folders_Bin":"MH_Folders_Date_Bin";mhp.updateNode((sTargetNodeName),{xmlUrl:"/ps2/ps_folders.php?mh_id="+hompy.mh_id,xmlParm:_11,waitTimes:10,waitNodeId:"MH_Notebook_subArea","onComplete":_12});},openFolderListBar:function(){if($("bbs_folderlist_bar_div").style.display=="block"){$("bbs_folderlist_bar_a").className="CloseList";}else{$("bbs_folderlist_bar_a").className="OpenList";}},userIsClickWideView:function(){switch(hompy.clickWideviw){case 0:Cytw.util.switch_class("MH_Notebook","","");break;case 1:Cytw.util.switch_class("MH_Notebook","WideView","WideView");break;}},switchShowFolderListBar:function(){switch(this.menuid){default:if($("MH_Notebook").className=="WideView"){$("MH_Notebook_FolderList").show();}else{$("MH_Notebook_FolderList").hide();}break;case -1:case -2:case -3:case 3:case 4:case 13:$("MH_Notebook_FolderList").hide();break;}if($("bbs_folderlist")&&$("bbs_folderlist").innerHTML!=""){if($("MH_Notebook").className=="WideView"){$("bbs_folderlist_bar").innerHTML=$("bbs_folderlist").innerHTML;$selFolder=$$("#bbs_folderlist li.Selected");if($selFolder[0]&&($selFolder[0].down("a").innerHTML!="")){$("bbs_folderlist_bar_title_all").hide();$("bbs_folderlist_bar_title").down("a").innerHTML=$selFolder[0].down("a").innerHTML;$("bbs_folderlist_bar_title").show();}else{$("bbs_folderlist_bar_title").hide();$("bbs_folderlist_bar_title_all").down("a").innerHTML="\u67e5\u770b\u5168\u90e8";$("bbs_folderlist_bar_title_all").show();}}}},syncMenuAndFolderAndContent:function(_15,_16,_17,_18){var _19=function(){hompy.folderChoose(_15,_16);hompy.removePosting();};if(_15==hompy.menuid){hompy.show_content(_17,{"onComplete":_19});}else{hompy.chg_menu_list(_15);hompy.getLeftFolderList(_15,_16,{"onComplete":function(){hompy.folderChoose(_15,_16,0,{last_postid:_17});hompy.show_content(_17,{"onComplete":_19});}});}},profileFolderChoose:function(_1a){if(_1a==null){_1a=this.folderid;}$A($("MH_ProfileSub_Bin").getElementsByClassName("Selected")).each(function(_1b){_1b.removeClassName("Selected");});if(_1a){$("folder_"+_1a).addClassName("Selected");}this.postid=null;hompy.putD("profileFolderChoose");},subFolderListTypeChoose:function(_1c){function _getFolderList_(){var _1d=Object.toQueryString({listBy:hompy.subFolderListType,year:hompy.subFolderListYear,month:hompy.subFolderListMonth,day:hompy.subFolderListday,menuid:hompy.menuid});if(hompy.subFolderListTypeChangeReload){mhp.updateNode((sTargetNodeName),{xmlUrl:"/ps2/ps_folders.php?mh_id="+hompy.mh_id,xmlParm:_1d,waitTimes:10});}else{mhp.insert2Node((sTargetNodeName),{xmlUrl:"/ps2/ps_folders.php?mh_id="+hompy.mh_id,xmlParm:_1d,waitTimes:10});}}switch(_1c){case "FolderList":this.subFolderListType=1;$A($("MH_Folders_Bin").getElementsByClassName("Selected")).each(function(_1e){if(_1e.firstDescendant().getAttribute("_relation_write")==hompy.relation){$("btn_posting").show();}});sTargetNodeName="MH_Folders_Bin";$("btnListByFolder").addClassName("Selected");$("btnListByDate").removeClassName("Selected");break;case "DateList":this.subFolderListType=2;sTargetNodeName="MH_Folders_Date_Bin";$("btnListByDate").addClassName("Selected");$("btnListByFolder").removeClassName("Selected");break;}if(!this.subFolderListTypeChangeReload){var _1f=$(sTargetNodeName).getElementsByClassName(_1c);if(_1f.length!=0){$A(_1f).each(function(_20){_20.show();});}else{_getFolderList_();}}else{_getFolderList_();}this.checkSubFolderListType();},init_menu:function(_21,_22){var _23=1;__onComplete=function(){try{if($("node_menuinfo")){hompy.menuinfo=$("node_menuinfo").innerHTML.evalJSON(true);}}catch(e){}};_onComplete=function(){__onComplete();menuid=$$("#MH_Notebook_tab a[_menuid]")[0].getAttribute("_menuid");hompy.chg_menu_list(menuid);};if(_22&&Cytw.lang.isObject(_22)){if(_22.menuid&&!_22.folderid&&!_22.postid){if(_22.menuid!=-3){_onComplete=function(){__onComplete();hompy.chg_menu_list(_22.menuid,null,null,_22.pageno);};}else{_onComplete=function(){__onComplete();hompy.chg_menu_list(_22.menuid,_22.setting_tab);};}}else{if(_22.menuid&&_22.folderid&&!_22.postid){_onComplete=function(){__onComplete();hompy.chg_menu_list(_22.menuid,_22.folderid,null);};}else{if(_22.menuid&&(_22.folderid||_22.postid)){_onComplete=function(){__onComplete();hompy.chg_menu_list(_22.menuid,_22.folderid,_22.postid);};}}}if(_22.notReloadInfoBlock){_23=0;}}this.mh_id=_21;if($("MH_Notebook_tab")){$("MH_Notebook_tab").remove();}mhp.insert2Node(("MH_Notebook"),{xmlUrl:"/ps2/ps_tab_ajax.php?mh_id="+this.mh_id,onComplete:_onComplete});if(this.isHome2&&!$("MH_InfoBlock")){Cytw.music.initHompyMusic();}else{if(_23){if($("MH_InfoBlock")){$("MH_InfoBlock").remove();}mhp.insert2Node(("MiniHompy"),{xmlUrl:"/ps2/ps_info_block.php?mh_id="+this.mh_id,waitNodeId:"MH_Notebook",waitTimes:10,onComplete:function(){Cytw.music.initHompyMusic();Cytw.hompy.set_tab_link();init_Event_SoleElementSwitch("MH_Notebook");}});}}mhp.updateNode(("MH_InfoBar_main"),{xmlUrl:"/ps2/ps_infobar.php?mh_id="+this.mh_id,onComplete:Cytw.hompy.mk_list,waitTimes:10});},set_tab_link:function(){var _24=$("MH_Notebook_tab").firstChild;var _25=_24.childNodes.length;_24=_24.firstChild;var _26=new Array(6);var _27;for(var i=0;i<_25;i++){_27=null;dataNode_Menuid=_24.firstChild.getAttribute("_menuid");dataNode_Folder_type=_24.firstChild.getAttribute("_menuid");switch(eval(_24.firstChild.getAttribute("_folder_type"))){case 3:_27=$("info_block_guestbook");break;case 0:_27=_27=$("info_block_diary");break;case 1:_27=_27=_27=$("info_block_photo");break;case 2:_27=_27=_27=$("info_block_bbs");break;case 5:_27=_27=_27=_27=$("info_block_gallery");break;}if(_27){_27.setAttribute("_menuid",dataNode_Menuid);_27.setAttribute("_folder_type",dataNode_Folder_type);_27.onclick=function(_29){hompy.chg_menu_list(this.getAttribute("_menuid"));return false;};}_24=_24.nextSibling;}},showCover:function(_2a){var _2b=_2a[0];mhp.updateNode(("MH_Notebook_subArea"),{xmlUrl:"/ps2/ps_index_left.php?mh_id="+this.mh_id,unique:true,onComplete:function(){hompy.initCoverAreaHeight();init_Event_SoleElementSwitch("MH_Notebook_subArea");hompy.initScrollArea("MainSub_BodyArea");}});mhp.updateNode(("MH_Notebook_mainArea"),{xmlUrl:"/ps2/ps_index_main.php?mh_id="+this.mh_id,unique:true,onComplete:function(){Cytw.util.switch_class("MH_Notebook","","");end_time=new Date().getTime();hompy.initNewUpdateArea();}});},showProfile:function(_2c){var _2d=_2c[0];if(_2c.length>1){var _2e=parseInt(_2c[1]);_onComplete=function(){hompy.profileFolderChoose(_2e);};}else{_onComplete=function(){};}mhp.updateNode(("MH_Notebook_subArea"),{xmlUrl:"/ps2/ps_profile_sub.php?mh_id="+this.mh_id,unique:true,onComplete:_onComplete});if(_2c.length>1){switch(_2e){case 4:mhp.updateNode(("MH_Notebook_mainArea"),{xmlUrl:"/ps2/ps_profile2_view.php?mh_id="+this.mh_id,unique:true,onComplete:hompy.showProfilePaging});break;default:mhp.updateNode(("MH_Notebook_mainArea"),{xmlUrl:"/ps2/ps_profile_Mview.php?mh_id="+this.mh_id,unique:true,onComplete:function(){Cytw.util.switch_class("MH_Notebook","","");}});}}else{mhp.updateNode(("MH_Notebook_mainArea"),{xmlUrl:"/ps2/ps_profile_Mview.php?mh_id="+this.mh_id,unique:true,onComplete:function(){Cytw.util.switch_class("MH_Notebook","","");}});}},showSetting:function(_2f){var _30=_2f[0];if(Cytw.env.login_id!=hompy.mh_id){hompy.chg_menu_list(-1);return false;}if(_2f.length>1){hompySetting.sel_tab=_2f[1];hompy.putD("sel_tab",hompySetting.sel_tab);}if(!hompySetting.open_setting){var _31=Object.toQueryString({mh_id:this.mh_id});mhp.insert2Node(("MiniHompy"),{xmlUrl:"/ps2/setting/index.php?mh_id="+hompy.mh_id,xmlParm:_31,onComplete:hompySetting.initSetting});}},showMiniroom:function(_32){var _33=_32[0];this.ContentListType=2;var _34=6;if(_32.length>1){_34=_32[1];}var _35=Object.toQueryString({menuid:_33});mhp.updateNode(("MH_Notebook_subArea"),{xmlUrl:"/ps2/ps_subarea.php?mh_id="+this.mh_id,xmlParm:_35,onComplete:function(){Cytw.util.switch_class("MH_Notebook","","");}});this.show_bbs_list(_33,"",1,"",_34);},showMusic:function(_36){var _37=_36[0];var _38=Object.toQueryString({mh_id:this.mh_id});mhp.updateNode(("MH_Notebook_mainArea"),{xmlUrl:"/ps2/ps_jukebox.php?mh_id="+this.mh_id,xmlParm:_38,unique:true,onComplete:function(){Cytw.util.switch_class("MH_Notebook","WideView","WideView");if(hompy.mh_id!=Cytw.env.login_id){$("MH_MusicList").className="Guest";}}});},showGuestbook:function(_39){var _3a=_39[0];mhp.updateNode(("MH_Notebook_subArea"),{xmlUrl:"/ps2/ps_index_left.php?mh_id="+this.mh_id,unique:true,onComplete:function(){hompy.initCoverAreaHeight();init_Event_SoleElementSwitch("MH_Notebook_subArea");hompy.initScrollArea("MainSub_BodyArea");}});this.ContentListType=2;if(_39.length>1){var _3b=_39[1];var _3c=_39[2];if(_39.length>=3){var _3d=_39[3];this.show_bbs_list(_3a,_3b,_3d,"","",{"postid":_3c});}else{this.show_bbs_list(_3a,_3b,1);}}else{this.show_bbs_list(_3a,"",1);}},showPreviewPersonacon:function(_3e){var _3f=_3e[0];mhp.updateNode(("MH_Notebook_subArea"),{xmlUrl:"/ps2/ps_index_left.php?mh_id="+this.mh_id,unique:true,onComplete:function(){hompy.initCoverAreaHeight();init_Event_SoleElementSwitch("MH_Notebook_subArea");hompy.initScrollArea("MainSub_BodyArea");}});$("MH_Notebook_mainArea").update($("personacon_tpl").innerHTML);},showContentMenu:function(_40){var _41=_40[0];if(_40.length>1){var _42=_40[1];var _43=_40[2];var _44=(_40[3])?_40[3]:null;this.getLeftFolderList(_41,_42,{"onComplete":function(){hompy.folderChoose(_41,_42,_44,{"last_postid":_43});}});}else{if(!this.onedit){this.getLeftFolderList(_41);this.show_bbs_list(_41,"",1);}}},chg_menu_list:function(_45){var _45=eval(_45);this.ContentListType=0;var _46=$("MH_Notebook_tab").firstChild.firstChild;var num=$("MH_Notebook_tab").firstChild.childNodes.length;var _48=false;for(i=0;i<num;i++){var _49=_46.firstChild.getAttribute("_menuid");if(_49==_45){_46.className="Selected";var _4a=_46.firstChild.getAttribute("_folder_type");_48=true;}else{_46.className="";}_46=_46.nextSibling;}if(!_48&&_45!=3&&_45!=-4){if(hompy.menuinfo){hompy.menuinfo.each(function(Obj){if(Obj.MENUID==_45){alert("\u8a72\u4f7f\u7528\u8005\u672a\u958b\u653e "+Obj.NAME+"\u5167\u5bb9\u5537!!");}});}else{alert("\u8a72\u4f7f\u7528\u8005\u672a\u958b\u653e\u6b64\u6a19\u7c64\u5167\u5bb9\u5537!!");}if(Cytw.lang.isValue(hompy.menuid)){$$("#MH_Notebook_tab a[_menuid=\""+hompy.menuid+"\"]")[0].parentNode.className="Selected";}else{hompy.chg_menu_list(-1);}return false;}if($("bbs_folderlist_bar_div")){$("bbs_folderlist_bar_div").style.display="none";$("bbs_folderlist_bar_a").className="CloseList";}$$("#bbs_folderlist li.Selected").each(function(s){s.removeClassName("Selected");});switch(_45){case -1:hompy.showCover(arguments);break;case -2:hompy.showProfile(arguments);break;case -3:hompy.showSetting(arguments);break;case -4:hompy.showPreviewPersonacon(arguments);break;case 3:hompy.showMiniroom(arguments);break;case 4:hompy.showMusic(arguments);break;case 13:hompy.showGuestbook(arguments);break;case 14:this.ContentListType=$("ContentListType");default:hompy.showContentMenu(arguments);}if(hompy.isHome2&&_45!=-1){$("MH_BlogCover_Bin").hide();$("MH_BlogContent").show();}this.folderid=null;this.menuid=_45;this.postid=null;hompy.putD("chg_menu_list",_45);if($("bbs_folderlist_bar_div")){hompy.switchShowFolderListBar();}hompy.getPersonIcons();},search_bbs_list:function(){var obj=$("search_value");if(!obj.value.empty()){this.show_bbs_list(this.menuid,this.folderid,1,obj.value,hompy.folder_type);}},initCoverAreaHeight:function(){$("MainSub_BodyArea").style.height=$("MH_Main_Sub").getHeight()-$("MainSub_HeadArea").getHeight()-$("MainSub_FootArea").getHeight()+"px";if($("MainSub_BodyArea").style.height=="0px"){hompy.initCoverAreaHeight.delay(0.01);}},initNewUpdateArea:function(){var _4e=Prototype.Browser.Gecko?20:30;$("New_PostArea").style.width=$("New_UpdateArea").getWidth()-$("New_PhotoArea").getWidth()-_4e+"px";if($("New_PostArea").style.width=="0px"){hompy.initNewUpdateArea.delay(0.01);}},show_bbs_list:function(_4f,_50,_51,_52,_53,_54){if(this.subFolderListType==2&&_50){this.subFolderListYear=_50.substring(0,4);this.subFolderListMonth=_50.substring(4,6);}if(this.subFolderListType!=2){$selFolder=$$("#bbs_folderlist li.Selected");if($selFolder[0]&&($selFolder[0].down("a").innerHTML!="")){_50=$selFolder[0].getAttribute("_folderid");}else{_50="";}}if(_4f==""){_4f=this.menuid;}if(_51==""){_51=this.pageno;}hompy.menuid=_4f;hompy.folderid=_50;hompy.pageno=_51;if(!_53){_53=hompy.folder_type;}if(_54&&_54.last_postid!=null){var _55=Object.toQueryString({menuid:_4f,folderid:_50,foldertype:_53,search_value:_52,subFolderListType:this.subFolderListType,pageno:_51,ContentListType:this.ContentListType});$("MH_Notebook_mainArea").setAttribute("_menuid",_4f);$("MH_Notebook_mainArea").setAttribute("_folderid",_50);mhp.updateNode(("MH_Notebook_mainArea"),{xmlUrl:"/ps2/ps_bbs_post_frame.php?mh_id="+this.mh_id,xmlParm:_55,waitTimes:10,onComplete:hompy.showPaging});this.show_content(_54.last_postid);}else{if(!_52){_52="";}if(_54&&_54.postid){var _56=_54.postid;}var _55=Object.toQueryString({menuid:_4f,folderid:_50,foldertype:_53,search_value:_52,subFolderListType:this.subFolderListType,pageno:_51,postid:(_56)?_56:null,ContentListType:this.ContentListType});$("MH_Notebook_mainArea").setAttribute("_menuid",_4f);$("MH_Notebook_mainArea").setAttribute("_folderid",_50);mhp.updateNode(("MH_Notebook_mainArea"),{xmlUrl:"/ps2/ps_bbs_post_frame.php?mh_id="+this.mh_id,xmlParm:_55,waitTimes:10,onComplete:hompy.showPaging});var _55=Object.toQueryString({menuid:_4f,folderid:_50,foldertype:_53,search_value:_52,subFolderListType:this.subFolderListType,ContentListType:this.ContentListType,pageno:_51,postid:(_56)?_56:null});mhp.updateNode(("MH_Contents_Bin"),{xmlUrl:"/ps2/ps_bbs_list.php?mh_id="+this.mh_id,xmlParm:_55,waitTimes:10,waitNodeId:"MH_Notebook_mainArea",onComplete:hompy._reset_contentlisttype});}},_reset_contentlisttype:function(obj){if($("MH_Contents_Frame")){if($("node_extra_info")){if($("node_folder_type")){hompy.folder_type=eval($("node_folder_type").innerHTML);}hompy.ContentListType=eval($("node_content_listype").innerHTML);if($("node_wide_view_type")){hompy.wideviw=eval($("node_wide_view_type").innerHTML);hompy.set_wideview(hompy.wideviw);}if($("node_menuid")){$("MH_Contents_Bin").setAttribute("_menuid",$("node_menuid").innerHTML);}else{$("MH_Contents_Bin").setAttribute("_menuid",null);}if($("node_folderid")){$("MH_Contents_Bin").setAttribute("_folderid",$("node_folderid").innerHTML);}else{$("MH_Contents_Bin").setAttribute("_folderid",null);}if($("node_pageno")){$("MH_Contents_Bin").setAttribute("_pageno",$("node_pageno").innerHTML);}else{$("MH_Contents_Bin").setAttribute("_pageno",null);}}if(hompy.menuid==3){$("MH_Contents_Frame").className="MiniroomStyle";Cytw.util.switch_class("MH_Notebook","","");}else{if(hompy.menuid==13){$("MH_Contents_Frame").className="GuestBookStyle";Cytw.util.switch_class("MH_Notebook","","");}else{hompy.userIsClickWideView();switch(hompy.ContentListType){case 1:if(hompy.folder_type==21){$("MH_Contents_Frame").className="ListStyle";}else{$("MH_Contents_Frame").className="SPhotoStyle";}break;case 2:if(hompy.folder_type==21){$("MH_Contents_Frame").className="BlogStyle";}else{$("MH_Contents_Frame").className="MPhotoStyle";}break;case 3:if(hompy.folder_type==21){$("MH_Contents_Frame").className="SingleStyle";}else{$("MH_Contents_Frame").className="LPhotoStyle";}break;case 4:$("MH_Contents_Frame").className="SinglePhotoStyle";if(hompy.folder_type==22){Cytw.util.switch_class("MH_Notebook","WideView","WideView");}if($("btn_wide_view")){$("btn_wide_view").hide();$($($("btn_wide_view").parentNode).previous(0)).hide();}if(eval($("MH_Contents_Photo_List").getAttribute("_loaded"))!=1){var tmp=hompy.ContentListType;var _59=$("node_postid").innerHTML;var _5a=$("node_postitems").innerHTML.evalJSON(true);var len=_5a.length;var tp=(len/8)+(((len%8)>0)?1:1);var np=$("node_np").innerHTML;var _5e=new Template("<div _id=\"pre_#{INDEX}\" _index=\"#{INDEX}\" _postid=\"#{POSTID}\" style=\"background-image:url(#{IMG_URL});\"><a href=\"#\" onclick=\"$('MH_Contents_Photo_List').divClick(this);return false;   hompy.show_content(#{POSTID});return false;\"  ></a><b><br style=\"display:none;\"/></b></div>");var _5f="";var _60;var _61=0;_5a.each(function(_62,_63){_62.INDEX=((np-1)*8)+_63;_5f+=_5e.evaluate(_62);});$("MH_Contents_Photo_List").update(_5f);$("MH_Contents_Photo_List").setAttribute("_max_loaded",np);$("MH_Contents_Photo_List").setAttribute("_min_loaded",np);var bb=hompy.getSelectIndex(_59,$$("#MH_Contents_Photo_List div"));$("MH_Contents_Photo_List").childNodes.item(bb).className="Selected";$("MH_Contents_Photo_List").setAttribute("_selected",bb);var _65=$("MH_Contents_Photo_List").scrollTop;$("MH_Contents_Photo_List").scrollTop=77*(bb-1);hompy.initImageList(_59);}else{$("MH_Contents_Photo_List").setAttribute("_np",$("node_np").innerHTML);}break;}}}}hompy.switchShowFolderListBar();},getSelectIndex:function(_66,obj){var bb;obj.each(function(_69,_6a){if(_69.getAttribute("_postid")==_66){bb=_6a;return;}});return bb;},switchSlideImageBackground:function(id,_6c,_6d){if($(id)&&$("MH_Contents_Photo_List").imgList[_6c]){var obj=$("MH_Contents_Photo_List").imgList;$(id).setStyle({backgroundImage:"url("+obj[_6c].IMG_URL+")"});$(id).setAttribute("_postid",obj[_6c].POSTID);$(id).onclick=function(_6f){$("MH_Contents_Photo_List").divClick(this.firstChild);return false;};var b=$("MH_Contents_Photo_List").scrollTop;if(_6d!=2){$("MH_Contents_Photo_List").scrollTop=77*7;}}else{setTimeout(function(){hompy.switchSlideImageBackground(id,_6c,_6d);},300);}},addPreImage:function(_71,_72){var bs=eval($("MH_Contents_Photo_List").getAttribute("_bs"));var _74=eval($("MH_Contents_Photo_List").getAttribute("_total"));var _75="";for(var i=0;i<bs;i++){var _77=(i+((_71-1)*8));if(_77<_74){_75+="<div id=\"pre_"+_77+"\" _index=\""+_77+"\" ><a href=\"#\"></a><b><br style=\"display:none;\"/></b></div>";hompy.switchSlideImageBackground("pre_"+_77,_77,_72);}}if(_72==2){$("MH_Contents_Photo_List").insert(_75);$("MH_Contents_Photo_List").setAttribute("_max_loaded",eval($("MH_Contents_Photo_List").getAttribute("_max_loaded"))+1);}else{if(_72==1){var _78=eval($("MH_Contents_Photo_List").getAttribute("_selected"));$("MH_Contents_Photo_List").insert({top:_75});$("MH_Contents_Photo_List").setAttribute("_min_loaded",eval($("MH_Contents_Photo_List").getAttribute("_min_loaded"))-1);$("MH_Contents_Photo_List").setAttribute("_selected",_78+8);}}},initImageList:function(_79){$("MH_Contents_Photo_List").divUp=function(){var _7a=eval($("MH_Contents_Photo_List").getAttribute("_min_loaded"));var _7b=$("MH_Contents_Photo_List").scrollTop;Cytw.hompy.move_scroll("MH_Contents_Photo_List","up",77);if(_7b<=0&&_7a>1){hompy.addPreImage(_7a-1,1);}};$("MH_Contents_Photo_List").divDown=function(){var _7c=eval($("MH_Contents_Photo_List").getAttribute("_max_loaded"));var _7d=$("MH_Contents_Photo_List").scrollHeight;var _7e=$("MH_Contents_Photo_List").scrollTop;var tp=eval($("MH_Contents_Photo_List").getAttribute("_tp"));Cytw.hompy.move_scroll("MH_Contents_Photo_List","down",77);if(_7d-(77*5)<=_7e&&_7c<tp){hompy.addPreImage(_7c+1,2);}};$("MH_Contents_Photo_List").divClick=function(obj){var _81=eval($("MH_Contents_Photo_List").getAttribute("_min_loaded"));var _82=eval($("MH_Contents_Photo_List").getAttribute("_max_loaded"));var _83=eval($("MH_Contents_Photo_List").getAttribute("_selected"));var _84=eval($("MH_Contents_Photo_List").getAttribute("_tp"));var _85=eval($("MH_Contents_Photo_List").getAttribute("_bs"));var _86=obj.parentNode;var _87=_86.getAttribute("_postid");var bb=hompy.getSelectIndex(_87,$$("#MH_Contents_Photo_List div"));$("MH_Contents_Photo_List").childNodes.item(bb).className="Selected";$("MH_Contents_Photo_List").childNodes.item(_83).className="";$("MH_Contents_Photo_List").setAttribute("_selected",bb);$("MH_Contents_Photo_List").setAttribute("_pre_selected",bb);$("MH_Contents_Photo_List").scrollTop=77*(bb-1);if(_83<=3&&_81>1){hompy.addPreImage(_81-1,1);}if(_83>=(_82*_85-4)&&_82<_84){hompy.addPreImage(_82+1,2);}hompy.show_content(_87);};$("MH_Contents_Photo_List").observe("mousewheel",function(e){hompy.articleWheel(e);});$("MH_Contents_Photo_List").observe("DOMMouseScroll",function(e){hompy.articleWheel(e);});switch(hompy.subFolderListType){case 1:var _8b=Object.toQueryString({mh_id:hompy.mh_id,menuid:$("MH_Notebook_mainArea").getAttribute("_menuid"),folderid:$("MH_Notebook_mainArea").getAttribute("_folderid"),postid:_79,subFolderListType:hompy.subFolderListType,ContentListType:hompy.ContentListType});break;case 2:var _8b=Object.toQueryString({mh_id:hompy.mh_id,menuid:$("MH_Notebook_mainArea").getAttribute("_menuid"),folderid:$("MH_Notebook_mainArea").getAttribute("_folderid"),postid:_79,subFolderListType:hompy.subFolderListType,ContentListType:hompy.ContentListType});break;}hompy.getImgList(_8b);},getImgList:function(_8c){var _8d=function(_8e){if(eval($("MH_Contents_Photo_List").getAttribute("_max_loaded"))){var _8f=_8e.responseText.evalJSON(true);if($("MH_Contents_Photo_List").imgList){$("MH_Contents_Photo_List").imgList=$("MH_Contents_Photo_List").imgList.concat(_8f.img);}else{$("MH_Contents_Photo_List").setAttribute("_tp",_8f.tp);$("MH_Contents_Photo_List").setAttribute("_np",_8f.np);$("MH_Contents_Photo_List").setAttribute("_bs",_8f.bs);$("MH_Contents_Photo_List").setAttribute("_rn",_8f.rn);$("MH_Contents_Photo_List").setAttribute("_total",_8f.total);$("MH_Contents_Photo_List").setAttribute("_loaded","1");$("MH_Contents_Photo_List").imgList=_8f.img;}if($("MH_Contents_Photo_List").imgList&&$("MH_Contents_Photo_List").imgList.length<_8f.total){var _90=_8c.toQueryParams();_90.page=eval(_8f.page)+1;_8c=Object.toQueryString(_90);hompy.getImgList(_8c);}}};var _91={url:"/ps2/ajax_getImgList.php",onComplete:_8d};if($("MH_LoadingBlock")){$("MH_LoadingBlock").setAttribute("_dont_show",1);$("MH_LoadingBlock").hide();}hompySetting._sendItemManageRequest(_8c,_91);},initScrollArea:function(_92){$(_92).observe("mousewheel",function(e){hompy.doScrollArea(e);});$(_92).observe("DOMMouseScroll",function(e){hompy.doScrollArea(e);});},doScrollArea:function(_95){var _96=0;if(!_95){_95=window.event;}if(_95.wheelDelta){_96=_95.wheelDelta/120;if(window.opera){_96=-_96;}}else{if(_95.detail){_96=-_95.detail/3;}}if(_96>0){Cytw.hompy.move_scroll("MainSub_BodyArea","up",10);}else{if(_96<0){Cytw.hompy.move_scroll("MainSub_BodyArea","down",10);}}if(_95.preventDefault){_95.preventDefault();}_95.returnValue=false;},articleWheel:function(_97){var _98=0;if(!_97){_97=window.event;}if(_97.wheelDelta){_98=_97.wheelDelta/120;if(window.opera){_98=-_98;}}else{if(_97.detail){_98=-_97.detail/3;}}if(_98>0){$("MH_Contents_Photo_List").divUp();}else{if(_98<0){$("MH_Contents_Photo_List").divDown();}}if(_97.preventDefault){_97.preventDefault();}_97.returnValue=false;},move_scroll:function(id,_9a,_9b){switch(_9a){case "down":if(($(id).scrollTop+_9b)<$(id).scrollHeight){$(id).scrollTop+=_9b;}else{$(id).scrollTop=$(id).scrollHeight;}break;case "up":if(($(id).scrollTop-_9b)>=0){$(id).scrollTop=$(id).scrollTop-_9b;}else{$(id).scrollTop=0;}break;}},auto_move_scroll:function(id,_9d,_9e,_9f){switch(_9f){case "start":$(id).setAttribute("_scroll_id",setInterval("Cytw.hompy.move_scroll('"+id+"','"+_9d+"',"+_9e+")",100));break;case "end":clearInterval($(id).getAttribute("_scroll_id"));break;}},switch_new_scroll:function(id,_a1){var _a2=$(id).parentNode.firstChild;if((_a2.className)==""){_a2.className="BeforeConent";Cytw.hompy.move_scroll(id,"down",_a1);}else{_a2.className="";Cytw.hompy.move_scroll(id,"up",_a1);}},show_content:function(_a3,_a4,no,_a6){switch(hompy.subFolderListType){case 1:var _a7=Object.toQueryString({menuid:$("MH_Notebook_mainArea").getAttribute("_menuid"),folderid:$("MH_Notebook_mainArea").getAttribute("_folderid"),postid:_a3,ident:_a6,subFolderListType:hompy.subFolderListType,ContentListType:hompy.ContentListType,no:no});break;case 2:var _a7=Object.toQueryString({menuid:$("MH_Notebook_mainArea").getAttribute("_menuid"),folderid:$("MH_Notebook_mainArea").getAttribute("_folderid"),postid:_a3,ident:_a6,subFolderListType:hompy.subFolderListType,ContentListType:hompy.ContentListType,no:no});break;}if(_a4&&Cytw.lang.isFunction(_a4.onComplete)){var _a8=function(obj){hompy._reset_contentlisttype(obj);if(hompy.folder_type!=22){_a7=Object.toQueryString({menuid:$("MH_Notebook_mainArea").getAttribute("_menuid"),folderid:$("MH_Notebook_mainArea").getAttribute("_folderid"),subFolderListType:hompy.subFolderListType,ContentListType:hompy.ContentListType,postid:_a3,pageno:hompy.pageno});setTimeout(function(){$("MH_LoadingBlock").setAttribute("_dont_show",1);mhp.insert2Node(("MH_Contents_Bin"),{xmlUrl:"/ps2/ps_bbs_list.php?mh_id="+hompy.mh_id,xmlParm:_a7,onComplete:hompy._reset_contentlisttype});},1000);}_a4.onComplete();hompy.postid=_a3;hompy.folderid=$("MH_Notebook_mainArea").getAttribute("_folderid");};}else{var _a8=function(obj){hompy._reset_contentlisttype(obj);if(hompy.folder_type!=22){_a7=Object.toQueryString({menuid:$("MH_Notebook_mainArea").getAttribute("_menuid"),folderid:$("MH_Notebook_mainArea").getAttribute("_folderid"),subFolderListType:hompy.subFolderListType,ContentListType:hompy.ContentListType,postid:_a3,pageno:hompy.pageno});setTimeout(function(){$("MH_LoadingBlock").setAttribute("_dont_show",1);mhp.insert2Node(("MH_Contents_Bin"),{xmlUrl:"/ps2/ps_bbs_list.php?mh_id="+hompy.mh_id,xmlParm:_a7,onComplete:hompy._reset_contentlisttype});},1000);}hompy.postid=_a3;hompy.folderid=$("MH_Notebook_mainArea").getAttribute("_folderid");var h=$("ScrollArea").scrollHeight;Cytw.hompy.move_scroll("ScrollArea","up",h);};}mhp.updateNode(("MH_Contents_Bin"),{xmlUrl:"/ps2/ps_bbs_post.php?mh_id="+hompy.mh_id,xmlParm:_a7,waitTimes:10,priority:2,onComplete:_a8});},set_ContentListType:function(_ac,_ad,_ae,_af){changeMenu_startTime=new Date().getTime();this.ContentListType=_ac;this.show_bbs_list(_ad,"",_af);hompy.switchShowFolderListBar();},set_wideview:function(_b0){if(_b0==null){Cytw.util.switch_class("MH_Notebook","WideView","");if($("MH_Notebook").className=="WideView"){hompy.clickWideviw=1;}else{hompy.clickWideviw=0;}}else{switch(hompy.wideviw){default:case 0:case 1:Cytw.util.switch_class("MH_Notebook","","");break;case 2:Cytw.util.switch_class("MH_Notebook","WideView","WideView");break;}}hompy.switchShowFolderListBar();},showPaging:function(obj){if($("node_extra_info")){hompy.ContentListType=eval($("node_content_listype").innerHTML);var _b2=$("node_paging").innerHTML.evalJSON(true);if($("node_search_value")){var _b3=$("node_search_value").innerHTML;}else{var _b3="";}}if(hompy.mh_id==Cytw.env.login_id){$("MH_Contents").addClassName("Admin");}else{$("MH_Contents").removeClassName("Admin");}if(eval(_b2["block_from"])>1){$("Page_first").innerHTML="<a onfocus=\"blur();\" href=\"javascript:Cytw.hompy.show_bbs_list("+"'',''"+","+_b2["first"]+",'"+_b3+"')\" class=\"Btn_First\">\u7b2c"+_b2["first"]+"\u9801</a>";}else{$("Page_first").innerHTML="";}if(eval(_b2["block_to"])<eval(_b2["last"])){$("Page_last").innerHTML="<a onfocus=\"blur();\" href=\"javascript:Cytw.hompy.show_bbs_list("+"'',''"+","+_b2["last"]+",'"+_b3+"')\" class=\"Btn_Last\">\u7b2c"+_b2["last"]+"\u9801</a>";}else{$("Page_last").innerHTML="";}if(eval(_b2["blockno"])>1){$("Page_prev").innerHTML="<a onfocus=\"blur();\" titie=\"\u4e0a\u4e94\u9801\" href=\"javascript:Cytw.hompy.show_bbs_list("+"'',''"+","+_b2["prevn"]+",'"+_b3+"')\" class=\"Btn_Pre_More\">\u4e0a\u4e94\u9801</a>";}if(eval(_b2["pageno"])>1){$("Page_prev").innerHTML+="<a onfocus=\"blur();\" titie=\"\u4e0a\u4e00\u9801\" href=\"javascript:Cytw.hompy.show_bbs_list("+"'',''"+","+_b2["prev1"]+",'"+_b3+"')\" class=\"Btn_Pre\">\u4e0a\u4e00\u9801</a>";}else{$("Page_prev").innerHTML="";}if(eval(_b2["pageno"])<eval(_b2["last"])){$("Page_next").innerHTML="<a onfocus=\"blur();\" titie=\"\u4e0b\u4e00\u9801\" href=\"javascript:Cytw.hompy.show_bbs_list("+"'',''"+","+_b2["next1"]+",'"+_b3+"')\" class=\"Btn_Next\">\u4e0b\u4e00\u9801</a>";}if(eval(_b2["blockno"])<eval(_b2["blocknum"])){$("Page_next").innerHTML+="<a onfocus=\"blur();\" titie=\"\u4e0b\u4e94\u9801\" href=\"javascript:Cytw.hompy.show_bbs_list("+"'',''"+","+_b2["nextn"]+",'"+_b3+"')\" class=\"Btn_Next_More\">\u4e0b\u4e94\u9801</a>";}else{$("Page_next").innerHTML="";}var tmp="";if(eval(_b2["block_from"])!=eval(_b2["block_to"])){var _b5=eval(_b2["block_to"]);var _b6=eval(_b2["pageno"]);for(var i=eval(_b2["block_from"]);i<=_b5;i++){if(_b6==i){tmp+="<a onfocus=\"blur();\" href=\"javascript:hompy.show_bbs_list("+"'','',"+i+",'"+_b3+"')\" class=\"Selected\">"+i+"</a>";}else{tmp+="<a onfocus=\"blur();\" href=\"javascript:hompy.show_bbs_list("+"'','',"+i+",'"+_b3+"')\">"+i+"</a>";}}}$("Page_paging").innerHTML=tmp;},showPosting:function(e,_b9,_ba,_bb,_bc){e=e?e:event;var _bd=e.srcElement?e.srcElement:e.target;var _be=21;if(_bd.tagName.toUpperCase()=="SPAN"){_bd=_bd.parentNode;}if($(_bd).getAttribute("_folder_type")){_be=eval($(_bd).getAttribute("_folder_type"));}if(_ba==null){_ba=hompy.menuid;}if(_bb==null){_bb=hompy.folderid;}var _bf="";var _c0=false;if(_be==22||_be==1){var _c1=true;var dst=hompy.dst;}else{var _c1=false;if($(_bd)&&$(_bd).getAttribute("_dst")){var dst=$(_bd).getAttribute("_dst");}else{var dst=hompy.dst;}}if(_be==-1){if(_bc==null){_c0=true;}_bf="MHCover";}else{_c0=false;}if(_be==9){_bf="MHHistory";}if(_be==21){_bf="Article";}if(!_c1&&!_c0){var _c3=Object.toQueryString({mh_id:this.mh_id,menuid:_ba,folderid:_bb,post_kind:_bf,postid:(_bc)?_bc:null});mhp.insert2Node(("MiniHompy"),{xmlUrl:"/ps2/ps_postingView.php",xmlParm:_c3,unique:true,onComplete:function(){if(_bf==""){hompy.toggleScrapYn("sel_menu_id","scrap_yn");}window.FCKeditor_OnComplete=function(){$A($("MH_PostEditor").getElementsByClassName("btn_default_Off")).each(function(_c4){_c4.className="btn_default";var _c5=_c4.firstDescendant().innerHTML;if(_c5.match(/取消/gi)){_c4.onclick=function(){hompy.removePosting();return false;};_c4.className="btn_default";}else{if(_c5.match(/儲存/gi)){try{if(hompy.menuid==13||(!$(hompy.contentsFrameId)&&!$("posting_article"))){if(_bf=="MHHistory"){_c4.onclick=function(){hompy.submitPersonalIntro();return false;};_c4.setAttribute("_event_code",2415);}else{_c4.onclick=function(){hompy.submitCoverstory();return false;};_c4.setAttribute("_event_code",2418);}}else{if(($(hompy.contentsFrameId)&&parseInt($(hompy.contentsFrameId).getAttribute("_is_write"))>0)||$("posting_article")){_c4.onclick=function(){hompy.testPost2Fs();return false;};}else{_c4.className="btn_default_Off";}}}catch(e){hompy.putD("Set Save/cancel btn Error!");}}}});};hompy.onedit=true;}});}else{if($(_bd)&&$(_bd).getAttribute("_post_id")){this.activePosting({"mh_id":hompy.mh_id,"postid":$(_bd).getAttribute("_post_id"),"post_kind":"album","menuid":_ba});}else{this.openImageWindow(hompy.fs,dst,document.domain,null,_c1,_bf,null,null,_ba);}}},activePosting:function(obj){var _c7=Object.toQueryString(obj);mhp.insert2Node(("MiniHompy"),{xmlUrl:"/ps2/ps_postingView.php",xmlParm:_c7,unique:true,onComplete:function(){hompy.activePhotoEditSubmitCancelBtn(obj.file_count);hompy.onedit=true;}});},editAlbum:function(_c8){var _c9=_c8.postid;},toggleScrapYn:function(_ca,_cb){var _cc=$(_ca).options[$(_ca).selectedIndex].getAttribute("_folder_type");if(!$("sel_menu_id")){_cd=hompy.menuid;}else{var _cd=$("sel_menu_id").value;}if(Cytw.lang.isValue(_cc)){if(_cc==0){$(_cb).checked=(eval($(_cb).getAttribute("_pre_checked_menu"+_cd)));}else{$(_cb).checked=true;}}},removePosting:function(){try{$("MH_LoadingBlock").hide();this.onedit=false;$("MH_PostEditor").remove();clearInterval(hompy.autoSaveI);}catch(e){if($("MH_PostEditor")){$("MH_PostEditor").remove();}hompy.putD("removePosting error catched");}window.FCKeditor_OnComplete=null;},postingChangeFolderList:function(_ce,_cf){var _d0=document.createElement("div");var _d1=Object.toQueryString({mh_id:this.mh_id,menuid:_ce});new Ajax.Request("/ps2/ajax_getFolders.php",{method:"post",postBody:_d1,onCreate:function(){},onComplete:function(_d2){var _d3=(_d2.responseText.evalJSON(true));var _d4=new Template("<option value=\"#{folder_id}\">#{name}</option>");var _d5=new Template("<option value=\"#{folder_id}\">#{name}</option>");var _d6="";_d6="<option value=\"-1\">\u6a94\u6848\u593e\u540d\u7a31</option>";_d6="";_d3["folder"].each(function(obj){_d6+=_d4.evaluate(obj);});Cytw.util.replaceSelectOption($("folderid"),_d6);hompy.toggleScrapYn("sel_menu_id","scrap_yn");$("menuid").value=_ce;$("menu_name").value=$("sel_menu_id").options[$("sel_menu_id").selectedIndex].text;$("folder_type").value=_d3.org_folder_type;}});Cytw.util.ajustYMDSelect("select_date",_cf[0],_cf[1],_cf[2],_ce);},testPost2Fs:function(){function _onComplete(_d8){var _d9=_d8.innerHTML.evalJSON(true);if(_d9&&_d9.result=="ok"){hompy.syncMenuAndFolderAndContent(_d9.menuid,_d9.folderid,_d9.last_postid);}else{if(_d9&&_d9.result=="invild"){alert(_d9.message);hompy.removePosting();}else{alert(Cytw.message.ArticleWriteFail);}}}function _onCheck(){var _da=FCKeditorAPI.GetInstance("content");var _db=_da.GetHTML().stripTags().gsub(/&nbsp;/,"").length;if(_db==0){alert(Cytw.message.EmptyContent);return false;}$("folder_name").value=$("folderid").options[$("folderid").selectedIndex].text;hompy.removeTagInputValue("MH_PostEditor");if($("title").value.blank()){alert(Cytw.message.EmptyTitle);return false;}if($("emoticonid").value==-1||$("emoticonid").value==""){$("emoticonid").value="0";}hompy.removeTagInputValue("MH_PostEditor");$("MH_LoadingBlock").show();var _dc=$("folder_type").value;var _dd=new Array();_dd[0]=2455;_dd[2]=2473;_dd[5]=2491;if(_dc&&_dd[_dc]){hompySendEventCode(_dd[_dc]);}return true;}util.submitForm($("posting_article"),{"onCheck":_onCheck,"onComplete":_onComplete});},postAlbumDesc:function(obj){function _onComplete(_df){var _e0=_df.innerHTML.evalJSON(true);if(_e0&&_e0.result=="ok"){hompy.syncMenuAndFolderAndContent(_e0.menuid,_e0.folderid,_e0.last_postid);}else{alert(message.AlbumDescWriteFail);if(_e0.menuid&&_e0.folderid&&_e0.last_postid){hompy.syncMenuAndFolderAndContent(_e0.menuid,_e0.folderid,_e0.last_postid);}else{hompy.chg_menu_list(-1);}}}function _onCheck(){hompy.removeTagInputValue("MH_PostEditor");$("folder_name").value=$("folderid").options[$("folderid").selectedIndex].text;$("MH_LoadingBlock").show();return true;}util.submitForm($("posting_album"),{"onCheck":_onCheck,"onComplete":_onComplete});},testfck:function(){var _e1=FCKeditorAPI.GetInstance("content");alert("status:"+_e1.Status);_e1.UpdateLinkedField();},editContentOnFly:function(_e2){var _e3=$("node_folder_type").innerHTML;$("content_editor_area_"+_e2).toggle();$($("content_current_area_"+_e2).parentNode).toggle();$("content_editor_"+_e2).value=$("content_current_area_"+_e2).innerHTML.replace(/<br(\s)?(\/)?>(\n)?/gi,"\n");},editContentOnFlyPost:function(_e4){var _e5=$("content_editor_"+_e4).getAttribute("_postid");var _e6=$("content_editor_"+_e4).getAttribute("_menuid");var _e7=$("content_editor_"+_e4).getAttribute("_folderid");var _e8=$("content_editor_"+_e4).value;$("content_current_area_"+_e4).innerHTML=_e8.stripTags().replace(/\n/g,"<br />");$("content_current_area_"+_e4).parentNode.toggle();$("content_editor_area_"+_e4).toggle();var _e9=Object.toQueryString({mh_id:hompy.mh_id,postid:_e5,menuid:_e6,folderid:_e7,content:_e8,action_name:"edit_content"});_onComplete=function(_ea){var _eb=(_ea.responseText.evalJSON(true));};option={"url":"/ps2/ajax_post.php","onComplete":_onComplete};hompySetting._sendItemManageRequest(_e9,option);},removeTagInputValue:function(id){var _ed=$$("#"+id+" input[type=\"text\"]");_ed.each(function(_ee){if($(_ee).getAttribute("_init")==1){_ee.value="";}});},toggleMyTagBubble:function(id,_f0,_f1){if(Cytw.env.login_id){if($(id).style.display=="block"){$(id).style.display="";}else{new Ajax.Request("/ps2/ajax_getMyTags.php",{method:"post",postBody:null,onCreate:function(){$(id).style.display="block";$(id).update("Loading.......");},onComplete:function(_f2){var _f3=(_f2.responseText.evalJSON(true));var _f4=new Template("<span><a href=\"#\" onclick=\"hompy.addTag2InputText('"+_f1+_f0+"',this.innerHTML);return false;\">#{TAG}</a>,&#160;</span>");var _f5="";if(_f3){_f3.each(function(obj){_f5+=_f4.evaluate(obj);});}if(_f5){_f5="<a href=\"#\" class=\"Btn_Close\" onfocus=\"blur();\" onclick=\"this.parentNode.style.display='';return false;\">CLOSE</a>"+_f5+"<b><br/></b>";}else{_f5=Cytw.message.MyTagsNotExists;}$(id).update(_f5);$(id).scrollTo();}});}}},smartTagHelper:function(e,_f8,_f9){var _fa=[9,13,16,17,18,27,37,38,39,40,36,35,33,34,];if(!$(_f9+"_EDITOR"+_f8).getAttribute("_send_on_enter")){if(_fa.indexOf(e.keyCode)>=0||e.altKey||e.ctrlKey){return false;}}var _fb=$(_f9+_f8);var _fc=_fb.getAttribute("_last_value");if(e.keyCode==13){hompy.EditTagFinish(_f9+_f8,_f8,_f9);}if(_fb.value==_fc){return false;}_fb.setAttribute("_last_value",_fb.value);var _fd=_fb.value.split(",");if(_fd.length>5){alert(message.ReachTagLimit);_fb.value=_fb.value.replace(/,$/,"");return false;}else{if(_fd[_fd.length-1].replace(/\s$/,"")){var _fe=Object.toQueryString({keyword:_fd[_fd.length-1],type:"smart",sorttype:1,pagesize:10});_onComplete=function(_ff){var json=(_ff.responseText.evalJSON(true));var _101=$(_f9+"_helper"+_f8);var _102=$(_f9+"_helper_container"+_f8);if(json&&json.length>0){var _103=new Template("<a href=\"#\" onfocus=\"blur();\" onclick=\"hompy.addSmartTag2Input('"+_f9+_f8+"',this.innerHTML);$('"+_f9+"_helper"+_f8+"').hide();return false;\">#{TAG}</a>");var _104="";json.each(function(obj){_104+=_103.evaluate(obj);});_102.update(_104);_101.show();_101.scrollTo();}else{_101.hide();}};option={"url":"/ps2/ajax_getMyTags.php","onComplete":_onComplete};$("MH_LoadingBlock").setAttribute("_dont_show",1);hompySetting._sendItemManageRequest(_fe,option);}}},addSmartTag2Input:function(id,tag){var _108=$(id).value.split(",");_108[_108.length-1]=tag;$(id).value=(_108.toString());},hideSmartHelper:function(id){setTimeout(function(){try{$(id).hide();}catch(e){}},500);},addTag2InputText:function(id,tag,_10c){if(!_10c){_10c=5;}var _10d=$(id);_10d.value=Cytw.util.trim(_10d.value);var _10e=_10d.value.split(",");if(!_10d.value.include(tag)){if(_10d.getAttribute("_init")==1||_10d.value==""){_10d.value=tag;_10d.setAttribute("_init",0);$(id).style.color="#555";}else{if(_10e.length>=_10c){return false;}_10d.value+=","+tag;}}else{_10d.value=_10d.value.replace(tag,"").replace(/^,|,$/,"").replace(",,",",");}},EditTag:function(_10f,_110,_111){var len=$("taglist"+_110).cleanWhitespace().firstChild.childNodes.length-1;var node,str="";for(i=0;i<len;i++){if(i==0){node=$("taglist"+_110).firstChild.childNodes[i];}else{node=node.nextSibling;}if(node.tagName=="A"){if(str==""){str=node.innerHTML;}else{str+=", "+node.innerHTML;}}}node=$(_10f);node.value=util.removeWhiteSpace(str);node.setAttribute("_init","0");node.style.color="#555";$(_111+"_EDITOR"+_110).show();$(_111+"_EDITOR"+_110).setAttribute("_send_on_enter",1);node.setAttribute("_last_value",node.value);node.focus();$($("taglist"+_110).firstChild).hide();},EditTagFinish:function(_115,_116,_117){try{$(_117+"_helper"+_116).hide();}catch(e){}$(_117+"_EDITOR"+_116).hide();$("taglist"+_116).firstChild.show();var _118=$(_115).value.split(",");var _119=$($("taglist"+_116).firstChild);var _11a=_119.lastChild.cloneNode(true);var a=new Array();for(i=0;i<_118.length;i++){a.push("&#160;<a href=\"#\" onclick=\"return false;\">"+_118[i]+"</a>");if(i==4){break;}}_119.update(a.toString());_119.appendChild(_11a);var parm=Object.toQueryString({keyword:$(_115).value,type:"update",postid:$("taglist"+_116).getAttribute("_postid"),section:$("taglist"+_116).getAttribute("_tag_section")});option={"url":"/ps2/ajax_getMyTags.php"};hompySetting._sendItemManageRequest(parm,option);$(_117+"_EDITOR"+_116).setAttribute("_send_on_enter",0);if($(_115).value==""){_119.remove();}},commentAreaClick:function(e,_11e){e=e?e:event;var _11f=e.srcElement?e.srcElement:e.target;var _120=$(_11f).getAttribute("_action");if(!$("person_div")){hompy.getPersonIcons(e);}hompy.putD(_11f.tagName,_120);switch(_120){case "toggleBubble":if(!Cytw.env.login_id){return false;}$("Bubble_"+_11e).toggle();$("icon_list_"+_11e).update($("person_div").innerHTML+"<span class=\"FloatClear\"><br style=\"display:none;\"/></span>");break;case "icon_click":if(!Cytw.env.login_id){return false;}var _121=_11f.getAttribute("_src");var _122=_11f.getAttribute("_pid");$("choosed_icon_"+_11e).setStyle({backgroundImage:"url("+_121+")"});$("comment_personicon_"+_11e).value=_122;$("Bubble_"+_11e).toggle();break;case "post_comment":if(!Cytw.env.login_id){alert("\u8acb\u767b\u5165\u5f8c\u4f7f\u7528");return false;}var _123=_11f.getAttribute("_postid");var _124=_11f.getAttribute("_menuid");var _125=_11f.getAttribute("_folderid");var _126=$("comment_input_"+_11e).value;var _127=$("comment_personicon_"+_11e).value;var parm=Object.toQueryString({mh_id:hompy.mh_id,postid:_11f.getAttribute("_postid"),menuid:_11f.getAttribute("_menuid"),folderid:_11f.getAttribute("_folderid"),comment:$("comment_input_"+_11e).value,personaconid:$("comment_personicon_"+_11e).value,action_name:"post_comment"});hompy.postComment(parm,_11e);break;case "delete_comment":if(!Cytw.env.login_id){return false;}var parm=Object.toQueryString({mh_id:hompy.mh_id,postid:$("comment_list_"+_11e).getAttribute("_postid"),writer_cyid:_11f.getAttribute("_writer_cyid"),writer_name:_11f.parentNode.firstChild.getAttribute("_mh_name"),seq:_11f.getAttribute("_seq"),action_name:"delete_comment"});hompy.deleteComment(parm,_11e);break;}},getPersonIcons:function(){try{_onComplete=function(html){if(!$("person_div")){var _12a=document.createElement("div");document.body.appendChild(_12a);$(_12a).hide();$(_12a).setAttribute("id","person_div");}$("person_div").innerHTML=html.responseText;};var parm=Object.toQueryString({mh_id:Cytw.env.login_id});option={"url":"ajax_getPersonIcons.php","onComplete":_onComplete};hompySetting._sendItemManageRequest(parm,option);}catch(e){}},postComment:function(parm,_12d){_onComplete=function(html){var json=(html.responseText.evalJSON(true));var _130=json.PERSONICON?"<img src=\"#{PERSONICON}\" />":"";var _131=new Template("<li><a class=\"NameUI\" href=\"#\" _mh_name=\"#{WRITER_NAME}\" _mh_id=\"#{WRITER_CYID}\">#{WRITER_NAME}</a><span> : </span>"+_130+"<span>#{COMMENT}</span><b>#{DATE}</b><a href=\"#\" _action=\"delete_comment\" class=\"Btn_Delete_inline\" onfocus=\"blur();\" onclick=\"return false\" _seq=\"#{SEQ}\" _writer_cyid=\"#{WRITER_CYID}\"><b>X</b></a></li>");if(json.result=="ok"){var _132=_131.evaluate(json).replace("\\'","'");$("comment_list_"+_12d).insert(_132);$("comment_input_"+_12d).value="";if($("comment_count_"+_12d)){var _133=$("comment_count_"+_12d).innerHTML.replace(/^\(|\)$/gi,"");$("comment_count_"+_12d).innerHTML="("+(eval(_133)+1)+")";}}else{alert(json.message);}};option={"url":"ajax_post.php","onComplete":_onComplete};hompySetting._sendItemManageRequest(parm,option);},deleteComment:function(parm,_135){_onComplete=function(html){var json=(html.responseText.evalJSON(true));if(json.result=="ok"){var _138=$$("#comment_list_"+_135+" a[_seq=\""+json.seq+"\"]");_138.each(function(Node){$(Node.parentNode).remove();});if($("comment_count_"+_135)){var _13a=$("comment_count_"+_135).innerHTML.replace(/^\(|\)$/gi,"");$("comment_count_"+_135).innerHTML="("+(eval(_13a)-1)+")";}}else{alert(json.message);}};option={"url":"ajax_post.php","onComplete":_onComplete};hompySetting._sendItemManageRequest(parm,option);},openGalleryWindow:function(fs,dst,host){var parm=Object.toQueryString({mh_id:this.mh_id,file_srv:fs,dstroot:dst,opener:host});var _13f=$("folder_type").value;var _140=new Array();_140[0]=2460;_140[2]=2478;_140[5]=2497;if(_13f&&_140[_13f]){hompySendEventCode(_140[_13f]);}var url="http://"+fs+".tw.cyworld.com/ps2/ps_galleryPosting.php?"+parm;Cytw.util.openMHPopup2(url,"460","400");},openAttachWindow:function(fs,dst,host){var parm=Object.toQueryString({mh_id:this.mh_id,file_srv:fs,dstroot:dst,opener:host,kind:"MHBoardFile",mode:"File",sign:Cytw.env.baseDomain});var _146=$("folder_type").value;var _147=new Array();_147[0]=2459;_147[2]=2477;_147[5]=2496;if(_146&&_147[_146]){hompySendEventCode(_147[_146]);}var url="http://"+fs+".tw.cyworld.com/ps2/ps_AttachFile.php?"+parm;Cytw.util.openMHPopup2(url,"350","450","yes");},openImageWindow:function(fs,dst,host,tag,_14d,kind,_14f,_150,_151){var _152=$("hompy_domain").innerHTML;if(kind==null){kind="JOURNAL";}if(!_14d){var parm=Object.toQueryString({mh_id:this.mh_id,file_srv:fs,dstroot:dst,opener:host,kind:kind,mode:"Image",sign:_152,tag:(tag)?tag:null,access_mode:_14f,folder_type:($("folder_type"))?$("folder_type").value:""});if($("folder_type")){var _154=$("folder_type").value;var _155=new Array();_155[0]=2457;_155[2]=2475;_155[5]=2494;}if(_154&&_155[_154]){hompySendEventCode(_155[_154]);}var url="http://"+fs+".tw.cyworld.com/ps2/ps_ImageUploadView_ArticleEditor.php?"+parm;}else{if(_14d){_151=(_151)?_151:hompy.menuid;var parm=Object.toQueryString({mh_id:this.mh_id,file_srv:fs,dstroot:dst,opener:host,kind:"MHPhoto",mode:"Image",sign:_152,tag:(tag)?tag:null,menuid:_151,folderid:this.folderid,access_mode:(_14f)?_14f:null,orgin_image:(_150)?_150:null});if($("btn_editposting")&&$("btn_editposting").getAttribute("_post_id")&&_14f=="edit"){parm+="&postid="+$("btn_editposting").getAttribute("_post_id");}if($("btn_editposting")&&$("btn_editposting").getAttribute("_photo_type")==2){var url="http://"+fs+".tw.cyworld.com/ps2/ps_ImageUploadView_AlbumEditor.php?"+parm;}else{var url="http://"+fs+".tw.cyworld.com/ps2/ps_ImageUploadView_AlbumEditor.php?"+parm;}}}if(!Cytw.env.bo.ie){url=url.replace("ps_ImageUploadView_AlbumEditor.php","ps_ImageUploadView_AlbumDirectUpload.php");}Cytw.util.openMHPopup2(url,"750","720","yes");},addImg2FckEditor:function(str){if(str.isJSON()){var json=str.evalJSON(true);if(!json[0].ERROR_MESSAGE){Cytw.util.fckEditor.attach_image(json[0].image);}else{alert(Cytw.message.GalleryUploadFail);}}else{}},attachFile:function(json){if(json&&json.isJSON()){var _15a=parseInt($("total_size").innerHTML);var _15b="<a href=\"#\" onclick=\"\">MHP_Setting.css</a>";var _15c=new Template("<a href=\"#\" onclick=\"hompy.removeAttachFile(this);return false;\" _dstfile=\"#{dstfile}\" _dstroot=\"#{dstroot}\" _file_size=\"#{file_size}\" _file_type_value=\"#{file_type_value}\" _file_srv=\"#{file_srv}\"   >#{orgfile}</a>");var _15d=new Template("#{dstfile}:#{file_size}:#{file_type_value}:#{file_srv}:#{dstroot}");var _15e="";var _15f="";var json=(json.evalJSON(true));json.each(function(json){_15e=_15c.evaluate(json);_15f=_15d.evaluate(json);var _161=(parseInt(json.file_size));_15a=_15a+((_161)?_161:1);if(_15a>2000){alert(message.OverAttachSizeLimit);return false;}$("total_size").innerHTML=_15a;if(!$("attach_div").visible()){$("file_list_div").insert(_15e);}else{$("file_list_div").insert(", "+_15e);}$("attach_div").show();hompy.addTag2InputText("hid_attach_file_list",_15f,999);});}},removeAttachFile:function(obj){var _163=parseInt($("total_size").innerHTML);var _164=parseInt(obj.getAttribute("_file_size"));var _165=_163-((_164)?_164:1);var _166=obj.getAttribute("_dstfile")+":"+obj.getAttribute("_file_size")+":"+obj.getAttribute("_file_type_value")+":"+obj.getAttribute("_file_srv")+":"+obj.getAttribute("_dstroot");$("total_size").innerHTML=_165;if($(obj).nextSibling&&$(obj).nextSibling.data==", "){var _167=$(obj).nextSibling;$("file_list_div").removeChild(_167);}else{if($(obj).previousSibling&&$(obj).previousSibling.data==", "){var _167=$(obj).previousSibling;$("file_list_div").removeChild(_167);}}$(obj).remove();if($("file_list_div").childNodes.length<=1){$("attach_div").hide();}this.addTag2InputText("hid_attach_file_list",_166,999);},activePhotoEditSubmitCancelBtn:function(_168){$A($("MH_PostEditor").getElementsByClassName("btn_default_Off")).each(function(_169){_169.className="btn_default";var html=_169.firstDescendant().innerHTML;if(html.match(/取消/gi)){_169.onclick=function(){hompy.removePosting();return false;};}else{if(html.match(/儲存/gi)){try{if(hompy.menuid==13||(!$(hompy.contentsFrameId)&&true)){_169.onclick=function(){hompy.submitCoverstory(this);return false;};}else{if(parseInt($(hompy.contentsFrameId).getAttribute("_is_write"))>0){_169.onclick=function(){hompy.postAlbumDesc(this);return false;};_169.setAttribute("_file_cnt",_168);}else{_169.className="btn_default_Off";}}}catch(e){}}}});},hidePasswordDiv:function(_16b){if($("password").value.blank()){_16b=true;}if(_16b){if(hompy.seepass!=1){$("password").value="";$("password_hint").value="";$("click_pass").checked=false;$("SetPassword").removeClassName("Checked");}}else{$("click_pass").checked=true;$("SetPassword").className="Checked";}$("password_div").hide();},showPasswordDiv:function(id){var obj=$(id);if(!obj.checked){obj.checked=false;this.hidePasswordDiv(true);return true;}else{$("password_div").show();return false;}},cleanUpEmptyBr:function(ids){var temp=$$("#"+ids+" BR");temp.map(Element.extend).invoke("remove");},editTitle:function(_170,_171){var obj=$(_170+_171);var _173=$(_170+"Input_"+_171);var _174=$(_170+"InputTag_"+_171);_174.value=_174.getAttribute("_value");$(obj.firstChild).hide();$(_173).show();},cancelEditTitle:function(_175,_176){var obj=$(_175+_176);var _178=$(_175+"Input_"+_176);$(obj.firstChild).show();$(_178).hide();},chg_title:function(_179,_17a){var _17b=$$("#MH_Notebook_tab a[_menuid=\""+hompy.menuid+"\"]")[0].getAttribute("_folder_type");var _17c=new Array();_17c[0]=2461;_17c[1]=2437;_17c[2]=2479;_17c[5]=2498;if(_17b&&_17c[_17b]){hompySendEventCode(_17c[_17b]);}var id=_179+"Input_"+_17a;var temp=$$("#"+id+" input[type=\"text\"]");var _17f="";var _180=$(_179+_17a).getAttribute("_postid");temp.each(function(_181){_17f=_181.value;});if(_17f.length==0){alert("\u5225\u5fd8\u4e86\u8f38\u5165\u6a19\u984c\u5594");return false;}$(_179+"text_"+_17a).innerHTML=_17f;$(_179+"InputTag_"+_17a).setAttribute("_value",_17f);hompy.cancelEditTitle(_179,_17a);var parm=Object.toQueryString({action_name:"chg_title",mh_id:hompy.mh_id,postid:_180,title:_17f});new Ajax.Request("/ps2/ajax_post.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){}});},submitPersonalIntro:function(){function _onComplete(body){var json=body.innerHTML.evalJSON(true);eval(json);if(result=="ok"){hompy.removePosting();mhp.updateNode(("MH_Notebook_mainArea"),{xmlUrl:"/ps2/ps_profile_history_list.php?mh_id="+hompy.mh_id,unique:true,onComplete:hompy.showProfilePaging});}else{alert(message.ArticleWriteFail);hompy.removePosting();}}function _onCheck(){var _186=FCKeditorAPI.GetInstance("content");var _187=_186.GetHTML().stripTags().gsub(/&nbsp;/,"").length;if(_187==0){alert(message.EmptyContent);return false;}$("MH_LoadingBlock").show();return true;}util.submitForm($("posting_profile"),{"onCheck":_onCheck,"onComplete":_onComplete});},submitCoverstory:function(){function _onComplete(body){var json=body.innerHTML.evalJSON(true);eval(json);if(result=="ok"){hompy.removePosting();if(hompy.menuid==-2){Cytw.hompy.profileFolderChoose(4);mhp.updateNode(("MH_Notebook_mainArea"),{xmlUrl:"/ps2/ps_profile2_view.php?mh_id="+hompy.mh_id,unique:true,onComplete:hompy.showProfilePaging});}else{mhp.updateNode(("MH_Notebook_subArea"),{xmlUrl:"/ps2/ps_index_left.php?mh_id="+hompy.mh_id,unique:true,onComplete:function(){hompy.initCoverAreaHeight();init_Event_SoleElementSwitch("MH_Notebook_subArea");hompy.initScrollArea("MainSub_BodyArea");}});}}}function _onCheck(){var _18a=FCKeditorAPI.GetInstance("content");var _18b=_18a.GetHTML().stripTags().gsub(/&nbsp;/,"").length;if(_18b==0){alert(message.EmptyContent);return false;}$("MH_LoadingBlock").show();return true;}util.submitForm($("posting_coverstory"),{"onCheck":_onCheck,"onComplete":_onComplete});},modifyCoverIntro:function(_18c,_18d,_18e,_18f){mh_id=this.mh_id;if(_18d==""||_18d==null){alert("no postid!");return false;}if(Cytw.env.login_id==""||Cytw.env.login_id!=mh_id){alert("no login!");return false;}if(_18e==null){_18e=0;}if(_18f==null){_18f=0;}var _190="";switch(_18c){case "coverstoryDelete":if(!confirm(Cytw.message.ConfirmDelete)){return false;}_190="/ps2/ps_profile2_delete.php";break;case "personalinfoDelete":if(!confirm(Cytw.message.ConfirmDelete)){return false;}_190="/ps2/ps_profile_history_delete.php";break;case "defaultCover":_190="/ps2/ps_profile2_default_cover.php";break;case "scrap":if(!confirm(Cytw.message.Set2CoverStory)){return false;}_190="/ps2/ps_profile2_default_cover.php";break;}var parm=Object.toQueryString({mh_id:mh_id,postid:_18d,menuid:_18e,folderid:_18f,action:_18c});new Ajax.Request(_190,{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){var json=html.responseText.evalJSON(true);eval(json);if(result=="ok"){switch(_18c){case "coverstoryDelete":mhp.updateNode(("MH_Notebook_mainArea"),{xmlUrl:"/ps2/ps_profile2_view.php?mh_id="+hompy.mh_id,unique:true,onComplete:hompy.showProfilePaging});break;case "personalinfoDelete":mhp.updateNode(("MH_Notebook_mainArea"),{xmlUrl:"/ps2/ps_profile_history_list.php?mh_id="+hompy.mh_id,unique:true,onComplete:hompy.showProfilePaging});break;}}}});},changeBookmarkViewFolder:function(_194){mhp.updateNode(("MH_Notebook_mainArea"),{xmlUrl:"/ps2/ps_bookmark_view_all.php?mh_id="+hompy.mh_id+"&menuid=2&folderid="+_194,unique:true,onComplete:hompy.showProfilePaging});},pressEditBookmark:function(_195,_196){for(i=0;i<$("folderid_"+_196).length;i++){if($("folderid_"+_196).options[i].value==_195){$("folderid_"+_196).options[i].selected=true;}}$("list_"+_196).addClassName("MyFavorite_SetSpace EidtMode");},addBookmarkFolder:function(_197,_198){if(_197==""||_197==null){alert(Cytw.message.NoCateogoryName);}else{var parm=Object.toQueryString({action_name:"add_folder",mh_id:this.mh_id,folder_name:_197,no_of_folder:_198});new Ajax.Request("/ps2/ajax_bookmark.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){var json=html.responseText.evalJSON(true);if(json["status"]){var _19c="<option value=\""+json["folderid"]+"\">"+_197+"</option>";var _19d=document.getElementsByTagName("select");for(var i=0;i<_19d.length;i++){var node=_19d[i];if(node.getAttribute("_type")=="favoriteFolder"){newObj=document.createElement("option");newObj.value=json["folderid"];newObj.text=_197;try{node.add(newObj,null);}catch(ex){node.add(newObj);}}}var node=$("FolderListArea").cleanWhitespace();var _1a0=node.lastChild;if(!_1a0.getAttribute("id")){_1a0=$(node.lastChild).previous(0);}hompy.putD(_1a0.getAttribute("id"));var _1a1=parseInt(_1a0.id.split("_")[1])+1;var _1a2="_"+_1a1;var _1a3=_1a0.cloneNode(true);_1a3.id=_1a0.id.replace(/_\d+/g,_1a2);_1a3.innerHTML=_1a3.innerHTML.replace(/_\d+/g,_1a2);_1a3.innerHTML=_1a3.innerHTML.replace(/value\,\d\)/g,"value,"+_1a1+")");_1a3.getElementsByTagName("em")[0].innerHTML=_197;$("FolderListArea").appendChild(_1a3);$("EditFName"+_1a2).value=_197;$("EditFID"+_1a2).value=json["folderid"];$("EditFEditBtn"+_1a2).firstChild.nextSibling.onclick=function(){Cytw.hompy.deleteBookmarkFolder($("EditFID"+_1a2).value,_1a1);};$("EditFOKBtn"+_1a2).firstChild.onclick=function(){Cytw.hompy.modifyBookmarkFolder($("EditFID"+_1a2).value,$("EditFName"+_1a2).value,_1a1);};}else{if(json["msg"]){alert(json["msg"]);}}}});}},modifyBookmarkFolder:function(_1a4,_1a5,pos){if(_1a5==""||_1a5==null){alert(Cytw.message.NoCateogoryName);}else{var parm=Object.toQueryString({action_name:"modify_folder",mh_id:this.mh_id,folder_name:_1a5,folder_id:_1a4});new Ajax.Request("/ps2/ajax_bookmark.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){var _1a9=document.getElementsByTagName("select");for(var i=0;i<_1a9.length;i++){var node=_1a9[i];if(node.getAttribute("_type")=="favoriteFolder"){for(var j=0;j<node.length;j++){if(node.options[j].value==_1a4){node.options[j].text=_1a5;}}}}for(var j=1;j<=5;j++){try{if($("hidden_folderid_"+j).value==_1a4){$("folder_name_"+j).innerHTML=_1a5;}}catch(ex){}}$("EditFEntry_"+pos).getElementsByTagName("em")[0].innerHTML=_1a5;$("EditFName_"+pos).value=_1a5;Cytw.util.switch_class("EditFEntry_"+pos,"Folder EditMode","Folder");$("EditFOKBtn_"+pos).style.display="none";}});}},deleteBookmarkFolder:function(_1ad,pos){var node=$("FolderListArea").cleanWhitespace();if(node.childNodes.length<=1){alert("\u6700\u5c11\u8981\u7559\u4e0b\u4e00\u500b\u8cc7\u6599\u593e\u554a~");return false;}if(!confirm("\u8a72\u8cc7\u6599\u593e\u6240\u6709\u7684\u5167\u5bb9\u90fd\u6703\u88ab\u522a\u9664\uff0c\u60a8\u78ba\u5b9a\u8981\u522a\u9664\u55ce\uff1f")){return false;}var parm=Object.toQueryString({action_name:"delete_folder",mh_id:this.mh_id,folder_id:_1ad});new Ajax.Request("/ps2/ajax_bookmark.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){var json=html.responseText.evalJSON(true);if(json["status"]){$("EditFEntry_"+pos).remove();var _1b3=document.getElementsByTagName("select");for(var i=0;i<_1b3.length;i++){var node=_1b3[i];if(node.getAttribute("_type")=="favoriteFolder"){for(var j=0;j<node.length;j++){if(node.options[j].value==_1ad){node.remove(j);}}}}$("MH_Favorite").setAttribute("_refresh",1);}else{if(json["msg"]){alert(json["msg"]);}}}});},modifyBookmark:function(_1b7,_1b8,_1b9,_1ba,url,_1bc,_1bd){_1b9=_1b9.replace(/^\s+|\s+$/g,"");url=url.replace(/^\s+|\s+$/g,"");_1ba=_1ba.replace(/^\s+|\s+$/g,"");if(_1b9==""||url=="http://"){alert("\u8acb\u8f38\u5165\u7db2\u5740\u548c\u540d\u7a31");return false;}if(_1b7==""||_1b7==null){alert("no postid!");return false;}var parm=Object.toQueryString({action_name:"modify_bookmark",mh_id:this.mh_id,postid:_1b7,folderid:_1b8,title:_1b9,content:_1ba,url:url});new Ajax.Request("/ps2/ajax_bookmark.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){$("title_name_"+_1bc).innerHTML=_1b9;$("url_name_"+_1bc).innerHTML=url;$("content_name_"+_1bc).innerHTML=_1ba.replace(/([^>])\n/g,"$1<br />\n");$("folder_name_"+_1bc).innerHTML=_1bd;$("hidden_folderid_"+_1bc).value=_1b8;$("list_"+_1bc).removeClassName("MyFavorite_SetSpace EidtMode");}});},addBookmark:function(_1c0,_1c1,_1c2,url){_1c1=_1c1.replace(/^\s+|\s+$/g,"");url=url.replace(/^\s+|\s+$/g,"");if(_1c1==""||url=="http://"){alert("\u8acb\u8f38\u5165\u7db2\u5740\u548c\u540d\u7a31");return false;}var parm=Object.toQueryString({action_name:"add_bookmark",mh_id:this.mh_id,folder_id:_1c0,title:_1c1,content:_1c2,url:url});new Ajax.Request("/ps2/ajax_bookmark.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){hompy.changeBookmarkViewFolder();}});},goBookmark:function(_1c6,_1c7,_1c8,_1c9){var parm=Object.toQueryString({cyid:_1c7,cyfid:_1c8,postid:_1c9,redirect_url:_1c6});var _1cb="/ps2/ps_bookmark_click.php?\t"+parm;window.open(_1cb,"_blank");},delBookmark:function(){if(confirm(Cytw.message.ConfirmDelete)){mh_id=this.mh_id;var _1cc=document.getElementsByName("delCheckBox");var str="";for(i=0;i<_1cc.length;i++){if(_1cc[i].checked){if(str==""){str=_1cc[i].value;}else{str+=","+_1cc[i].value;}}}var parm=Object.toQueryString({action_name:"del_bookmark",mh_id:mh_id,postid_list:str});new Ajax.Request("/ps2/ajax_bookmark.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){mhp.updateNode(("MH_Notebook_mainArea"),{xmlUrl:"/ps2/ps_bookmark_view_all.php?mh_id="+mh_id+"&menuid=2",unique:true,onComplete:hompy.showProfilePaging});}});}},showProfilePaging:function(obj){if(obj.XMLobj&&obj.XMLobj.documentElement){hompy.putD("4");var XML=obj.XMLobj.documentElement;var _1d2=XML.getElementsByTagName("PAGING")[0].firstChild.nodeValue.evalJSON(true);var _1d3=" ";_1d3=XML.getElementsByTagName("CATEGORY")[0].firstChild.nodeValue;}else{if($("node_extra_info")){var _1d2=$("node_paging").innerHTML.evalJSON(true);var _1d3=" ";_1d3=$("node_category").innerHTML;}}if(eval(_1d2["block_from"])>1){$("Page_first").innerHTML="<a onfocus=\"blur();\" href=\"javascript:Cytw.hompy.changeProfilePage("+_1d2["first"]+",'"+_1d3+"')\" class=\"Btn_First\">\u7b2c"+_1d2["first"]+"\u9801</a>";}else{$("Page_first").innerHTML="";}if(eval(_1d2["block_to"])<eval(_1d2["last"])){$("Page_last").innerHTML="<a onfocus=\"blur();\" href=\"javascript:Cytw.hompy.changeProfilePage("+_1d2["last"]+",'"+_1d3+"')\" class=\"Btn_Last\">\u7b2c"+_1d2["last"]+"\u9801</a>";}else{$("Page_last").innerHTML="";}if(eval(_1d2["blockno"])>1){$("Page_prev").innerHTML="<a onfocus=\"blur();\" titie=\"\u4e0a\u4e94\u9801\" href=\"javascript:Cytw.hompy.changeProfilePage("+_1d2["prevn"]+",'"+_1d3+"')\" class=\"Btn_Pre_More\">\u4e0a\u4e94\u9801</a>";}if(eval(_1d2["pageno"])>1){$("Page_prev").innerHTML+="<a onfocus=\"blur();\" titie=\"\u4e0a\u4e00\u9801\" href=\"javascript:Cytw.hompy.changeProfilePage("+_1d2["prev1"]+",'"+_1d3+"')\" class=\"Btn_Pre\">\u4e0a\u4e00\u9801</a>";}else{$("Page_prev").innerHTML="";}if(eval(_1d2["pageno"])<eval(_1d2["last"])){$("Page_next").innerHTML="<a onfocus=\"blur();\" titie=\"\u4e0b\u4e00\u9801\" href=\"javascript:Cytw.hompy.changeProfilePage("+_1d2["next1"]+",'"+_1d3+"')\" class=\"Btn_Next\">\u4e0b\u4e00\u9801</a>";}if(eval(_1d2["blockno"])<eval(_1d2["blocknum"])){$("Page_next").innerHTML+="<a onfocus=\"blur();\" titie=\"\u4e0b\u4e94\u9801\" href=\"javascript:Cytw.hompy.changeProfilePage("+_1d2["nextn"]+",'"+_1d3+"')\" class=\"Btn_Next_More\">\u4e0b\u4e94\u9801</a>";}else{$("Page_next").innerHTML="";}var tmp="";if(eval(_1d2["block_from"])!=eval(_1d2["block_to"])){var _1d5=eval(_1d2["block_to"]);var _1d6=eval(_1d2["pageno"]);for(var i=eval(_1d2["block_from"]);i<=_1d5;i++){if(_1d6==i){tmp+="<a onfocus=\"blur();\" href=\"javascript:Cytw.hompy.changeProfilePage("+i+",'"+_1d3+"')\" class=\"Selected\">"+i+"</a>";}else{tmp+="<a onfocus=\"blur();\" href=\"javascript:Cytw.hompy.changeProfilePage("+i+",'"+_1d3+"')\">"+i+"</a>";}}}$("Page_paging").innerHTML=tmp;},changeProfilePage:function(_1d8,_1d9){mh_id=this.mh_id;switch(_1d9){case "coverstory":mhp.updateNode(("MH_Notebook_mainArea"),{xmlUrl:"/ps2/ps_profile2_view.php?mh_id="+mh_id+"&startpos="+_1d8,unique:true,onComplete:hompy.showProfilePaging});break;case "personalinfo":mhp.updateNode(("MH_Notebook_mainArea"),{xmlUrl:"/ps2/ps_profile_history_list.php?mh_id="+mh_id+"&startpos="+_1d8,unique:true,onComplete:hompy.showProfilePaging});break;default:var _1da="";if($("selectChangeFolder").value){_1da="&folderid="+$("selectChangeFolder").value;}mhp.updateNode(("MH_Notebook_mainArea"),{xmlUrl:"/ps2/ps_bookmark_view_all.php?mh_id="+mh_id+"&menuid=2&startpos="+_1d8+_1da,unique:true,onComplete:hompy.showProfilePaging});break;}},modifyProfileOpenType:function(_1db,_1dc,_1dd,_1de){if(_1de==null){_1de="";}mh_id=this.mh_id;var parm=Object.toQueryString({fieldid:_1db,mh_id:mh_id,inputtype:_1dd,value:_1dc});new Ajax.Request("/ps2/ajax_profile_modify.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){if(_1de!=""){if(_1dd=="selectopentype"){if(_1dc==2){$(_1de+"_em").addClassName("Hidden");}else{$(_1de+"_em").removeClassName("Hidden");}}else{if(_1dd=="anniopentype"){if(_1dc==2){$(_1de).addClassName("Hidden");}else{$(_1de).removeClassName("Hidden");}}}}}});},modifyBirthday:function(_1e1,_1e2,day,_1e4,_1e5,_1e6){_1e2=("00"+_1e2).substr(("00"+_1e2).length-2);day=("00"+day).substr(("00"+day).length-2);value=_1e2+day;$("BIRTH_MONTH").innerHTML=_1e2;$("BIRTH_DAY").innerHTML=day;this.changeConstellationByDate(_1e2,day);value+="|"+$("CONSTELLATION_TYPE_INPUT").value;Cytw.hompy.modifyProfile(_1e1,value,_1e4,_1e5,_1e6);},modifyMinihpDomain:function(_1e7,_1e8,_1e9,_1ea,_1eb){if(_1ea==null){_1ea="";}if(_1eb==null){_1eb="";}mh_id=this.mh_id;var _1ec=/^\w*$/;if(_1ec.test(_1e8)){var parm=Object.toQueryString({mh_id:mh_id,value:_1e8});new Ajax.Request("/ps2/ajax_profile_checkDomain.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){var _1ef=html.responseText.evalJSON(true);if(_1ef!="OK"){alert(_1ef);return false;}Cytw.hompy.modifyProfile(_1e7,_1e8,_1e9,_1ea,_1eb);}});}else{alert("\u4e0d\u597d\u610f\u601d,\u8acb\u8f38\u51651~12\u500b\u82f1\u6587\u5b57\u6bcd\u6216\u6578\u5b57");}},modifyProfile:function(_1f0,_1f1,_1f2,_1f3,_1f4){if(_1f3==null){_1f3="";}if(_1f4==null){_1f4="";}mh_id=this.mh_id;if(_1f3!=""){$(_1f3).addClassName("Saving");}var parm=Object.toQueryString({fieldid:_1f0,mh_id:mh_id,inputtype:_1f2,value:_1f1});new Ajax.Request("/ps2/ajax_profile_modify.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){if(_1f2!="selectClubDisplay"){switch(_1f2){case "input":$(_1f0+"_VALUE").style.color="";$(_1f0+"_VALUE").innerHTML=_1f1;break;case "select":$(_1f0+"_VALUE").style.color="";$(_1f0+"_VALUE").innerHTML=$(_1f0+"_SELECT").options($(_1f0+"_SELECT").selectedIndex).text;break;case "taginput":eval(html.responseText);$(_1f0).style.color="";myKeywordList=obj_result["myKeywords"];myTagList=obj_result["myTags"];myTagDisplay_YN=obj_result["myTagDisplay"];if(myTagList!=""){if(myKeywordList!=""){$(_1f0).innerHTML=myTagList+", "+myKeywordList;}else{$(_1f0).innerHTML=myTagList;}}else{if(myKeywordList!=""){$(_1f0).innerHTML=myKeywordList;}else{$("tagdisplay_all").style.color="#999";$(_1f0).innerHTML="\u9ede\u9078Edit\u7de8\u8f2f\u5c6c\u65bc\u4f60\u7684\u500b\u4eba\u95dc\u9375\u5b57\u5427~";}}if(myKeywordList!=""){if(myTagDisplay_YN=="Y"&&myTagList!=""){$("taglist_leftsub").innerHTML=myTagList+", "+myKeywordList;}else{$("taglist_leftsub").innerHTML=myKeywordList;}}else{if(myTagDisplay_YN=="Y"&&myTagList!=""){$("taglist_leftsub").innerHTML=myTagList;}else{$("taglist_leftsub").innerHTML="<b style=\"display:block;width:100%;padding-top:30px;text-align:center;color:#999;\">\u6c92\u6709\u95dc\u9375\u5b57</b>";}}$("tagedit").style.display="none";$("taglist").style.display="block";break;}if(_1f3!=""){$(_1f3).removeClassName("Saving");}if(_1f4!=""){$(_1f4).removeClassName("Edit");}}}});},modifyRealName:function(_1f7,_1f8){if(_1f7==null){_1f7="";}if(_1f8==null){_1f8="";}mh_id=this.mh_id;var _1f9=Cytw.util.trim($("FIRST_NAME").value);var _1fa=Cytw.util.trim($("LAST_NAME").value);var _1fb=$("REALNAME_PASS").value;var _1fc=Cytw.util.trim($("FIRST_NAME_OLD").value);var _1fd=Cytw.util.trim($("LAST_NAME_OLD").value);if((_1f9==_1fc)&&(_1fa==_1fd)){alert("\u4e0d\u597d\u610f\u601d,\u8acb\u8f38\u5165\u60a8\u8981\u8b8a\u66f4\u7684\u65b0\u540d\u5b57.");return false;}if((_1fa.length<1)||_1fa.length>2||/\w/.test(_1fa)){alert("\u8acb\u586b\u5beb1-2\u500b\u4e2d\u6587\u5b57\u4f5c\u70ba\u59d3\u6c0f\uff0c\u4e26\u78ba\u8a8d\u60a8\u586b\u5beb\u7684\u5167\u5bb9\u662f\u5426\u6b63\u78ba.");$("LAST_NAME").focus();return false;}if(Cytw.util.checkNonChineseChar(_1fa)){alert("\u8acb\u586b\u5beb1-2\u500b\u5b57\u7684\u4e2d\u6587\u59d3.");$("LAST_NAME").focus();return false;}if((_1f9.length<1)||_1f9.length>4||/\w/.test(_1f9)){alert("\u8acb\u586b\u5beb1-4\u500b\u4e2d\u6587\u5b57\u4f5c\u70ba\u540d\u5b57\uff0c\u4e26\u78ba\u8a8d\u60a8\u586b\u5beb\u7684\u5167\u5bb9\u662f\u5426\u6b63\u78ba.");$("FIRST_NAME").focus();return false;}if(Cytw.util.checkNonChineseChar(_1f9)){alert("\u8acb\u586b\u5beb1-4\u500b\u5b57\u7684\u4e2d\u6587\u540d.");$("FIRST_NAME").focus();return false;}if(_1fb==""){alert("\u8acb\u8f38\u5165\u5bc6\u78bc.");$("REALNAME_PASS").focus();return false;}var parm=Object.toQueryString({mh_id:mh_id,value:_1fb});new Ajax.Request("/ps2/ajax_profile_checkPwd.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){var _200=html.responseText.evalJSON(true);if(!_200){alert("\u60a8\u8f38\u5165\u7684\u5bc6\u78bc\u4e0d\u6b63\u78ba\u55b2!");return false;}var _201=confirm("\u60a8\u78ba\u5b9a\u8981\u5c07\u59d3\u540d\u4fee\u6539\u70ba "+_1fa+_1f9+" \u55ce\uff1f\nCyworld\u63d0\u9192\u60a8\uff1a\n\u78ba\u8a8d\u4fee\u6539\u5f8c\u5c31\u4e0d\u80fd\u518d\u900f\u904e\u7cfb\u7d71\u4fee\u6b63\u560d^_^");if(_201!=true){$(_1f8).removeClassName("Edit");return false;}$(_1f7).addClassName("Saving");var parm=Object.toQueryString({fieldid:"realname",mh_id:mh_id,first_name:_1f9,last_name:_1fa});new Ajax.Request("/ps2/ajax_profile_changeNames.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){$("REALNAME_VALUE").style.color="";$("REALNAME_VALUE").innerHTML=_1fa+_1f9;var _204=$(_1f7).firstChild.firstChild.nextSibling.lastChild;_204.parentNode.removeChild(_204);$(_1f7).removeClassName("Saving");$(_1f8).removeClassName("Edit");}});}});},modifyUsername:function(_205,_206){if(_205==null){_205="";}if(_206==null){_206="";}mh_id=this.mh_id;var _207=Cytw.util.trim($("USER_NAME").value);var _208=$("USER_NAME_PASS").value;var _209=Cytw.util.trim($("USER_NAME_OLD").value);if(_207==_209){alert("\u4e0d\u597d\u610f\u601d,\u8acb\u8f38\u5165\u60a8\u8981\u8b8a\u66f4\u7684\u65b0\u66b1\u7a31.");return false;}if((_207.length<2)||_207.length>4||/\w/.test(_207)){alert("\u8acb\u586b\u5beb2-4\u500b\u4e2d\u6587\u5b57\u4f5c\u70ba\u66b1\u7a31\uff0c\u4e26\u78ba\u8a8d\u60a8\u586b\u5beb\u7684\u5167\u5bb9\u662f\u5426\u6b63\u78ba.");$("USER_NAME").focus();return false;}if(_208==""){alert("\u8acb\u8f38\u5165\u5bc6\u78bc.");$("REALNAME_PASS").focus();return false;}var parm=Object.toQueryString({mh_id:mh_id,value:_208});new Ajax.Request("/ps2/ajax_profile_checkPwd.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){var _20c=html.responseText.evalJSON(true);if(!_20c){alert("\u60a8\u8f38\u5165\u7684\u5bc6\u78bc\u4e0d\u6b63\u78ba\u55b2!");return false;}var _20d=confirm("\u60a8\u78ba\u5b9a\u8981\u5c07\u66b1\u7a31\u4fee\u6539\u70ba "+_207+" \u55ce\uff1f\nCyworld\u63d0\u9192\u60a8\uff1a\n\u78ba\u8a8d\u4fee\u6539\u5f8c\u5c31\u4e0d\u80fd\u518d\u900f\u904e\u7cfb\u7d71\u4fee\u6b63\u560d^_^");if(_20d!=true){$(_206).removeClassName("Edit");return false;}$(_205).addClassName("Saving");var parm=Object.toQueryString({fieldid:"username",mh_id:mh_id,user_name:_207});new Ajax.Request("/ps2/ajax_profile_changeNames.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){$("USER_NAME_VALUE").innerHTML=_207;var _210=$(_205).firstChild.firstChild.nextSibling.lastChild;_210.parentNode.removeChild(_210);$(_205).removeClassName("Saving");$(_206).removeClassName("Edit");}});}});},changeConstellationByDate:function(_211,day,_213){var _214="";var _215=0;var _216=parseInt(_211+day,10);var _217=new Array();_217[1]="\u6c34\u74f6\u5ea7";_217[2]="\u96d9\u9b5a\u5ea7";_217[3]="\u767d\u7f8a\u5ea7";_217[4]="\u91d1\u725b\u5ea7";_217[5]="\u96d9\u5b50\u5ea7";_217[6]="\u5de8\u87f9\u5ea7";_217[7]="\u7345\u5b50\u5ea7";_217[8]="\u8655\u5973\u5ea7";_217[9]="\u5929\u79e4\u5ea7";_217[10]="\u5929\u880d\u5ea7";_217[11]="\u5c04\u624b\u5ea7";_217[12]="\u9b54\u7faf\u5ea7";if(_216!=0){if(_216>=120&_216<=218){_215=1;}else{if(_216>=219&_216<=320){_215=2;}else{if(_216>=321&_216<=419){_215=3;}else{if(_216>=420&_216<=520){_215=4;}else{if(_216>=521&_216<=621){_215=5;}else{if(_216>=622&_216<=722){_215=6;}else{if(_216>=723&_216<=822){_215=7;}else{if(_216>=823&_216<=923){_215=8;}else{if(_216>=924&_216<=1022){_215=9;}else{if(_216>=1023&_216<=1122){_215=10;}else{if(_216>=1123&_216<=1224){_215=11;}else{_215=12;}}}}}}}}}}}_214=_217[_215];}else{_214=_217[_213];_215=_213;}$("CONSTELLATION_TYPE_VALUE").innerHTML=_214;$("CONSTELLATION_TYPE_INPUT").value=_215;},showSchoolList:function(_218,type,_21a,_21b){var _21c="";if(_218=="UNIVERSITY_INPUT"){_21c="\u5165\u5b78\u5e74\u5ea6";}else{_21c="\u7562\u696d\u5e74\u5ea6";}var _21d=" <option value=\"0\">"+_21c+"</option>";var _21e=1911;var end=new Date().getFullYear();for(var i=_21e;i<=end;i++){_21d+=" <option value=\""+i+"\"";if(i==_21b){_21d+=" selected=\"selected\"";}_21d+=" >"+i+"</option>";}objYear=$(_21a).cleanWhitespace().childElements()[0];var a=Cytw.util.replaceSelectOption(objYear,_21d);parm=Object.toQueryString({school_type:type});new Ajax.Request("/ps2/ps_profile_schoolList.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){var json=(html.responseText.evalJSON(true));var _224=json;var obj=actb(document.getElementById(_218),_224);}});},modifySchool:function(_226,name,_228,_229){if(_228==null){_228="";}if(_229==null){_229="";}mh_id=this.mh_id;if($(_226+"_OLDID").value=="0"){$(_226+"_OLDID").value="";}if($(_226+"_INPUT").value==""&&$(_226+"_OLDID").value==""){alert("\u8acb\u8f38\u5165\u5b78\u6821\u540d\u7a31.");return false;}$(_228).addClassName("Saving");value=$(_226+"_INPUT").value;value+="|"+$(_226+"_YEAR").value;value+="|"+$(_226+"_OLDID").value;value+="|"+$(_226+"_OLDYEAR").value;var parm=Object.toQueryString({fieldid:_226,mh_id:mh_id,value:value});new Ajax.Request("/ps2/ajax_profile_modify.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){var _22c=html.responseText.evalJSON(true);if(_22c==0){$(_226+"_VALUE").style.color="#990";$(_226+"_VALUE").innerHTML="\u8acb\u8f38\u5165"+name;}else{$(_226+"_VALUE").style.color="";$(_226+"_VALUE").innerHTML=$(_226+"_INPUT").value+"&#160;("+$(_226+"_YEAR").value+")";}$(_226+"_OLDID").value=_22c;$(_226+"_OLDYEAR").value=$(_226+"_YEAR").value;$(_228).removeClassName("Saving");$(_229).removeClassName("Edit");}});},delAnniversary:function(_22d){mh_id=this.mh_id;var parm=Object.toQueryString({fieldid:"delAnniversary",mh_id:mh_id,value:_22d});new Ajax.Request("/ps2/ajax_profile_modify.php",{method:"post",postBody:parm,onCreate:function(){$("AnniversaryList_"+_22d).remove();},onComplete:function(html){mhp.updateNode(("MH_Notebook_mainArea"),{xmlUrl:"/ps2/ps_profile_Mview.php?mh_id="+mh_id,unique:true,onComplete:function(){ProfileScroll.scrollTop=1000;}});}});},addAnniversary:function(_230,name,_232,day){mh_id=this.mh_id;_232=("00"+_232).substr(("00"+_232).length-2);day=("00"+day).substr(("00"+day).length-2);var parm=Object.toQueryString({fieldid:"addAnniversary",mh_id:mh_id,value:_230,anniname:name,annidate:_232+day});new Ajax.Request("/ps2/ajax_profile_modify.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){mhp.updateNode(("MH_Notebook_mainArea"),{xmlUrl:"/ps2/ps_profile_Mview.php?mh_id="+mh_id,unique:true,onComplete:function(){ProfileScroll.scrollTop=1000;}});}});},modifyEmail:function(_236,_237){if(_236==null){_236="";}if(_237==null){_237="";}mh_id=this.mh_id;var _238=$("OLDEMAIL").value;var _239=$("EMAIL_INPUT").value;var _23a=$("REEMAIL").value;if(_239==""){alert("\u8acb\u6b63\u78ba\u8f38\u5165\u60a8\u7684\u90f5\u4ef6\u5730\u5740.");$("EMAIL_INPUT").focus();return false;}if(_239==_238){alert("\u60a8\u4e0d\u80fd\u7528\u540c\u6a23\u7684\u5730\u5740\u4f86\u66f4\u6539\u90f5\u4ef6\u5730\u5740.\n\u8acb\u8f38\u5165\u65b0\u7684\u90f5\u4ef6\u5730\u5740");$("EMAIL_INPUT").focus();return false;}if(_239.search(/^[\w\~\-]+(\.[\w\~\-]+)*@[\w\~\-]+(\.[\w\~\-]+)+$/)<0){alert("\u8acb\u6b63\u78ba\u8f38\u5165\u60a8\u7684\u90f5\u4ef6\u5730\u5740.");$("EMAIL_INPUT").focus();return false;}if(_239!=_23a){alert("\u91cd\u8907\u78ba\u8a8d\u60a8\u7684\u90f5\u4ef6\u5730\u5740.");$("REEMAIL").focus();return false;}var parm=Object.toQueryString({mh_id:mh_id,value:_239});new Ajax.Request("/ps2/ajax_email_modify.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){eval(html.responseText);switch(res.status){case "nologin":alert("\u53ea\u6709\u672c\u4eba\u624d\u80fd\u4fee\u6539!!");$("EMAIL_INPUT").focus();return false;break;case "emailused":alert("\u90f5\u4ef6\u5730\u5740\u5df2\u8a3b\u518a\u4f7f\u7528.");$("EMAIL_INPUT").focus();return false;break;case "ok":alert("\u8acb\u5230\u60a8\u7684\u65b0\u4fe1\u7bb1\u9032\u884c\u66f4\u6539\u78ba\u8a8d\u3002");if(_236!=""){$(_236).removeClassName("Saving");}if(_237!=""){$(_237).removeClassName("Edit");}break;default:alert("\u7cfb\u7d71\u932f\u8aa4, \u8acb\u7a0d\u5f8c\u518d\u8a66.");$("EMAIL_INPUT").focus();return false;break;}}});},modifyPassword:function(){mh_id=this.mh_id;var _23d=$("password").value;var _23e=$("newpassword").value;var _23f=$("renewpassword").value;if(_23d==""){alert("\u8acb\u8f38\u5165\u73fe\u5728\u7684\u5bc6\u78bc.");$("password").focus();return false;}if(_23e==""){alert("\u8acb\u8f38\u5165\u65b0\u5bc6\u78bc.");$("newpassword").focus();return false;}if(_23e.length<4||_23e.length>16){alert("\u5bc6\u78bc\u9577\u5ea6\u89814\uff0d16\u82f1\u6587\u6216\u6578\u5b57.");$("newpassword").focus();return false;}if(_23e!=_23f){alert("\u5bc6\u78bc\u4e0d\u7b26, \u8acb\u518d\u8f38\u5165\u65b0\u5bc6\u78bc.");$("renewpassword").focus();return false;}$("password_title").innerHTML="\u5132\u5b58\u4e2d...";var parm=Object.toQueryString({mh_id:mh_id,value:_23d});new Ajax.Request("/ps2/ajax_profile_checkPwd.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){var _242=html.responseText.evalJSON(true);if(!_242){alert("\u60a8\u8f38\u5165\u7684\u5bc6\u78bc\u4e0d\u6b63\u78ba\u55b2!");$("password").focus();return false;}Cytw.hompy.modifyProfile("password",_23e,"others");$("editPassword").style.display="none";$("password_title").innerHTML="\u4fee\u6539\u5bc6\u78bc";}});},modifyMSNHelper:function(_243,_244){mh_id=this.mh_id;if(_244==null){_244="";}if(_243=="msn"){var _245=$("msn_input").value;if(_245==""){alert("\u8acb\u8f38\u5165MSN\u5e33\u865f.");$("msn_input").focus();return false;}var parm=Object.toQueryString({mh_id:mh_id,value:_245,join_from:1});}else{var parm=Object.toQueryString({mh_id:mh_id,atc:_244});}new Ajax.Request("/ps2/ajax_msn_modify.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){eval(html.responseText);switch(res.status){case "nologin":alert("\u53ea\u6709\u672c\u4eba\u624d\u80fd\u4fee\u6539!!");$("msn_input").focus();return false;break;case "emailuseed":alert("\u9019\u500bMSN\u5e33\u865f\u5df2\u5728\u4f7f\u7528\u4e2d!!");$("msn_input").focus();return false;break;case "emailerror":alert("\u8f38\u5165\u7684MSN\u5e33\u865f\u6709\u8aa4!!");$("msn_input").focus();return false;break;case "botfull":alert("\u76ee\u524d\u7ba1\u5bb6\u670d\u52d9\u4eba\u6578\u5df1\u9054\u4e0a\u9650\uff0c\u8acb\u7a0d\u5f8c\u518d\u8a66.");$("msn_input").focus();return false;break;case "stopok":if(typeof (res.ac)!="undefined"){var ky=(res.ac>=3)?1:0;}break;case "ok":$("msn").innerHTML=res.msn_email;$("msnHelper").innerHTML=res.bot;if(typeof (res.ac)!="undefined"){var ky=(res.ac>=3)?1:0;document.getElementById("MSNNotify").options[ky].selected=true;}$("editMSN").style.display="none";$("infoMSN").style.display="block";break;default:alert("\u7cfb\u7d71\u932f\u8aa4, \u8acb\u7a0d\u5f8c\u518d\u8a66.");$("msn_input").focus();return false;break;}}});},delPost_list:function(){if(!confirm("\u78ba\u5b9a\u8981\u522a\u9664\u6240\u9078\u64c7\u7684\u5167\u5bb9?")){return;}var _249="";$$("#MH_Contents_Bin input[type=\"checkbox\"]").each(function(_24a){if(_24a.checked){_249+=_24a.getAttribute("_postid")+",";}});this.delPost(_249.substr(0,_249.length-1));},delPost:function(_24b){var parm=Object.toQueryString({action_name:"delpost",mh_id:this.mh_id,postid:_24b});new Ajax.Request("/ps2/ajax_post.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){var json=(html.responseText.evalJSON(true));if(json){hompy.folderChoose($("MH_Notebook_mainArea").getAttribute("_menuid"),$("MH_Notebook_mainArea").getAttribute("_folderid"),$("MH_Notebook_mainArea").getAttribute("_pageno"));}else{alert("delete failed!!");}}});},save_ContentListType:function(id,_250){var parm=Object.toQueryString({action_name:"set_content_list_type",mh_id:this.mh_id,menuid:$(id).getAttribute("_menuid"),folderid:$(id).getAttribute("_folderid"),content_list_type:_250});new Ajax.Request("/ps2/ajax_set_type.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){var json=(html.responseText.evalJSON(true));if(json){}else{alert("set failed!!");}}});},select_icon:function(obj){["BBS","Blog","PhotoOnly","PhotoWithText","Blog"].each(function(s){$$("#DisplaySetting_Ul li."+s).each(function(x){x.down("a").className="";});});obj.className="Selected";},mk_list:function(obj){init_Event_SoleElementSwitch("MH_InfoBar_main");},switch_logon:function(){var parm=Object.toQueryString({mh_id:this.mh_id});new Ajax.Request("/ps2/ajax_set_login.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){var json=(html.responseText.evalJSON(true));if(json["result"]){$("MajiList_open").firstChild.firstChild.nextSibling.nextSibling.className=(json["isonline"]?"UnCheckBox":"CheckBox");}}});},get_visitor:function(obj){var _25c=obj.getAttribute("_pageid");var parm=Object.toQueryString({pageid:_25c});new Ajax.Request("/ps2/ajax_visitor.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){var json=(html.responseText.evalJSON(true));var str="";if(json["pageid"]){if(json["data"].length>0){var _261=new Template("<li><a href=\"#\" onclick=\"javascript:Cytw.util.open_minihompy("+"'#{CYID}','this.mh_id');return false;"+"\">#{FRIEND_NAME}</a></li>");json["data"].each(function(obj){str+=_261.evaluate(obj);});if(str!=""){str+="<li class=\"LastOne\"><a href=\"#\" _pageid=\""+json["pageid"]+"\" onclick=\"javascript:Cytw.hompy.get_visitor(this);return false;\">\u66f4\u591a</a></li>";}$("VisitorArea_list").innerHTML=str;}}}});},go_random:function(){var parm=Object.toQueryString({mh_id:this.mh_id});new Ajax.Request("/ps2/ajax_random.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){var json=(html.responseText.evalJSON(true));if(json){Cytw.util.open_minihompy(json,Cytw.env.login_id);}}});},set_feel:function(_266){if(_266==null){_266=$("EmotionIcon_Option").getAttribute("_feelid");}_266=eval(_266);var _267=$("Emotion_string_input").value;var parm=Object.toQueryString({mh_id:this.mh_id,feeling_type:_266,feeling_comments:_267});new Ajax.Request("/ps2/ajax_feel.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){var json=(html.responseText.evalJSON(true));if(json["status"]){$("EmotionIcon_Option").setAttribute("_feelid",_266);$("EmotionIcon").className="EmotionIcon_"+_266;$("EmotionIcon").firstChild.innerHTML=$("EmotionIcon_Option").getElementsByClassName("EmotionIcon_"+_266)[0].innerHTML;$("Emotion_string").getElementsByTagName("b")[0].innerHTML=json["feel_commonts_short"]+"&nbsp;";}}});},friendnote_save:function(_26b){var _26b=Cytw.util.trim(_26b);if(_26b.length==0||_26b=="\u5225\u5fd8\u4e86\u7559\u4e0b\u4f60\u60f3\u5c0d\u9ebb\u5409\u8aaa\u7684\u5fc3\u5e95\u8a71\u5594~"){alert("\u8acb\u8f38\u5165\u6587\u5b57!!");return false;}var parm=Object.toQueryString({mh_id:this.mh_id,comment:_26b});new Ajax.Request("/ps2/ajax_friendnote_save.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){var json=(html.responseText.evalJSON(true));if(json["status"]){Cytw.hompy.get_friendnote();}else{if(json["msg"]){alert(json["msg"]);}}}});},get_friendnote:function(){var parm=Object.toQueryString({mh_id:this.mh_id});new Ajax.Request("/ps2/ajax_friendnote.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){var json=(html.responseText.evalJSON(true));var _272="";var _273=new Template("<li class=\"#{CLASS}\"><a href=\"#\" class=\"Text\">#{COMMENT}</a><span class=\"MajiSayInfo\">(<a href=\"#\" class=\"NameUI\" _mh_id=\"#{CYFID}\" _mh_name=\"#{FRIEND_NAME}\">#{FRIEND_NAME}</a><em>#{CREATE_DATE}</em>)</span><a class=\"Cancle\" href=\"#\" onclick=\"javascript:Cytw.hompy.friendnote_del(#{CYFID})\"><b>X</b></a></li>");json.each(function(obj){_272+=_273.evaluate(obj);});$("MajiSayArea_ListArea").innerHTML=_272;}});},friendnote_del:function(_275){var parm=Object.toQueryString({mh_id:this.mh_id,writer_cyid:_275});new Ajax.Request("/ps2/ajax_friendnote_del.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){var json=(html.responseText.evalJSON(true));if(json["status"]){Cytw.hompy.get_friendnote();}}});},title_set_color:function(_279){$("MH_titleName_input").style.color="#"+_279;},sync_title_color:function(){$("MH_titleName_input").value=$$("#MH_titleName span")[0].firstChild.nodeValue;$("MH_titleName_input").style.color=$("MH_titleName").style.color;},rgb2hexColor:function rgb2hexColor(_27a){var _27b=_27a.substr(_27a.indexOf("(")+1,_27a.indexOf(")")-4).split(",");iR=eval(_27b[0]);iG=eval(_27b[1]);iB=eval(_27b[2]);var hex=new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");var rgb=new Array();var k=0;for(var i=0;i<16;i++){for(var j=0;j<16;j++){rgb[k]=hex[i]+hex[j];k++;}}return ("#"+rgb[iR]+rgb[iG]+rgb[iB]);},save_title_color:function(){var _281=$("MH_titleName_input").style.color;if(Prototype.Browser.Gecko){_281=this.rgb2hexColor(_281);}_281=_281.substr(1,6);var _282=$("MH_titleName_input").value;var parm=Object.toQueryString({mh_id:this.mh_id,fontcolor:_281,title:_282});new Ajax.Request("/ps2/ajax_set_title.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){var json=(html.responseText.evalJSON(true));if(json["status"]){var node=$("MH_titleName");node.firstChild.innerHTML=_282;node.style.color="#"+_281;}else{alert(json["msg"]);}}});},copyShareFlash:function(){util.copy2Clip($("ShareFlashCode"));alert("\u5df2\u8907\u88fd\u5230\u526a\u8cbc\u7c3f");},checkPostPassword:function(obj){var _288=obj.getAttribute("_ipkey");var _289=obj.getAttribute("_postid");var pwd=$("pwd_"+_289).value;if(pwd=="******"){$("wmesg_"+_289).show();return false;}if(!_288.blank()&&!pwd.blank()){var url="ps_post_checkpasswd_proc.php";var pars="ipkey="+_288+"&pwd="+pwd+"&mh_id="+hompy.mh_id;new Ajax.Request(url,{method:"post",postBody:pars,onComplete:function(_28d){var xml=_28d.responseXML;if(xml){var _28f=xml.documentElement.getElementsByTagName("STATUS")[0].firstChild.nodeValue.evalJSON();if(_28f.ident){hompy.show_content(_289,null,null,_28f.ident);}else{$("wmesg_"+_289).show();}}}});}else{$("wmesg_"+_289).show();}},trimByLength:function(obj,max){if(obj.value.length>max){alert("\u5b57\u6578\u8d85\u904e\u4e0a\u9650");var str=obj.value.substring(0,max);if(obj.innerHTML!=""){obj.innerHTML=str;}else{obj.value=str;}return false;}},clearn_content:function(obj,_294){if(obj.value==_294){if(obj.innerHTML!=""){obj.innerHTML="";}else{obj.value="";}}},saveVisitor:function(obj,_296){var _297=0;if($("whisper_yn").checked){hompy.putD("set whisper");_297=1;hompySendEventCode(2507);}var _298=obj.getAttribute("_folderid");var _299=$("visitor_content").value;if(!_299.blank()){var url="ps_visitor_proc.php";var _29b=2;if(Cytw.env.login_id){if($("ImgSelectRadio_1").checked){var _29b=1;hompySendEventCode(2505);}else{var _29b=0;hompySendEventCode(2504);}}var parm=Object.toQueryString({mh_id:hompy.mh_id,type:1,phote_type:_29b,whisper_yn:_297,folderid:_298,content:_299});new Ajax.Request(url,{method:"post",postBody:parm,onComplete:function(_29d){var xml=_29d.responseXML;if(xml.documentElement.getElementsByTagName("return")[0].childNodes[0].nodeValue==2){alert("\u5c0d\u4e0d\u8d77,\u60a8\u8f38\u5165\u7684\u5167\u5bb9\u8207\u7db2\u7ad9\u8981\u6c42\u4e0d\u7b26");return false;}else{try{var _29f=xml.documentElement.getElementsByTagName("msg")[0];if(_29f&&_29f.nodeValue!=""){alert(xml.documentElement.getElementsByTagName("msg")[0].childNodes[0].nodeValue);}hompy.chg_menu_list(13);}catch(e){hompy.chg_menu_list(13);}}}});}else{alert(message.EmptyContent);}},saveGuestVisitor:function(obj){var _2a1=$("visitor_content").innerHTML;var _2a2=obj.getAttribute("_folderid");var _2a3=obj.getAttribute("_captcha_id");var _2a4=$("writer_name").value;var _2a5=$("writer_url").value;var _2a6=$("captcha_code").value;if(_2a4.blank()||(_2a4.length>4)){alert("\u6700\u591a\u53ef\u8f38\u51654\u500b\u4e2d\u6587\u5b57");return false;}else{if(_2a1.blank()){alert(message.EmptyContent);return false;}else{if(_2a6.blank()||(_2a6.length>4)){alert("\u8acb\u8f38\u5165\u5de6\u65b9\u56db\u4f4d\u9a57\u8b49\u78bc");return false;}}}if(!_2a1.blank()){var url="ps_visitor_proc.php";new Ajax.Request(url,{method:"post",postBody:"type=3&captcha="+_2a6+"&captcha_id="+_2a3+"&mh_id="+hompy.mh_id+"&folderid="+_2a2+"&content="+_2a1+"&writer_name="+_2a4+"&writer_url="+_2a5,onComplete:function(_2a8){var xml=_2a8.responseXML;if(xml.documentElement.getElementsByTagName("return")[0].childNodes[0].nodeValue==0){alert("\u9a57\u8b49\u78bc\u8f38\u5165\u932f\u8aa4");return false;}else{if(xml.documentElement.getElementsByTagName("return")[0].childNodes[0].nodeValue==2){alert("\u5c0d\u4e0d\u8d77,\u60a8\u8f38\u5165\u7684\u5167\u5bb9\u8207\u7db2\u7ad9\u8981\u6c42\u4e0d\u7b26");return false;}else{hompy.chg_menu_list(13);}}}});}},changeVisitorImg:function(x){if(x){$("coverimg").show();$("coverminime").hide();$("ImgSelectRadio_0").checked=0;$("ImgSelectRadio_1").checked=1;}else{$("coverminime").show();$("coverimg").hide();$("ImgSelectRadio_0").checked=1;$("ImgSelectRadio_1").checked=0;}},delVisitor:function(obj){if(confirm(Cytw.message.ConfirmDelete)){var _2ac=obj.getAttribute("_postid");var _2ad=obj.getAttribute("_folderid");var _2ae=obj.getAttribute("_writer_cyid");var url="ps_visitor_delete.php";var pars="folderid="+_2ad+"&postid="+_2ac+"&writer_cyid="+_2ae+"&mh_id="+hompy.mh_id;new Ajax.Request(url,{method:"post",postBody:pars,onComplete:function(_2b1){hompy.show_bbs_list(hompy.menuid,"",hompy.pageno);}});}},editVisitor:function(obj,type){var _2b4=obj.getAttribute("_postid");if(type){$("view_"+_2b4).hide();$("edit_view_"+_2b4).show();$("visitor_content_"+_2b4).value=$("view_"+_2b4).innerHTML.replace(/<br(\s)?>(\n)?/gi,"\n").stripTags();}else{$("view_"+_2b4).show();$("edit_view_"+_2b4).hide();}},modVisitor:function(obj){var _2b6=obj.getAttribute("_folderid");var _2b7=obj.getAttribute("_postid");var _2b8=$("visitor_content_"+_2b7).value;var _2b9="";if($("whisper_yn_"+_2b7)){var _2ba=0;if($("whisper_yn_"+_2b7).checked){_2ba=1;}var _2b9="&whisper_yn="+_2ba;}if(!_2b8.blank()){var url="ps_visitor_proc.php";var pars="type=2&folderid="+_2b6+"&content="+_2b8+"&mh_id="+hompy.mh_id+"&postid="+_2b7+_2b9;new Ajax.Request(url,{method:"post",postBody:pars,onComplete:function(_2bd){hompy.chg_menu_list(13);}});}else{alert(Cytw.message.EmptyContent);}},openMovePop:function(_2be,_2bf){if(_2be){var url="ps_movepost.php";var pars="type=1&menuid="+hompy.menuid+"&mh_id="+hompy.mh_id;new Ajax.Request(url,{method:"post",parameters:pars,onComplete:function(_2c2){var xml=_2c2.responseXML;if(xml){hompy.movePostFolderList=xml.documentElement.getElementsByTagName("MENU")[0].firstChild.nodeValue.evalJSON();var _2c4="";hompy.movePostFolderList.each(function(_2c5){_2c4+="<option value='"+_2c5.menuid+"' >"+_2c5.name+"</option>";});util.replaceSelectOption($("move_menu_list"),_2c4);hompy.changeMoveMenuSel();$("move_folder_list").setAttribute("_postid",_2be);$("move_folder_list").setAttribute("_folderid",_2bf);["move_pop","MH_POP"].each(Element.show);}}});}},changeMoveMenuSel:function(){if(hompy.movePostFolderList){var _2c6="";hompy.movePostFolderList[$("move_menu_list").selectedIndex].folder_list.each(function(s){_2c6+="<option value='"+s.id+"' >"+s.name+"</option>";});util.replaceSelectOption($("move_folder_list"),_2c6);}},closeMovePop:function(){["MH_POP","move_confirm_pop","move_pop"].each(Element.hide);},movePost:function(){if($("move_folder_list").getAttribute("_postid")){var url="ps_movepost.php";var pars="type=2&m_folderid="+$("move_folder_list").value+"&m_menuid="+$("move_menu_list").value+"&menuid="+hompy.menuid+"&postid="+$("move_folder_list").getAttribute("_postid")+"&folderid="+$("move_folder_list").getAttribute("_folderid")+"&mh_id="+hompy.mh_id;new Ajax.Request(url,{method:"post",parameters:pars,onComplete:function(_2ca){var xml=_2ca.responseXML;if(xml){var _2cc=xml.documentElement.getElementsByTagName("MOVESTATUS")[0].firstChild.nodeValue.evalJSON();if(_2cc.status){$("goMoevConfirm").setAttribute("_menuid",_2cc.target_menuid);$("goMoevConfirm").setAttribute("_folderid",_2cc.target_folderid);$("move_pop").hide();$("move_confirm_pop").show();}else{alert("\u79fb\u52d5\u5931\u6557");hompy.closeMovePop();}}}});}},goConfirm:function(){var _2cd=$("goMoevConfirm").getAttribute("_menuid");var _2ce=$("goMoevConfirm").getAttribute("_folderid");hompy.closeMovePop();if(hompy.menuid!=_2cd){hompy.init_menu(hompy.mh_id,{menuid:_2cd,folderid:_2ce,notReloadInfoBlock:1});}else{hompy.folderChoose(_2cd,_2ce);}},closeMoveConfirmPop:function(){hompy.folderChoose(hompy.menuid,hompy.folderid);hompy.closeMovePop();},movePost_list:function(){var _2cf="",_2d0="";$$("#MH_Contents_Bin input[type=\"checkbox\"]").each(function(_2d1){if(_2d1.checked){_2cf+=_2d1.getAttribute("_postid")+",";}if(_2d1.checked){_2d0+=_2d1.getAttribute("_folderid")+",";}});hompy.openMovePop(_2cf.substr(0,_2cf.length-1),_2d0.substr(0,_2d0.length-1));},Init_PostEdit_EmoticonSelect:function(){Event.observe($("emoticonid"),"change",function(){if(this.value>0){$("EmoticonPanel").removeClassName("Ignore");$("EmoticonPanel").style.backgroundImage="url(http://img.tw.cyworld.com/image/common/icon/ico_em_"+this.value+".gif)";}else{$("EmoticonPanel").addClassName("Ignore");$("EmoticonPanel").style.backgroundImage="";}});},setDefaultMiniroom:function(pid){if(pid){var url="ps_miniroom.php";var pars="pid="+pid+"&mh_id="+hompy.mh_id;new Ajax.Request(url,{method:"post",parameters:pars,onComplete:function(_2d5){var xml=_2d5.responseXML;if(xml){var ok=xml.documentElement.getElementsByTagName("STATUS")[0].firstChild.nodeValue;if(ok==1){alert("\u5df2\u5c07\u8ff7\u4f60\u7aa9\u9996\u9801\u7684mini-room\u63db\u6210\u60a8\u73fe\u5728\u9078\u64c7\u7684mini-room\u56c9 ^_^");}else{alert("\u8a2d\u5b9a\u5931\u6557");}}}});}},delMiniroom:function(pid){var parm=Object.toQueryString({action_name:"delpost",mh_id:this.mh_id,postid:pid});new Ajax.Request("/ps2/ajax_post.php",{method:"post",postBody:parm,onCreate:function(){},onComplete:function(html){var json=(html.responseText.evalJSON(true));if(json){hompy.show_bbs_list(hompy.menuid,"",hompy.pageno,"",hompy.folder_type);}else{alert("delete failed!!");}}});},checkAllList:function(){var _2dc=$("MH_Contents_Bin").getElementsByTagName("input");for(var i=0;i<_2dc.length;i++){var node=_2dc[i];if(node.getAttribute("type")=="checkbox"){node.checked=true;}}},initAutoSave:function(){setTimeout(function(){hompy.autoSaveI=setInterval(hompy.autoSaveArticle,60000);},30000);},autoSaveArticle:function(){try{var _2df=FCKeditorAPI.GetInstance("content");var _2e0=_2df.GetHTML().stripTags().gsub(/&nbsp;/,"").length;if(!_2e0||_2e0==0){return false;}$("content").value=_2df.GetHTML();var parm=$("posting_article").serialize();_onComplete=function(){};var _2e2={url:"/ps2/ajax_post.php",onComplete:_onComplete};hompySetting._sendItemManageRequest(parm+"&action_name=draft",_2e2);}catch(e){}},clearInter:function(){try{clearInterval(hompy.autoSaveArticle);}catch(e){}},catchEventCodeFail:function(e,_2e4){var parm=Object.toQueryString({mh_id:hompy.mh_id,login_id:Cytw.env.login_id,event_code:_2e4,menuid:hompy.menuid,folderid:hompy.folderid,postid:hompy.postid,eName:e.name,eMessage:e.message});for(name in e){hompy.putD(name,e[name]);}_onComplete=function(){};var _2e6={url:"/ps2/logEventCodeFail.php",onComplete:_onComplete};hompySetting._sendItemManageRequest(parm,_2e6);},Hompy2Moving:function(){var _url="/ps2/moving/index.php";if(opener){opener.location.href=_url;opener.focus();}else{window.open(_url,"");}}};var hompy=Cytw.hompy;
