var __SINA_SURVEY_DATA={"survey":{"id":"1234","creator":"zhangheng6","title":"\u79d1\u521b\u677f\u9996\u6279\u53d7\u7406\u76849\u5bb6\u516c\u53f8 \u542b\u91d1\u91cf\u51e0\u4f55\uff1f","description":"\u4e0a\u4ea4\u624022\u65e5\u516c\u5e03\u4e86\u9996\u6279\u53d7\u7406\u7684\u79d1\u521b\u677f\u7684\u53d1\u884c\u4eba\u540d\u5355\uff0c9\u5bb6\u4f01\u4e1a\u5165\u56f4\uff0c\u5206\u522b\u4e3a\u6676\u6668\u534a\u5bfc\u4f53\u3001\u777f\u521b\u5fae\u7eb3\u3001\u5929\u5948\u79d1\u6280\u3001\u6c5f\u82cf\u5317\u4eba\u3001\u5229\u5143\u4ea8\u3001\u5b81\u6ce2\u5bb9\u767e\u3001\u548c\u8230\u82af\u7247\u3001\u5b89\u7ff0\u79d1\u6280\u3001\u79d1\u524d\u751f\u7269\u3002","keyword":"\u79d1\u521b\u677f","start_time":"1553481480","end_time":"3193871880","type":"1","channel":"8","status":"1","anti_cheat_strategy":"0","qr_code":"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKIAAACiAQMAAAD4PIRYAAAABlBMVEX\/\/\/8AAABVwtN+AAAA+0lEQVRIic2W2Q0DIRBDLVEAJdE6JVEAEvEc7JECzI6SFbzkwxo8XoAPVFlWZQB1rdFsM+SUXzQ+ibhAEDVt3JfVi9MSKs\/Qxe6UcZIGmjhFcTXFG4QDNJ3a4vPnXw3dZT167pXUPEqL+JywZk29SurH0yfgkdFjrabVlM2ILWaHqVRTk1I7NVmDuLCZkVN3p3ekUd8+Ny21zOpXdziuoVdJIzJSVvzpAKUz6E6bFiqL38Q0ZLlL4CGWTlXSKPp1PUJcTCPB4QPjb9N+gO6bzfRniclR07zZpMo7NdQ0r5i5OEe9KOutTENxXy6xk1RMXdB9NmiP+46IfqB+79HApKLGu1sAAAAASUVORK5CYII=","others":{"result_show":"1","user_result_show":0,"result_save":"0","result_order":"0","result_order_q":0,"true_result":"1","vote_show":"1","vote_submit":null,"vote_login":"1","share_img":"https:\/\/n.sinaimg.cn\/default\/46b60762\/20171013\/sinavotepic.png","comment":"1","survey_summary":"\u6295\u7968\u6210\u529f\uff0c\u611f\u8c22\u60a8\u7684\u53c2\u4e0e\uff01","redirect_url":"http:\/\/www.sina.com.cn","display_type":"2","text_detail":"","text_detail_url":"","repetition_attr":"0","repetition_user_cookie_device":"1","repetition_interval":"","repetition_freq":"","repetition_end_msg":"","result_interval_show":"0","result_address":2,"group":2,"repetition_interval_did":"0","repetition_freq_did":"0","final_result_show":1},"created_time":"1553481576","modified_time":"1553482838"},"content":{"question":[{"id":"22190","survey_id":"1234","type":"1","parent_id":"1234","sort_id":"1","status":"1","description":"\u4f60\u8ba4\u4e3a\u9996\u6279\u79d1\u521b\u677f\u53d7\u7406\u4f01\u4e1a\uff0c\u542b\u91d1\u91cf\u5982\u4f55\uff1f","others":{"question_selection":"1","question_type":"1","question_img":"","checkbox_num_least":0,"checkbox_num_most":0,"score_display_type":0,"score_num_least":0,"score_num_most":0,"standard_point":0},"created_time":"1553481783","modified_time":"1553481783","r_aids":[],"answers":[22191,22192]},{"id":"22193","survey_id":"1234","type":"1","parent_id":"1234","sort_id":"2","status":"1","description":"\u4f60\u662f\u5426\u4f1a\u53c2\u4e0e\u79d1\u521b\u677f\u6295\u8d44\uff1f","others":{"question_selection":"1","question_type":"1","question_img":"","checkbox_num_least":0,"checkbox_num_most":0,"score_display_type":0,"score_num_least":0,"score_num_most":0,"standard_point":0},"created_time":"1553481783","modified_time":"1553481783","r_aids":[],"answers":[22194,22195]}],"answer":{"22190":[{"id":"22191","survey_id":"1234","type":"2","parent_id":"22190","sort_id":"1","status":"1","description":"\u9ad8\u4e8e\u9884\u671f","others":{"next_question":0,"answer_img":"","answer_img_width":"undefined","answer_img_height":"undefined","answer_type_blank":0,"standard_point":0,"next_question_id":22193},"created_time":"1553481783","modified_time":"1553481783"},{"id":"22192","survey_id":"1234","type":"2","parent_id":"22190","sort_id":"2","status":"1","description":"\u5f31\u4e8e\u9884\u671f","others":{"next_question":0,"answer_img":"","answer_img_width":"undefined","answer_img_height":"undefined","answer_type_blank":0,"standard_point":0,"next_question_id":22193},"created_time":"1553481783","modified_time":"1553481783"}],"22193":[{"id":"22194","survey_id":"1234","type":"2","parent_id":"22193","sort_id":"1","status":"1","description":"\u662f","others":{"next_question":0,"answer_img":"","answer_img_width":"undefined","answer_img_height":"undefined","answer_type_blank":0,"standard_point":0,"next_question_id":null},"created_time":"1553481783","modified_time":"1553481783"},{"id":"22195","survey_id":"1234","type":"2","parent_id":"22193","sort_id":"2","status":"1","description":"\u5426","others":{"next_question":0,"answer_img":"","answer_img_width":"undefined","answer_img_height":"undefined","answer_type_blank":0,"standard_point":0,"next_question_id":null},"created_time":"1553481783","modified_time":"1553481783"}]},"point":[],"group":[],"a_q":{"22191":22190,"22192":22190,"22194":22193,"22195":22193}},"total":{"true":{"survey":"191","modified_time":"1553732497","question":{"22190":"191","22193":"191"},"answer":{"22191":{"number":"28","score":0,"percent":14.66},"22192":{"number":"163","score":0,"percent":85.34},"22194":{"number":"65","score":0,"percent":34.03},"22195":{"number":"126","score":0,"percent":65.97}}},"fake":{"survey":"191","modified_time":"1553732497","question":{"22190":"191","22193":"191"},"answer":{"22191":{"number":"28","score":0,"percent":14.66},"22192":{"number":"163","score":0,"percent":85.34},"22194":{"number":"65","score":0,"percent":34.03},"22195":{"number":"126","score":0,"percent":65.97}}}},"records":null}; !function(){var t=window.__SINA_SURVEY_DATA||null,e=t&&t.survey.id,s={},n=window.location.href,a=".com";-1!=n.indexOf("sina.cn")&&(a="");var i="";window.sina_survey_config&&(i=window.sina_survey_config.host||"");var o="//"+i+"vote.sina"+a+".cn/api/survey/cast_vote",r="//"+i+"vote.sina"+a+".cn/api/survey/get_captcha/",c="//"+i+"vote.sina"+a+".cn/result/component/",u="//"+i+"vote.sina"+a+".cn/api/survey/vote_status/",d="//"+i+"vote.sina"+a+".cn/api/survey/info/",l={},_=null,h=document.getElementById("sina_survey_js_"+e),v={},p={},y={},g=null;e&&(s[e]=t,window.sina_survey_config&&window.sina_survey_config.callback&&(y[e]=window.sina_survey_config.callback));var m={addClass:function(t,e){new RegExp("\\b"+e+"\\b").test(t.className)||(t.className=(t.className+" "+e).match(/\S+/g).join(" "))},removeClass:function(t,e){var s=new RegExp("\\b"+e+"\\b","g");t.className=t.className.replace(s,"").replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")},getByClass:function(t,e){for(var s=t.getElementsByTagName("*"),n=new RegExp("\\b"+e+"\\b","i"),a=[],i=0;i320&&d<=480?Math.round(.3*(d-25)):Math.round(.23*(d-25)),o=Math.round(a/n*i);else if("sina"==r){h?u=h.parentNode:p[s]&&(u=p[s]);d=Math.round(m.getWidth(u));var l=m.getStyle(document.getElementsByTagName("html")[0],"fontSize").split("px")[0];i=Math.round((d-.8*l-.6*l-.1*l)/2),o=Math.round(a/n*i)}return{width:i,height:o}},addEvent:function(t,e,s){t.attachEvent?t.attachEvent("on"+e,s):t.addEventListener(e,s,!1)},removeEvent:function(t,e,s){t.detachEvent?t.detachEvent("on"+e,s):t.removeEventListener(e,s,!1)},browserRedirect:function(){var t=navigator.userAgent.toLowerCase(),e=window.location.href,s=window.location.host,n=t.match(/(sinanews|sinafinance)/i),a=t.match(/MicroMessenger/i);return n?-1!=e.indexOf("file://")?"client":"client_m":a?"wechat":-1!=s.indexOf("sina.cn")?"m":"pc"},getUrlKey:function(t){return t.substring(t.indexOf("code=")).split("&")[0].split("=")[1]},getCookie:function(t){var e=document.cookie.split("; "),s=0;for(s=0;s"),e.push(s+"="+n)}return e.join("&")},ajax:function(t,e){if((e=e||{}).data=e.data||{},e.data.t=e.data.t||(new Date).getTime(),e.method=e.method||"get","wechat"==f&&(e.data.code=m.getUrlKey(window.location.href)),"client"==f)g&&g.fetch({url:t,type:e.method,data:e.data},function(t){e.success&&e.success(t)});else{var s=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");if("post"==e.method){s.open("POST",t,!0),s.withCredentials=!0,s.setRequestHeader("Content-Type","application/x-www-form-urlencoded");try{s.send(e.data?this.json2url(e.data):null)}catch(t){}}else{t+="?"+this.json2url(e.data),s.open("GET",t,!0);try{s.send()}catch(t){}}s.onreadystatechange=function(){4==s.readyState&&(200==s.status?e.success&&e.success(s.responseText):e.error&&e.error(s.status))}}}},f=m.browserRedirect(),w="";n=n.replace(/([?|&])code=[^&]*/gi,"$1");var b="https://vote.sina.cn/weixin/router?final_redirect_url="+encodeURIComponent(n);if("wechat"==f&&t.survey.others.vote_login>0&&!window.sessionStorage.getItem("vote_wxCode")){window.sessionStorage.setItem("vote_wxCode",1);var x=encodeURIComponent(b);window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx7ae02ffb0ec715d6&redirect_uri="+x+"&response_type=code&scope=snsapi_base#wechat_redirect"}"client"==f&&(w="https:"),window.sinaSurveyEvent={init:function(n){window.sina_survey_config=n,p[n.id]=m.getDom(n.parent),v[n.id]=n.parent,y[n.id]=n.callback,g=n.class,m.jsonp({url:w+d+n.id,success:function(n){0==n.result.status.code&&(t=n.result.data,e=t.survey.id,s[e]=t,T(e))}})},imgError:function(t){var e=t.parentNode,s=w+"//n.sinaimg.cn/survey/images/sina_logo.png";e.style.background="url("+s+") center center no-repeat #eee",e.style.backgroundSize="102px 44px",e.onclick=function(){var s=t.getAttribute("data-src");t.src=s+"?"+(new Date).getTime(),e.onclick=null}}};var T=function(t){t&&m.ajax(w+u+t,{method:"post",success:function(e){var n=null;if(n="string"==typeof e?JSON.parse(e):e,window["sina_survey_status_"+t]=n.result.status.code,l[t]=n.result.status.code,window.sina_survey_config&&"_blank"==window.sina_survey_config.resultType)k.init(t);else if(0==n.result.status.code||102==n.result.status.code)k.init(t);else{var a=C.getStatus(t);1==s[t].survey.type&&1==s[t].survey.others.result_show&&a?C.init(t):k.init(t)}}})},k={init:function(t){if(h||p[t]){var e=this;this.addCss(t),setTimeout(function(){e.cHtml(t),setTimeout(function(){e.setImgInfo()},100)},100)}},addCss:function(t){var e=document.getElementsByTagName("head")[0],s=document.getElementById("sina_survey_css"),n=document.createElement("link"),a=null,i="";window.sina_survey_config&&(a=window.sina_survey_config.surveyCss),a&&!s&&(i=-1!=a.toString().indexOf("http")?a:"pc"!=f?w+"//n.sinaimg.cn/survey/css/sina_survey_m_js.css":w+"//n.sinaimg.cn/survey/css/sina_survey_js.css",n.id="sina_survey_css",n.rel="stylesheet",n.type="text/css",n.href=i,e.appendChild(n))},setImgInfo:function(){var t="";window.sina_survey_config&&(window.sina_survey_config.source,t=window.sina_survey_config.imgWidth);for(var e=m.getByClass(document,"survey_img_box"),s=0;s'+d+""):(d="已结束",c.innerHTML=''+d+""),1==a&&2!=i&&(c.innerHTML+=''+_.survey+"人参与"),u.className="survey_content_item_wrap survey_content_item_wrap_"+e.id,r.innerHTML=e.title;for(var h=0;h提交';else switch(l[t]){case 0:case 102:p='提交';break;case 101:p='已结束';break;default:p='已提交'}var y="",g=C.getStatus(t);return 1==e.others.result_show&&2!=e.type&&g&&window.sina_survey_config&&"_blank"==window.sina_survey_config.resultType&&(y="查看结果'),2==e.status&&(p='已结束'),o.innerHTML+='
'+p+y+"
",o},cItem:function(t,e,n){var a=s[n].content.answer[t];switch(e.others.question_type){case"1":return this.radio(e,a,n);case"2":return this.checkBox(e,a,n);case"3":return this.text(e,a,n);case"4":return this.score(e,a,n);case"5":return this.radio(e,a,n);case"6":return this.checkBox(e,a,n)}},radio:function(t,e,s){var n="",a="";1==t.others.question_selection&&(n='*');for(var i=0;i',l=""):i%2==1&&(d="",l="")):this.parentWidth>320&&this.parentWidth<=480?(c="survey_img_box_min",i%3==0?(d='
',l=""):i%3==2&&(d="",l="
")):i%4==0?(d='
',l=""):i%4==3&&(d="",l="
"):i%2==0?(d='
',l=""):i%2==1&&(d="",l="
"),i==e.length-1&&(l=""),-1==g.indexOf("http")&&(g=w+g),o='
',r="survey_img_box",c&&"pc"==f&&(u=c)}a+=d+'
  • '+l}return'

    '+t.sort_id+'、'+t.description+""+n+'

      '+a+"
    "},checkBox:function(t,e,s){var n="",a="";1==t.others.question_selection&&(n='*('+(t.others.checkbox_num_least>0?" 最少"+t.others.checkbox_num_least+"项 ":"")+(t.others.checkbox_num_most>0?" 最多"+t.others.checkbox_num_most+"项":"")+')');for(var i=0;i',l=""):i%2==1&&(d="",l="")):this.parentWidth>320&&this.parentWidth<=480?(c="survey_img_box_min",i%3==0?(d='
    ',l=""):i%3==2&&(d="",l="
    ")):i%4==0?(d='
    ',l=""):i%4==3&&(d="",l="
    "):i%2==0?(d='
    ',l=""):i%2==1&&(d="",l="
    "),i==e.length-1&&(l=""),-1==g.indexOf("http")&&(g=w+g),o='
    ',r="survey_img_box",c&&"pc"==f&&(u=c)}a+=d+'
  • "+e[i].description+'

  • '+l}return'

    '+t.sort_id+'、'+t.description+""+n+'

      '+a+"
    "},text:function(t,e){var s="",n="";return 1==t.others.question_selection&&(s='*'),n+='
  • ','

    '+t.sort_id+'、'+t.description+""+s+'

      '+n+"
    "},score:function(t,e){var s="",n="";1==t.others.question_selection&&(s='*');for(var a=0;a"+o+""}return n='
  • ','

    '+t.sort_id+'、'+t.description+""+s+'

      '+n+"
    "},show:function(t){m.getByClass(document,"survey_content_body_"+t)[0].style.display="block"},hide:function(t){m.getByClass(document,"survey_content_body_"+t)[0].style.display="none"},getData:function(t){var e="true";return 0==s[t].survey.others.true_result&&(e="fake"),s[t].total[e]}},E={init:function(t){this.addDomEvent(t),this.scoreBoxEvent(t)},addDomEvent:function(t){var e=s[t].survey,n=m.getByClass(document.body,"survey_content_body_"+e.id)[0],a=(m.getByClass(n,"survey_score_box"),this);m.addEvent(n,"click",function(s){var n=s.target;if("I"===n.tagName){2==e.others.vote_show?a.nextEvent(n,t):a.scoreEvent(n);var i=m.getParentTagName(n,"UL");m.addClass(i,"active"),m.removeClass(i,"tip"),i.style.background=""}}),m.addEvent(n,"change",function(s){var n=s.target;if(2!=e.others.vote_show||"TEXTAREA"!==n.tagName&&"INPUT"!==n.tagName)switch(n.tagName){case"INPUT":a.inputEvent(n);break;case"I":a.scoreEvent(n)}else a.nextEvent(n,t);var i=m.getParentTagName(n,"UL");m.removeClass(i,"tip"),i.style.background=""}),m.addEvent(n,"mouseover",function(t){var e=t.target;if("I"===e.tagName)for(var s=e.parentNode.getElementsByTagName("i"),n=s.length,a=0;a=s?m.removeClass(n[a],"active"):m.addClass(n[a],"active")}},inputEvent:function(t){var e=m.getParent(t,"survey_content_item"),s=e.getElementsByTagName("input");if("radio"==t.type&&e.setAttribute("data-answer",t.value),"checkbox"==t.type){e.getAttribute("data-min");for(var n=e.getAttribute("data-max"),a=[],i=0,o=0;on)return t.checked=!1,void B.show("最多选择"+n+"项");e.setAttribute("data-answer",a.join("-"))}},scoreEvent:function(t){for(var e=t.parentNode.getElementsByTagName("i"),s=!0,n=0;n0){for(var r=0,c=0;c0){var i=null;if("wechat"!=f){if("client"==f)return void(g&&g.login({},function(t){1==s[n].survey.anti_cheat_strategy?S.init(n):e.postForm(n)}));if(!(window.userInfo||e.getCookie()))return void(window.WapLogin?(i="function"==typeof WapLogin?new WapLogin:this).login(!1,function(t){S.init(n)}):(i=window.SINA_OUTLOGIN_LAYER)&&i.set("plugin",{parentNode:document.body,position:"center"}).register("login_success",function(){S.init(n)}).show())}}1==s[n].survey.anti_cheat_strategy?S.init(n):e.postForm(n)}else"scoreNoPass"!=a.code?B.show("请完善各必填项!",function(){B.highLight()}):B.show("多选题"+a.index+"最少选择"+a.min+"项!",function(){B.highLight()})})},getPostData:function(t){for(var e={survey_id:t,user_info:{user_id:"",user_type:1},vote:[],captcha:{captcha_token:S.captchaToken||"",value:S.value||""}},s=m.getByClass(document.body,"survey_content_item_wrap_"+t)[0],n=m.getByClass(s,"survey_content_item"),a=0;a0){var i=null;"wechat"!=f&&"client"!=f&&(i=window.userInfo||this.getCookie(),a.user_info.user_id=i.uid)}m.ajax(w+o,{method:"post",data:a,success:function(s){if(s){var n=null;switch((n="string"==typeof s?JSON.parse(s):s).result.status.code){case 0:N.changeBtn(t),S.showStatus=!1,S.captchaHide();var a="";return window.sina_survey_config&&"toast"==window.sina_survey_config.tipType&&(a="toast"),void B.show(n.result.status.msg,function(){window.sina_survey_records={},window.sina_survey_records[n.result.data.survey.id]=n.result.data.records,window.sina_survey_config?("_blank"==window.sina_survey_config.resultType?function(e){if(!C.getStatus(t))return;if("wechat"==f||"m"==f||"client_m"==f)window.location.href=w+e.result.data.url+"?time="+(new Date).getTime();else{var s=window.open("about:blank");s.location.href=w+e.result.data.url+"?time="+(new Date).getTime()}}(n):C.show(t,function(){k.hide(t)}),y[e]&&y[e](n)):C.show(t,function(){k.hide(t)})},a);case 106:case 107:S.showStatus=!1,C.show(t,function(){k.hide(t)});break;case 108:case 109:case 110:S.showStatus=!1;break;case 113:return S.status=!0,void B.show(n.result.status.msg,function(){S.getData(t)});case 112:case 114:S.showStatus=!0;break;default:S.showStatus=!1}S.captchaHide(),B.show(n.result.status.msg)}},error:function(t){}})}},C={getStatus:function(t){for(var e=!1,n=s[t].content.question,a=0;a已提交':1==s[t].survey.others.result_show&&n&&(this.init(t),e&&e())},init:function(t){if(!document.querySelector("#sina_survey_result_js_"+t)){var e=document.getElementById("sina_survey_result_css"),s=document.createElement("script"),n=null;t&&(window.sina_survey_config&&(n=window.sina_survey_config.resultCss),n&&!e&&s.setAttribute("data-css",n.toString()),s.setAttribute("data-parent",v[t]),s.id="sina_survey_result_js_"+t,s.type="text/javascript",s.src=w+c+t+".js?v="+(new Date).getTime(),p[t]?p[t].appendChild(s):h.parentNode.insertBefore(s,h),s.onload=s.onreadystatechange=function(){this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||window.sina_survey_config&&window.sina_survey_config.setPercent&&window.sina_survey_config.setPercent(t)})}}},S={init:function(t){this.surveyId=t,this.captchaToken="",this.captchaImg="",this.value="",this.height=this.height||"",this.status=!0,this.showStatus=!1,this.timer=null,this.getData(t)},getData:function(t){var e=this;m.jsonp({url:w+r+t,success:function(s){0==s.result.status.code&&(e.captchaImg=s.result.data.img,e.captchaToken=s.result.data.captcha_token,e.captchaTokenValue=s.result.data.value,e.cBody(t))}})},captchaShow:function(){var t=this;if(this.box){function e(){window.sina_survey_box_mask.style.display="block",t.box.style.display="block"}"pc"!=f?this.setStyle("",function(){e()}):e()}},captchaHide:function(){this.box&&(window.sina_survey_box_mask.style.display="none",this.box.style.display="none")},cBody:function(t){var e=document.createElement("div");e.className="survey_captcha_box clearfix",e.style.display="block",e.innerHTML='

    验证码

    取消确定
    ',this.box?this.box.innerHTML=e.innerHTML:(this.box=e,document.body.appendChild(e)),this.addEvent(e,t),this.captchaShow()},addEvent:function(t,e){var s=this;if("pc"!=f){var n=this.box.getElementsByTagName("input")[0];n.onfocus=function(){s.setStyle("focus")},n.onblur=function(){s.setStyle("blur")}}this.box.ontouchmove=function(t){t.preventDefault()},t.onclick=function(t){if("survey_captcha_cancel"==t.target.className&&s.captchaHide(),"survey_captcha_ok"==t.target.className){if(!s.status)return;s.status=!1;var n=setTimeout(function(){s.status=!0,clearTimeout(n)},1500),a=m.getByClass(document,"survey_captcha_code_"+s.surveyId)[0].value;""!=m.removeSpace(a)?(s.value=a,N.postForm(s.surveyId)):(B.show("请输入验证码!"),s.status=!0)}"survey_captcha_img"==t.target.className&&s.getData(e)}},setStyle:function(t,e){if("m"==f||"pc"==f){var s=this.height||this.box.clientHeight;return s&&(this.height=s),this.box.style.position="fixed",this.box.style.top="50%",this.box.style.marginTop="-"+s/2+"px",void(e&&e())}var n=this,a=navigator.userAgent.toLowerCase(),i="ios";t&&"blur"==t?(clearTimeout(this.timer),this.timer=setTimeout(function(){n.setTop(e),clearTimeout(n.timer)},500)):(-1!=a.indexOf("android")&&(i="android"),"ios"==i?n.setTop(e):"android"==i&&(clearTimeout(this.timer),this.timer=setTimeout(function(){n.setTop(e),clearTimeout(n.timer)},500)))},setTop:function(t){if(window.sina_survey_config&&window.sina_survey_config.setTop)window.sina_survey_config.setTop(this.box,e);else{var s=this.height||this.box.clientHeight;s&&(this.height=s),I(this.box,s)}t&&t()}},B={init:function(){this.height=this.height||"",this.timer=null,this.cBody()},cBody:function(){if(!document.getElementById("survey_tip_box")){var t=document.createElement("div"),e=document.createElement("div");t.id="survey_captcha_box_mask",t.className="survey_captcha_box_mask",e.id="survey_tip_box",e.className="survey_tip_box",e.innerHTML='

    提示

    确定
    ',window.sina_survey_box_mask=t,document.body.appendChild(t),document.body.appendChild(e),m.addEvent(e,"touchmove",function(t){t.preventDefault()}),m.addEvent(t,"touchmove",function(t){t.preventDefault()}),m.addEvent(t,"click",function(t){t.preventDefault()})}},show:function(t,e,s){if(s&&"toast"==s){var n=document.querySelector(".survey_toast_box");return n||((n=document.createElement("div")).className="survey_toast_box",n.innerHTML=t,document.body.appendChild(n)),n.style.display="block",window.sina_survey_config.setTop&&window.sina_survey_config.setTop(n),void setTimeout(function(){n.style.opacity=0,setTimeout(function(){n.style.display="none",n.style.opacity=1},1e3)},1e3)}var a=document.getElementById("survey_captcha_box_mask"),i=document.getElementById("survey_tip_box");i.getElementsByTagName("p")[0].innerHTML=t,a.style.display="block","pc"!=f?this.height?this.setStyle(function(){i.style.display="block"}):(i.style.display="block",this.setStyle()):i.style.display="block",m.getByClass(i,"survey_tip_btn")[0].onclick=function(){S.showStatus&&S.captchaShow(),S.box&&"block"==S.box.style.display||S.showStatus||(a.style.display="none"),i.style.display="none",e&&e()}},highLight:function(){if(3==_.getAttribute("data-type")?_.getElementsByTagName("textarea")[0].focus():m.addClass(_.getElementsByTagName("ul")[0],"tip"),"m"==f){var t=m.getPos(_).top;window.scrollTo(0,t)}},setStyle:function(t){if("m"==f||"pc"==f){var e=document.getElementById("survey_tip_box"),s=this.height||e.clientHeight;return s&&(this.height=s),e.style.position="fixed",e.style.top="50%",e.style.marginTop="-"+s/2+"px",void(t&&t())}var n=this,a="ios",i=0;-1!=navigator.userAgent.toLowerCase().indexOf("android")&&(a="android"),"ios"==a?i=300:"android"==a&&(i=500),clearTimeout(this.timer),this.timer=setTimeout(function(){n.setTop(t),clearTimeout(n.timer)},i)},setTop:function(t){var s=document.getElementById("survey_tip_box");if(window.sina_survey_config&&window.sina_survey_config.setTop)window.sina_survey_config.setTop(s,e);else{var n=this.height||s.clientHeight;n&&(this.height=n),I(s,n)}t&&t()}},I=function(t,e){var s=document.documentElement.scrollTop||document.body.scrollTop,n=document.documentElement.clientHeight||document.body.clientHeight,a=Math.floor((n-e)/2)+s;t.style.position="absolute",t.style.marginTop=0,t.style.top=a+"px"};T(e)}();