var communities = new Array(
	'Silver Lawn Trailer Park','Friendly Village of Adrian','Hidden River Community','Hidden River','King Mobile Home Court Inc','Lee Villa Mobile Home Park','Maple Woods','Robin Hood Mobile Court','Sterling Estates','Channelview Mobile Home Park','Seaway Trailer Court','Kingsbrook Mobile Homes Estate','Scio Farms Estates','Sunnyside Park','Sandhill Mobile Home Estates','Chateau Lake in the Hills','College Heights Mobile Home Park','Lake In The Hills','Oakland Estates Mobile Home Park','Sheffield Estates','Park Lake Mobile Home Court','American Presidential Estates','Belle Mobile Village','Belle Villa Mobile Home Estates','Belleville Manor Mobile Park','Golden Triangle Mobile Home Park','Holiday West Mobile Home Park','Holiday Woods Mobile Home Park','Park Estates Mobile Home Park','Presidential Estates','Prestige Community Development','Sylvan Valley Estates Inc','Town & Country Mobile Home Estate','Van Buren Estates','Wagon Wheel South Mobile Home','Coach Light Estates Mobile Home Park & Sales','Brighton Village Mobile Park','Glen Sylvan Mobile Estates','Pine Lodge Park','Starlight Mobile Home Park Inc','Woodland Lake Mobile Courts','Hillanlake Village','Mapleview Estates','Centennial Farms','Century Homes','Creek Wood ','Delta Mobile Home Park','Green Briar','Green Briar Estates-Century','Maple Grove Mobile Home Park','Twin Meadows Mobile Home Park','Villa-Grande Estates','Academy Point Mobile Home','College Park Estates','Holiday Estates','Royal Holiday Park','Sherwood Village Mobile Homes','Wagon Wheel Mobile Home Park','Carleton Mobile Home Park','Flat Rock Village','Yorkshire Manor','Americana Estates of Casco','Hidden Lake Estates','Carriage Way','Chateau Chesterfield','Carriage Way Mobile Home Community','Chateau Estates Chesterfield','Clarkston Lakes','Clinton Villa Mobile Home Park','Independence Woods Mobile Home Community','Sashabaw Meadows Mobile Home','Allens Trailer Court, Inc.','Clinton Mobile Home Community','Capital Home Sales','Chateau Clinton','Chateau Communities Inc','Parkway Village Mobile Home Park','Rudgate Clinton Mobile Home','Chateau Pinewood on the Lake','Pinewood Creek Associates','Springrove','Chateau Old Orchard','Chateau Timber Heights','Continental North','Continental Estates','Continental North','Davison East Mobile Estates','Davison Hills','Arney\'s Mobile Home ','Pat\'s Trailer Court','Pelham Mobile Home Park','Riverside Properties','Lakeside Trailer Court Company','Windsor Estates','Country Heritage','Dundee Meadows','Alans Park','Country Manor Mobile Home Park','Lakeview Estates','Chandler Farms','Dutch Hills','Falon Pointe','Oak Island Mobile Home Park','University Mobile Village','June\'s Mobile Home Village & Sales','Potter Mobile Home Park','Erie Mobile Home Village','Hidden Creek','Hometown USA','Northtown Meadows','Oakwood Mobile Home Park','Chateau Estates Anchor Bay','Flamingo Trailer Court','Quality Mobile Home Sales','Farmington Hills Mobile Manor','Little Valley Estates','Fenton Oaks MHC','Lake Fenton Mobile Home Park','North Bay Harbor Club','Americana Mobile Home Park','Country Meadows Mobile Home Park','Deerfield Estates','Airport Home Center','Ambassador East Mobile Home','American Mobile Home Park','Benmark Kearsley Lake Terrace','Carriage Hills Mobile Home','Carriage Manor Mobile Home Park','Chateau Torrey Hills Mobile Park','Chateau Villa Estates','Delta Mobile Home Park','Dort Village Mobile Home Park','Edgewater Riverside Trailer','Elms Mobile Home Park','Fisherman\'s Cove','Genesee Villa','Heather Hill Estates','HI-Way Trailer Court','Holiday Village Mobile Park','Holt\'s Mobile Home Court & Sales','Indian Hills Manor Mobile Home Park','Kirkwood Mobile Home Court','Linden Place','Maple Grove Mobile Home Park','Parkwood Mobile Home Community','Pasadena Mobile Homes','Pheasant Run Mobile Home','Pineview Estates','Pineview Estates','Royal Mobile Home Sites','Tudor Estates Mobile Home Community','West Haven Mobile Court','Westwood Heights Mobile Home','Westwood Village','Flushing Estates','Meadowbrook Manor Estates Inc','Medallion Homes','Birchwood Estates','Indian Trail North','Alan\'s Mobile Home Park','Cedar River Estates','Grand Shire Estates','Chateau of Grand Blanc','Coventry Woods','Blue Skies Mobile Home Park','Heartland Homes','Willow Point','Hartland Meadows Family Community','Highland Greens Estate','Highland Hills of Highland','Chateau Estates Oak Hill','Groveland Manor','Hawaiian Gardens Mobile Home Park','Holly Village Mobile Home Park','Delhi Manor Mobile Home Park','Holt Manor Mobile Home Park','Midway Terrace Trailer Park','Valley Brook Estates','Chateau Estates Howell','Fairlane Estates Mobile Home','Fairlawn Meadow','Oakcrest Mobile Village','Burkhart Ridge Mobile Home Community','Presidential Estates','Northside Community Mobile Home','Riverview Trailer Park','Coffman Trailer Court','Cozy Mobile Home Community','English Meadows Mobile Home','Holiday Manor Park','Indian Village Mobile Home Community','Jackson Mobile Home Park','Pleasant Lake Mobile Homes CT','Sherman Oaks Mobile Park','Sun Valley Mobile Home Estates','Walnut Ridge Manufactured Home Community','Windham Hill Manufactured Home Community','Sunrise Mobile Home Park','Keego Harbor Mobile Home Park','The Lakes','Somerset Meadows','Quiet Cove Mobile Home Park','Chateau Estates Orion','Little Valley Homes','Bunnell Mobile Home Park','Cadgewith Farms & Sales','Century Park Mobile Home Park','Kensington Meadows','King Arthur\'s Court','Kristana Mobile Court','Life O\'Riley Mobile Home Park','Mill Pond Village','Park Terrace Mobile Home Park','Riverview Estates Mobile Community','Rotunda Trailer Park','Stonegate','Valley Estates Mobile Home Park','Chateau Pine Lakes','Crestview Manor Mobile Home','Hunters Creek Mobile Home Community','Hunters Creek Mobile Home Community','Lapeer Meadows','Wood Creek Manufactured Housing','Quail Run Community','Hidden Lake Estates','Country Manor Mobile Home Park','Leslie Estates','Lexington Mobile Home Park','Sandpiper Estates Cooperative','Lincoln Park Mobile Home Village','Loon Lake Manufactured Home','Pine Ridge Mobile Home Park','Shiawassee Shores Retirement','Chateau Estates Macomb','Ackels Mobile Court','Madison Heights Manufacturing Home Community','Red Run Park Mobile Homes','Manchester Manor','Devils Lake Estate Inc','Round Lake Estates Inc','Shangri-LA Village Homes','Tag-A-Long Trailer Court','Tag-A-Long Trailer Court','Marysville Villa Estates Inc','Seaway Mobile Home Ranch Inc','Mason Manor Mobile Home Community','Sycamore Village Mobile Home','Hearthside Mobile Home Park','Melvindale Mobile Home Park','Ideal Villa Mobile Park','Child Lake Estates','Ridgewood Family Community','Holiday South Mobile Home Park','Meadowbrook Estates','Oakridge Estates Mobile Home','Pleasantville Park','Raisin Ridge','Shamrock Mobile Home Village','Sunny South Villa','Willow Green Mobile Home Park','Willow Point','Camelot Villa Community','Diane Mobile Home Manor & Sales','Dutch Village','Gunther Mobile Court & Sales','Highlands','North Dort Manor Limited','North Morris Estates','Pineview Manufactured Home Sales','South Creek Village','White Oak Estates','Vinings Trailer Park','Country Meadows Mobile Home Park','Swan Creek Limited','Quail Run Community','Riverbrook','Kensington Place Mobile Home','French Town Villa Office','Kimberly Estates','Newport Farms MHC','Deerfield Pines','Country Estates Mobile Home','Chateau Estates Novi','Country Cousin Mobile Village','Highland Hills Estates','Little Valley Homes','Novi Meadows','Old Dutch Farms','Arney\'s Woodlands MH Estates','Winslow\'s Mobile Home Park','Chateau Orion','Watson\'s Mobile Home Park Inc','Candlewick Court','Northwood Mobile Home Estates','Owosso Trailer Park','Lake Villa Mobile Home Park','Oxford Manor Mobile Home Park','Parkhurst Estates','Countryside Village','Oak Haven Manufactured Home Community','Plymouth Hills Mobile Court','River Bank Mobile Home Village','Sylvan Lake Estates','Walton Manor Mobile Home Park','Walton Ridge','Edison Mobile Home Court','Fenner\'s Mobile Village','Stock\'s Creek','Port of Call','Long\'s Mobile Home Court','Warwick Village Trailer Coach','Richmond Place Mobile Home Estate','Chateau Estates Avon','Rochester Estates','Springbrook Estates','Huron Estates','Metro Commons Mobile Home Community','Royal Village Trailer Court','Rudgate West','Leslie\'s Mobile Home Village','Saline Meadows','Saline Mobile Home Park','Shelby Forest','Shelby West','Dove Road Mobile Home Estates','Somerset Meadows','Silver Lake Mobile Park','South Lyon Woods Park','Huron River Mobile Home Park','Lawrence Manor','Southfield Downs Mobile Home','Southfield Mobile Home Park','Southgate Mobile Home Terrace','St Clair Place','Rudgate Manor','Sterling Estates','Estates of Genesee Valley','South Valley Estates','Wellington Estates','Robbinwood Villa/Annex','Inverness Mobile Home Community','Lloyd\'s Mobile Home Park','Troy Mobile Home Villa','Dequindre Estates Mobile Home','Commerce Ridge','Fawn Lake Estates','Jackson Trailer Park','Lafayette Place Mobile Home','Motor City Trailer Park Inc','Shadylane Mobile Home Estates','Twin Pines Trailer Coach Park','Warren Mobile Home Park','Rudgate East Company','Washington Mobile Home Park','Enterprise Estates Construction','Robbin\'s Mobile Village','Hamlin Mobile Home Park','Webbervilla Mobile Home Park','Southern Great Lakes Management Company','Big Trees Mobile Home Community','Mohawk Mobile Home Park','Old Orchard Mobile Home Park','West Point Park','Westland Meadows','Cedarbrook Estates','Chateau Cranberry Lake','Meadow Lake','Village On The Lake','White Lake Mobile Village','White Lake Trailer Park','Village Square Mobile Home Park','Willow Village Home Court','Winslow\'s Mobile Home Park','Commerce Meadows','Stratford Villa Mobile Park','Woodhaven Place','North Hill Mobile Home Village','Arbor Meadows','Coachville Mobile Park','Elmcrest Mobile Village','Ford Boulevard Mobile Home Park','Kingsley Mobile Park','Lakeview Mobile Home Park','Swan Creek Mobile Home Community','Village Estates Mobile Home Park','Westridge Mobile Home Community','Willow Run Mobile Home','Ypsilanti Mobile Village Inc');
