﻿
 
 function SubmITKeyClick(button)  
    {     
     if (event.keyCode == 13)  
     {         
      event.keyCode=9;  
      event.returnValue = false;  
      $(button).click();  
     }  
    }  


//异步请求
function XgKeyword(ctlId,word,elementType,num,url,total)
{
     var opt = {
              method: 'post',             
              onSuccess: function(data) {
                var obj=document.getElementById(ctlId);
               if(obj) 
                  {
                    var html='';
                    var returnobj = eval('(' + data.responseText + ')').Head;
                    if(returnobj.length>0)
                    {
                        html='<dl class=\"class_recom\"><dt>您还可以找：</dt><dd>';
                        for (i = 0; i <returnobj.length; i++) {
                        html +='<a href=\"'+returnobj[i].Url+'\" style=\"color:blue;\" target=\"_blank\">'+returnobj[i].Keyword+'</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
                        } 
                        html+='</dd></dl>';
                    }
                    obj.innerHTML=html;
                  }                                              
              },
              // Handle 404
              on404: function(t) {
                  alert('Error 404: location "' + t.statusText + '" was not found.');
                  return false;
              },
              // Handle other errors
              onFailure: function(t) {
                  alert('Error ' + t.status + ' -- ' + t.statusText);
                  return false;
              }
         }
         new Ajax.Request('/Common/CommonActionAjax.aspx?Action=Keyword&word='+escape(word)+'&num='+num+'&url='+escape(url)+'&type='+elementType+'&records='+total,opt);//
}

//TopTen  姜军 2009-6-10
//应用URL  /Detail/GkNewsDetail.aspx
function TopTen(ctlId,action)
{

     var opt = {
              method: 'post',             
              onSuccess: function(t) {
               if(document.getElementById(ctlId)) 
                  {
                  document.getElementById(ctlId).innerHTML=t.responseText;   
                  }                                              
              },
              // Handle 404
              on404: function(t) {
                  alert('Error 404: location "' + t.statusText + '" was not found.');
                  return false;
              },
              // Handle other errors
              onFailure: function(t) {
                  alert('Error ' + t.status + ' -- ' + t.statusText);
                  return false;
              }
         }
         new Ajax.Request('/Common/CommonActionAjax.aspx?Action='+action,opt);
}
