﻿  //设置栏目ID为3
  var funID = 3;
  //设置书籍类别父ID为60
  var parentID = 3;
  //父类名称
  var parentName = encodeURIComponent('杂志');
  //文件路径
  var filePath = '../Magazine';  
  
    //标题长度
  var titleLength = 12;
  //类名长度
  var typeLength = 11;
  //作者长度
  var writeLength = 7;
  //查看方式
  var defaultXslPath = '../UI/ArticleList.xslt';
  var viewType = 1;

  //当前页码
  var currentPage = 1;
  //当前类别名称
  var currentName = '杂志';
  //当前ID
  var currentID = parentID;
  
 function PageSizeProperty(){
   //这里设置不同浏览方式的页尺寸,因为简单方式固定为8,所以为8
   return viewType==1?8:8;
 }
 
   //页尺寸
  var pageSize = PageSizeProperty();
 
 //导航菜单的按钮事件
 function MenuAjaxClick(id, strName){
     currentID = id;
     currentName = strName;
     viewType = 1;
     defaultXslPath = '../UI/ArticleList.xslt';
     strName += "  ";   
     $('titleName').setText(strName);    
     refrsh(pageSize,1, 'refrsh', 'pagination01', $H({'parentID':id, 'xsltPath':defaultXslPath, 'viewType':1}));     
 };
 
 
   //切换浏览方式
  function turnViewType(type){
   switch(type){
     case  1:
         viewType = type;
         defaultXslPath = '../UI/ArticleList.xslt';
         refrsh(pageSize,currentPage, 'refrsh', 'pagination01', $H({'parentID':currentID, 'xsltPath':defaultXslPath, 'viewType':viewType}));
       break;
     case 2:
         viewType = type;
         defaultXslPath = '../UI/ArticleMetailList.xslt';
         refrsh(pageSize,currentPage, 'refrsh', 'pagination01', $H({'parentID':currentID, 'xsltPath':defaultXslPath, 'viewType':viewType}));
       break;
   }
 };
 
     //跳转到明细页
   function GoToDetail(magaID,bookTypeID, bookTypeName, bookName){
      addHitCount(magaID);
      var t = window.location.pathname.toString().split('/');
      var m = t[t.length-1].replace(/#/g,'');
      window.location = 'Detail.aspx?magaID='+encodeURIComponent(magaID)+'&currentID='+encodeURIComponent(bookTypeID)+'&bookTypeID='+encodeURIComponent(currentID)+'&currentName='+encodeURIComponent(bookTypeName)+'&bookTypeName='+encodeURIComponent(currentName)+'&bookName='+encodeURIComponent(bookName)+'&viewType='+encodeURIComponent(viewType)+'&currentPage='+encodeURIComponent(currentPage)+'&returnPage='+encodeURIComponent(m);
   };
   
    //跳转到作者作品页
    function GoToWriterDetail(userID, userName){
      window.open('../main/WriterList.aspx?userID='+encodeURIComponent(userID)+'&userName='+encodeURIComponent(userName),"_blank");
    };  
    
    function GoPage(bookTypeName, bookTypeID){
       window.location='default.aspx?bookTypeID='+escape(bookTypeID)+'&bookTypeName='+escape(bookTypeName);
    };   