$reg("qiyi.action.FeedBack",function(){var b="http://static.qiyi.com/ext/common/speedTest.swf?t="+new Date().getTime();var a="http://data.video.qiyi.com/videos/movie/20100327/d6ae00d77468471c0fba3a53a0273891.f4v";qiyi.action.FeedBack={init:function(c){this.initElement();this.initEvent();this._info=[0,0,0,0,0,"0@0@0","0"];if(!lib.ipad){this.initSpeedTestFlash();this.setAvailable()}else{$("#j-speed-show").parent().parent().parent().css("display","none")}window.getFlashSpeedOk=function(f,e){if(!f){f=[0,0,0]}else{for(var d=0;d<f.length;d++){if(!f[d]){f[d]="0"}}}qiyi.action.FeedBack.setPlayerSpeed(this.format(f));qiyi.action.FeedBack.setUserInfo(e)}.bind(this)},initElement:function(){this._els={box:$("#j-speed-box"),bar:$("#j-speed-bar"),per:$("#j-speed-per"),result:$("#j-speed-result"),stop:$("#j-speed-stop"),sub:$("#feedbacksubmit"),mes:$("#j-speed-text")}},setAvailable:function(){var c=document.getElementById("fb_class1").checked;if(c){this.disSubmit()}},disSubmit:function(){this._els.sub.attr("class","bzfkBtn disabled");this._els.sub.attr("disabled","disabled")},enSubmit:function(){this._els.sub.attr("class","bzfkBtn bzBg");this._els.sub.removeAttr("disabled","disabled")},initEvent:function(){if(!lib.ipad){this._els.stop.on("click",this.stop.bind(this))}this._els.sub.on("mouseover",this.subOver.bind(this));this._els.sub.on("mouseout",this.subOut.bind(this))},subOver:function(){if(this._els.sub.attr("disabled")){return}this._els.sub.attr("class","bzfkBtn2 bzBg")},subOut:function(){if(this._els.sub.attr("disabled")){return}this._els.sub.attr("class","bzfkBtn bzBg")},initSpeedTestFlash:function(){var c=a+"?t="+new Date().getTime();var d=['<object height="1" width="1" align="middle" id="speedTest_ob" name="speedTest_ob" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">','<param value="always" name="allowScriptAccess"/>','<param value="all" name="allowNetworking"/>','<param value="'+b+'" name="movie"/>','<param value="high" name="quality"/>','<param value="url='+c+'" name="flashvars"/>','<param value="transparent" name="wmode"/>','<param value="#A4B6C8" name="bgcolor"/>','<embed height="1" width="1" align="middle" type="application/x-shockwave-flash" allowNetworking="all" allowscriptaccess="always" name="speedTest_em" id="speedTest_em" flashvars="url='+a+'" swliveconnect="true" bgcolor="#A4B6C8" quality="high" src="'+b+'"/></object>'];$("#j-speed-flashBox").html(d.join(""))},loadStart:function(){this.getPlayerSpeed();this._els.mes.html("测速进行中，您可先填写反馈内容！")},loadError:function(c){this._info[3]=5;this.autoComplete(this.getPer())},getPer:function(){return parseInt(this._els.per.html())||10},loadding:function(d,g,f,h){if(this._info[3]==4){return}if(d>0&&!this.state){this.enSubmit();this.state=true}if(!h||h.length<3){h=0}this._info[0]=g;this._info[1]=f;this._info[2]=h;this._info[3]=1;d=d>1?1:d||0;var e=Math.floor(d*100),c=e+"%";this._els.per.html(c);this._els.bar.css("width",c)},overTime:function(d,c){this._info[0]=30;this._info[3]=3;this.autoComplete(this.getPer())},requestOverTime:function(){this._info[0]=10;this._info[3]=4;this.autoComplete(this.getPer())},isLoadDone:function(c){if(!this.loadComplete){this._els.sub.css("visibility","hidden");this._els.stop.parent().show();return false}else{return true}},loadDone:function(d,c){this._info[3]=1;this.end()},autoComplete:function(c){if(c>=100){this.end();return}this._els.bar.css("width",c+"%");this._els.per.html(c+"%");setTimeout(function(d){this.autoComplete(d+5)}.bind(this,c),100)},end:function(){this.state=false;this.enSubmit();this.loadComplete=true;this._els.sub.css("visibility","visible");this._els.mes.html("测速完成,请填写反馈内容后提交");this._els.bar.css("width","100%");this._els.per.html("100%");this._els.result.val(this.format(this._info));this._els.stop.parent().hide()},format:function(c){return c.join("@")},setUserInfo:function(c){this._info[6]=this.formatUserInfo(c)},formatUserInfo:function(e){if(!e){return"0"}var f=[];for(var d=0,c=e.length;d<c;d++){f.push(e[d]+"<br/>")}return f.join("")},stop:function(){this.loadComplete=true;this._info[3]=2;this._els.result.val(this.format(this._info));$("#feedbacksubmit").elements()[0].click()},setDispatcherStatus:function(d,c){this._info[4]=d+""+c},getPlayerSpeed:function(){this.getFlash().getFlashSpeed()},setPlayerSpeed:function(c){this._info[5]=c},getFlash:function(){return lib.component.PlayHistory.ctrl.getFlash()}};$(window).on("load",function(){setTimeout(function(){qiyi.action.FeedBack.init()},500)})});function wentiFun(b,a){var c=document.getElementById(b).getElementsByTagName("dt");for(i=0;i<c.length;i++){c[i].con=document.getElementById(b).getElementsByTagName("dd")[i];c[i].onmouseover=function(){this.style.cssText="background:#ffffca;border:1px solid #ccc;line-height:28px;text-indent:24px;"};c[i].onmouseout=function(){this.style.cssText=""};c[i].onclick=function(){this.className==a?(this.className="",this.con.style.display="none"):(this.className=a,this.con.style.display="block")}}}wentiFun("wtDl","wtDlOpen");var title=new ShowHideObj("click","","",2);title.addElement("t1","c1");title.addElement("t2","c2");function showWentiDom(a){dt_=document.getElementById("wtDl").getElementsByTagName("dt")[a];dd_=document.getElementById("wtDl").getElementsByTagName("dd")[a];dt_.className="wtDlOpen";dd_.style.display="block";title.showItem(document.getElementById("t1"))}var v_id_="";var v_title_="";var entry_class_="";var sound_="";var url=new Url(document.location.href);v_id_=url.getParam("id");v_title_=url.getParam("title");if(v_title_!=""){v_title_=decodeURIComponent(v_title_)}entry_class_=url.getParam("entry");sound_=url.getParam("sound");var uplevel_url_=document.referrer;if(entry_class_=="bfyeding"||entry_class_=="banquan"||entry_class_=="huanchong"||entry_class_=="guzhang"||entry_class_=="shouxian"||entry_class_=="duoci"){$("#fb_class1").checked=true}else{if(entry_class_=="yedi"||entry_class_=="shouye"){$("#fb_class2").checked=true}else{if(entry_class_=="liebiao"||entry_class_=="sousuo"){$("#fb_class3").checked=true}else{if(entry_class_=="bangzhu"){$("#fb_class4").checked=true}}}}var selectedClass="";var GenerateTicket=function(){this.url_=new Interface("http://feedback.qiyi.com/f/b/g.html")};GenerateTicket.prototype={getTicket:function(){var a=this;this.url_.request({GET:"",onSuccess:function(b){a.getTicketResult(b)},onError:function(b){a.getTicketResult(b)}})}};var ticket=new GenerateTicket();ticket.getTicketResult=function(a){$("#ft").val(a)};ticket.getTicket();$("#feedbacksubmit").on("click",function(){if(!lib.ipad){if(!qiyi.action.FeedBack.isLoadDone()){return}$("#feedbacksubmit")[0].disable="disabled";var a=GetSwfVer()}var b=lib.component.PlayHistory.model.getStringData();if(checkForm()){var d=new FeedBack();var c={ticket:document.getElementById("ft").value,uplevel_url:uplevel_url_,entry_class:entry_class_,content:$("#content").val(),fb_class:selectedClass,email:$("#email").val(),phone:$("#phone").val(),v_id:v_id_,v_title:v_title_,flash_version:a,flash_sound:sound_,record:unescape(b),speed_test:$("#j-speed-result").val(),input_country:$("#j-country")[0].disabled?"":$("#j-country").val(),input_province:$("#j-province")[0].disabled?"":$("#j-province").val(),input_city:$("#j-city")[0].disabled?"":$("#j-city").val(),input_isp:$("#j-ispname").val(),country:correctArea.curr.country,province:correctArea.curr.province,city:correctArea.curr.city,isp:correctArea.curr.isp};d.feedBackSuccess=function(e){if(e=="success"){$("#topInfo2").css("display","none");$("#paixu").css("display","none");$("#c1").css("display","none");$("#c2").css("display","none");$("#successField").css("display","block")}else{d.feedBackError(e)}};d.feedBackError=function(e){$("#successField").css("display","none");alert("连接超时，请刷新页面重试！")};d.submitFeedBackInfo(c)}});var FeedBack=function(){this.url=new Interface("http://feedback.qiyi.com/f/b/s.html")};FeedBack.prototype={submitFeedBackInfo:function(b){var a=this;this.url.request({POST:b,onSuccess:function(c){a.feedBackSuccess(c)},onError:function(c){a.feedBackError(c)}})}};var checkForm=function(){if($("#fb_class1")[0].checked==true){selectedClass=$("#fb_class1").val()}else{if($("#fb_class2")[0].checked==true){selectedClass=$("#fb_class2").val()}else{if($("#fb_class3")[0].checked==true){selectedClass=$("#fb_class3").val()}else{if($("#fb_class4")[0].checked==true){selectedClass=$("#fb_class4").val()}else{if($("#fb_class5")[0].checked==true){selectedClass=$("#fb_class5").val()}else{errorMsg(1);return false}}}}}if($("#content")){if($("#content").val().length>2000){errorMsg(2);return false}}if($("#phone")){if($("#phone").val()!=""&&$("#phone").val().search(/((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/)==-1){errorMsg(3);return false}}if($("#email")){if($("#email").val()!=""&&$("#email").val().search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)==-1){errorMsg(4);return false}}return true};var errorMsg=function(a){switch(a){case 1:$("#erroClass").css("display","block");break;case 2:$("#erroContent").css("display","block");break;case 3:$("#erroPhone").css("display","block");break;case 4:$("#erroMail").css("display","block");break}};var correctArea={region:lib.$("#j-region"),ip:lib.$("#j-ip"),isp:lib.$("#j-isp"),country:lib.$("#j-country"),province:lib.$("#j-province"),city:lib.$("#j-city"),ispname:lib.$("#j-ispname"),arealist:lib.$("#j-arealist")};var prolist=correctArea.arealist.html().split(","),citylist=[];var currCountry,currProvince=-1;var opt=lib.Element.create("option");opt.html("选择国家");opt.attr("value","");correctArea.country.append(opt);opt=lib.Element.create("option");opt.html("中国");opt.attr("value","中国");correctArea.country.append(opt);opt=lib.Element.create("option");opt.html("其他");opt.attr("value","其他");correctArea.country.append(opt);correctArea.country.on("change",function(){currCountry=this.value;checkProv();checkCity()});initProv();initCity();function initProv(){if(!correctArea.province[0].options||correctArea.province[0].options.length==0){var b=lib.Element.create("option");b.html("选择省份");b.attr("value","");correctArea.province.append(b);for(var a=0;a<prolist.length;a++){b=lib.Element.create("option");var c=prolist[a].split(":");b.html(c[0].replace("\n",""));b.attr("value",c[0].replace("\n",""));correctArea.province.append(b);citylist[a]=c[1].split("#")}correctArea.province.on("change",function(){currProvince=this.selectedIndex-1;initCity()})}checkProv()}function checkProv(){if(currCountry!="中国"){correctArea.province.attr("disabled","disabled")}else{correctArea.province.removeAttr("disabled")}}function initCity(){correctArea.city.html("");var b=lib.Element.create("option");b.html("选择市/县");b.attr("value","");correctArea.city.append(b);checkCity();var c=citylist[currProvince];if(c){for(var a=0;a<c.length;a++){var b=lib.Element.create("option");b.html(c[a].replace("\n",""));b.attr("value",c[a].replace("\n",""));correctArea.city.append(b)}}}function checkCity(){if(currCountry!="中国"||currProvince<0){correctArea.city.attr("disabled","disabled")}else{correctArea.city.removeAttr("disabled")}}JsLoad.request("http://iplocation.geo.qiyi.com/cityjson",{CACHE:{varname:"returnIpCity"},onSuccess:function(a){if(a.country){correctArea.region.html(a.country)}if(a.province){correctArea.region.html(correctArea.region.html()+" "+a.province)}if(a.city){correctArea.region.html(correctArea.region.html()+" "+a.city)}if(a.ip){correctArea.ip.html(a.ip)}if(a.isp){correctArea.isp.html(a.isp)}correctArea.curr=a},onError:function(a){}});document.domain="qiyi.com";
