﻿// JScript 文件
  
function clear1()
{

  document.all.txtKeyword.value="";
}
function InputGo()
{
    if( event.keyCode == 13 )
    {
        document.getElementById("ImageButton1").focus();

    }
}
 function Imgbt()
 {

    var keyword=document.all.txtKeyword.value;
//    if(keyword=="")
//    {
//      alert("请输入关键字!");
//      return;
//    }
    var x= document.all.sl1.value;
    if(x==0)
    {
     window.location.href="/products/Search.aspx?keyword="+keyword;
     }
     else
     {
       var l = 0;
     
       if(x == 1)
       {
          l=1;
       }
       if(x == 2)
       {
          l=2;
       }
       if(x == 3)
       {
          l=3;
       }
       if(x == 4)
       {
          l=4;
       }
       if(x == 5)
       {
          l=5;
       }
       if(x == 6)
       {
          l=6;
       } 
      window.location.href="/Search.aspx?keyword="+keyword+"&columnid="+l;
     }
 }



function loadColumn()
{
        var ddlpcity=this.document.getElementById('sl1'); 
      
    
//        //清空下拉框用于下次填充数据 
////        RemoveItemAll(ddlpcity); 
       var oHttpReq = new ActiveXObject("MSXML2.XMLHTTP"); 
        var oDoc = new ActiveXObject("MSXML2.DOMDocument"); 
      
//        //调用的ajax页面，并给页面传递参数 
       oHttpReq.open("POST", "../Ajax/LoadColumn.aspx", false); 

        oHttpReq.send(""); 
        result = oHttpReq.responseText; 
        oDoc.loadXML(result); 
//  alert(result) 
        //从回发的dataset中获取数据其中Migration_Agency是dataset表名,ID为表的字段 
        items3 = oDoc.selectNodes("/NewDataSet/Table1/ID"); 
       items4 = oDoc.selectNodes("/NewDataSet/Table1/ColumnName"); 
        var itemsLength1=items3.length; 
//        alert(items3);
//        alert(items4);

        //填充数据 
       for(var i=0;i<itemsLength1;i++) 
        { 
        var newOption1 = document.createElement("OPTION"); 
        newOption1.text = items4[i].text; 
       newOption1.value = items3[i].text; 
        ddlpcity.options.add(newOption1); 
        } 
} 
   