function actb(obj,ca){
	/* ---- Public Variables ---- */
	this.actb_timeOut = -1; // Autocomplete Timeout in ms (-1: autocomplete never time out)
	this.actb_lim = 10;    // Number of elements autocomplete can show (-1: no limit)
	this.actb_firstText = false; // should the auto complete be limited to the beginning of keyword?
	this.actb_mouse = true; // Enable Mouse Support
	this.actb_delimiter = new Array(';',',');  // Delimiter for multiple autocomplete. Set it to empty array for single autocomplete
	this.actb_startcheck = 1; // Show widget only after this number of characters is typed in.
	/* ---- Public Variables ---- */

	/* --- Styles --- */
	this.actb_bgColor = '#e5ebd1';
	this.actb_textColor = '#4f4f3e';
	this.actb_hColor = '#fcfcfa';
	this.actb_fFamily = 'Trebuchet MS';
	this.actb_fSize = '11px';
	this.actb_hStyle = 'text-decoration:underline;font-weight="bold";text-align:left;padding:3px;';
	/* --- Styles --- */

	/* ---- Private Variables ---- */
	var actb_delimwords = new Array();
	var actb_cdelimword = 0;
	var actb_delimchar = new Array();
	var actb_display = false;
	var actb_pos = 0;
	var actb_total = 0;
	var actb_curr = null;
	var actb_rangeu = 0;
	var actb_ranged = 0;
	var actb_bool = new Array();
	var actb_pre = 0;
	var actb_toid;
	var actb_tomake = false;
	var actb_getpre = "";
	var actb_mouse_on_list = 1;
	var actb_kwcount = 0;
	var actb_caretmove = false;
	this.actb_keywords = new Array();
	/* ---- Private Variables---- */
	
	this.actb_keywords = ca;
	var actb_self = this;

	actb_curr = obj;
	
	addEvent(actb_curr,"focus",actb_setup);
	function actb_setup(){
		addEvent(document,"keydown",actb_checkkey);
		addEvent(actb_curr,"blur",actb_clear);
		addEvent(document,"keypress",actb_keypress);
	}

	function actb_clear(evt){
		if (!evt) evt = event;
		removeEvent(document,"keydown",actb_checkkey);
		removeEvent(actb_curr,"blur",actb_clear);
		removeEvent(document,"keypress",actb_keypress);
		actb_removedisp();
	}
	function actb_parse(n){
		if (actb_self.actb_delimiter.length > 0){
			var t = actb_delimwords[actb_cdelimword].trim().addslashes();
			var plen = actb_delimwords[actb_cdelimword].trim().length;
		}else{
			var t = actb_curr.value.addslashes();
			var plen = actb_curr.value.length;
		}
		var tobuild = '';
		var i;

		if (actb_self.actb_firstText){
			var re = new RegExp("^" + t, "i");
		}else{
			var re = new RegExp(t, "i");
		}
		var p = n.search(re);
				
		for (i=0;i<p;i++){
			tobuild += n.substr(i,1);
		}
		tobuild += "<font style='"+(actb_self.actb_hStyle)+"'>"
		for (i=p;i<plen+p;i++){
			tobuild += n.substr(i,1);
		}
		tobuild += "</font>";
			for (i=plen+p;i<n.length;i++){
			tobuild += n.substr(i,1);
		}
		return tobuild;
	}
	function actb_generate(){
		if (document.getElementById('tat_table')){ actb_display = false;document.body.removeChild(document.getElementById('tat_table')); } 
		if (actb_kwcount == 0){
			actb_display = false;
			return;
		}
		a = document.createElement('table');
		a.cellSpacing='1px';
		a.cellPadding='2px';
		a.style.position='absolute';
		a.style.float = 'left';
		a.style.top = eval(curTop(actb_curr) + actb_curr.offsetHeight) + "px";
		a.style.left = curLeft(actb_curr) + "px";
		a.style.backgroundColor=actb_self.actb_bgColor;
		a.id = 'tat_table';
		document.body.appendChild(a);
		var i;
		var first = true;
		var j = 1;
		if (actb_self.actb_mouse){
			a.onmouseout = actb_table_unfocus;
			a.onmouseover = actb_table_focus;
		}
		var counter = 0;
		for (i=0;i<actb_self.actb_keywords.length;i++){
			if (actb_bool[i]){
				counter++;
				r = a.insertRow(-1);
				if (first && !actb_tomake){
					r.style.backgroundColor = actb_self.actb_hColor;
					first = false;
					actb_pos = counter;
				}else if(actb_pre == i){
					r.style.backgroundColor = actb_self.actb_hColor;
					first = false;
					actb_pos = counter;
				}else{
					r.style.backgroundColor = actb_self.actb_bgColor;
				}
				r.id = 'tat_tr'+(j);
				c = r.insertCell(-1);
				c.style.color = actb_self.actb_textColor;
				c.style.fontFamily = actb_self.actb_fFamily;
				c.style.fontSize = actb_self.actb_fSize;
				c.innerHTML = actb_parse(actb_self.actb_keywords[i]);
				c.id = 'tat_td'+(j);
				c.setAttribute('pos',j);
				if (actb_self.actb_mouse){
					c.style.cursor = 'pointer';
					c.onclick=actb_mouseclick;
					c.onmouseover = actb_table_highlight;
				}
				j++;
			}
			if (j - 1 == actb_self.actb_lim && j < actb_total){
				r = a.insertRow(-1);
				r.style.backgroundColor = actb_self.actb_bgColor;
				c = r.insertCell(-1);
				c.style.color = actb_self.actb_textColor;
				c.style.fontFamily = 'arial narrow';
				c.style.fontSize = actb_self.actb_fSize;
				c.align='center';
				replaceHTML(c,'\\/');
				if (actb_self.actb_mouse){
					c.style.cursor = 'pointer';
					c.onclick = actb_mouse_down;
				}
				break;
			}
		}
		actb_rangeu = 1;
		actb_ranged = j-1;
		actb_display = true;
		if (actb_pos <= 0) actb_pos = 1;
	}
	function actb_remake(){
		document.body.removeChild(document.getElementById('tat_table'));
		a = document.createElement('table');
		a.cellSpacing='1px';
		a.cellPadding='2px';
		a.style.float = 'left';
		a.style.position='absolute';
		a.style.top = eval(curTop(actb_curr) + actb_curr.offsetHeight) + "px";
		a.style.left = curLeft(actb_curr) + "px";
		a.style.backgroundColor=actb_self.actb_bgColor;
		a.id = 'tat_table';
		if (actb_self.actb_mouse){
			a.onmouseout= actb_table_unfocus;
			a.onmouseover=actb_table_focus;
		}
		document.body.appendChild(a);
		var i;
		var first = true;
		var j = 1;
		if (actb_rangeu > 1){
			r = a.insertRow(-1);
			r.style.backgroundColor = actb_self.actb_bgColor;
			c = r.insertCell(-1);
			c.style.color = actb_self.actb_textColor;
			c.style.fontFamily = 'arial narrow';
			c.style.fontSize = actb_self.actb_fSize;
			c.align='center';
			replaceHTML(c,'/\\');
			if (actb_self.actb_mouse){
				c.style.cursor = 'pointer';
				c.onclick = actb_mouse_up;
			}
		}
		for (i=0;i<actb_self.actb_keywords.length;i++){
			if (actb_bool[i]){
				if (j >= actb_rangeu && j <= actb_ranged){
					r = a.insertRow(-1);
					r.style.backgroundColor = actb_self.actb_bgColor;
					r.id = 'tat_tr'+(j);
					c = r.insertCell(-1);
					c.style.color = actb_self.actb_textColor;
					c.style.fontFamily = actb_self.actb_fFamily;
					c.style.fontSize = actb_self.actb_fSize;
					c.innerHTML = actb_parse(actb_self.actb_keywords[i]);
					c.id = 'tat_td'+(j);
					c.setAttribute('pos',j);
					if (actb_self.actb_mouse){
						c.style.cursor = 'pointer';
						c.onclick=actb_mouseclick;
						c.onmouseover = actb_table_highlight;
					}
					j++;
				}else{
					j++;
				}
			}
			if (j > actb_ranged) break;
		}
		if (j-1 < actb_total){
			r = a.insertRow(-1);
			r.style.backgroundColor = actb_self.actb_bgColor;
			c = r.insertCell(-1);
			c.style.color = actb_self.actb_textColor;
			c.style.fontFamily = 'arial narrow';
			c.style.fontSize = actb_self.actb_fSize;
			c.align='center';
			replaceHTML(c,'\\/');
			if (actb_self.actb_mouse){
				c.style.cursor = 'pointer';
				c.onclick = actb_mouse_down;
			}
		}
	}
	function actb_goup(){
		if (!actb_display) return;
		if (actb_pos == 1) return;
		document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_bgColor;
		actb_pos--;
		if (actb_pos < actb_rangeu) actb_moveup();
		document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_hColor;
		if (actb_toid) clearTimeout(actb_toid);
		if (actb_self.actb_timeOut > 0) actb_toid = setTimeout(function(){actb_mouse_on_list=0;actb_removedisp();},actb_self.actb_timeOut);
	}
	function actb_godown(){
		if (!actb_display) return;
		if (actb_pos == actb_total) return;
		document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_bgColor;
		actb_pos++;
		if (actb_pos > actb_ranged) actb_movedown();
		document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_hColor;
		if (actb_toid) clearTimeout(actb_toid);
		if (actb_self.actb_timeOut > 0) actb_toid = setTimeout(function(){actb_mouse_on_list=0;actb_removedisp();},actb_self.actb_timeOut);
	}
	function actb_movedown(){
		actb_rangeu++;
		actb_ranged++;
		actb_remake();
	}
	function actb_moveup(){
		actb_rangeu--;
		actb_ranged--;
		actb_remake();
	}

	/* Mouse */
	function actb_mouse_down(){
		document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_bgColor;
		actb_pos++;
		actb_movedown();
		document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_hColor;
		actb_curr.focus();
		actb_mouse_on_list = 0;
		if (actb_toid) clearTimeout(actb_toid);
		if (actb_self.actb_timeOut > 0) actb_toid = setTimeout(function(){actb_mouse_on_list=0;actb_removedisp();},actb_self.actb_timeOut);
	}
	function actb_mouse_up(evt){
		if (!evt) evt = event;
		if (evt.stopPropagation){
			evt.stopPropagation();
		}else{
			evt.cancelBubble = true;
		}
		document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_bgColor;
		actb_pos--;
		actb_moveup();
		document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_hColor;
		actb_curr.focus();
		actb_mouse_on_list = 0;
		if (actb_toid) clearTimeout(actb_toid);
		if (actb_self.actb_timeOut > 0) actb_toid = setTimeout(function(){actb_mouse_on_list=0;actb_removedisp();},actb_self.actb_timeOut);
	}
	function actb_mouseclick(evt){
		if (!evt) evt = event;
		if (!actb_display) return;
		actb_mouse_on_list = 0;
		actb_pos = this.getAttribute('pos');
		actb_penter();
	}
	function actb_table_focus(){
		actb_mouse_on_list = 1;
	}
	function actb_table_unfocus(){
		actb_mouse_on_list = 0;
		if (actb_toid) clearTimeout(actb_toid);
		if (actb_self.actb_timeOut > 0) actb_toid = setTimeout(function(){actb_mouse_on_list = 0;actb_removedisp();},actb_self.actb_timeOut);
	}
	function actb_table_highlight(){
		actb_mouse_on_list = 1;
		document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_bgColor;
		actb_pos = this.getAttribute('pos');
		while (actb_pos < actb_rangeu) actb_moveup();
		while (actb_pos > actb_ranged) actb_movedown();
		document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_hColor;
		if (actb_toid) clearTimeout(actb_toid);
		if (actb_self.actb_timeOut > 0) actb_toid = setTimeout(function(){actb_mouse_on_list = 0;actb_removedisp();},actb_self.actb_timeOut);
	}
	/* ---- */

	function actb_insertword(a){
		if (actb_self.actb_delimiter.length > 0){
			str = '';
			l=0;
			for (i=0;i<actb_delimwords.length;i++){
				if (actb_cdelimword == i){
					prespace = postspace = '';
					gotbreak = false;
					for (j=0;j<actb_delimwords[i].length;++j){
						if (actb_delimwords[i].charAt(j) != ' '){
							gotbreak = true;
							break;
						}
						prespace += ' ';
					}
					for (j=actb_delimwords[i].length-1;j>=0;--j){
						if (actb_delimwords[i].charAt(j) != ' ') break;
						postspace += ' ';
					}
					str += prespace;
					str += a;
					l = str.length;
					if (gotbreak) str += postspace;
				}else{
					str += actb_delimwords[i];
				}
				if (i != actb_delimwords.length - 1){
					str += actb_delimchar[i];
				}
			}
			actb_curr.value = str;
			setCaret(actb_curr,l);
		}else{
			actb_curr.value = a;
		}
		actb_mouse_on_list = 0;
		actb_removedisp();
	}
	function actb_penter(){
		if (!actb_display) return;
		actb_display = false;
		var word = '';
		var c = 0;
		for (var i=0;i<=actb_self.actb_keywords.length;i++){
			if (actb_bool[i]) c++;
			if (c == actb_pos){
				word = actb_self.actb_keywords[i];
				break;
			}
		}
		actb_insertword(word);
		l = getCaretStart(actb_curr);
	}
	function actb_removedisp(){
		if (actb_mouse_on_list==0){
			actb_display = 0;
			if (document.getElementById('tat_table')){ document.body.removeChild(document.getElementById('tat_table')); }
			if (actb_toid) clearTimeout(actb_toid);
		}
	}
	function actb_keypress(e){
		if (actb_caretmove) stopEvent(e);
		return !actb_caretmove;
	}
	function actb_checkkey(evt){
		if (!evt) evt = event;
		a = evt.keyCode;
		caret_pos_start = getCaretStart(actb_curr);
		actb_caretmove = 0;
		switch (a){
			case 38:
				actb_goup();
				actb_caretmove = 1;
				return false;
				break;
			case 40:
				actb_godown();
				actb_caretmove = 1;
				return false;
				break;
			case 13: case 9:
				if (actb_display){
					actb_caretmove = 1;
					actb_penter();
					return false;
				}else{
					return true;
				}
				break;
			default:
				setTimeout(function(){actb_tocomplete(a)},50);
				break;
		}
	}

	function actb_tocomplete(kc){
		if (kc == 38 || kc == 40 || kc == 13) return;
		var i;
		if (actb_display){ 
			var word = 0;
			var c = 0;
			for (var i=0;i<=actb_self.actb_keywords.length;i++){
				if (actb_bool[i]) c++;
				if (c == actb_pos){
					word = i;
					break;
				}
			}
			actb_pre = word;
		}else{ actb_pre = -1};
		
		if (actb_curr.value == ''){
			actb_mouse_on_list = 0;
			actb_removedisp();
			return;
		}
		if (actb_self.actb_delimiter.length > 0){
			caret_pos_start = getCaretStart(actb_curr);
			caret_pos_end = getCaretEnd(actb_curr);
			
			delim_split = '';
			for (i=0;i<actb_self.actb_delimiter.length;i++){
				delim_split += actb_self.actb_delimiter[i];
			}
			delim_split = delim_split.addslashes();
			delim_split_rx = new RegExp("(["+delim_split+"])");
			c = 0;
			actb_delimwords = new Array();
			actb_delimwords[0] = '';
			for (i=0,j=actb_curr.value.length;i<actb_curr.value.length;i++,j--){
				if (actb_curr.value.substr(i,j).search(delim_split_rx) == 0){
					ma = actb_curr.value.substr(i,j).match(delim_split_rx);
					actb_delimchar[c] = ma[1];
					c++;
					actb_delimwords[c] = '';
				}else{
					actb_delimwords[c] += actb_curr.value.charAt(i);
				}
			}

			var l = 0;
			actb_cdelimword = -1;
			for (i=0;i<actb_delimwords.length;i++){
				if (caret_pos_end >= l && caret_pos_end <= l + actb_delimwords[i].length){
					actb_cdelimword = i;
				}
				l+=actb_delimwords[i].length + 1;
			}
			var ot = actb_delimwords[actb_cdelimword].trim(); 
			var t = actb_delimwords[actb_cdelimword].addslashes().trim();
		}else{
			var ot = actb_curr.value;
			var t = actb_curr.value.addslashes();
		}
		if (ot.length == 0){
			actb_mouse_on_list = 0;
			actb_removedisp();
		}
		if (ot.length < actb_self.actb_startcheck) return this;
		if (actb_self.actb_firstText){
			var re = new RegExp("^" + t, "i");
		}else{
			var re = new RegExp(t, "i");
		}

		actb_total = 0;
		actb_tomake = false;
		actb_kwcount = 0;
		for (i=0;i<actb_self.actb_keywords.length;i++){
			actb_bool[i] = false;
			if (re.test(actb_self.actb_keywords[i])){
				actb_total++;
				actb_bool[i] = true;
				actb_kwcount++;
				if (actb_pre == i) actb_tomake = true;
			}
		}

		if (actb_toid) clearTimeout(actb_toid);
		if (actb_self.actb_timeOut > 0) actb_toid = setTimeout(function(){actb_mouse_on_list = 0;actb_removedisp();},actb_self.actb_timeOut);
		actb_generate();
	}
	return this;
}