var SetIndividual=(function(){var dataIndivi={dataValue:[],dataUrl:[],bgColor:"",bgColorNum:"",fontColor:"",fontColorNum:""};function __placeQuote(s){return s.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(type){switch(type){case 0:return"您的第#{0}个名称不能大于12个字符！";case 1:return"您的第#{0}个网址不能大于200字符！";case 2:return"您的第#{0}个的网址格式不正确，请重新输入！";case 3:return"请您添加第#{0}个的网址！";case 4:return"请您添加第#{0}个的名称！";case 5:return"图片链接地址不能超过200个字符，支持JPG、GIF、BMP格式的图片！";case 6:return"浏览器的cookie已经被禁用！";case 7:return"确认您是否需要保存设置?";case 8:return"确认恢复默认值吗？"}}function check(ngxv,ngxu,imggx){for(var i=0,l=ngxv.length;i<l;i++){var vv=trim(ngxv[i].value),uv=trim(ngxu[i].value),n=i+1;if(byteLength(vv)>12){alert(format(Error(0),n));return false}if(byteLength(uv)>200){alert(format(Error(1),n));return false}if(vv==""&&uv!="http://"){alert(format(Error(4),n));return false}if(vv!=""&&uv=="http://"){alert(format(Error(3),n));return false}if(vv!=""&&!/http:\/\/.+/.test(uv)){alert(format(Error(2),n));return false}}if(imggx.disabled==false){if(G("imgFile").value!=""){imggx.value=G("imgFile").value.replace(/\\/g,"\\\\\\\\")}if(byteLength(imggx.value)>200||!/^.+((\.jpg)|(\.png)|(\.gif)|(\.bmp)|(\.jpeg))$/.test(trim(imggx.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(obj){if(obj.value=="radiobutton"&&obj.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 ngxv=GN("ngxv"),ngxu=GN("ngxu"),imggx=G("imggx"),radioimg=GN("radioimg"),radiofont=GN("radiofont");for(var k=0,le=ngxv.length;k<le;k++){var vv=encodeText(__placeQuote(trim(ngxv[k].value))),uv=__placeQuote(trim(ngxu[k].value));if(vv==""){dataIndivi.dataValue.push("null")}else{dataIndivi.dataValue.push(vv)}dataIndivi.dataUrl.push(uv)}for(var i=0,l=radioimg.length;i<l;i++){if(radioimg[i].checked==true){if(radioimg[i].value=="radiobutton"){dataIndivi.bgColor=imggx.value}else{dataIndivi.bgColor=radioimg[i].value}dataIndivi.bgColorNum=i}}for(var j=0,len=radiofont.length;j<len;j++){if(radiofont[j].checked==true){dataIndivi.fontColor=radiofont[j].value;dataIndivi.fontColorNum=j}}var data=escape(jsonToString(dataIndivi));UserData.set("HAOGX",data);dataIndivi={dataValue:[],dataUrl:[],bgColor:"",bgColorNum:"",fontColor:"",fontColorNum:""}}function set(){var ngxv=GN("ngxv"),ngxu=GN("ngxu"),imggx=G("imggx");if(check(ngxv,ngxu,imggx)==false){return false}var isSave=confirm(Error(7));if(isSave){save();parent.Individual.reload()}}function reset(obj){var isReset=confirm(Error(8));if(isReset){G("imggx").disabled=true;setStyle("#imggx","background-color:#cccccc");document.reg.reset();save();parent.Individual.reload()}}return{set:set,outImg:outImg,reset:reset,reader:reader}})();function formatn(){if(parent.document.getElementById("ifr")){var A=parent.document.getElementById("ifr");A.style.height=document.body.scrollHeight+20+"px"}}parent.window.onresize=function(){formatn()};window.onload=function(){setTimeout("formatn();",100)};