var initWordBreak=function(e){var d=$("word_link_"+e);var b=d.getElements("td");var c=$(e).getElements("div[id^="+e+"_word_page_]");d.setProperty("pageIndex","1");var a=b.length;b.each(function(g,f){if(f==0){g.addEvent("click",function(){var h=d.getProperty("pageIndex");if(h>1){h--}b[h].fireEvent("click")})}else{if(f==a-1){g.addEvent("click",function(){var h=d.getProperty("pageIndex");if(h<a-2){h++}b[h].fireEvent("click")})}else{g.addEvent("click",function(){var h=d.getProperty("pageIndex");c[h-1].setStyle("display","none");b[h].set("class","unselectWord");b[f].set("class","selectWord");c[f-1].setStyle("display","");d.setProperty("pageIndex",f);if(f==1){b[0].setStyle("display","none");b[a-1].setStyle("display","")}else{if(f==a-2){b[0].setStyle("display","");b[a-1].setStyle("display","none")}else{b[0].setStyle("display","");b[a-1].setStyle("display","")}}})}}})};var resetMarqueeElementSize=function(){var a=$(document.body).getElements("marquee[direction=right,left]");a.each(function(d){var c=d.getStyle("width").toInt();var b=d.getChildren();b.each(function(f){var e=f.getStyle("width");if(e.contains("%")){f.setStyle("width",e.toInt()/100*c)}else{if(e.toInt()>c){f.setStyle("width",c)}}})})};var setupRequestHTML=function(a,d,c){var b=new Request.HTML({url:a,onSuccess:function(e){$(d).set("text","");$(d).adopt(e);if(c){c.call()}}});return b};var PageQuery=new Class({initialize:function(d,b,a,c){this.request=d;this.options=b;this.lastPage=1;this.nowPage=1;this.toPage=1;if(a>=0){this.nowPage=a}if(c>=0){this.lastPage=c}},query:function(){},go2First:function(){if(this.nowPage>1){this.toPage=1;this.go()}},go2Prov:function(){if(this.nowPage>1){this.toPage=--this.nowPage;this.go()}},go2Next:function(){if(this.nowPage<this.lastPage){this.toPage=++this.nowPage;this.go()}},go2Last:function(){if(this.nowPage<this.lastPage){this.toPage=this.lastPage;this.go()}},go2page:function(a){if(isNaN(a)||a<1||a>this.lastPage){$("pageNum").value="";return}this.toPage=a;this.go()}});var handleTextLength=function(h,c,e){var g=$$("#"+h+" ."+c);var d=g.length;var b;var f;for(var a=0;a<d;a++){b=g[a];f=b.get("text");b.set("title",f);b.set("text",f.length>=e?f.substring(0,e)+"...":f)}};var handleContentLength=function(h,c,e){var g=$$("#"+h+" ."+c);var d=g.length;var b;var f;for(var a=0;a<d;a++){b=g[a];f=b.get("html");b.set("title",f);b.set("html",f.length>=e?f.substring(e):f)}};var array2select=function(b){var a=new Element("select",{"class":"zz_input01"});b.each(function(c){a.adopt(new Element("option",{text:c}))});return a};var isOpenShop=false;var isQueryOpenShop=false;var isOpenShopReq=new Request.JSON({url:"/business/shoppingcart!isOpen.do",noCache:true,onSuccess:function(a){if(a.result){isOpenShop=true;isQueryOpenShop=true}else{isOpenShop=false;isQueryOpenShop=true}}});var sendIsOpenShopReq=function(a){if(!isQueryOpenShop){isOpenShopReq.get({siteId:a})}};var setSell=function(a,b){sendIsOpenShopReq(a);$$("#"+b+" .offsell").each(function(c){c.addEvent("click",function(d){if(isOpenShop){new Event(d).stop();showError(text.product.notallowedtobuy);return false}})});$$("#"+b+" .isshopping").each(function(c){c.addEvent("click",function(d){if(!isOpenShop){new Event(d).stop();showError(text.product.shoppingclosed);return false}else{return true}})})};if(typeof goodsResultArray=="undefined"){var goodsResultArray=new Hash();var goodsSoOption={}}var saveSoOption=function(c){var a=$(""+c);var b;goodsSoOption={};b=a.getElement(".goodssoname");if(null!=b){$extend(goodsSoOption,{goodsSoName:b.get("value")})}b=a.getElement(".goodssotypeinfo");if(null!=b){$extend(goodsSoOption,{goodsSoTypeId:b.get("value")})}b=a.getElement(".goodssospec");if(null!=b){$extend(goodsSoOption,{goodsSoSpec:b.get("value")})}b=a.getElement(".goodssopricefrom");if(null!=b){$extend(goodsSoOption,{goodsSoPriceFrom:b.get("value")})}b=a.getElement(".goodssopriceto");if(null!=b){$extend(goodsSoOption,{goodsSoPriceTo:b.get("value")})}b=a.getElement(".goodssokeyword");if(null!=b){$extend(goodsSoOption,{goodsSoKeyword:b.get("value")})}b=a.getElement(".goodssosummary");if(null!=b){$extend(goodsSoOption,{goodsSoSummary:b.get("value")})}b=a.getElement(".goodssopubtimefrom");if(null!=b){$extend(goodsSoOption,{goodsSoPubtimeFrom:b.get("value")})}b=a.getElement(".goodssopubtimeto");if(null!=b){$extend(goodsSoOption,{goodsSoPubtimeTo:b.get("value")})}};var goodsSo=function(a){saveSoOption(a);goodsResultArray.each(function(b){b.currentPage=1;$extend(b.option.defaultQueryData,goodsSoOption);b.reloadPage()});return false};window.addEvent("domready",function(){if(Browser.Engine.gecko){resetMarqueeElementSize.delay(200)}});function homepageclick(c){try{c.style.behavior="url(#default#homepage)";c.setHomePage(document.location.href)}catch(b){if(window.netscape){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");var a=Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);a.setCharPref("browser.startup.homepage",document.location.href)}catch(b){alert(text.homepage.prompt)}}}return false}function friendclick(){if(window.clipboardData){window.clipboardData.setData("Text",window.location.href);showMessage(text.friend.copysuccess)}else{showMessage(text.friend.copyfail+"\n"+window.location.href)}}function favoriteclick(){try{window.external.addFavorite(document.location.href,document.title)}catch(a){try{window.sidebar.addPanel(document.title,document.location.href,"")}catch(a){showError(text.favorite.prompt)}}return false}poll={resultDiv:null,resultDialog:null,resultRequest:null,onSuccess:function(a){if(a=="0"){showSuccessI18n(text.poll.success)}else{showErrorI18n(text.poll.iprepeat)}},beforeSubmit:function(a){return function(){var b=$$("#"+a+" input:checked");if(b.length<=0){showErrorI18n(text.poll.pleaseSelect);return false}return true}},initPollForm:function(a){new FormCheck(a,{submitByAjax:true,onAjaxSuccess:poll.onSuccess,display:{showErrors:1,indicateErrors:2,scrollToFirst:false,skipToDisplay:true}}).beforeSubmit=poll.beforeSubmit(a)},initResultDiv:function(){poll.resultDiv=new Element("div",{id:"pollResultDiv",html:"aaa"});poll.resultDiv.inject(document.body,"bottom");poll.resultDialog=poll.resultDiv.makeMDialog({isShow:false,title:text.poll.resultTitle,divClass:"zz_width03"});poll.resultRequest=new Request.HTML({url:"/business/PollShow!result.do",method:"get",onSuccess:function(b,a,c){poll.resultDiv.empty();poll.resultDiv.set("html",c);poll.resultDialog.show()}})},result:function(a){if(!poll.resultDiv){poll.initResultDiv()}poll.resultRequest.get({pollid:a})}};var RevertShowSimulateWindow=new Class({options:{url:"http://www.baidu.com",elementId:null,cover:true,rtnFun:null,contentType:1,showCloseBox:true,title:"",frameWidth:"750px",frameHeight:"450px"},coverDiv:null,containerDiv:null,initialize:function(a){this.options=$merge(this.options,a);if(this.options.cover==true){this.createCover()}this.createContainer();this.show()},createCover:function(){var b=window.getScrollSize();var a=new Element("div",{id:"popupMask",styles:{height:b.y+"px",width:b.x+"px"}});a.inject($(document.body),"bottom");this.coverDiv=a},createContainer:function(){var a=new Element("div",{id:"popupContainer"});a.set("html",'<div id="popupTitleBar"><div id="popupTitle">'+this.options.title+'</div><div id="popupControls"><img src="/images/close.gif" alt="关闭" id="popCloseBox" /></div></div><iframe src="" style="width:'+this.options.frameWidth+";height:"+this.options.frameHeight+';background-color:transparent;" scrolling="no" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="100%" height="100%"></iframe>');a.setStyle("width",this.options.frameWidth);a.inject($(document.body),"bottom");this.containerDiv=a;var b=this;$("popupControls").addEvent("click",function(){b.close()})},show:function(){if(this.coverDiv){this.coverDiv.setStyle("display","block")}if(this.containerDiv){this.containerDiv.setStyle("display","block");var e=this.containerDiv.getSize();var b=$(document.body).getSize();var a=$(document.body).getScroll();var d=50+a.y;var c=(b.x-e.x>0?(b.x-e.x)/2:0)+a.x;this.containerDiv.setStyles({top:d+"px",left:c+"px"});if(this.options.url.indexOf("?")!=-1){this.options.url+="&"+Math.random()}else{this.options.url+="?"+Math.random()}this.containerDiv.getElement("iframe").src=this.options.url}},close:function(){if(this.coverDiv){this.coverDiv.destroy()}if(this.containerDiv){this.containerDiv.destroy()}},retrunValue:function(a){if(this.options.rtnFun){this.options.rtnFun(a);this.close()}}});function scrollToTop(d){var c=$(d).getParent(".zen-context");var b=new Fx.Scroll(c);var e=c.getElement("table[name=first-table]");if(e){b.toElement(e)}var a=new Fx.Scroll(window);a.toElement(c)}function scrollToReply(e,b){var d=$("replyDiv");if(!d){alert(text.bbs.replyfail);return}var a=new Fx.Scroll(window);a.toElement(d);var g=d.getElement("iframe");if(g){var f=text.bbs.reply+"："+e+text.bbs.floor+" "+b+" "+text.bbs.infostr;var c=g.contentWindow.document.getElementById("name");if(c){c.value=f}c.focus()}else{alert(text.bbs.memberlogin)}}function editMyBbs(d,b){var c="";if(b==0){c=text.bbs.editbbs}else{c=text.bbs.editreply}var a="/business/bbs!toEdit.do?rid="+d;simulateWin=new RevertShowSimulateWindow({url:a,title:c})}function removeMyBbs(c,b){var a="";if(b==0){a=text.bbs.removebbs}else{a=text.bbs.removereply}if(confirm(a)){new Request({url:"/business/bbs!delete.do",method:"get",onSuccess:function(d){d=JSON.decode(d);alert(d.message);if(d.code==0){window.location=window.location.toString()}},onFailure:function(){alert(text.bbs.errorstr)}}).get({rid:c})}}function addKeywordEvent(c){var b=c.getElement("input[name=keyword]");a();b.addEvent("focus",function(){if(this.get("updated")==0){b.set("value","");b.setStyle("color","black")}});b.addEvent("blur",function(){if(b.get("value").trim().length==0){a()}else{b.set("updated",1)}});c.addEvent("submit",function(){if(b.get("updated")==0){b.set("value","")}return true});function a(){b.set("updated",0);b.setStyle("color","gray");b.set("value",b.defaultValue)}}function initFindPswForm(a){$Lib.checkDiv().formChecker();new FormCheck("findpw_form_"+a,{submitByAjax:true,onAjaxSuccess:function(c,d){this.form.find(".findpw_submit").disabled=false;this.form.find(".findpw_waiting").style.display="none";var b=JSON.decode(c);if(b.result){alert(text.member.findpsw);window.location.href="index.html"}else{new Function("verificationRefresh"+a+"();")();handerCheckDiv(b.checkDivs)}},onAjaxRequest:function(){$$(".check-div").each(function(b){b.getElements("a.close").fireEvent("mouseup")});this.form.find(".findpw_submit").disabled=true;this.form.find(".findpw_waiting").style.display=""},display:{showErrors:1,indicateErrors:2,scrollToFirst:false}})}function checkRegEmail(c,d){$Lib.checkDiv().formChecker();var a=$("form_"+d);var b=a.email.value;new Request({url:"/business/member!checkEmail.do?siteid="+c,method:"post",onSuccess:function(e,f){$("checkmsg_"+d).innerHTML=e}}).send("email="+b)}function initLogonInfoSubmitForm(b,a){$Lib.checkDiv().formChecker();new FormCheck("form_"+b,{submitByAjax:true,onAjaxRequest:function(){$$(".check-div").each(function(c){c.getElements("a.close").fireEvent("mouseup")})},onAjaxSuccess:function(e,f){var d=JSON.decode(e);var c=$("next_form_"+b);if(d.result){c.email.value=this.form.email.value;c.password.value=this.form.password.value;c.validate_code.value=$("validate_code_"+a).value;c.submit()}else{handerCheckDiv(d.checkDivs)}},display:{showErrors:1,indicateErrors:2,scrollToFirst:false}})}function showUploadPortraitDialog(a){window.currentUploadPortraitDiv=a;uploadImage();return false}function callBackUploadPortrait(a){var b=JSON.decode(a);if(b.result==1){$("portrait_"+window.currentUploadPortraitDiv).value=b.photourl;$("portraitIcoImg_"+window.currentUploadPortraitDiv).src=b.photourl;uploadImageDialog.close()}else{showError(b.reason);return}}function uploadPortraitCheck(a){if(a.form.portrait.value==""){a.errors.push(text.member.pleaseuploadportrait);return false}else{return true}}function initAddMemberProfileForm(c,a){$Lib.datePicker().formChecker();var b=new FormCheck("detailform_"+c,{submitByAjax:true,onAjaxRequest:function(){$$(".check-div").each(function(d){d.getElements("a.close").fireEvent("mouseup")})},onAjaxSuccess:function(e,f){var d=JSON.decode(e);window.location.href=d.redirectUrl},display:{showErrors:1,indicateErrors:2,scrollToFirst:false}});b.beforeSubmit=function(){return !a}}function initMemeberModifyForm(d,c,a){$Lib.datePicker().formChecker();var b=new FormCheck("modifyform_"+d,{submitByAjax:true,onAjaxRequest:function(){$$(".check-div").each(function(e){e.getElements("a.close").fireEvent("mouseup")})},onAjaxSuccess:function(f,g){var e=JSON.decode(f);if(e.result==0){alert(text.member.membermodifyerror)}else{showSuccessI18n(text.member.changesuccessful,{onClosed:function(){window.location.href=a}})}},display:{showErrors:1,indicateErrors:2,scrollToFirst:false}});b.beforeSubmit=function(){return !c}}function initModifyPswForm(b){$Lib.checkDiv().formChecker();var a=new FormCheck("modifypw_form_"+b,{submitByAjax:true,onAjaxRequest:function(){$$(".check-div").each(function(c){c.getElements("a.close").fireEvent("mouseup")})},onAjaxSuccess:function(d,e){var c=JSON.decode(d);if(c.result){showSuccessI18n(text.member.changesuccessful,{onClosed:function(){$$("#modifypw_form_"+b+" input").set("value","")}})}else{showError(c.message);$$("#modifypw_form_"+b+" input[name=oldPasswd]").set("value","");$$("#modifypw_form_"+b+" input[name=oldPasswd]")[0].focus()}},display:{showErrors:1,indicateErrors:2,scrollToFirst:false}});a.beforeSubmit=function(){return true}}var downfileDialog,fileJsonRequest;function noPwd(c){window.location="/business/FileListShow!download.do?fileId="+c;var b=$(document).getElement(".downtimes"+c);if(b){var a=parseInt(b.get("html"));$$(".downtimes"+c).set("html",a+1)}}function showcheck(a,b){if(!downfileDialog){initDownfileDlg()}downfileDialog.eleFileId.value=b;downfileDialog.eleFilePw.value="";downfileDialog.show()}function checkPwd(){var b=downfileDialog.eleFileId.value;var a=downfileDialog.eleFilePw.value;if(!fileJsonRequest){initFileJsonRequest()}fileJsonRequest.post({fileId:b,filePwd:a})}function initFileJsonRequest(){fileJsonRequest=new Request.JSON({url:"/business/FileListShow!checkPwd.do",method:"post",onSuccess:function(a){if(a.isRight==1){downfileDialog.close();window.open("/business/FileListShow!download.do?fileId="+a.id+"&key="+a.key);if($$(".downtimes"+a.id)){$$(".downtimes"+a.id).set("html",a.downloadtimes+1)}}else{showErrorI18n(text.filelist.wrongpassword);downfileDialog.eleFilePw.set("value","")}}})}function initDownfileDlg(){var a=$("downfileDiv");downfileDialog=a.makeMDialog({title:text.filelist.enterpassword,isShow:false,divClass:"zz_width02"});$extend(downfileDialog,{eleFileId:a.find("input[name=fileId]"),eleFilePw:a.find("input[name=filePwd]")})}function backclick(){history.back()};
