function planint(plan)
{  //查询方法定义
   if(plan)
   {
	   //-----------------------------------
	   plan.searchnow = function(obj,outinput)
	   {
		  //输入拼音或者汉字查询
		  this.outobj = obj; //输入对象
		  this.outinput = outinput; //code输出对象
		  if(obj.value.length>0)
		  {
			   var nz = obj.value;
			   var cx = "name";
			   if(nz.match(/^[a-zA-Z]+$/))
			   { //拼音查询
				  cx = "pinyin";
			   }
			   //alert(cx);
			   this.cx = function(i)
			   {
				 var str = "this["+i+"]."+cx;
				 str = str.replace('"');
				 return (eval(str));
			   }
			   var data = new Array();
			   var re = new RegExp("^"+nz,"i"); 
			
			   
			   for(var i=0;i<this.length;i++)
			   { //遍历查找
				   if(this.cx(i).match(re))
				   {
					  data.push(this[i]);
				   }
			   }
			   this.showpop(data);
			   
		  }
		  return true;
	   }
	   //------------------------------------
		plan.showpop=function(date)
		{
			if(date.length>0){
			  var html = '<div id="test" class="planpop"><div class="planp_tit">请输入拼音或中文并选择</div>';
			  for(var i=0;i<date.length;i++)
			  {
				  html+='<li onclick="plan.outdate(\''+date[i].code+'\',\''+this.outinput+'\',this)">'+date[i].pinyin+' '+date[i].name+'</li>';
			  }
			  html+='</div>';
			  var xy = fGetXY(this.outobj);
			  while(typeof($("#test")[0])=='object')
			  {
				  //alert(typeof($("#test")[0]));
				  $("#test").remove();
			  }
			  $("body").append(html);
			  //$("#test").html(html);
			  $("#plan_back").show();
			  $("#test").css({"top":xy.y+25,"left":xy.x});
			  $("#test >li").hover(function(){
				
				    $(this).addClass("plpoplihover");
				
				},function(){
					$(this).removeClass("plpoplihover");
			  });
			  
			}
		}
		//------------------------------------
		plan.outdate = function(code,id,obj)
		{  //输出内容
			$("#"+id).val(code);
			this.outobj.value=obj.innerHTML;
			$("#test").remove();
			$("#plan_back").hide();
			if(this.outobj.name=='qiname'){
			  //送票城市
			  $("#gns_codeid").val(code);
			  $("#gns_code").val(obj.innerHTML);
			}
		}
		//------------------------------------
		plan.click =function(obj,outinput)
		{
			test_c = false;
			$(obj).val('');
			this.searchnow(obj,outinput);
			this.showpop(htdate);
			//alert(htdate);
			}
		//------------------------------------
   }
   else
   {
	  alert("对象绑定失败");
   }
   return plan;
}
