var sSiteChannel='';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"+a[o]+""+i;e=s.substring(0,s.length-1)}return e}function fSplitReplaceLinkTop(e,i,t,s){if(0<=e.indexOf("|")){for(var a="",o=(e=e.substring(1,e.length-1)).split("|"),r=0;r"+o[r]+""+i,!(s<=r));r++);e=a.substring(0,a.length-1)}return e}function fSplitReplaceLinkTopMulti(e,i,t,s,a,o,r){if(0<=e.indexOf("|")){for(var l="",n=(e=e.substring(1,e.length-1)).split("|"),d=0;d"+n[d]+""+i,!(s<=d));d++);e=l.substring(0,l.length-1)}return e}function fMediaChapterLevel(e,o,t,r,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+"",1==l&&document.querySelector('meta[property="og:title"]').setAttribute("content",document.title);$("#"+o).html(a)}},error:function(e){console.log(e.responseText)}})}function fMediaChapterLevelMulti(e,l,t,n){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=l.split("|");for(o in r)$("#"+r[o]).html(a)}},error:function(e){console.log(e.responseText)}})}function fMediaChapterList(e,l,t,n){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,o,r="";for(i=1;i<=t.oItemList.length;i++)s=t.oItemList[i-1].sChapter,a=t.oItemList[i-1].iShelfLink,o=t.oItemList[i-1].sLink,1==a&&0'+s+"":r+='
  • '+s+"
  • ";$("#"+l).html(r)}},error:function(e){console.log(e.responseText)}})}function fMediaItemShowPageGet(m,e,t,f,s,a,h,u,o,r,l){var I=e,L=a+"&iC="+m,l=s+"/API/GetMediaItemShowGet.ashx?iC="+m+"&iPNO="+e+"&iPC="+t+"&iMP="+o+"&sFilter="+r+"&sFT="+l;$.ajax({url:l,cache:!1,dataType:"json",success:function(e){var t=$.parseJSON(JSON.stringify(e));if("0"==t.iErrorCode){var s,a,o,r,l="",n=0;for(i=1;i<=t.oItemList.length;i++)n=t.oItemList[i-1].iTotalCount,s=t.oItemList[i-1].iSeq,sTitle=t.oItemList[i-1].sTitle,o=t.oItemList[i-1].sKeyword,rScore=t.oItemList[i-1].rScore,r=t.oItemList[i-1].iMediaType,t.oItemList[i-1].iChapter1,a=h+"&iC="+m+"&iS="+s,l+="
    ",l+=3==r?"
    "+fSplitReplace(t.oItemList[i-1].sStudentName,"")+"
    ":"
    "+fSplitReplace(t.oItemList[i-1].sStudentName,"")+"
    ",l+="
    ",l+="
    "+t.oItemList[i-1].iCountPlay+"
    ",l+="
    "+t.oItemList[i-1].sChapter1+"
    ",l+="",l+="
    ",l+="
    "+t.oItemList[i-1].sTitleSub+"
    ",0"+parseInt(rScore)+""),l+="
    "+fSplitReplace(t.oItemList[i-1].sStudentName,"、")+""+fSplitReplaceLinkTop(t.oItemList[i-1].sStudentType,"、",u+"&iC="+m+"&sFilterType=0&sFilter=",3)+"
    ",l+="
    "+fSplitReplaceLinkTop(t.oItemList[i-1].sAuthorName,"、",u+"&iC="+m+"&sFilterType=A&sFilter=",5)+"
    ",l+="
    "+fSplitReplaceLinkTop(t.oItemList[i-1].sMediaItemType,"、",u+"&iC="+m+"&sFilterType=0&sFilter=",3)+"
    ",l+="
    "+fSplitReplaceLinkTop(o," ",u+"&iC="+m+"&sFilterType=K&sFilter=",5)+"
    ",l+="
    ";$("#"+f).html(l);var d="",p=Math.ceil(n/iPageCount);if($("#"+f+"PageRecord").html("第 "+I+" 頁,共 "+p+"頁 "+n+"筆資料"),p<=5)for(var c=1;c<=p;c++)d+=I==c?""+c+" ":""+c+" ";else if(I<5){for(c=1;c<=5;c++)d+=I==c?""+c+" ":""+c+" ";d+="... ",d+=""+p+" "}else if(p-3<=I){d+="1 ",d+="... ";for(c=p-4;c<=p;c++)d+=I==c?""+c+" ":""+c+" "}else{d+="1 ",d+="... ";for(c=I-1;c<=I+1;c++)d+=I==c?""+c+" ":""+c+" ";d+="... ",d+=""+p+" "}$("#"+f+"Page").html(d),$("#"+f+"Page2").html(d)}else $("#"+f).hide},error:function(e){console.log(e.responseText)}})}function fMediaItemShowPageGetMulti(u,e,t,I,s,a,L,g,o,S,T,y,v,C){var F=e,b=a+"&iC="+u+"&sFilter="+S+"&sFT="+T+"&sD="+y+"&sStuType="+v+"&sMType="+C,o=s+"/API/GetMediaItemShowGetMulti.ashx?iC="+u+"&iPNO="+e+"&iPC="+t+"&iMP="+o+"&sFilter="+S+"&sFT="+T+"&sD="+y+"&sStuType="+v+"&sMType="+C;$.ajax({url:o,cache:!1,dataType:"json",success:function(e){var t=$.parseJSON(JSON.stringify(e));if("0"==t.iErrorCode){var s,a,o,r,l,n,d,p="",c=0;for(i=1;i<=t.oItemList.length;i++)c=t.oItemList[i-1].iTotalCount,s=t.oItemList[i-1].iSeq,sTitle=t.oItemList[i-1].sTitle,o=t.oItemList[i-1].sKeyword,rScore=t.oItemList[i-1].rScore,r=t.oItemList[i-1].iMediaType,t.oItemList[i-1].iChapter1,l=t.oItemList[i-1].sDate,n=t.oItemList[i-1].sStudentType,d=t.oItemList[i-1].sMediaItemType,a=L+"&iC="+u+"&iS="+s,p+="
    ",p+=3==r?"
    "+fSplitReplace(t.oItemList[i-1].sStudentName,"")+"":"
    "+fSplitReplace(t.oItemList[i-1].sStudentName,"")+"",p+="
    "+t.oItemList[i-1].sChapter1+"
    ",p+="
    "+t.oItemList[i-1].iCountPlay+"
    ",p+="
    ",p+="",p+="
    ",p+="
    "+t.oItemList[i-1].sTitleSub+"
    ",0"+parseInt(rScore)+""),p+="
    "+fSplitReplace(t.oItemList[i-1].sStudentName,"、")+""+fSplitReplaceLinkTopMulti(n,"、",g+"&iC="+u+"&sFilterType="+T+"&sFilter="+S+"&sStuType=",3,y,v,C)+"
    ",p+="
    "+fSplitReplaceLinkTopMulti(t.oItemList[i-1].sAuthorName,"、",g+"&iC="+u+"&sFilterType=A&sFilter=",5,y,v,C)+"
    ",p+="
    "+l+"
    ",p+="
    "+fSplitReplaceLinkTopMulti(d,"+",g+"&iC="+u+"&sFilterType="+T+"&sFilter="+S+"&sMType=",3,y,v,C)+"
    ",p+="
    "+fSplitReplaceLinkTopMulti(o," ",g+"&iC="+u+"&sFilterType=K&sFilter=",5,y,v,C)+"
    ",p+="
    ";$("#"+I).html(p);var m="",f=Math.ceil(c/iPageCount);if($("#"+I+"PageRecord").html("第 "+F+" 頁,共 "+f+"頁 "+c+"筆資料"),f<=5)for(var h=1;h<=f;h++)m+=F==h?""+h+" ":""+h+" ";else if(F<5){for(h=1;h<=5;h++)m+=F==h?""+h+" ":""+h+" ";m+="... ",m+=""+f+" "}else if(f-3<=F){m+="1 ",m+="... ";for(h=f-4;h<=f;h++)m+=F==h?""+h+" ":""+h+" "}else{m+="1 ",m+="... ";for(h=F-1;h<=F+1;h++)m+=F==h?""+h+" ":""+h+" ";m+="... ",m+=""+f+" "}$("#"+I+"Page").html(m),$("#"+I+"Page2").html(m)}else $("#"+I).hide},error:function(e){console.log(e.responseText)}})}function fMediaItemShowNextChapter(e,l,n,t,d){e=t+"/API/GetMediaItemShowNext.ashx?iS="+e+"&iC="+l;$.ajax({url:e,cache:!0,dataType:"json",success:function(e){var t=$.parseJSON(JSON.stringify(e));if("0"==t.iErrorCode){var s,a,o,r="";for(i=1;i<=t.oItemList.length;i++)s=t.oItemList[i-1].iSeq,a=t.oItemList[i-1].sTitle,o=d+"&iS="+s+"&iC="+l,-1==t.oItemList[i-1].iRow?r+="
      ":r+="
        ",r+="
      1. "+a+"
      2. ",r+="
      ";$("#"+n).html(r)}else $("#"+n).hide()},error:function(e){console.log(e.responseText)}})}function fMediaItemShowDetail(e,p,c,i,m,f,h,t,u,I){e=i+"/API/GetMediaItemShowDetail.ashx?iS="+e;$.ajax({url:e,async:!1,dataType:"json",success:function(e){var i,t,s,a,o,r,l,n,d=$.parseJSON(JSON.stringify(e));"0"==d.iErrorCode?(i=0,e=n=l=r=o=a=s=t="",sFileVideoHLS=d.oItemList[0].sFileVideoHLS,iMediaType=d.oItemList[0].iMediaType,sVideoHight=1==iMediaType?437:40,t=d.oItemList[0].sTitle,i=d.oItemList[0].iChapter1,d.oItemList[0].sSubTitle,d.oItemList[0].sFileHtml,a=d.oItemList[0].sDescription,o=d.oItemList[0].sDescription2,d.oItemList[0].sStudentName,r=d.oItemList[0].sStudentType,l=d.oItemList[0].sMediaItemType,sMyDate=d.oItemList[0].sDate,d.oItemList[0].sAuthor,s=d.oItemList[0].sKeyword,scategory=d.oItemList[0].sChapter1,e+=t,n+="
      ",n+="
      ",n+="
      "+fSplitReplaceLinkTopMulti(l,"+",m+"&iC="+i+"&sFilterType="+h+"&sFilter="+f+"&sMType=",3,"",u,I)+"
      ",n+="
      "+t+"
      ",n+="
      "+fSplitReplaceLinkTopMulti(s," ",m+"&iC="+i+"&sFilterType=K&sFilter=",5,"",u,I)+"
      ",3==iMediaType?n+="
      "+fSplitReplace(d.oItemList[0].sStudentName,"")+"
      ":n+="
      "+fSplitReplace(d.oItemList[0].sStudentName,"")+"
      ",n+="
      ",n+="
      "+d.oItemList[0].sTitleSub+"
      ",n+="
      "+fSplitReplace(d.oItemList[0].sStudentName,"、")+""+fSplitReplaceLinkTopMulti(r,"、",m+"&iC="+i+"&sFilterType="+h+"&sFilter="+f+"&sStuType=",3,"",u,I)+"
      ",n+="
      "+fSplitReplaceLinkTopMulti(d.oItemList[0].sAuthorName,"、",m+"&iC="+i+"&sFilterType=A&sFilter=",5,"",u,I)+"
      ",n+="
      "+d.oItemList[0].sBranch+"
      ",n+="
      "+sMyDate+"
      ",n+="
      ",n+="
      "+d.oItemList[0].iCountPlay+"
      ",n+="
      ",(0"+a+"
      "+o+"
      "),n+="
    ",$("#"+p).html(n),$("#"+c).html(e)):($("#"+p).hide(),$("#"+c).hide())},error:function(e){console.log(e.responseText)}})}dDate=fDateDiff(dToday,-365);