 

function getZtInfo(keyword) {
	 
  //dwr.util.useLoadingMessage();
    
  fillZtInfo(keyword);
}

var ztsearchResultCache = { };
 
 
function fillZtInfo(keyword) {
 
  
	ZtSearchResult.fillZtSearchResult(keyword, function(ztsearchResult) {

	 
    // Delete all the rows except for the "pattern" row
    dwr.util.removeAllRows("ztshowflag", { filter:function(div) {
		
      return (li.id != "ztpattern");
    }});

	 
    // Create a new set cloned from the pattern row
    var ztInfo, id;
	ztsearchResult.sort(function compare(a,b){return a.id-b.id;});  
     

	 var ztnum=ztsearchResult.length;
	 dwr.util.setValue("syztnum", ztnum+"个");
	 dwr.util.setValue("syztnum1", ztnum+"个");

	 if(ztnum==0){
		 ztshowflag.style.display = "none";
	 }
	 else{
		 ztshowflag.style.display = "";

	 }
	

	 if(ztnum>3) ztnum=3;
    
	 for (var i = 0; i < ztnum; i++) {
		 
      ztInfo = ztsearchResult[i];
      //id = ztInfo.id;
	  id=i+1;
	 
      dwr.util.cloneNode("ztpattern", { idSuffix:id });


	  

	  dwr.util.setValue("zttablePic" + id, "<a href='"+ztInfo.suburl+"' target='_blank'><img src='"+ztInfo.subpic+"' border='0'></a>", { escapeHtml:false });
   
      dwr.util.setValue("zttableName" + id, ztInfo.subname);

	  dwr.util.setValue("zttableDesc" + id, ztInfo.subdesc);

      dwr.util.setValue("zttableUrl" + id,"<a href='"+ztInfo.suburl+"' target='_blank' class=\"cBrown\">进入专题</a>", { escapeHtml:false });
	  //dwr.util.setValue("zttableUrl" + id, ztInfo.suburl, { escapeHtml:false });
  
      $("ztpattern" + id).style.display = ""; // officially we should use table-row, but IE prefers "" for some reason
	   
      ztsearchResultCache[id] = ztInfo;
	  
    }
  });
}

 
