';break;case 1:n=' ';break;case 0:n=' ';break;case 6:n=' '}t.val()&&t.val()!=""?t.val(parseInt(t.val(),10)+1):t.val("1");switch(t.val()){case"1":$("#span1").html(n);$("#bnGen").val("Next");break;case"2":$("#span2").html(n);$("#bnGen").val("Next");break;case"3":$("#span3").html(n);$("#bnGen").val("Next");break;case"4":$("#span4").html(n);$("#bnGen").val("Next");break;case"5":$("#span5").html(n);$("#bnGen").val("Next");break;case"6":$("#span6").html(n);$("#bnGen").val("Completed")}t.val()=="6"&&($("#bnGen").attr("disabled","disabled"),o=new Date,o.setTime(o.getTime()+2592e5),Cookies.set("yijinglastgen",f.val(),{expires:o,sameSite:"strict"}),processLoad(f.val(),"1"))}function processLoad(n,t){var i,f;if(t=="0")for(i=0;i ';u=' ';break;case 1:r=' ';u=' ';break;case 0:r=' ';u=' ';break;case 6:r=' ';u=' '}$("#span"+(i+1)).html(r);$("#span"+(i+1)+"_Hu").html(u)}f="/api/SystemAPI/RetrieveYiJingGua?YaoResultStr="+n+"&lan=en-us&track="+t;$.ajax({url:f,type:"POST",dataType:"json",contentType:"application/json; charset=utf-8",success:function(n){onLoadSuccess(n)}})}function retrieveDetails(n,t){var i="/api/SystemAPI/RetrieveYaoDetails?YaoDuanNum="+n+"&gua="+t;$.ajax({url:i,type:"POST",dataType:"json",contentType:"application/json; charset=utf-8",success:function(n){$("#yaoDetailsDiv").html(n)}})}function secondChance2(n,t,i,r){retrieveDetails(i,r);PopupArea(n,t)}function onLoadSuccess(n){var o,e,s,r;if(n!=null){$(".bordered").find("span").each(function(){$(this).css("color","")});var t=n[0],i=n[1],h=n[2],u=t.YiID,f=i.YiID;$("#spanYiName").html(t.YiName+" ("+u+")");$("#spanYiDesc").html(t.YiMainDec+" "+t.YiLiYue+" "+t.XiangYue);$("#spanDesc1").html(t.YaoOne+" "+t.YaoOneXiang+FormatExplain(t.YaoOneExplain)+' ');$("#spanDesc2").html(t.YaoTwo+" "+t.YaoTwoXiang+FormatExplain(t.YaoTwoExplain)+' ');$("#spanDesc3").html(t.YaoThree+" "+t.YaoThreeXiang+FormatExplain(t.YaoThreeExplain)+' ');$("#spanDesc4").html(t.YaoFour+" "+t.YaoFourXiang+FormatExplain(t.YaoFourExplain)+' ');$("#spanDesc5").html(t.YaoFive+" "+t.YaoFiveXiang+FormatExplain(t.YaoFiveExplain)+' ');$("#spanDesc6").html(t.YaoSix+" "+t.YaoSixXiang+FormatExplain(t.YaoSixExplain)+' ');$("#spanDetails").html(t.FullExplain.replace(/\n/g," ").replace(/\r/g,""));$("#spanYiName_Hu").html(i.YiName+" ("+f+")");$("#spanYiDesc_Hu").html(i.YiMainDec+" "+i.YiLiYue+" "+i.XiangYue);$("#spanDesc1_Hu").html(i.YaoOne+" "+i.YaoOneXiang+FormatExplain(i.YaoOneExplain)+' ');$("#spanDesc2_Hu").html(i.YaoTwo+" "+i.YaoTwoXiang+FormatExplain(i.YaoTwoExplain)+' ');$("#spanDesc3_Hu").html(i.YaoThree+" "+i.YaoThreeXiang+FormatExplain(i.YaoThreeExplain)+' ');$("#spanDesc4_Hu").html(i.YaoFour+" "+i.YaoFourXiang+FormatExplain(i.YaoFourExplain)+' ');$("#spanDesc5_Hu").html(i.YaoFive+" "+i.YaoFiveXiang+FormatExplain(i.YaoFiveExplain)+' ');$("#spanDesc6_Hu").html(i.YaoSix+" "+i.YaoSixXiang+FormatExplain(i.YaoSixExplain)+' ');$("#spanDetails_Hu").html(i.FullExplain.replace(/\n/g," ").replace(/\r/g,""));switch(h){case 0:$("#spanYiDesc").css("color","red");$("#spanYiDesc_Hu").css("color","red");break;case 1:$("#spanDesc1").css("color","red");$("#spanDesc1_Hu").css("color","red");break;case 2:$("#spanDesc2").css("color","red");$("#spanDesc2_Hu").css("color","red");break;case 3:$("#spanDesc3").css("color","red");$("#spanDesc3_Hu").css("color","red");break;case 4:$("#spanDesc4").css("color","red");$("#spanDesc4_Hu").css("color","red");break;case 5:$("#spanDesc5").css("color","red");$("#spanDesc5_Hu").css("color","red");break;case 6:$("#spanDesc6").css("color","red");$("#spanDesc6_Hu").css("color","red")}if(o=$("#GuaHF"),o.val()!="")for(e=0;e<6;e++){s=parseInt(o.val().charAt(e),10);r="";switch(s){case 9:r=' ';break;case 1:r=' ';break;case 0:r=' ';break;case 6:r=' '}switch((e+1).toString()){case"1":$("#span1_Hu").html(r);break;case"2":$("#span2_Hu").html(r);break;case"3":$("#span3_Hu").html(r);break;case"4":$("#span4_Hu").html(r);break;case"5":$("#span5_Hu").html(r);break;case"6":$("#span6_Hu").html(r)}}}}function ResetSettings(){var n=$("#StepHF"),t=$("#GuaHF");n.val("");t.val("");$("#span1").html("");$("#span2").html("");$("#span3").html("");$("#span4").html("");$("#span5").html("");$("#span6").html("");$("#spanYiName").html("");$("#spanYiDesc").html("");$("#spanDesc1").html("");$("#spanDesc2").html("");$("#spanDesc3").html("");$("#spanDesc4").html("");$("#spanDesc5").html("");$("#spanDesc6").html("");$("#spanDetails").html("");$("#span1_Hu").html("");$("#span2_Hu").html("");$("#span3_Hu").html("");$("#span4_Hu").html("");$("#span5_Hu").html("");$("#span6_Hu").html("");$("#spanYiName_Hu").html("");$("#spanYiDesc_Hu").html("");$("#spanDesc1_Hu").html("");$("#spanDesc2_Hu").html("");$("#spanDesc3_Hu").html("");$("#spanDesc4_Hu").html("");$("#spanDesc5_Hu").html("");$("#spanDesc6_Hu").html("");$("#spanDetails_Hu").html("");$("#spanYiDesc").removeAttr("style");$("#spanDesc1").removeAttr("style");$("#spanDesc2").removeAttr("style");$("#spanDesc3").removeAttr("style");$("#spanDesc4").removeAttr("style");$("#spanDesc5").removeAttr("style");$("#spanDesc6").removeAttr("style");$("#spanYiDesc_Hu").removeAttr("style");$("#spanDesc1_Hu").removeAttr("style");$("#spanDesc2_Hu").removeAttr("style");$("#spanDesc3_Hu").removeAttr("style");$("#spanDesc4_Hu").removeAttr("style");$("#spanDesc5_Hu").removeAttr("style");$("#spanDesc6_Hu").removeAttr("style");$("#bnGen").removeAttr("disabled");$("#bnGen").attr("value","Start")}function ShowHideHeader(){$("#divDesc").css("display")=="none"?$("#divDesc").css("display","block"):$("#divDesc").css("display","none")}function FormatExplain(n){return n==""?"":" "+n}function DeleteStored(n){$.ajax({url:"/api/SystemAPI/ToDeleteYiJingTrack?TrackID="+n,type:"POST",dataType:"json",contentType:"application/json; charset=utf-8",success:function(t){t&&$("#yijingtrack"+n).remove()}})}$(document).ready(function(){if($("#resetBn").click(function(){confirm("Are you sure to reset?")&&ResetSettings()}),Cookies.get("yijinglastgen")){var n=Cookies.get("yijinglastgen");processLoad(n,"0")}})