 var lastAutoValue ="";
  function   jsAuto(instaceName,objID,ttextID){  
  	this._msg   =   [];   
  	this._o   =   document.getElementById(   objID   );   
  	if   (!this._o)   return;   
	  this._f   =   null;   
	  this._i   =   instaceName;   
	  this._r   =   null;   
	  this._v   =   null;   
	  this._o.style.visibility   =   "hidden";   
	  this._o.style.lineHeight   =   "120%";   
	  this._o.style.position   =   "absolute";  
	  this._o.style.zIndex   =   "9999";   

	  return   this;   
  };   
  //   mouseEvent.   
  jsAuto.prototype.domouseover=function(obj){
  	obj.tagName=="DIV"?obj.className="mouseover":obj.parentElement.className="mouseover";   
  };   
  jsAuto.prototype.domouseout=function(obj){ 
  	obj.tagName=="DIV"?obj.className="mouseout":obj.parentElement.className="mouseout";   
  };   
  jsAuto.prototype.doclick=function(msg,tobject){   
  	with(this){   
  	  if(_r){   
  		_r.value=msg;   
  		_o.style.visibility="hidden";
  		
  		var _tForm =document.getElementById(tobject._value);
  		_tForm.action =tobject._action;
  		_tForm.submit();
  		
  	  }else{   
  		alert("javascript   autocomplete   ERROR   :\n\n   can   not   get   return   object.");   
  		return;   
  	  }   
  	}
  };     
  //   object   method;   
  jsAuto.prototype.item=function(msg){   
  	if(   msg.indexOf(",")>0   ){   
 		 var   arrMsg=msg.split(",");   
  		 for(var i=0;i<arrMsg.length;i++){   
  			arrMsg[i]?this._msg.push(arrMsg[i]):"";   
  		 }   
    }else{   
  		this._msg.push(msg);   
    }   
   	this._msg.sort();   
   };   
  jsAuto.prototype.append=function(msg,tobject){
	with   (this){
        _i?"":_i=eval(_i);   
        var div = document.createElement("DIV");   
	   //bind   event   to   object.   
  	    div.onmouseover=function(){_i.domouseover(this)};   
        div.onmouseout =function(){_i.domouseout(this)};   
        div.onclick    =function(){_i.doclick(msg,tobject)};   
        var   re       =new RegExp("("+_v+")","i");   
        div.className  ="mouseout";   
        if(_v) div.innerHTML  =msg.replace(re   ,   "<strong>$1</strong>");   
        div.style.fontFamily   =   "verdana";   
 		 _o.appendChild(div);   
  	}
  };   
  jsAuto.prototype.display=function(){   
  	with(this){   
  		if(_f){   
  		 _o.style.left  =_r.offsetLeft;   
         _o.style.width =_r.offsetWidth;   
  		 _o.style.top   =_r.offsetTop+_r.offsetHeight;   
         _o.style.visibility="visible";   
  		}else{   
  		_o.style.visibility="hidden";   
  		}   
  	}
  };   
  jsAuto.prototype.handleEvent=function(tobject,fID){
	  
  	with   (this){   
  		var   re;   
  		_f=false;   
  		_r=document.getElementById(fID);
  		fValue =tobject.value;   
  		_v=fValue;
  		_i=eval(_i);   
  		re=new RegExp("^"+fValue+"","i");   
  		if(fValue=="")return;   
  		_o.innerHTML="";   
  		for(var i=0;i<_msg.length;i++){   
  			if(re.test(_msg[i])){   
  				_i.append(_msg[i],tobject);   
  				_f=true;   
  		}   
  	}   
  	if(_f){
  		_i?_i.display():alert("can   not   get   instance"); 
  		lastAutoValue =tobject;
  	}else{
  		setElementValue(fID,lastAutoValue);
  	}
    
    
  }};   
  window.onerror=new   Function("return   true;");   
 

