var SetIndividual=(function(){var dataIndivi={dataValue:[],dataUrl:[],bgColor:"",bgColorNum:"",fontColor:"",fontColorNum:""};function __placeQuote($){return $.replace(/[\"\'\\]/g,"")}function reader(){var ngxv=GN("ngxv"),ngxu=GN("ngxu"),imggx=G("imggx"),radioimg=GN("radioimg"),radiofont=GN("radiofont");if(UserData.get("HAOGX")!=undefined&&UserData.get("HAOGX")!=""){var data=eval("("+unescape(UserData.get("HAOGX"))+")");for(var i=0,l=ngxv.length;i<l;i++){if(data.dataValue[i]=="null")ngxv[i].value="";else ngxv[i].value=decodeHtml(data.dataValue[i]);ngxu[i].value=data.dataUrl[i]}if(data.bgColorNum==6){G("imggx").disabled=false;G("imgFile").disabled=false;G("imggx").value=data.bgColor.replace(/\\/g,"\\\\");setStyle("#imggx","background-color:#fff")}radioimg[data.bgColorNum].checked=true;radiofont[data.fontColorNum].checked=true}}if(Browser.isWebkit||Browser.isOpera)window.FlashCallBack=function(){reader()};else on(window,"load",reader);function Error($){switch($){case 0:return"\u60a8\u7684\u7b2c#{0}\u4e2a\u540d\u79f0\u4e0d\u80fd\u5927\u4e8e12\u4e2a\u5b57\u7b26\uff01";case 1:return"\u60a8\u7684\u7b2c#{0}\u4e2a\u7f51\u5740\u4e0d\u80fd\u5927\u4e8e200\u5b57\u7b26\uff01";case 2:return"\u60a8\u7684\u7b2c#{0}\u4e2a\u7684\u7f51\u5740\u683c\u5f0f\u4e0d\u6b63\u786e\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\uff01";case 3:return"\u8bf7\u60a8\u6dfb\u52a0\u7b2c#{0}\u4e2a\u7684\u7f51\u5740\uff01";case 4:return"\u8bf7\u60a8\u6dfb\u52a0\u7b2c#{0}\u4e2a\u7684\u540d\u79f0\uff01";case 5:return"\u56fe\u7247\u94fe\u63a5\u5730\u5740\u4e0d\u80fd\u8d85\u8fc7200\u4e2a\u5b57\u7b26\uff0c\u652f\u6301JPG\u3001GIF\u3001BMP\u683c\u5f0f\u7684\u56fe\u7247\uff01";case 6:return"\u6d4f\u89c8\u5668\u7684cookie\u5df2\u7ecf\u88ab\u7981\u7528\uff01";case 7:return"\u786e\u8ba4\u60a8\u662f\u5426\u9700\u8981\u4fdd\u5b58\u8bbe\u7f6e?";case 8:return"\u786e\u8ba4\u6062\u590d\u9ed8\u8ba4\u503c\u5417\uff1f"}}function check(E,D,$){for(var F=0,C=E.length;F<C;F++){var _=trim(E[F].value),A=trim(D[F].value),B=F+1;if(byteLength(_)>12){alert(format(Error(0),B));return false}if(byteLength(A)>200){alert(format(Error(1),B));return false}if(_==""&&(A!=""&&A!="http://")){alert(format(Error(4),B));return false}if(_!=""&&A=="http://"){alert(format(Error(3),B));return false}if(_!=""&&!/https?:\/\/.+/i.test(A)){alert(format(Error(2),B));return false}}if($.disabled==false){if(G("imgFile").value!="")$.value=G("imgFile").value.replace(/\\/g,"\\\\\\\\");if(byteLength($.value)>200||!/^.+((\.jpg)|(\.png)|(\.gif)|(\.bmp)|(\.jpeg))$/i.test(trim($.value))){alert(Error(5));return false}}if(!Browser.isCookie){alert(Error(6));return false}return true}on(G("imgFile"),"onchange",function(){G("imggx").value=G("imgFile").value.replace(/\\/g,"\\\\\\\\")});function outImg($){if($.value=="radiobutton"&&$.checked==true){G("imggx").disabled=false;G("imgFile").disabled=false;setStyle("#imggx","background-color:#fff")}else{G("imggx").disabled=true;G("imgFile").disabled=true;setStyle("#imggx","background-color:#cccccc")}}function save(){var P=GN("ngxv"),O=GN("ngxu"),$=G("imggx"),A=GN("radioimg"),_=GN("radiofont"),J=GN("tpl_type"),K=GN("tpl_css");log.params.page="templ";for(var H=0,M=P.length;H<M;H++){var L=encodeText(__placeQuote(trim(P[H].value))),N=__placeQuote(trim(O[H].value));if(L==""){dataIndivi.dataValue.push("null");log.params.content=0}else{var B=1;dataIndivi.dataValue.push(L);log.params.content=B++}dataIndivi.dataUrl.push(N)}for(var I=0,D=J.length;I<D;I++)if(J[I].checked==true)dataIndivi.tplType=J[I].value;for(I=0,D=K.length;I<D;I++)if(K[I].checked==true)dataIndivi.tplCss=K[I].value;for(I=0,D=A.length;I<D;I++)if(A[I].checked==true){if(A[I].value=="radiobutton")dataIndivi.bgColor=$.value;else dataIndivi.bgColor=A[I].value;dataIndivi.bgColorNum=I}for(var F=0,E=_.length;F<E;F++)if(_[F].checked==true){dataIndivi.fontColor=_[F].value;dataIndivi.fontColorNum=F}log.params.bg_color_num=dataIndivi.bgColorNum;log.params.bg_font_num=dataIndivi.fontColorNum;log.params.tpl_type=dataIndivi.tplType;log.params.tpl_css=dataIndivi.tplCss;var C=escape(jsonToString(dataIndivi));UserData.set("HAOGX",C);dataIndivi={dataValue:[],dataUrl:[],bgColor:"",bgColorNum:"",fontColor:"",fontColorNum:"",tplType:"",tplCss:""};log(log.params)}function set(){var B=GN("ngxv"),A=GN("ngxu"),_=G("imggx");if(check(B,A,_)==false)return false;var $=confirm(Error(7));if($)save()}function reset($){var _=confirm(Error(8));if(_){G("imggx").disabled=true;setStyle("#imggx","background-color:#cccccc");document.reg.reset();save()}}return{set:set,outImg:outImg,reset:reset,reader:reader}})()