function fSplitReplace(e,t){return 0<=e.indexOf("|")&&(e=(e=e.substring(1,e.length-1)).replace(/[|]/g,t)),e}var dToday=new Date,dDate=new Date;function fDateDiff(e,t){e=new Date(e);return e.setDate(e.getDate()+t),e}function fDateStr(e){return e.getFullYear()+""+(e.getMonth()+1<10?"0"+(e.getMonth()+1):e.getMonth()+1)+(e.getDate()<10?"0"+e.getDate():e.getDate())}function fSearchLink(e,t,i){e=document.getElementById(e);e.innerHTML=fSplitReplaceLink(e.innerHTML,"、",i+"&sFilterType="+t+"&sFilter=")}function fSearchKeyword(sObj,sKey,sColor){if(null!=document.getElementById(sObj)){var sKeyNew="",objItem,sKeyNew=""+sKey+"";if(sVar=eval(sObj+".length"),"undefined"==typeof sVar)objItem=eval(sObj),objItem.innerHTML=objItem.innerHTML.replace(new RegExp(sKey,"g"),sKeyNew);else for(i=0;i'+s+"",1==n&&(document.title=s+","+document.title,document.querySelector('meta[property="og:title"]').setAttribute("content",document.title));$("#"+o).html(a)}},error:function(e){console.log(e.responseText)}})}function fMediaChapterLevelMulti(e,n,t,l){e=t+"/API/GetMediaChapterLevel.ashx?iC="+e;$.ajax({url:e,cache:!1,dataType:"json",success:function(e){var t=$.parseJSON(JSON.stringify(e));if("0"==t.iErrorCode){var s,a="";for(i=1;i<=t.oItemList.length;i++)s=t.oItemList[i-1].sChapter,a+=''+s+"";var o,r=n.split("|");for(o in r)$("#"+r[o]).html(a)}},error:function(e){console.log(e.responseText)}})}function fMediaChapterLevelNoLink(e,o,t,r){e=t+"/API/GetMediaChapterLevel.ashx?iC="+e;$.ajax({url:e,cache:!1,dataType:"json",success:function(e){var t=$.parseJSON(JSON.stringify(e));if("0"==t.iErrorCode){var s="",a="",e="";for(i=1;i<=t.oItemList.length;i++)s+="、"+t.oItemList[i-1].sChapter,a+=""+t.oItemList[i-1].sChapter+"";e=r+","+s,$("#"+o).html(a),$("#sSubject").val(e.replace(",、",","))}},error:function(e){console.log(e.responseText)}})}function fMediaChapterLevelNoLinkReturn(e,t){var e=t+"/API/GetMediaChapterLevel.ashx?iC="+e,s="";return $.ajax({url:e,async:!1,cache:!0,dataType:"json",success:function(e){var t=$.parseJSON(JSON.stringify(e));if("0"==t.iErrorCode)for(s="",i=1;i<=t.oItemList.length;i++)t.oItemList[i-1].sChapter,s+=""+t.oItemList[i-1].sChapter+""},error:function(e){console.log(e.responseText)}}),s}function fMediaChapterList(e,o,t,r){t=t+"/API/GetMediaChapterList.ashx?iC="+e;$.ajax({url:t,cache:!1,dataType:"json",success:function(e){var t=$.parseJSON(JSON.stringify(e));if("0"==t.iErrorCode){var s,a="";for(i=1;i<=t.oItemList.length;i++)s=t.oItemList[i-1].sChapter,a+='
  • '+s+"
  • ";$("#"+o).html(a)}},error:function(e){console.log(e.responseText)}})}function fMediaItemShowPageiBrain(e,t,s,g,u,L,I,a){var w=t,v=L+"&iC="+e,a=u+"/API/GetMediaItemShowiBrain.ashx?iC="+e+"&iPNO="+t+"&iPC="+s+"&iMP="+a;$.ajax({url:a,cache:!1,dataType:"json",success:function(e){var t=$.parseJSON(JSON.stringify(e));if("0"==t.iErrorCode){var s,a,o,r,n,l,p,m="",c=0;for(i=1;i<=t.oItemList.length;i++)c=t.oItemList[i-1].iTotalCount,s=t.oItemList[i-1].iSeq,iMediaItem=t.oItemList[i-1].iMediaItem,sTitle=t.oItemList[i-1].sTitle,rScore=t.oItemList[i-1].rScore,l=t.oItemList[i-1].iMediaType,p=t.oItemList[i-1].iChapter1,o=t.oItemList[i-1].sStudentName,r=t.oItemList[i-1].sMediaItemType,n=t.oItemList[i-1].sTitleSub,a=I+"&iS="+s+"&iM="+iMediaItem+"&iC="+p,m+="
    ",m+=3==l?""+fSplitReplace(o,"")+"":1==l||2==l||6==l?""+fSplitReplace(o,"")+"":""+fSplitReplace(o,"")+"",m+="",t.oItemList[i-1].sDate>fDateStr(dDate)&&(m+=" "),m+=3==l?" ":"",m+="",m+="

    "+sTitle+"

    ",m+="

    "+t.oItemList[i-1].iCountPlay,0"+o+"

    "),0"+n+"

    "),0"+fSplitReplace(r,"、")+"

    "),m+="
    ",fMediaChapterLevelNoLink(p,"ParentChapter_"+s,u,"");$("#"+g).html(m);var h="",d=Math.ceil(c/iPageCount);if($("#"+g+"PageRecord").html("第 "+w+" 頁,共 "+d+"頁 "+c+"筆資料"),d<=5)for(var f=1;f<=d;f++)h+=w==f?""+f+" ":""+f+" ";else if(w<5){for(f=1;f<=5;f++)h+=w==f?""+f+" ":""+f+" ";h+="... ",h+=""+d+" "}else if(d-3<=w){h+="1 ",h+="... ";for(f=d-4;f<=d;f++)h+=w==f?""+f+" ":""+f+" "}else{h+="1 ",h+="... ";for(f=w-1;f<=w+1;f++)h+=w==f?""+f+" ":""+f+" ";h+="... ",h+=""+d+" "}$("#"+g+"Page").html(h),$("#"+g+"Page2").html(h)}else $("#"+g).hide},error:function(e){console.log(e.responseText)}})}function fMediaItemShowNextChapteriBrain(e,r,n,t,l){e=t+"/API/GetMediaItemShowNext2.ashx?iS="+e+"&iC="+r;$.ajax({url:e,cache:!0,dataType:"json",success:function(e){var t=$.parseJSON(JSON.stringify(e));if("0"==t.iErrorCode){var s,a,o="";for(i=1;i<=t.oItemList.length;i++)s=t.oItemList[i-1].iSeq,a=t.oItemList[i-1].sTitle,o+="
  • "+a+"
  • ";$("#"+n).html(o)}else $("#"+n).hide()},error:function(e){console.log(e.responseText)}})}function fMediaGroupItemShowDetail(c,h,d,f,g){var e=g+"/API/GetMediaGroupItemShowDetail.ashx?iS="+c;$.ajax({url:e,async:!1,dataType:"json",success:function(e){var t,i,s,a,o,r,n,l="",p="",m="";sPoster=e.oItemList[0].sPoster,sFileVideoHLS=e.oItemList[0].sFileVideoHLS,iMediaType=e.oItemList[0].iMediaType,sVideoHight=1==iMediaType?437:40,i=e.oItemList[0].sTitle,t=e.oItemList[0].iChapter1,document.title=i+","+document.title,s=e.oItemList[0].sSubTitle,a=e.oItemList[0].sFileHtml,o=e.oItemList[0].sDescription,r=e.oItemList[0].sDescription2,n=e.oItemList[0].sStudentName,e.oItemList[0].sAuthor,l+="

    "+i+"人氣"+e.oItemList[0].iCountPlay+"

    ",l+="
    ",0"+s+"
    "),0講義試閱"),l+="",l+="我要諮詢",l+="
    ",6==iMediaType&&(l+="
    ",l+="
    ",l+=""),(0"+n+o+"
    "+r+""),m+=i+" (  )",fMediaChapterLevelNoLink(t,"AskChapter",g,i),fMediaItemShowLink9(c,"ShopLink",g),$("#"+h).html(l),$("#"+d).html(p),$("#"+f).html(m)},error:function(e){console.log(e.responseText)}})}function fMediaItemShowLink9(e,a,t){e=t+"/API/GetMediaShowItemLink.ashx?iS="+e+"&iF=9";$.ajax({url:e,cache:!0,dataType:"json",success:function(e){var t=$.parseJSON(JSON.stringify(e));if("0"==t.iErrorCode){var s="";for(i=1;i<=t.oItemList.length;i++)t.oItemList[i-1].iSeq,s+="";$("#"+a).html(s)}else $("#"+a).hide()},error:function(e){console.log(e.responseText)}})}function fMediaItemShowLink10(e,o,r){e=r+"/API/GetMediaShowItemLink.ashx?iS="+e+"&iF=10";$.ajax({url:e,cache:!0,dataType:"json",success:function(e){var t=$.parseJSON(JSON.stringify(e));if("0"==t.iErrorCode){var s,a;for(i=1;i<=t.oItemList.length;i++)t.oItemList[i-1].iSeq,s=t.oItemList[i-1].iId,a=t.oItemList[i-1].sValue,fMediaAuthor(t.oItemList[i-1].sAuthor,s,a,o,r)}else $("#"+o).hide(),$("#"+o+"Zone").hide()},error:function(e){console.log(e.responseText)}})}function fMediaAuthor(e,l,t,p,s){t=s+"/API/GetMediaAuthor.ashx?sA="+e+"&iMP="+l+"&sV="+t;$.ajax({url:t,cache:!0,dataType:"json",success:function(e){var t=$.parseJSON(JSON.stringify(e));if("0"==t.iErrorCode){e=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""];e[0]="https://www.get.com.tw/media/goldensun/ListDetail.aspx?",e[52]="https://www.get.com.tw/media/goldensun/ListDetail.aspx?",e[23]="https://www.get.com.tw/media/apex/ListDetail.aspx?",e[53]="https://www.get.com.tw/media/cpa/ListDetail.aspx?",e[54]="https://www.get.com.tw/media/master/ListDetail.aspx?",e[55]="https://www.get.com.tw/media/lawyer/ListDetail.aspx?",e[56]="https://www.get.com.tw/media/doctor/ListDetail.aspx?",e[63]="https://www.get.com.tw/media/sw/ListDetail.aspx?",e[64]="https://www.get.com.tw/media/real-estate/ListDetail.aspx?",e[65]="https://www.get.com.tw/media/transfer/ListDetail.aspx?",e[66]="https://www.get.com.tw/media/civil/ListDetail.aspx?",e[76]="https://www.get.com.tw/media/goldensun/ListDetail.aspx?";var s,a,o,r=e[l],n="";for(i=1;i<=t.oItemList.length;i++)s=t.oItemList[i-1].iSeq,iMediaItem=t.oItemList[i-1].iMediaItem,a=t.oItemList[i-1].sTitle,o=t.oItemList[i-1].sStudentName,n+="
  • "+o+":"+a+"
  • ";""!=n&&($("#"+p).html(n),$("#"+p+"Zone").show())}else $("#"+p).hide()},error:function(e){console.log(e.responseText)}})}dDate=fDateDiff(dToday,-365);