function actbVideoGallery(obj,ca){
	/* ---- Public Variables ---- */
	this.actbVideoGallery_timeOut = -1; // Autocomplete Timeout in ms (-1: autocomplete never time out)
	this.actbVideoGallery_lim = 10;    // Number of elements autocomplete can show (-1: no limit)
	this.actbVideoGallery_firstText = false; // should the auto complete be limited to the beginning of keyword?
	this.actbVideoGallery_mouse = true; // Enable Mouse Support
	this.actbVideoGallery_delimiter = new Array(';',',');  // Delimiter for multiple autocomplete. Set it to empty array for single autocomplete
	this.actbVideoGallery_startcheck = 1; // Show widget only after this number of characters is typed in.
	/* ---- Public Variables ---- */

	/* --- Styles --- */
	this.actbVideoGallery_bgColor = '#707070';
	this.actbVideoGallery_textColor = '#FFFFFF';
	this.actbVideoGallery_hColor = '#666666';
	this.actbVideoGallery_fFamily = 'tahoma';
	this.actbVideoGallery_fSize = '10pt';
	this.actbVideoGallery_hStyle = 'font-size:10pt;font-family:tahoma;';
	/* --- Styles --- */

	/* ---- Private Variables ---- */
	var actbVideoGallery_delimwords = new Array();
	var actbVideoGallery_cdelimword = 0;
	var actbVideoGallery_delimchar = new Array();
	var actbVideoGallery_display = false;
	var actbVideoGallery_pos = 0;
	var actbVideoGallery_total = 0;
	var actbVideoGallery_curr = null;
	var actbVideoGallery_rangeu = 0;
	var actbVideoGallery_ranged = 0;
	var actbVideoGallery_bool = new Array();
	var actbVideoGallery_pre = 0;
	var actbVideoGallery_toid;
	var actbVideoGallery_tomake = false;
	var actbVideoGallery_getpre = "";
	var actbVideoGallery_mouse_on_list = 1;
	var actbVideoGallery_kwcount = 0;
	var actbVideoGallery_caretmove = false;
	this.actbVideoGallery_keywords = new Array();
	/* ---- Private Variables---- */
	
	this.actbVideoGallery_keywords = ca;
	var actbVideoGallery_self = this;

	actbVideoGallery_curr = obj;
	
	addEvent(actbVideoGallery_curr,"focus",actbVideoGallery_setup);
	function actbVideoGallery_setup(){
		addEvent(document,"keydown",actbVideoGallery_checkkey);
		addEvent(actbVideoGallery_curr,"blur",actbVideoGallery_clear);
		addEvent(document,"keypress",actbVideoGallery_keypress);
	}

	function actbVideoGallery_clear(evt){
		if (!evt) evt = event;
		removeEvent(document,"keydown",actbVideoGallery_checkkey);
		removeEvent(actbVideoGallery_curr,"blur",actbVideoGallery_clear);
		removeEvent(document,"keypress",actbVideoGallery_keypress);
		actbVideoGallery_removedisp();
	}
	function actbVideoGallery_parse(n){
		if (actbVideoGallery_self.actbVideoGallery_delimiter.length > 0){
			var t = actbVideoGallery_delimwords[actbVideoGallery_cdelimword].trim().addslashes();
			var plen = actbVideoGallery_delimwords[actbVideoGallery_cdelimword].trim().length;
		}else{
			var t = actbVideoGallery_curr.value.addslashes();
			var plen = actbVideoGallery_curr.value.length;
		}
		var tobuild = '';
		var i;

		if (actbVideoGallery_self.actbVideoGallery_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='"+(actbVideoGallery_self.actbVideoGallery_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 actbVideoGallery_generate(){
		if (document.getElementById('tat_table')){ actbVideoGallery_display = false;document.body.removeChild(document.getElementById('tat_table')); } 
		if (actbVideoGallery_kwcount == 0){
			actbVideoGallery_display = false;
			return;
		}
		a = document.createElement('table');
		a.cellSpacing='2px';
		a.cellPadding='2px';
		a.style.position='absolute';
		a.style.top = eval(curTop(actbVideoGallery_curr) + actbVideoGallery_curr.offsetHeight) + "px";
		a.style.left = curLeft(actbVideoGallery_curr) + "px";
		a.style.width = "425px";
		a.style.backgroundColor=actbVideoGallery_self.actbVideoGallery_bgColor;
		a.id = 'tat_table';
		document.body.appendChild(a);
		var i;
		var first = true;
		var j = 1;
		if (actbVideoGallery_self.actbVideoGallery_mouse){
			a.onmouseout = actbVideoGallery_table_unfocus;
			a.onmouseover = actbVideoGallery_table_focus;
		}
		var counter = 0;
		for (i=0;i<actbVideoGallery_self.actbVideoGallery_keywords.length;i++){
			if (actbVideoGallery_bool[i]){
				counter++;
				r = a.insertRow(-1);
				if (first && !actbVideoGallery_tomake){
					r.style.backgroundColor = actbVideoGallery_self.actbVideoGallery_hColor;
					first = false;
					actbVideoGallery_pos = counter;
				}else if(actbVideoGallery_pre == i){
					r.style.backgroundColor = actbVideoGallery_self.actbVideoGallery_hColor;
					first = false;
					actbVideoGallery_pos = counter;
				}else{
					r.style.backgroundColor = actbVideoGallery_self.actbVideoGallery_bgColor;
				}
				r.id = 'tat_tr'+(j);
				c = r.insertCell(-1);
				c.style.color = actbVideoGallery_self.actbVideoGallery_textColor;
				c.style.fontFamily = actbVideoGallery_self.actbVideoGallery_fFamily;
				c.style.fontSize = actbVideoGallery_self.actbVideoGallery_fSize;
				c.style.width = "425px";
				c.innerHTML = actbVideoGallery_parse(actbVideoGallery_self.actbVideoGallery_keywords[i]);
				c.id = 'tat_td'+(j);
				c.setAttribute('pos',j);
				if (actbVideoGallery_self.actbVideoGallery_mouse){
					c.style.cursor = 'pointer';
					c.onclick=actbVideoGallery_mouseclick;
					c.onmouseover = actbVideoGallery_table_highlight;
				}
				j++;
			}
			if (j - 1 == actbVideoGallery_self.actbVideoGallery_lim && j < actbVideoGallery_total){
				r = a.insertRow(-1);
				r.style.backgroundColor = actbVideoGallery_self.actbVideoGallery_bgColor;
				c = r.insertCell(-1);
				c.style.color = actbVideoGallery_self.actbVideoGallery_textColor;
				c.style.fontFamily = 'tahoma';
				c.style.fontSize = actbVideoGallery_self.actbVideoGallery_fSize;
				c.align='center';
				c.style.width = "425px";
				//c.style.backgroundImage='url(http://www.tarbon.com/images/downarrow.gif)';
				replaceHTML(c,'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::');
				if (actbVideoGallery_self.actbVideoGallery_mouse){
					c.style.cursor = 'pointer';
					c.onclick = actbVideoGallery_mouse_down;
				}
				break;
			}
		}
		actbVideoGallery_rangeu = 1;
		actbVideoGallery_ranged = j-1;
		actbVideoGallery_display = true;
		if (actbVideoGallery_pos <= 0) actbVideoGallery_pos = 1;
	}
	function actbVideoGallery_remake(){
		document.body.removeChild(document.getElementById('tat_table'));
		a = document.createElement('table');
		a.cellSpacing='2px';
		a.cellPadding='2px';
		a.style.position='absolute';
		a.style.top = eval(curTop(actbVideoGallery_curr) + actbVideoGallery_curr.offsetHeight) + "px";
		a.style.left = curLeft(actbVideoGallery_curr) + "px";
		a.style.width = "425px";
		a.style.backgroundColor=actbVideoGallery_self.actbVideoGallery_bgColor;
		a.id = 'tat_table';
		if (actbVideoGallery_self.actbVideoGallery_mouse){
			a.onmouseout= actbVideoGallery_table_unfocus;
			a.onmouseover=actbVideoGallery_table_focus;
		}
		document.body.appendChild(a);
		var i;
		var first = true;
		var j = 1;
		if (actbVideoGallery_rangeu > 1){
			r = a.insertRow(-1);
			r.style.backgroundColor = actbVideoGallery_self.actbVideoGallery_bgColor;
			c = r.insertCell(-1);
			c.style.color = actbVideoGallery_self.actbVideoGallery_textColor;
			c.style.fontFamily = 'tahoma';
			c.style.fontSize = actbVideoGallery_self.actbVideoGallery_fSize;
			c.style.width = "425px";
			c.align='center';
			//c.style.backgroundImage='url(http://www.tarbon.com/images/uparrow.gif)';
			replaceHTML(c,'\::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::');
			if (actbVideoGallery_self.actbVideoGallery_mouse){
				c.style.cursor = 'pointer';
				c.onclick = actbVideoGallery_mouse_up;
			}
		}
		for (i=0;i<actbVideoGallery_self.actbVideoGallery_keywords.length;i++){
			if (actbVideoGallery_bool[i]){
				if (j >= actbVideoGallery_rangeu && j <= actbVideoGallery_ranged){
					r = a.insertRow(-1);
					r.style.backgroundColor = actbVideoGallery_self.actbVideoGallery_bgColor;
					r.id = 'tat_tr'+(j);
					c = r.insertCell(-1);
					c.style.color = actbVideoGallery_self.actbVideoGallery_textColor;
					c.style.fontFamily = actbVideoGallery_self.actbVideoGallery_fFamily;
					c.style.fontSize = actbVideoGallery_self.actbVideoGallery_fSize;
					c.style.width = "425px";
					c.innerHTML = actbVideoGallery_parse(actbVideoGallery_self.actbVideoGallery_keywords[i]);
					c.id = 'tat_td'+(j);
					c.setAttribute('pos',j);
					if (actbVideoGallery_self.actbVideoGallery_mouse){
						c.style.cursor = 'pointer';
						c.onclick=actbVideoGallery_mouseclick;
						c.onmouseover = actbVideoGallery_table_highlight;
					}
					j++;
				}else{
					j++;
				}
			}
			if (j > actbVideoGallery_ranged) break;
		}
		if (j-1 < actbVideoGallery_total){
			r = a.insertRow(-1);
			r.style.backgroundColor = actbVideoGallery_self.actbVideoGallery_bgColor;
			c = r.insertCell(-1);
			c.style.color = actbVideoGallery_self.actbVideoGallery_textColor;
			c.style.fontFamily = 'tahoma';
			c.style.width = "425px";
			c.style.fontSize = actbVideoGallery_self.actbVideoGallery_fSize;
			c.align='center';
			//c.style.backgroundImage='url(http://www.tarbon.com/images/downarrow.gif)';
			replaceHTML(c,'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::');
			if (actbVideoGallery_self.actbVideoGallery_mouse){
				c.style.cursor = 'pointer';
				c.onclick = actbVideoGallery_mouse_down;
			}
		}
	}
	function actbVideoGallery_goup(){
		if (!actbVideoGallery_display) return;
		if (actbVideoGallery_pos == 1) return;
		document.getElementById('tat_tr'+actbVideoGallery_pos).style.backgroundColor = actbVideoGallery_self.actbVideoGallery_bgColor;
		actbVideoGallery_pos--;
		if (actbVideoGallery_pos < actbVideoGallery_rangeu) actbVideoGallery_moveup();
		document.getElementById('tat_tr'+actbVideoGallery_pos).style.backgroundColor = actbVideoGallery_self.actbVideoGallery_hColor;
		if (actbVideoGallery_toid) clearTimeout(actbVideoGallery_toid);
		if (actbVideoGallery_self.actbVideoGallery_timeOut > 0) actbVideoGallery_toid = setTimeout(function(){actbVideoGallery_mouse_on_list=0;actbVideoGallery_removedisp();},actbVideoGallery_self.actbVideoGallery_timeOut);
	}
	function actbVideoGallery_godown(){
		if (!actbVideoGallery_display) return;
		if (actbVideoGallery_pos == actbVideoGallery_total) return;
		document.getElementById('tat_tr'+actbVideoGallery_pos).style.backgroundColor = actbVideoGallery_self.actbVideoGallery_bgColor;
		actbVideoGallery_pos++;
		if (actbVideoGallery_pos > actbVideoGallery_ranged) actbVideoGallery_movedown();
		document.getElementById('tat_tr'+actbVideoGallery_pos).style.backgroundColor = actbVideoGallery_self.actbVideoGallery_hColor;
		if (actbVideoGallery_toid) clearTimeout(actbVideoGallery_toid);
		if (actbVideoGallery_self.actbVideoGallery_timeOut > 0) actbVideoGallery_toid = setTimeout(function(){actbVideoGallery_mouse_on_list=0;actbVideoGallery_removedisp();},actbVideoGallery_self.actbVideoGallery_timeOut);
	}
	function actbVideoGallery_movedown(){
		actbVideoGallery_rangeu++;
		actbVideoGallery_ranged++;
		actbVideoGallery_remake();
	}
	function actbVideoGallery_moveup(){
		actbVideoGallery_rangeu--;
		actbVideoGallery_ranged--;
		actbVideoGallery_remake();
	}

	/* Mouse */
	function actbVideoGallery_mouse_down(){
		document.getElementById('tat_tr'+actbVideoGallery_pos).style.backgroundColor = actbVideoGallery_self.actbVideoGallery_bgColor;
		actbVideoGallery_pos++;
		actbVideoGallery_movedown();
		document.getElementById('tat_tr'+actbVideoGallery_pos).style.backgroundColor = actbVideoGallery_self.actbVideoGallery_hColor;
		actbVideoGallery_curr.focus();
		actbVideoGallery_mouse_on_list = 0;
		if (actbVideoGallery_toid) clearTimeout(actbVideoGallery_toid);
		if (actbVideoGallery_self.actbVideoGallery_timeOut > 0) actbVideoGallery_toid = setTimeout(function(){actbVideoGallery_mouse_on_list=0;actbVideoGallery_removedisp();},actbVideoGallery_self.actbVideoGallery_timeOut);
	}
	function actbVideoGallery_mouse_up(evt){
		if (!evt) evt = event;
		if (evt.stopPropagation){
			evt.stopPropagation();
		}else{
			evt.cancelBubble = true;
		}
		document.getElementById('tat_tr'+actbVideoGallery_pos).style.backgroundColor = actbVideoGallery_self.actbVideoGallery_bgColor;
		actbVideoGallery_pos--;
		actbVideoGallery_moveup();
		document.getElementById('tat_tr'+actbVideoGallery_pos).style.backgroundColor = actbVideoGallery_self.actbVideoGallery_hColor;
		actbVideoGallery_curr.focus();
		actbVideoGallery_mouse_on_list = 0;
		if (actbVideoGallery_toid) clearTimeout(actbVideoGallery_toid);
		if (actbVideoGallery_self.actbVideoGallery_timeOut > 0) actbVideoGallery_toid = setTimeout(function(){actbVideoGallery_mouse_on_list=0;actbVideoGallery_removedisp();},actbVideoGallery_self.actbVideoGallery_timeOut);
	}
	function actbVideoGallery_mouseclick(evt){
		if (!evt) evt = event;
		if (!actbVideoGallery_display) return;
		actbVideoGallery_mouse_on_list = 0;
		actbVideoGallery_pos = this.getAttribute('pos');
		actbVideoGallery_penter();
	}
	function actbVideoGallery_table_focus(){
		actbVideoGallery_mouse_on_list = 1;
	}
	function actbVideoGallery_table_unfocus(){
		actbVideoGallery_mouse_on_list = 0;
		if (actbVideoGallery_toid) clearTimeout(actbVideoGallery_toid);
		if (actbVideoGallery_self.actbVideoGallery_timeOut > 0) actbVideoGallery_toid = setTimeout(function(){actbVideoGallery_mouse_on_list = 0;actbVideoGallery_removedisp();},actbVideoGallery_self.actbVideoGallery_timeOut);
	}
	function actbVideoGallery_table_highlight(){
		actbVideoGallery_mouse_on_list = 1;
		document.getElementById('tat_tr'+actbVideoGallery_pos).style.backgroundColor = actbVideoGallery_self.actbVideoGallery_bgColor;
		actbVideoGallery_pos = this.getAttribute('pos');
		while (actbVideoGallery_pos < actbVideoGallery_rangeu) actbVideoGallery_moveup();
		while (actbVideoGallery_pos > actbVideoGallery_ranged) actbVideoGallery_movedown();
		document.getElementById('tat_tr'+actbVideoGallery_pos).style.backgroundColor = actbVideoGallery_self.actbVideoGallery_hColor;
		if (actbVideoGallery_toid) clearTimeout(actbVideoGallery_toid);
		if (actbVideoGallery_self.actbVideoGallery_timeOut > 0) actbVideoGallery_toid = setTimeout(function(){actbVideoGallery_mouse_on_list = 0;actbVideoGallery_removedisp();},actbVideoGallery_self.actbVideoGallery_timeOut);
	}
	/* ---- */

	function actbVideoGallery_insertword(a){
		if (actbVideoGallery_self.actbVideoGallery_delimiter.length > 0){
			str = '';
			l=0;
			for (i=0;i<actbVideoGallery_delimwords.length;i++){
				if (actbVideoGallery_cdelimword == i){
					prespace = postspace = '';
					gotbreak = false;
					for (j=0;j<actbVideoGallery_delimwords[i].length;++j){
						if (actbVideoGallery_delimwords[i].charAt(j) != ' '){
							gotbreak = true;
							break;
						}
						prespace += ' ';
					}
					for (j=actbVideoGallery_delimwords[i].length-1;j>=0;--j){
						if (actbVideoGallery_delimwords[i].charAt(j) != ' ') break;
						postspace += ' ';
					}
					str += prespace;
					str += a;
					l = str.length;
					if (gotbreak) str += postspace;
				}else{
					str += actbVideoGallery_delimwords[i];
				}
				if (i != actbVideoGallery_delimwords.length - 1){
					str += actbVideoGallery_delimchar[i];
				}
			}
			actbVideoGallery_curr.value = str;
			setCaret(actbVideoGallery_curr,l);
		}else{
			actbVideoGallery_curr.value = a;
		}
		actbVideoGallery_mouse_on_list = 0;
		actbVideoGallery_removedisp();
	}
	function actbVideoGallery_penter(){
		if (!actbVideoGallery_display) return;
		actbVideoGallery_display = false;
		var word = '';
		var c = 0;
		for (var i=0;i<=actbVideoGallery_self.actbVideoGallery_keywords.length;i++){
			if (actbVideoGallery_bool[i]) c++;
			if (c == actbVideoGallery_pos){
				word = actbVideoGallery_self.actbVideoGallery_keywords[i];
				break;
			}
		}
		actbVideoGallery_insertword(word);
		l = getCaretStart(actbVideoGallery_curr);
	}
	function actbVideoGallery_removedisp(){
		if (actbVideoGallery_mouse_on_list==0){
			actbVideoGallery_display = 0;
			if (document.getElementById('tat_table')){ document.body.removeChild(document.getElementById('tat_table')); }
			if (actbVideoGallery_toid) clearTimeout(actbVideoGallery_toid);
		}
	}
	function actbVideoGallery_keypress(e){
		if (actbVideoGallery_caretmove) stopEvent(e);
		return !actbVideoGallery_caretmove;
	}
	function actbVideoGallery_checkkey(evt){
		if (!evt) evt = event;
		a = evt.keyCode;
		caret_pos_start = getCaretStart(actbVideoGallery_curr);
		actbVideoGallery_caretmove = 0;
		switch (a){
			case 38:
				actbVideoGallery_goup();
				actbVideoGallery_caretmove = 1;
				return false;
				break;
			case 40:
				actbVideoGallery_godown();
				actbVideoGallery_caretmove = 1;
				return false;
				break;
			case 13: case 9:
				if (actbVideoGallery_display){
					actbVideoGallery_caretmove = 1;
					actbVideoGallery_penter();
					return false;
				}else{
					return true;
				}
				break;
			default:
				setTimeout(function(){actbVideoGallery_tocomplete(a)},50);
				break;
		}
	}

	function actbVideoGallery_tocomplete(kc){
		if (kc == 38 || kc == 40 || kc == 13) return;
		var i;
		if (actbVideoGallery_display){ 
			var word = 0;
			var c = 0;
			for (var i=0;i<=actbVideoGallery_self.actbVideoGallery_keywords.length;i++){
				if (actbVideoGallery_bool[i]) c++;
				if (c == actbVideoGallery_pos){
					word = i;
					break;
				}
			}
			actbVideoGallery_pre = word;
		}else{ actbVideoGallery_pre = -1};
		
		if (actbVideoGallery_curr.value == ''){
			actbVideoGallery_mouse_on_list = 0;
			actbVideoGallery_removedisp();
			return;
		}
		if (actbVideoGallery_self.actbVideoGallery_delimiter.length > 0){
			caret_pos_start = getCaretStart(actbVideoGallery_curr);
			caret_pos_end = getCaretEnd(actbVideoGallery_curr);
			
			delim_split = '';
			for (i=0;i<actbVideoGallery_self.actbVideoGallery_delimiter.length;i++){
				delim_split += actbVideoGallery_self.actbVideoGallery_delimiter[i];
			}
			delim_split = delim_split.addslashes();
			delim_split_rx = new RegExp("(["+delim_split+"])");
			c = 0;
			actbVideoGallery_delimwords = new Array();
			actbVideoGallery_delimwords[0] = '';
			for (i=0,j=actbVideoGallery_curr.value.length;i<actbVideoGallery_curr.value.length;i++,j--){
				if (actbVideoGallery_curr.value.substr(i,j).search(delim_split_rx) == 0){
					ma = actbVideoGallery_curr.value.substr(i,j).match(delim_split_rx);
					actbVideoGallery_delimchar[c] = ma[1];
					c++;
					actbVideoGallery_delimwords[c] = '';
				}else{
					actbVideoGallery_delimwords[c] += actbVideoGallery_curr.value.charAt(i);
				}
			}

			var l = 0;
			actbVideoGallery_cdelimword = -1;
			for (i=0;i<actbVideoGallery_delimwords.length;i++){
				if (caret_pos_end >= l && caret_pos_end <= l + actbVideoGallery_delimwords[i].length){
					actbVideoGallery_cdelimword = i;
				}
				l+=actbVideoGallery_delimwords[i].length + 1;
			}
			var ot = actbVideoGallery_delimwords[actbVideoGallery_cdelimword].trim(); 
			var t = actbVideoGallery_delimwords[actbVideoGallery_cdelimword].addslashes().trim();
		}else{
			var ot = actbVideoGallery_curr.value;
			var t = actbVideoGallery_curr.value.addslashes();
		}
		if (ot.length == 0){
			actbVideoGallery_mouse_on_list = 0;
			actbVideoGallery_removedisp();
		}
		if (ot.length < actbVideoGallery_self.actbVideoGallery_startcheck) return this;
		if (actbVideoGallery_self.actbVideoGallery_firstText){
			var re = new RegExp("^" + t, "i");
		}else{
			var re = new RegExp(t, "i");
		}

		actbVideoGallery_total = 0;
		actbVideoGallery_tomake = false;
		actbVideoGallery_kwcount = 0;
		for (i=0;i<actbVideoGallery_self.actbVideoGallery_keywords.length;i++){
			actbVideoGallery_bool[i] = false;
			if (re.test(actbVideoGallery_self.actbVideoGallery_keywords[i])){
				actbVideoGallery_total++;
				actbVideoGallery_bool[i] = true;
				actbVideoGallery_kwcount++;
				if (actbVideoGallery_pre == i) actbVideoGallery_tomake = true;
			}
		}

		if (actbVideoGallery_toid) clearTimeout(actbVideoGallery_toid);
		if (actbVideoGallery_self.actbVideoGallery_timeOut > 0) actbVideoGallery_toid = setTimeout(function(){actbVideoGallery_mouse_on_list = 0;actbVideoGallery_removedisp();},actbVideoGallery_self.actbVideoGallery_timeOut);
		actbVideoGallery_generate();
	}
	return this;
}