		var iex=(document.all);//ie
		var na6=(window.sidebar);//netscape 6.2
		var elementSet=0;
		var Expkey=new RegExp("&amp;","ig");
		var currentField="";
		var intervalId;
			function checkdropDown(){
				if (currentField==""){
					clearInterval(intervalId);
					hideList();
					intervalId="";
				}
			}
			function toggleText(mode){
				if (mode==1) {
					currentField="Text";
					showList();
					if (intervalId) clearInterval(intervalId);
					intervalId=setInterval("checkdropDown()",300);
				} else {
					currentField="";
				}
			}
			function toggleList(mode){
				if (mode==1){
					currentField="drop";
				} else {
					currentField="";
				}
			}
			function showList(){ 
				var listbox=document.getElementById("event_list");
				var textbox=document.select_event.select_text;
				listbox.style.display="";
				//listbox.style.offsetLeft=textbox.style.offsetLeft;
				//listbox.style.offsetTop=textbox.style.offsetTop;
				
				var left = getPageOffsetLeft(textbox);
				var top =getPageOffsetTop(textbox);
				
				if(window.scrollMaxX >0)listbox.style.left=left;
				else listbox.style.left=left;
				listbox.style.top=top+17;
			}
			function hideList(){
				var listbox=document.getElementById("event_list");
				var textbox=document.select_event.select_text;
				setListboxText(1);
				listbox.style.display="none";
			}
			function scrollList(e){
				var listbox=document.select_event.select_id;
				var keyCode=0;
				if (iex) keyCode=window.event.keyCode;
				if (na6) keyCode=e.which;
				if (keyCode==40 || keyCode==38){
					if (keyCode==40 && listbox.selectedIndex>=0 && listbox.selectedIndex<listbox.options.length-1){
						listbox.selectedIndex+=1;
					} else if (keyCode==38 && listbox.selectedIndex>0 && listbox.selectedIndex<=listbox.options.length-1){
						listbox.selectedIndex-=1;
					}
					setListboxText(0);
					if (iex) window.event.returnValue=0;
					if (na6) e.returnValue=0;
					return;
				}
			}
			function selectList(e){
				var listbox=document.select_event.select_id;
				var search_word=document.select_event.select_text.value;
				var found=-1;
				var listbox_word;
				var keyCode=0;
				var listElement;
				var tWord;
				if (!listbox.options || listbox.options.length<=0) return;

				if (search_word!="") {
					search_word=search_word.toLowerCase();
					//found=binaryFind(listbox,search_word,0,listbox.options.length-1);
					found=-1;
					for (var icnt=0;icnt<listbox.options.length;icnt++){
						listElement=listbox.options[icnt].innerHTML.toLowerCase();
						listElement=listElement.replace(Expkey,"&");
						tWord=listElement.substr(0,search_word.length);
						if (tWord==search_word) {
							found=icnt;
							break;
						}
					}
					if (found>=0)
						listbox.selectedIndex=found;
				}

			}
			function setListboxText(mode){
				var listbox=document.select_event.select_id;
				var content;
				if (!listbox.options || listbox.options.length<=0 || listbox.selectedIndex<=-1) return;
				var textbox_name=document.select_event.select_text;
				if (mode==1 && textbox_name.value=="") {
				    document.select_event.select_id.selectedIndex=-1;
					return;
				}
				content=listbox.options[listbox.selectedIndex].innerHTML;

				content=content.replace(Expkey,"&");
				textbox_name.value=content;
			}
			
			function binaryFind(listBox,fWord,sPos,ePos){
				var listElement;
				var tWord;
				var mPos;
				
				if (sPos>ePos) return -1;
				mPos=sPos+Math.ceil((ePos-sPos)/2);
				
				if (mPos<0 || mPos>=listBox.options.length) return -1;
				listElement=listBox.options[mPos].innerHTML.toLowerCase();

				tWord=listElement.substr(0,fWord.length);

				if (tWord==fWord) return mPos;
				if (mPos<=0 || mPos>=listBox.options.length) return -1;
				
				if (fWord<tWord) return binaryFind(listBox,fWord,mPos+1,ePos);
				else return binaryFind(listBox,fWord,sPos,mPos-1);
			}
