﻿//jquery.cookie
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('j.5=u(9,a,2){6(h a!=\'v\'){2=2||{};6(a===m){a=\'\';2.3=-1}4 3=\'\';6(2.3&&(h 2.3==\'n\'||2.3.k)){4 7;6(h 2.3==\'n\'){7=w C();7.B(7.z()+(2.3*A*o*o*E))}l{7=2.3}3=\'; 3=\'+7.k()}4 8=2.8?\'; 8=\'+2.8:\'\';4 b=2.b?\'; b=\'+2.b:\'\';4 c=2.c?\'; c\':\'\';d.5=[9,\'=\',q(a),3,8,b,c].t(\'\')}l{4 g=m;6(d.5&&d.5!=\'\'){4 e=d.5.x(\';\');D(4 i=0;i<e.f;i++){4 5=j.r(e[i]);6(5.p(0,9.f+1)==(9+\'=\')){g=y(5.p(9.f+1));s}}}F g}};',42,42,'||options|expires|var|cookie|if|date|path|name|value|domain|secure|document|cookies|length|cookieValue|typeof||jQuery|toUTCString|else|null|number|60|substring|encodeURIComponent|trim|break|join|function|undefined|new|split|decodeURIComponent|getTime|24|setTime|Date|for|1000|return'.split('|'),0,{}))
//var value= $.cookie("key");
//$.cookie("key",html,{path:"/"});  
$(document).ready(function(){
    if($.cookie("year")!=null&&$.cookie("week")!=null)
    {
        if($.cookie("year")!=""&&$.cookie("week")!="")
        {
            $("#ctl00_Y_UC_SearchLite1_ddlYear").val($.cookie("year"));
        }
        GetWeekByYearWithUC_SearchLite();
    }
}); 
function GetBookList(mod)
    {
    $.cookie("year","");
    $.cookie("week","");
        var a=$("#ctl00_Y_UC_SearchLite1_hidtw").val();
        var b=$("#ctl00_Y_UC_SearchLite1_hidlw").val();
        var c=$("#ctl00_Y_UC_SearchLite1_hidly").val();
        var d=$("#ctl00_Y_UC_SearchLite1_hidy").val();
        var r=isLogin();
        if(r=="0")
        {
             alert("请先登录");
        }
        else if(r=="1")
        {
            if(!document.getElementById("ctl00_Y_UC_BookListEngine1_urlpara")&&!document.getElementById("ctl00_Y_UC_BookListEngine_1_1_urlpara"))
            {
               if(mod==1){
                  $.cookie("year",d,{path:"/"});
                  $.cookie("week",a,{path:"/"});
                  window.location.href=_root+"SearchBooks.aspx?bookDate_begin="+a.split('|')[0]+"&bookDate_end="+a.split('|')[1];
               }else if(mod==2)
               {
                  if(c==b.substr(11,4))
                  {
                      $.cookie("year",c,{path:"/"});
                  }else
                  {
                      $.cookie("year",d,{path:"/"});
                  }
                  $.cookie("week",b,{path:"/"});
                  window.location.href=_root+"SearchBooks.aspx?bookDate_begin="+b.split('|')[0]+"&bookDate_end="+b.split('|')[1];
               }else if(mod==3)
               {
                  $.cookie("year",$("#ctl00_Y_UC_SearchLite1_ddlYear").val(),{path:"/"});
                  $.cookie("week",$("#ctl00_Y_UC_SearchLite1_ddlWeek").val(),{path:"/"});
                  window.location.href=_root+"SearchBooks.aspx?bookDate_begin="+$("#ctl00_Y_UC_SearchLite1_ddlWeek").val().split('|')[0]+"&bookDate_end="+$("#ctl00_Y_UC_SearchLite1_ddlWeek").val().split('|')[1];
               }
            }else
            {
               var urlpara=$("input[id$='_urlpara']").val();
            
               var paraarray=urlpara.split(',');
               var nav_url = _root + "SearchBooks.aspx?";
               var p="";
               if(paraarray[0]!="")
               {
                   p+="&publishName=";
                   //modify by cyc 2010-12-14
                  // alert(paraarray[0]);
                   //p+=escape(paraarray[0]);
                   p+=paraarray[0];
                   
               }
               if(paraarray[1]!=""&&paraarray[2]!="")
               { 
                   if(mod==1)
                   {
                       $.cookie("year",d,{path:"/"});
                       $.cookie("week",a,{path:"/"});
                       p+="&bookDate_begin=";
                       p+=a.split('|')[0];
                       p+="&bookDate_end=";
                       p+=a.split('|')[1];
                   }else if(mod==2)
                   {
                       if(c==b.substr(11,4))
                       {
                          $.cookie("year",c,{path:"/"});
                       }else
                       {
                          $.cookie("year",d,{path:"/"});
                       }
                       $.cookie("week",b,{path:"/"});
                       p+="&bookDate_begin=";
                       p+=b.split('|')[0];
                       p+="&bookDate_end=";
                       p+=b.split('|')[1];
                   }else if(mod==3)
                   {
                       $.cookie("year",$("#ctl00_Y_UC_SearchLite1_ddlYear").val(),{path:"/"});
                       $.cookie("week",$("#ctl00_Y_UC_SearchLite1_ddlWeek").val(),{path:"/"});
                       p+="&bookDate_begin=";
                       p+=$("#ctl00_Y_UC_SearchLite1_ddlWeek").val().split('|')[0];
                       p+="&bookDate_end=";
                       p+=$("#ctl00_Y_UC_SearchLite1_ddlWeek").val().split('|')[1];
                   }
               }
               if(paraarray[3]!="")
               {
                   p+="&title=";
                   p+=escape(paraarray[3]);
               }
               if(paraarray[4]!="")
               {
                   p+="&seriesTitle=";
                   p+=escape(paraarray[4]);
               }
               if(paraarray[5]!="")
               {
                   p+="&author=";
                   p+=escape(paraarray[5]);
               }
               if(paraarray[6]!="")
               {
                   p+="&isbn=";
                   p+=paraarray[6];
               }
               if(paraarray[7]!="")
               {
                   p+="&publishDate=";
                   p+=paraarray[7];
               }
               if(paraarray[8]!="")
               {
                   p+="&kindid=";
                   p+=paraarray[8];
               }
               if(paraarray[9]!="")
               {
                   p+="&plotcompany=";
                   p+=paraarray[9];
               }
               if(p!="")
               {
                  nav_url+=p.substring(1);
               }
              
               window.location.href=encodeURI(nav_url);
            }
        }  
    }


