var bca; function addEvent(obj,event_name,func_name){ if (obj.attachEvent){ obj.attachEvent("on"+event_name, func_name);}else if(obj.addEventListener){ obj.addEventListener(event_name,func_name,true);}else{ obj["on"+event_name] = func_name;}} function removeEvent(obj,event_name,func_name){ if (obj.detachEvent){ obj.detachEvent("on"+event_name,func_name);}else if(obj.removeEventListener){ obj.removeEventListener(event_name,func_name,true);}else{ obj["on"+event_name] = null;}} function stopEvent(evt){ evt || window.event;if (evt.stopPropagation){ evt.stopPropagation();evt.preventDefault();}else if(typeof evt.cancelBubble != "undefined"){ evt.cancelBubble = true;evt.returnValue = false;} return false;} function getElement(evt){ if (window.event){ return window.event.srcElement;}else{ return evt.currentTarget;}} function getTargetElement(evt){ if (window.event){ return window.event.srcElement;}else{ return evt.target;}} function stopSelect(obj){ if (typeof obj.onselectstart != 'undefined'){ addEvent(obj,"selectstart",function(){ return false;});}} function getCaretEnd(obj){ if(typeof obj.selectionEnd != "undefined"){ return obj.selectionEnd;}else if(document.selection&&document.selection.createRange){ var M=document.selection.createRange();try{ var Lp = M.duplicate();Lp.moveToElementText(obj);}catch(e){ var Lp=obj.createTextRange();} Lp.setEndPoint("EndToEnd",M);var rb=Lp.text.length;if(rb>obj.value.length){ return -1;} return rb;}} function getCaretStart(obj){ if(typeof obj.selectionStart != "undefined"){ return obj.selectionStart;}else if(document.selection&&document.selection.createRange){ var M=document.selection.createRange();try{ var Lp = M.duplicate();Lp.moveToElementText(obj);}catch(e){ var Lp=obj.createTextRange();} Lp.setEndPoint("EndToStart",M);var rb=Lp.text.length;if(rb>obj.value.length){ return -1;}return rb;}} function setCaret(obj,l){ obj.focus();if (obj.setSelectionRange){ obj.setSelectionRange(l,l);}else if(obj.createTextRange){ m = obj.createTextRange();m.moveStart('character',l);m.collapse();m.select();}} function setSelection(obj,s,e){ obj.focus();if (obj.setSelectionRange){ obj.setSelectionRange(s,e);}else if(obj.createTextRange){ m = obj.createTextRange();m.moveStart('character',s);m.moveEnd('character',e);m.select();}} String.prototype.addslashes = function(){ return this.replace(/(["\\\.\|\[\]\^\*\+\?\$\(\)])/g, '\\$1');} String.prototype.trim = function () { return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1");}; function curTop(obj){ toreturn = 0;while(obj){ toreturn += obj.offsetTop;obj = obj.offsetParent;} return toreturn;} function curLeft(obj){ toreturn = 0;while(obj){ toreturn += obj.offsetLeft;obj = obj.offsetParent;} return toreturn;} function isNumber(a) { return typeof a == 'number' && isFinite(a);} function replaceHTML(obj,text){ while(el = obj.childNodes[0]){ obj.removeChild(el);};obj.appendChild(document.createTextNode(text));} function a(obj,ca){ this.atimeOut = -1; this.alim = 10; this.afirstText = true; this.amouse = true; this.adelimiter = new Array(';',','); this.astartcheck = 2; this.abgColor = '#F5f5f5'; this.ahColor = '#E7E7E7'; var adelimwords = new Array();var acdelimword = 0;var adelimchar = new Array();var adisplay = false;var apos = 0;var atotal = 0;var acurr = null;var arangeu = 0;var aranged = 0;var abool = new Array();var apre = 0;var atoid;var atomake = false;var agetpre = "";var amouse_on_list = 1;var akwcount = 0;var acaretmove = false;this.akeywords = new Array();this.akeywords = ca;var aself = this;acurr = obj; addEvent(acurr,"focus",asetup); function asetup(){ addEvent(document,"keydown",acheckkey);addEvent(acurr,"blur",aclear);addEvent(document,"keypress",akeypress);} function aclear(evt){ if (!evt) evt = event;removeEvent(document,"keydown",acheckkey);removeEvent(acurr,"blur",aclear);removeEvent(document,"keypress",akeypress);aremovedisp();} function aparse(n){ if (aself.adelimiter.length > 0){ var t = adelimwords[acdelimword].trim().addslashes(); var plen = adelimwords[acdelimword].trim().length;}else{ var t = acurr.value.addslashes();var plen = acurr.value.length;} var tobuild = '';var i;if (aself.afirstText){ var re = new RegExp("^" + t, "i");}else{ var re = new RegExp(t, "i");} var p = n.search(re);for (i=0;i
";for (i=p;i
';if (aself.amouse){ c.onclick = amouse_up;}} for (i=0;i
';if (aself.amouse){ c.onclick = amouse_down;}}}
function agoup(){ if (!adisplay) return;if (apos == 1) return;document.getElementById('tat_tr'+apos).style.backgroundColor = aself.abgColor;apos--;if (apos < arangeu) amoveup();document.getElementById('tat_tr'+apos).style.backgroundColor = aself.ahColor;if (atoid) clearTimeout(atoid);if (aself.atimeOut > 0) atoid = setTimeout(function(){amouse_on_list=0;aremovedisp();},aself.atimeOut);}
function agodown(){ if (!adisplay) return;if (apos == atotal) return;document.getElementById('tat_tr'+apos).style.backgroundColor = aself.abgColor;apos++;if (apos > aranged) amovedown();document.getElementById('tat_tr'+apos).style.backgroundColor = aself.ahColor;if (atoid) clearTimeout(atoid);if (aself.atimeOut > 0) atoid = setTimeout(function(){amouse_on_list=0;aremovedisp();},aself.atimeOut);}
function amovedown(){ arangeu++;aranged++;aremake();}
function amoveup(){ arangeu--;aranged--;aremake();}
function amouse_down(){ document.getElementById('tat_tr'+apos).style.backgroundColor = aself.abgColor;apos++;amovedown();document.getElementById('tat_tr'+apos).style.backgroundColor = aself.ahColor;acurr.focus();amouse_on_list = 0;if (atoid) clearTimeout(atoid);if (aself.atimeOut > 0) atoid = setTimeout(function(){amouse_on_list=0;aremovedisp();},aself.atimeOut);}
function amouse_up(evt){ if (!evt) evt = event;if (evt.stopPropagation){ evt.stopPropagation();}else{ evt.cancelBubble = true;} document.getElementById('tat_tr'+apos).style.backgroundColor = aself.abgColor;apos--;amoveup();document.getElementById('tat_tr'+apos).style.backgroundColor = aself.ahColor;acurr.focus();amouse_on_list = 0;if (atoid) clearTimeout(atoid);if (aself.atimeOut > 0) atoid = setTimeout(function(){amouse_on_list=0;aremovedisp();},aself.atimeOut);}
function amouseclick(evt){ if (!evt) evt = event;if (!adisplay) return;amouse_on_list = 0;apos = this.getAttribute('pos');apenter();}
function atable_focus(){ amouse_on_list = 1;}
function atable_unfocus(){ amouse_on_list = 0;if (atoid) clearTimeout(atoid);if (aself.atimeOut > 0) atoid = setTimeout(function(){amouse_on_list = 0;aremovedisp();},aself.atimeOut);}
function atable_highlight(){ amouse_on_list = 1;document.getElementById('tat_tr'+apos).style.backgroundColor = aself.abgColor;apos = this.getAttribute('pos');while (apos < arangeu) amoveup();while (apos > aranged) amovedown();document.getElementById('tat_tr'+apos).style.backgroundColor = aself.ahColor;if (atoid) clearTimeout(atoid);if (aself.atimeOut > 0) atoid = setTimeout(function(){amouse_on_list = 0;aremovedisp();},aself.atimeOut);}
function ainsertword(a){ if (aself.adelimiter.length > 0){ str = '';l=0;for (i=0;i