function CyloCombo(obj) {
	try {
		if (obj == false) return false;
		this.setUp();
		if (typeof(obj.parentDiv) == "undefined" || obj.parentDiv == "") {
			this.Error = "obj.parentDiv is empty";
			return false;
		}
		if (typeof(obj.comboName) == "undefined" || obj.comboName == "") {
			this.Error = "obj.comboName is empty";
			return false;
		}
		if (typeof(obj.size) == "undefined") {
			obj.size = 0;
			if (obj.multiple == true) obj.size = 4;
		}
		if (typeof(obj.multiple) == "undefined") obj.multiple = false;
		if (obj.multiple == true && obj.size == 0) {
			obj.size = 2;
		}
		if (typeof(obj.max) == "undefined") obj.max = -1;
		if (typeof(obj.direction) == "undefined") obj.direction = "";
		this.Error = 0;
		this.OnClick = "return 0;";
		if (typeof(obj.onclick) != "undefined") this.OnClick = obj.onclick + ";";
		this.OnDblClick = "return 0;";
		if (typeof(obj.ondblclick) != "undefined") this.OnDblClick = obj.ondblclick + ";";
		this.OnChangeCode = "return 0;";
		if (typeof(obj.onchange) != "undefined") this.OnChangeCode = obj.onchange + ";";
		this.OnFocusCode = "";
		if (typeof(obj.onfocus) != "undefined") this.OnFocusCode = obj.onfocus + ";";
		this.OnBlurCode = "";
		if (typeof(obj.onblur) != "undefined") this.OnBlurCode = obj.onblur + ";";
		if (typeof(obj.resize) == "undefined") obj.resize = true;
		this.onTabDragUp = false;
		this.onkeysup = null;
		this.Disabled = false;
		if (typeof(obj.disabled) != "undefined") {
			if (obj.disabled == true || obj.disabled == false) this.Disabled = obj.disabled;
		}
		this.ParentContainer = obj.parentDiv;
		this.currentIndex = "INITIAL";
		this.InitialIndex = "";
		this.InitialIndexOnClosed = "";
		this.previouseIndex = "";
		this.indexs = 0;
		this.CodeToExc = "";
		this.selectedIndexes = [];
		this.Max = obj.max;
		this.Size = obj.size;
		this.Resize = obj.resize;
		this.ComboValues = [];
		this.options = [];
		this.stayOpen = false;
		this.Sized = false;
		this.SetSelTabOnEntry = false;
		this.tZindexForActive = 0;
		this.Direction = obj.direction.toLowerCase();
		this.Multiple = obj.multiple;
		this.ComboName = obj.comboName;
		this.InputName = this.ComboName + "inp";
		this.OnCPrev = [];
		this.OnCCurr = [];
		this.onClickStartTime = 0;
		this.closedChanged = false;
		this.rowAssignKey = "PCyloP";
		this.DisabledDivs = null;
		this.RowJustSelected = false;
		this.AutoSize = false;
		this.value = "";
		this.OptionStyle = {
			"optionOn": "CyloLEON",
			"optionOff": "CyloLEOFF",
			"parentDivBackgroundUrl": ""
		};
		if (typeof(obj.optionon) != "undefined") this.OptionStyle.optionOn = obj.optionon;
		if (typeof(obj.optionoff) != "undefined") this.OptionStyle.optionOff = obj.optionoff;
		if (typeof(obj.parentDivBackgroundUrl) != "undefined") this.OptionStyle.parentDivBackgroundUrl = obj.parentDivBackgroundUrl;
		if (!document.getElementById(this.ParentContainer)) {
			this.Error = "Combo container does not exist";
			return false;
		}
		hiddenSelect = document.createElement("select");
		hiddenSelect.multiple = this.Multiple;
		hiddenSelect.size = this.Size;
		hiddenSelect.id = this.InputName;
		hiddenSelect.name = this.InputName;
		hiddenSelect.onclick = new Function(this.OnClick);
		hiddenSelect.ondblclick = new Function(this.OnDblClick);
		hiddenSelect.onchange = new Function(this.OnChangeCode);
		hiddenSelect.style.display = 'none';
		document.getElementById(this.ParentContainer).parentNode.appendChild(hiddenSelect);
		if (this.Size == 0) {
			var sibling = null;
			var appendWhichWay = "";
			if (document.getElementById(this.ParentContainer).previousSibling) {
				sibling = document.getElementById(this.ParentContainer).previousSibling;
				appendWhichWay = "after";
			} else if (document.getElementById(this.ParentContainer).nextSibling) {
				sibling = document.getElementById(this.ParentContainer).nextSibling;
				appendWhichWay = "before";
			} else {
				appendWhichWay = "parent";
			}
			document.getElementById(this.ParentContainer).parentNode.removeChild(document.getElementById(this.ParentContainer));
			tableSurround = document.createElement("table");
			tableSurround.id = this.ComboName + "surround";
			tableSurround.cellPadding = "0px";
			tableSurround.cellSpacing = "0px";
			tbody = document.createElement("tbody");
			tableSurround.appendChild(tbody);
			tr = document.createElement("tr");
			td = document.createElement("td");
			this.disableSelection(td);
			tr.className = this.OptionStyle.optionOff;
			td.id = this.ComboName + "selTab";
			td.className = "CyloSelTab";
			td.innerHTML = "&nbsp;";
			PC = document.createElement("div");
			PC.id = this.ParentContainer;
			tr.appendChild(td);
			td = document.createElement("td");
			td.id = this.ComboName + "ddIMG";
			tr.appendChild(td);
			tbody.appendChild(tr);
			tr = document.createElement("tr");
			td = document.createElement("td");
			td.colSpan = "2";
			td.appendChild(PC);
			tr.appendChild(td);
			tbody.appendChild(tr);
			switch (appendWhichWay) {
			case "after":
				this.insertAfter(sibling.parentNode, tableSurround, sibling);
				break;
			case "before":
				sibling.parentNode.insertBefore(tableSurround, sibling);
				break;
			case "parent":
				sibling.appendChild(tableSurround);
				break;
			}
		}
		PC = document.getElementById(this.ParentContainer);
		PC.className = 'CyloComboContainer';
		PC.onscroll = function () {
			window.CyloMouseDown = false;
		}
		var comName = this.ComboName;
		if (this.Size > 0 && window.navigator.userAgent.indexOf("MSIE") == -1) {
			PC.onmousedown = function (e) {
				var code = "var combo=" + comName + ";";
				eval(code);
				combo.trackElement(e, this, "down")
			};
			PC.onmouseup = function (e) {
				var code = "var combo=" + comName + ";";
				eval(code);
				combo.trackElement(e, this, "up")
			};
		}
		if (this.Size > 0 && window.navigator.userAgent.indexOf("MSIE") > -1) {
			PC.attachEvent("onmousedown", function (Event) {
				try {
					var code = "combo=" + comName + ";";
					eval(code);
					src = Event.srcElement;
					if (src.clientHeight < src.scrollHeight) {
						if (document.getElementById(combo.ParentContainer).offsetWidth - Event.offsetX < 19) {
							combo.doOnFocus();
						} else {
							if (combo.RowJustSelected == false) {
								combo.doOnFocus();
								combo.startOnClick();
							}
						}
					} else {
						if (combo.RowJustSelected == false) {
							combo.doOnFocus();
							combo.startOnClick();
						}
					}
					combo.RowJustSelected = false;
				}
				catch(e) {}
			});
		}
		
		if(typeof(obj.width)!="undefined")
		{
			var ext="";
			if(obj.width.indexOf("px")==-1 && obj.width.indexOf("%")==-1)
			{
				ext="px";
			}
			PC.style.width=obj.width+ext;
		}else{
			this.AutoSize = true;
		}
		if(typeof(obj.height)!="undefined")
		{
			var ext="";
			if(obj.height.indexOf("px")==-1 && obj.height.indexOf("%")==-1)
			{
				ext="px";
			}
			PC.style.height=obj.height+ext;
		}
		
		if (this.OptionStyle.parentDivBackgroundUrl != "") {
			PC.style.background = "url('" + this.OptionStyle.parentDivBackgroundUrl + "')";
		}
		if (document.getElementById(this.ComboName)) {
			this.Error = "Combo name is not uniqie";
			return false;
		}
		combo = document.createElement("table");
		combo.style.tableLayout = "fixed"
		tbody = document.createElement("tbody");
		combo.appendChild(tbody);
		combo.id = this.ComboName;
		combo.className = 'CyloSELECT';
		PC.appendChild(combo);
		this.combo = tbody;
		if (this.Disabled == true) {
			var disdiv = document.createElement("div");
			disdiv.className = "CyloComboDisabled";
			disdiv.id = this.ComboName + "DisabledDiv";
			var appendToo = null;
			if (this.Size == 0) {
				appendToo = tableSurround;
			} else {
				appendToo = document.getElementById(this.ParentContainer);
			}
			if (window.navigator.userAgent.indexOf("MSIE") > -1) {
				disdiv.style.top = this.findPosY(appendToo) + "px";
				disdiv.style.left = this.findPosX(appendToo) + "px";
				disdiv.style.width = document.getElementById(this.ParentContainer).offsetWidth + "px";
				disdiv.style.height = appendToo.offsetHeight + "px";
			}
			document.getElementById(this.InputName).disabled = true;
			this.DisabledDivs = disdiv;
			appendToo.appendChild(disdiv);
		}
		window.CyloComboList.push(this);
		if (window.navigator.userAgent.indexOf("MSIE") == -1) {
			this.adjustDisabledDivsPart2();
		}
		return true;
	} catch(e) {
		alert(e.message);return false;
	}
}

CyloCombo.prototype.trackElement = function (e, mouseMoveElem, action) {
	if (!e) e = window.event;
	var sElem = e.target;
	if (this.RowJustSelected == false) {
		if (typeof sElem.scrollHeight != "undefined" && typeof sElem.clientHeight != "undefined" && typeof e.pageX != "undefined") {
			this.doOnFocus();
			if (sElem.scrollHeight > sElem.clientHeight && e.pageX - sElem.offsetLeft > sElem.clientWidth) {} else if (sElem.scrollWidth > sElem.clientWidth && e.pageY - sElem.offsetTop > sElem.clientHeight) {} else {
				if (action == "down") {
					this.removeAllSelectedIndexes();
					this.AddSelectedIndex(this.options[this.options.length - 1].id);
				}
				if (action == "up") {
					this.checkTempSelectedOptions();
					this.startOnClick();
				}
			}
		} else {
			if (action == "down") {
				this.removeAllSelectedIndexes();
				this.AddSelectedIndex(this.options[this.options.length - 1].id);
			}
			if (action == "up") {
				this.checkTempSelectedOptions();
				this.startOnClick();
			}
		}
	}
	this.RowJustSelected = false;
}
CyloCombo.prototype.addEntry = function (display, value, SELECTED, title) {
	try {

		if (typeof(SELECTED) == "undefined") SELECTED = false;
		if (typeof(display) == "undefined") display = "";
		if (typeof(title) == "undefined") title = "";
		if (typeof(value) == "undefined") value = display;
		if (typeof(this.combo) == "undefined") {
			return false;
		}
		if (display.length < 1) {
			display = "&nbsp;";
		}
		DEBUG = true;
		var tr = document.createElement("tr");
		var td = null;
		td = document.createElement("td");
		tr.appendChild(td);
		this.disableSelection(td);
		td.innerHTML = display;
		td.onselectstart = function () {
			return false;
		}
		if (this.OptionStyle != null) {
			if (typeof(this.OptionStyle.optionOff) != "undefined") {}
		}
		var singleclick = "";
		if (this.Size > 0) {
			singleclick = this.createSingleClickCode();
		}
		mouseDown = "" + this.ComboName + ".RowJustSelected=true;window.CyloMouseDown=true;" + this.ComboName + ".AddDragTabs();" + this.ComboName + ".doOnFocus();" + this.ComboName + ".CyloHandleMouseDown();";
		tr.onmousedown = new Function(mouseDown + ";" + singleclick);
		mouseOver = "";
		if (this.Multiple == false && this.Size > 0) {
			mouseOver = "if(window.CyloMouseDown==true&&window.CyloCurrentCombo=='" + this.ComboName + "'){" + this.ComboName + ".removeAllSelectedIndexes();" + this.ComboName + ".AddSelectedIndex(this.id);}";
		} else if (this.Multiple == false && this.Size == 0) {
			mouseOver = "" + this.ComboName + ".unhighlightAllSelectedIndexes();" + this.ComboName + ".HighlightSelectedIndex(this.id);" + this.ComboName + ".currentIndex=this.id;" + this.ComboName + ".stayOpen=true;";
		} else {
			mouseOver = "if(window.CyloMouseDown==true&&" + this.ComboName + ".Multiple==true&&window.CyloCurrentCombo=='" + this.ComboName + "'){if(" + this.ComboName + ".thisIsSelected(this.id)==false){" + this.ComboName + ".SelectedRowsInbetweenInitialAndIndex(this.id);" + this.ComboName + ".AddSelectedIndex(this.id);}else{if(" + this.ComboName + ".thisLastInCombo(this.id)==false)eval(" + this.ComboName + ".CodeToExc);}}";
		}
		tr.onmouseover = new Function(mouseOver);
		mouseOut = "if(window.CyloMouseDown==true&&" + this.ComboName + ".Multiple==true){if(" + this.ComboName + ".thisIsSelected(this.id)==true && " + this.ComboName + ".thisLastInCombo(this.id)==true){" + this.ComboName + ".CodeToExc='" + this.ComboName + ".RemoveLastIndex();';}}";
		tr.onmouseout = new Function(mouseOut);
		mouseUp = "" + this.ComboName + ".RowJustSelected=true;window.CyloMouseDown=false;" + this.ComboName + ".RemoveDragTabs();";
		if (this.Size == 0) {
			mouseUp = mouseUp + this.ComboName + ".closedChanged=false;" + this.ComboName + ".removeAllSelectedIndexes();" + this.ComboName + ".AddSelectedIndex(this.id);" + this.ComboName + ".openDropDown(-1);" + this.ComboName + ".setDDLable(this.id);";
		}
		mouseUp = mouseUp + this.ComboName + ".checkTempSelectedOptions();";
		onclickCode = "";
		onclickCode = ("" + this.ComboName + ".startOnClick();");
		tr.onmouseup = new Function(mouseUp + ";" + onclickCode);
		tr.id = this.ComboName + this.rowAssignKey + this.indexs;
		tr.onselectstart = function () {
			return false;
		}
		this.combo.appendChild(tr);
		this.SetRowStyle(tr.id, "OFF");
		this.indexs++;
		tr.title = title;
		opt = {};
		opt.id = tr.id;
		opt.text = display;
		opt.value = value;
		opt.selected=false;
		this.options.push(opt);
		this.ComboValues[tr.id] = value;
		var newOpt = new Option(value, value);
		hinp = document.getElementById(this.InputName);
		hinp.options[hinp.options.length] = newOpt;
		globeH = 0;
		if (this.Sized == false) {
			bgc = "";
			if (td.currentStyle) bgc = td.currentStyle["backgroundColor"];
			else if (window.getComputedStyle) bgc = document.defaultView.getComputedStyle(td, null).getPropertyValue("background-color");
			PC = document.getElementById(this.ParentContainer);
			PC.style.backgroundColor = bgc;
		}
		if (this.Sized == false && this.Size == 0) {
			h = tr.offsetHeight;
			globeH = h;
			var w = document.getElementById(this.ParentContainer).offsetWidth;
			dd = document.createElement("img");
			dd.src = 'dd.gif';
			dd.className = 'CyloDDIMG';
			onclk = this.ComboName + ".doOnFocus();" + this.ComboName + ".stayOpen=true;" + this.ComboName + ".openDropDown(true);";
			dd.onmousedown = new Function(onclk);
			if (window.navigator.userAgent.indexOf("MSIE") > -1) {
				dd.style.width = h + "px";
				dd.style.height = h + "px";
				dd.ondblclick = new Function(onclk);
			} else {
				dd.style.width = h + "px";
				dd.style.height = h + "px";
			}
			document.getElementById(this.ComboName + "ddIMG").appendChild(dd);
			dd.onmouseup = new Function(this.ComboName + ".startOnClick(true);");
			w = w - h;
			document.getElementById(this.ParentContainer).style.display = "none";
			selTab = document.getElementById(this.ComboName + "selTab");
			selTab.style.padding = td.style.padding;
			selTab.style.backgroundColor = tr.style.backgroundColor;
			selTab.style.width = w + "px";
			selTab.innerHTML = display;
			selTab.className = this.OptionStyle.optionOff;
			selTab.style.border = '1px solid black';
			selTab.onmouseup = new Function(this.ComboName + ".startOnClick();");
			if (this.OptionStyle.parentDivBackgroundUrl != "") {}
			document.getElementById(this.ComboName + "selTab").style.width = w + "px";
			document.getElementById(this.ComboName + "selTab").onmousedown = new Function(onclk);
			document.getElementById(this.ComboName + "surround").style.width = (w + globeH) + "px";
			this.AddSelectedIndex(tr.id);
		} else if (this.Sized == false && this.Size > 0 && this.Resize==true) {
			h = tr.offsetHeight;
			cd = document.getElementById(this.ParentContainer);
			if (window.navigator.userAgent.indexOf("MSIE") > -1) {
				cd.style.height = (h * this.Size) + 2 + "px";
			} else {
				cd.style.height = (h * this.Size) + "px";
			}
		}
		if (this.Sized == false) {
			this.Sized = true;
			if (this.Size == 0) {
				this.AddSelectedIndex(tr.id);
				this.OnCCurr = this.selectedIndexes.slice();
			}
			if (this.Disabled == true) {
				var disdiv = document.getElementById(this.ComboName + "DisabledDiv");
				var appendToo = null;
				if (this.Size == 0) {
					appendToo = document.getElementById(this.ComboName + "surround");
				} else {
					appendToo = document.getElementById(this.ParentContainer);
				}
				disdiv.style.top = this.findPosY(appendToo) + "px";
				disdiv.style.left = this.findPosX(appendToo) + "px";
				disdiv.style.width = appendToo.offsetWidth;
				disdiv.style.height = appendToo.offsetHeight;
			}
		}
		if (this.SetSelTabOnEntry == true) {
			this.setDDLable(tr.id);
			this.SetSelTabOnEntry = false;
		}
		if (SELECTED) {
			if (this.Multiple == false) {
				this.removeAllSelectedIndexes();
				this.AddSelectedIndex(tr.id);
				if (this.Size == 0) {
					this.setDDLable(tr.id);
				}
			} else {
				this.AddSelectedIndex(tr.id);
				this.OnCCurr = this.selectedIndexes.slice();
			}
		}
		if (this.AutoSize == true) {}
		return true;
	} catch(e) {
		alert(e.message);
		return false;
	}
}
CyloCombo.prototype.disabled = function (bool) {
	try {
		if (typeof(bool) == "undefined") bool = "";
		bool = bool + "";
		if (bool.length > 0) {
			if (bool == "false") {
				document.getElementById(this.InputName).disabled = false;
				this.DisabledDivs.style.display = "none";
				this.Disabled = false;
			}
			if (bool == true || bool.toLowerCase() == "true") {
				document.getElementById(this.InputName).disabled = true;
				this.DisabledDivs.style.display = "";
				this.Disabled = true;
			}
		} else {
			return this.Disabled;
		}
	} catch(e) {}
}
CyloCombo.prototype.removeIndexes = function () {
	try {
		var ol = this.options.length;
		for (var x = ol - 1; x > -1; x--) {
			document.getElementById(this.options[x].id).parentNode.removeChild(document.getElementById(this.options[x].id));
		}
		this.ComboValues = [];
		this.OnCPrev = [];
		this.OnCCurr = [];
		this.options = [];
		this.indexs = 0;
		document.getElementById(this.InputName).length = 0;
		if (this.Size == 0) {
			this.setDDLable("");
			this.SetSelTabOnEntry = true;
		}
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.remove = function (n) {
	try {
		if (typeof(this.options[n]) != "undefined" && this.options[n] != null) {
			var fn = false;
			var ol = this.options.length;
			var sf = ol;
			var workingRowID = "";
			var setNextOrPrev = false;
			for (var x = ol - 1; x > n - 1; x--) {
				if (x == n) {
					workingRowID = this.options[x].id;
					if (this.InitialIndex == workingRowID) this.InitialIndex = "";
					if (this.currentIndex == workingRowID) {
						this.currentIndex = "INITIAL";
						setNextOrPrev = true;
					}
					if (this.previouseIndex == workingRowID) this.previouseIndex = "";
					document.getElementById(this.InputName).remove(x);
					this.ComboValues.splice(x, 1);
					document.getElementById(this.options[x].id).parentNode.removeChild(document.getElementById(this.options[x].id));
					this.options.splice(x, 1);
					var sil = this.selectedIndexes.length;
					for (var xxx = 0; xxx < sil; xxx++) {
						if (this.selectedIndexes[xxx] == workingRowID) {
							this.selectedIndexes.splice(xxx, 1);
							xxx = sil;
						}
					}
					for (var x = 0; x < this.OnCCurr.length; x++) {
						if (this.OnCCurr[x] == workingRowID) {
							this.OnCCurr.splice(x, 1);
						}
					}
					for (var x = 0; x < this.OnCPrev.length; x++) {
						if (this.OnCPrev[x] == workingRowID) {
							this.OnCPrev.splice(x, 1);
						}
					}
					this.indexs--;
				} else {
					var orig = this.options[x].id;
					tid = orig + "";
					tid = tid.replace(this.ComboName + this.rowAssignKey, "");
					tid--;
					tid = this.ComboName + this.rowAssignKey + tid;
					this.options[x].id = tid;
					document.getElementById(orig).title = tid;
					document.getElementById(orig).id = tid;
				}
			}
			if (this.options.length == 0) {
				if (this.Size == 0) {
					this.setDDLable("");
					this.SetSelTabOnEntry = true;
				}
			}
			if (setNextOrPrev == true && this.Size == 0 && this.options.length > 0) {
				this.selectedIndex(0);
			}
		}
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.removeIndexByVal = function (val) {
	try {
		var ol = this.options.length;
		for (var x = ol - 1; x > n - 1; x--) {
			if (this.options[x].value == val) {
				this.removeIndex(x);
			}
		}
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.openDropDown = function (which, resize) {
	try {
		if (this.Size != 0) {
			return 0;
		}
		if (typeof(resize) == "undefined") resize = false;
		dd = document.getElementById(this.ParentContainer);
		if (which == false || which == -1) {
			if (this.InitialIndexOnClosed == this.currentIndex) {
				this.closedChanged = false;
			}
			if (this.stayOpen == false || which == -1) {
				dd.style.display = "none";
				window.CyloDropDownComboIsOpen = false;
				this.reSelectSelectedIndex();
				try {
					this.takeAwayHiddenDiv();
				} catch(e) {}
			}
		} else {
			if (dd.style.display == "none" && resize == false) {
				this.InitialIndexOnClosed = this.currentIndex;
				window.CyloDropDownComboIsOpen = true;
				dd.style.zIndex = 9998;
				dd.style.display = "";
				dd.style.position = "absolute";
				dd.style.zIndex = 9999;
				surround = document.getElementById(this.ComboName + "surround");
				rows = dd.getElementsByTagName("tr");
				h = 0;
				if (window.navigator.userAgent.indexOf("MSIE") > -1) h = h + 2;
				if (window.navigator.userAgent.indexOf("MSIE") == -1) h = h - 1;
				for (var x = 0; x < rows.length; x++) {
					if (rows[x].parentNode.parentNode.parentNode.id == this.ParentContainer) {
						h = h + rows[x].offsetHeight;
					}
				}
				initH = h;
				info = this.dropUpOrDown(surround);
				info = info.split("|");
				tDirection = info[0];
				tYPos = parseInt(info[1]);
				tBrowserHeight = parseInt(info[2]);
				tScrolled = parseInt(info[3]);
				IEFFW = 0;
				if (window.navigator.userAgent.indexOf("MSIE") > -1) {
					IEFFW = 2;
					IEFFH = 1;
				} else {
					IEFFW = 1.5;
					IEFFH = 1.5;
				}
				dd.style.width = surround.offsetWidth - IEFFW + "px";
				if (window.navigator.userAgent.indexOf("MSIE") > -1) {
					dd.style.height = (h - 2) + "px";
				} else {
					dd.style.height = (h + 2) + "px";
				}
				if (this.Direction == "down") {
					tDirection = "down";
				}
				if (this.Direction == "up") {
					tDirection = "up";
				}
				if (tDirection == "down") {
					dd.style.top = tYPos + surround.offsetHeight - IEFFH + "px";
					if (h + tYPos + tScrolled + surround.offsetHeight > tBrowserHeight) {
						if (tBrowserHeight - (tYPos) + tScrolled - 80 < initH) dd.style.height = tBrowserHeight - (tYPos) + tScrolled - 80 + "px";
					}
				} else {
					if (h > (tBrowserHeight - (tBrowserHeight - (tYPos - tScrolled)))) {
						h = (tBrowserHeight - (tBrowserHeight - (tYPos - tScrolled))) - 30;
					}
					if (window.navigator.userAgent.indexOf("MSIE") > -1) {
						dd.style.top = (tYPos - h) + 1 + "px";
					} else {
						dd.style.top = (tYPos - h) - 3 + "px";
					}
					var ps = document.getElementById(this.currentIndex);
					if (ps.offsetTop < ps.parentNode.parentNode.parentNode.scrollTop) {
						ps.parentNode.parentNode.parentNode.scrollTop = ps.offsetTop;
					} else if (ps.offsetTop > ps.parentNode.parentNode.parentNode.scrollTop + ps.parentNode.parentNode.parentNode.offsetHeight - ps.offsetHeight) {
						ps.parentNode.parentNode.parentNode.scrollTop = ps.offsetTop - ps.parentNode.parentNode.parentNode.offsetHeight + ps.offsetHeight;
					}
				}
			} else if (resize == true && dd.style.display == "") {
				surround = document.getElementById(this.ComboName + "surround");
				rows = dd.getElementsByTagName("tr");
				h = 0;
				if (window.navigator.userAgent.indexOf("MSIE") > -1) h = h + 2;
				if (window.navigator.userAgent.indexOf("MSIE") == -1) h = h - 1;
				for (var x = 0; x < rows.length; x++) {
					if (rows[x].parentNode.parentNode.parentNode.id == this.ParentContainer) {
						h = h + rows[x].offsetHeight;
					}
				}
				initH = h;
				info = this.dropUpOrDown(surround);
				info = info.split("|");
				tDirection = info[0];
				tYPos = parseInt(info[1]);
				tBrowserHeight = parseInt(info[2]);
				tScrolled = parseInt(info[3]);
				IEFFW = 0;
				if (window.navigator.userAgent.indexOf("MSIE") > -1) {
					IEFFW = 2;
					IEFFH = 1;
				} else {
					IEFFW = 1.5;
					IEFFH = 1.5;
				}
				dd.style.width = surround.offsetWidth - IEFFW + "px";
				if (window.navigator.userAgent.indexOf("MSIE") > -1) {
					dd.style.height = (h - 2) + "px";
				} else {
					dd.style.height = (h + 2) + "px";
				}
				if (this.Direction == "down") {
					tDirection = "down";
				}
				if (this.Direction == "up") {
					tDirection = "up";
				}
				if (tDirection == "down") {
					dd.style.top = tYPos + surround.offsetHeight - IEFFH + "px";
					if (h + tYPos + tScrolled + surround.offsetHeight > tBrowserHeight) {
						if (tBrowserHeight - (tYPos) + tScrolled - 80 < initH) dd.style.height = tBrowserHeight - (tYPos) + tScrolled - 80 + "px";
					}
				} else {
					if (h > (tBrowserHeight - (tBrowserHeight - (tYPos - tScrolled)))) {
						h = (tBrowserHeight - (tBrowserHeight - (tYPos - tScrolled))) - 30;
					}
					if (window.navigator.userAgent.indexOf("MSIE") > -1) {
						dd.style.top = (tYPos - h) + 1 + "px";
					} else {
						dd.style.top = (tYPos - h) - 3 + "px";
					}
				}
			} else {
				if (this.closedChanged == true) {
					this.closedChanged = false;
					this.doOnChange();
				}
				window.CyloDropDownComboIsOpen = false;
				dd.style.display = "none";
				this.reSelectSelectedIndex();
				this.stayOpen = false;
				try {
					this.takeAwayHiddenDiv();
				} catch(e) {}
			}
		}
	} catch(e) {
		alert(e.message);return false;
	}
	return true;
}
CyloCombo.prototype.takeAwayHiddenDiv = function () {
	document.getElementById(this.ParentContainer).style.zIndex = this.tZindexForActive;
	document.getElementById(this.ComboName).style.zIndex = this.tZindexForActive;
}
CyloCombo.prototype.thisLastInCombo = function (rowid) {
	try {
		if (this.selectedIndexes[this.selectedIndexes.length - 1] == rowid) {
			return true;
		}
	} catch(e) {
		alert(e.message);return false;
	}
	return false;
}
CyloCombo.prototype.thisIsSelected = function (rowid) {
	try {
		for (var x = 0; x < this.selectedIndexes.length; x++) {
			if (this.selectedIndexes[x] == rowid) return true;
		}
	} catch(e) {
		alert(e.message);return false;
	}
	return false;
}
CyloCombo.prototype.SelectedRowsInbetweenInitialAndIndex = function (rowid) {
	try {
		if (this.InitialIndex == null) return;
		if (this.InitialIndex == rowid) return;
		initid = this.InitialIndex;
		initid = initid.replace(this.ComboName + this.rowAssignKey, "");
		rowid = rowid;
		rowid = rowid.replace(this.ComboName + this.rowAssignKey, "");
		if (parseInt(rowid) > parseInt(initid)) {
			on = false;
			for (cx = parseInt(initid); cx < parseInt(rowid); cx++) {
				this.AddSelectedIndex(this.options[cx].id);
			}
		} else {
			on = false;
			for (cx = parseInt(initid); cx > parseInt(rowid); cx--) {
				this.AddSelectedIndex(this.options[cx].id);
			}
		}
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.SetRowStyle = function (rowid, style) {
	if (!document.getElementById(rowid)) {
		return;
	}
	var row = document.getElementById(rowid);
	row = row.getElementsByTagName("td")[0];
	try {
		if (style == "ON") {
			row.className = 'CyloLEON';
			if (this.OptionStyle != null) {
				row.className = this.OptionStyle.optionOn;
			}
		}
		if (style == "OFF") {
			row.className = 'CyloLEOFF';
			if (this.OptionStyle != null) {
				row.className = this.OptionStyle.optionOff;
			}
		}
		row.className += " CyloDDHide";
		return 0;
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.AddSelectedIndex = function (rowid, scrollIntoView, dir) {
	try {
		if (typeof(scrollIntoView) == "undefined") scrollIntoView = false;
		this.previouseIndex = rowid;
		if (this.selectedIndexes.length == 0) this.InitialIndex = rowid;
		if (this.Multiple == true) {
			if (this.selectedIndexes.length >= this.Max && this.Max > -1) return;
		}
		for (var x = 0; x < this.selectedIndexes.length; x++) {
			if (this.selectedIndexes[x] == rowid) return;
		}
		this.SetRowStyle(rowid, "ON");
		this.selectedIndexes.push(rowid);
		this.currentIndex = rowid;
		var oc = this.options.length;
		var setFirstValue = false;
		this.value = "";
		for (var x = 0; x < oc; x++) {
			if (this.Multiple == false) {
				this.options[x].selected = false;
			}
			if (this.options[x].id == rowid) {
				this.options[x].selected = true;
			}
			if (setFirstValue == false && this.options[x].selected == true) {
				setFirstValue = true;
				this.value = this.options[x].value;
			}
		}
		if (this.Multiple == true) {
			this.setHiddenValue();
		} else {
			tid = rowid;
			tid = tid.replace(this.ComboName + this.rowAssignKey, "");
			document.getElementById(this.InputName).selectedIndex = tid;
		}
		if (scrollIntoView) {
			var ps = document.getElementById(rowid);
			if (dir == "UP") {
				if (ps.offsetTop < ps.parentNode.parentNode.parentNode.scrollTop) ps.parentNode.parentNode.parentNode.scrollTop = ps.offsetTop;
			} else {
				if (ps.offsetTop > ps.parentNode.parentNode.parentNode.scrollTop + ps.parentNode.parentNode.parentNode.offsetHeight - ps.offsetHeight) ps.parentNode.parentNode.parentNode.scrollTop = ps.offsetTop - ps.parentNode.parentNode.parentNode.offsetHeight + ps.offsetHeight;
			}
		}
		this.Cylight(rowid);
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.RemoveSelectedIndex = function (rowid) {
	try {
		this.SetRowStyle(rowid, "OFF");
		if (this.currentIndex == rowid) this.currentIndex = "";
		for (var x = 0; x < this.selectedIndexes.length; x++) {
			if (this.selectedIndexes[x] == rowid) {
				this.selectedIndexes.splice(x, 1);
			}
		}
		for (var x = 0; x < this.OnCCurr.length; x++) {
			if (this.OnCCurr[x] == rowid) {
				this.OnCCurr.splice(x, 1);
			}
		}
		for (var x = 0; x < this.OnCPrev.length; x++) {
			if (this.OnCPrev[x] == rowid) {
				this.OnCPrev.splice(x, 1);
			}
		}
		var oc = this.options.length;
		var setFirstValue = false;
		this.value = "";
		for (var x = 0; x < oc; x++) {
			if (this.options[x].id == rowid) {
				this.options[x].selected = false;
			}
			if (setFirstValue == false && this.options[x].selected == true) {
				setFirstValue = true;
				this.value = this.options[x].value;
			}
		}
		this.setHiddenValue();
		if (this.selectedIndexes.length == 0) this.InitialIndex = null;
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.RemoveLastIndex = function () {
	try {
		if (this.currentIndex == this.selectedIndexes[this.selectedIndexes.length - 1]) this.currentIndex = "";
		var rowid = this.selectedIndexes[this.selectedIndexes.length - 1];
		this.SetRowStyle(rowid, "OFF");
		this.selectedIndexes.pop();
		var oc = this.options.length;
		var setFirstValue = false;
		this.value = "";
		for (var x = 0; x < oc; x++) {
			if (this.options[x].id == rowid) {
				this.options[x].selected = false;
			}
			if (setFirstValue == false && this.options[x].selected == true) {
				setFirstValue = true;
				this.value = this.options[x].value;
			}
		}
		this.setHiddenValue();
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.removeAllSelectedIndexes = function () {
	try {
		for (var x = 0; x < this.selectedIndexes.length; x++) {
			this.SetRowStyle(this.selectedIndexes[x], "OFF");
		}
		this.selectedIndexes = [];
		this.InitialIndex = null;
		this.currentIndex = "";
		var oc = this.options.length;
		this.value = "";
		for (var x = 0; x < oc; x++) {
			this.options[x].selected = false;
		}
		this.setHiddenValue();
		return;
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.unhighlightAllSelectedIndexes = function () {
	try {
		if (this.previouseIndex == "INITIAL") {
			this.SetRowStyle(this.options[0].id, "OFF");
			return;
		}
		if (this.previouseIndex != "") {
			this.SetRowStyle(this.previouseIndex, "OFF");
		}
		return;
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.HighlightSelectedIndex = function (rowid) {
	try {
		this.SetRowStyle(rowid, "ON");
		this.previouseIndex = rowid;
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.reSelectSelectedIndex = function () {
	try {
		this.unhighlightAllSelectedIndexes();
		var oc = this.options.length;
		for (var x = 0; x < oc; x++) {
			if (this.options[x].selected == true) {
				tid = this.options[x].id;
				this.previouseIndex = tid;
				this.currentIndex = tid;
				this.SetRowStyle(tid, "ON");
				return;
			}
		}
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.setHiddenValue = function () {
	try {
		document.getElementById(this.InputName).selectedIndex = -1;
		var oc = this.options.length;
		for (var x = 0; x < oc; x++) {
			if (this.options[x].selected == true) {
				tid = this.options[x].id;
				tid = tid.replace(this.ComboName + this.rowAssignKey, "");
				document.getElementById(this.InputName).options[tid].selected = true;
			}
		}
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.setDDLable = function (rowid) {
	try {
		var cont = "&nbsp;";
		if (rowid != "") {
			var row = document.getElementById(rowid);
			td = row.getElementsByTagName("td");
			cont = td[0].innerHTML;
		}
		document.getElementById(this.ComboName + "selTab").innerHTML = cont;
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.Cylight = function (newIndex) {
	try {
		return;
		ttd = newIndex.getElementsByTagName("td");
		ttd = ttd[0];
		padding = ttd.style.padding;
		padding = padding.replace("px", "");
		if (padding > 0) {
			padding--;
			ttd.style.padding = padding + "px";
			cn = ttd.className;
			ttd.className = cn + " CyloCylight ";
		}
		return;
		if (this.previouseIndex != "") {
			ttd = this.previouseIndex.getElementsByTagName("td");
			ttd = ttd[0];
			cn = ttd.className;
			cn = cn.replace(" CyloCylight ", "");
			ttd.className = cn;
		}
		this.previouseIndex = this.currentIndex;
		ttd = this.currentIndex.getElementsByTagName("td");
		ttd = ttd[0];
		cn = ttd.className;
		ttd.className = cn + " CyloCylight ";
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.checkTempSelectedOptions = function () {
	try {
		this.OnCPrev = [];
		this.OnCPrev = this.OnCCurr.slice();
		this.OnCCurr = [];
		this.OnCCurr = this.selectedIndexes.slice();
		var pLength = parseInt(this.OnCPrev.length);
		var cLength = parseInt(this.OnCCurr.length);
		if (cLength == 0) {}
		if (cLength != pLength) {
			this.doOnChange();
			return;
		}
		var tc = [];
		var tp = [];
		for (x = 0; x < this.OnCPrev.length; x++) {
			tc[x] = this.OnCCurr[x];
			tp[x] = this.OnCPrev[x];
		}
		tc.sort();
		tp.sort();
		for (x = 0; x < cLength; x++) {
			if (tc[x] != tp[x]) {
				this.doOnChange();
				return;
			}
		}
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.startOnClick = function (fromClosed) {
	try {
		if (typeof(fromClosed) == "undefined") fromClosed = false;
		if (window.CyloCurrentCombo == null) {
			this.startOnClick;
			return;
		}
		code = "cc=" + window.CyloCurrentCombo + ";";
		eval(code);
		if (cc.onClickStartTime == 0) {
			var start = new Date();
			cc.onClickStartTime = start.getTime();
			cc.doOnClick();
		} else {
			var end = new Date();
			var difference = end.getTime() - cc.onClickStartTime;
			if (difference < 450) {
				if (window.navigator.userAgent.indexOf("MSIE") == -1) {
					cc.doOnClick();
				}
				if (fromClosed == true && window.navigator.userAgent.indexOf("MSIE") == -1) {} else {
					cc.doOnDblClick();
				}
			} else {
				cc.doOnClick();
			}
			cc.onClickStartTime = 0;
		}
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.doOnClick = function () {
	if (window.navigator.userAgent.indexOf("MSIE") > -1) {
		document.getElementById(this.InputName).click();
	} else {
		document.getElementById(this.InputName).onclick();
	}
}
CyloCombo.prototype.doOnDblClick = function () {
	document.getElementById(this.InputName).ondblclick();
}
CyloCombo.prototype.doOnChange = function () {
	this.onClickStartTime = 0;
	if (document.getElementById(this.InputName).onchange) document.getElementById(this.InputName).onchange();
}
CyloCombo.prototype.onchange = function () {
	this.doOnChange();
}
CyloCombo.prototype.doOnFocus = function () {
	if (window.CyloCurrentCombo != null && window.CyloCurrentCombo != this.ComboName) {
		code = "cc=" + window.CyloCurrentCombo + ".doOnBlur();";
		eval(code);
	}
	if (window.CyloCurrentCombo != this.ComboName) {
		window.CyloCurrentCombo = this.ComboName;
		eval(this.OnFocusCode);
		try {
			window.addEventListener('mousedown', function (Event) {
				try {
					if (window.CyloCurrentCombo == null) {
						this.removeEventListener('mousedown', arguments.callee, true);
						return;
					}
					code = "var pc=" + window.CyloCurrentCombo + ".ParentContainer;";
					eval(code);
					src = Event.target;
					if (src.id == pc || src.id == window.CyloCurrentCombo + "surround") {
						return true;
					}
					while (src = src.parentNode) {
						if (src.id == pc || src.id == window.CyloCurrentCombo + "surround") {
							return true;
						}
					}
					code = "cc=" + window.CyloCurrentCombo + ".doOnBlur();";
					eval(code);
					this.removeEventListener('mousedown', arguments.callee, true);
				}
				catch(e) {}
			},
			true);
		}
		catch(e) {
			window.document.attachEvent("onmousedown", function (Event) {
				try {
					if (window.CyloCurrentCombo == null) {
						this.removeEventListener('onmousedown', arguments.callee, true);
						return;
					}
					code = "var pc=" + window.CyloCurrentCombo + ".ParentContainer;";
					eval(code);
					src = Event.srcElement;
					if (src.id == pc || src.id == window.CyloCurrentCombo + "surround") {
						return true;
					}
					while (src = src.parentNode) {
						if (src.id == pc || src.id == window.CyloCurrentCombo + "surround") {
							return true;
						}
					}
					code = "cc=" + window.CyloCurrentCombo + ".doOnBlur();";
					eval(code);
					window.document.detachEvent('onmousedown', arguments.callee);
				}
				catch(e) {}
			});
		}
	}
}
CyloCombo.prototype.focus = function () {
	this.doOnFocus();
}
CyloCombo.prototype.doOnBlur = function () {
	try {
		if (this.Size > 0) {
			this.RemoveDragTabs();
		}
		this.openDropDown(-1);
		if (this.closedChanged == true) {
			this.closedChanged = false;
			this.doOnChange();
		}
		window.CyloCurrentCombo = null;
		eval(this.OnBlurCode);
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.blur = function () {
	this.doOnBlur();
}
CyloCombo.prototype.AddDragTabs = function () {
	try {
		if (this.Size > 0) {
			if (!document.getElementById(this.ComboName + "DragTabTop")) {
				var comboYPos = this.findPosY(this.combo);
				var comboHeight = document.getElementById(this.ParentContainer).offsetHeight;
				var brSize = this.getBrowserSize();
				var bodyWidth = brSize[0];
				var bodyHeight = brSize[1];
				var dragTab = document.createElement("div");
				dragTab.className = 'CyloDragTab';
				dragTab.id = this.ComboName + "DragTabTop";
				dragTab.style.top = "0px";
				dragTab.style.left = "0px";
				dragTab.style.width = "100%";
				dragTab.style.height = comboYPos + "px";
				dragTab.onmouseup = new Function(this.ComboName + ".RemoveDragTabs();");
				var br = "FF";
				if (window.navigator.userAgent.indexOf("MSIE") > -1) {
					var br = "IE";
				}
				this.onTabDragUp = true;
				var code = this.ComboName + ".onTabDragUp=true;" + this.ComboName + ".scrollSelect('" + br + "','UP');";
				if (br == "IE") {
					dragTab.onmouseover = new Function(code);
				} else {
					dragTab.onmousemove = new Function(code);
				}
				code = this.ComboName + ".onTabDragUp=false;";
				dragTab.onmouseout = new Function(code);
				dragTab.onmouseup = new Function(code + this.ComboName + ".RemoveDragTabs();" + this.ComboName + ".checkTempSelectedOptions();");
				document.body.appendChild(dragTab);
				dragTab = document.createElement("div");
				dragTab.className = 'CyloDragTab';
				dragTab.id = this.ComboName + "DragTabBot";
				dragTab.style.top = (comboYPos + comboHeight) + "px";
				dragTab.style.left = "0px";
				dragTab.style.width = "100%";
				dragTab.onmouseup = new Function(this.ComboName + ".RemoveDragTabs();");
				this.onTabDragUp = true;
				var code = this.ComboName + ".onTabDragUp=true;" + this.ComboName + ".scrollSelect('" + br + "','DOWN');";
				if (br == "IE") {
					dragTab.onmouseover = new Function(code);
				} else {
					dragTab.onmousemove = new Function(code);
				}
				code = this.ComboName + ".onTabDragUp=false;";
				dragTab.onmouseout = new Function(code);
				dragTab.onmouseup = new Function(code + this.ComboName + ".RemoveDragTabs();" + this.ComboName + ".checkTempSelectedOptions();");
				dragTab.style.height = document.body.offsetHeight - (comboYPos + comboHeight) + "px";
				document.body.appendChild(dragTab);
			}
		}
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.RemoveDragTabs = function () {
	try {
		if (this.Size > 0) {
			if (document.getElementById(this.ComboName + "DragTabTop")) {
				document.getElementById(this.ComboName + "DragTabTop").parentNode.removeChild(document.getElementById(this.ComboName + "DragTabTop"));
				document.getElementById(this.ComboName + "DragTabBot").parentNode.removeChild(document.getElementById(this.ComboName + "DragTabBot"));
				window.CyloMouseDown = false;
			}
		}
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.scrollSelect = function (browser, direction) {
	try {
		if (browser == "IE" && this.onTabDragUp == false) {
			return;
		}
		var ind = this.currentIndex;
		ind = ind.replace(this.ComboName + this.rowAssignKey, "");
		if (direction == "UP") ind--;
		if (direction == "DOWN") ind++;
		if (typeof(this.options[ind]) != "undefined") {
			if (this.Multiple == true) {
				this.AddSelectedIndex(this.options[ind].id, true, direction);
			} else {
				this.removeAllSelectedIndexes();
				this.AddSelectedIndex(this.options[ind].id, true, direction);
			}
			this.currentIndex = this.options[ind].id;
		}
		if (browser == "IE") {
			setTimeout(window.CyloCurrentCombo + ".scrollSelect('IE','" + direction + "');", "5");
		}
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.setUp = function () {
	try {
		if (typeof(window.CyloSetUpCobo) == "undefined") {
			document.onkeydown = this.keyDown;
			document.onkeyup = this.keyUp;
			document.onkeypress = this.keyUp;
			window.CyloComboList = [];
			window.CyloCurrentCombo = null;
			window.CyloMouseDown = false;
			window.CyloShiftIsPressed = false;
			window.CyloCTRLIsPressed = false;
			window.CyloDropDownComboIsOpen = false;
			window.CyloDebug = true;
			var adjustDisabledDivsCode = "function adjustDisabledDivsPart1(){var tempCyloCombo=new CyloCombo(false);tempCyloCombo.adjustDisabledDivsPart2();};";
			var script = document.createElement('script');
			script.type = 'text/javascript';
			script.text = adjustDisabledDivsCode;
			document.body.appendChild(script);
			try {
				window.addEventListener('resize', function (e) {
					if (window.CyloSetUpCobo == true) {
						adjustDisabledDivsPart1();
					}
					if (window.CyloCurrentCombo != null) {
						code = "cc=" + window.CyloCurrentCombo + ".closeOpenDDCallee();";
						eval(code);
					}
				},
				true);
			}
			catch(e) {
				window.attachEvent('onresize', function (e) {
					if (window.CyloSetUpCobo == true) {
						adjustDisabledDivsPart1();
					}
					if (window.CyloCurrentCombo != null) {
						code = "cc=" + window.CyloCurrentCombo + ".closeOpenDDCallee();";
						eval(code);
					}
				});
			}
			sels = document.getElementsByTagName("select");
			inps = document.getElementsByTagName("input");
			txta = document.getElementsByTagName("textarea");
			buts = document.getElementsByTagName("button");
			allinps = [];
			for (x = 0; x < buts.length; x++) {
				allinps[allinps.length] = buts[x];
			}
			for (x = 0; x < sels.length; x++) {
				allinps[allinps.length] = sels[x];
			}
			for (x = 0; x < inps.length; x++) {
				allinps[allinps.length] = inps[x];
			}
			for (x = 0; x < txta.length; x++) {
				allinps[allinps.length] = txta[x];
			}
			for (x = 0; x < allinps.length; x++) {
				try {
					allinps[x].addEventListener('focus', function (e) {
						window.CyloCurrentCombo = null;
					},
					true);
				} catch(e) {
					allinps[x].attachEvent('onfocus', function (e) {
						window.CyloCurrentCombo = null;
					});
				}
			}
			window.CyloSetUpCobo = true;
		}
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.adjustDisabledDivsPart2 = function () {
	for (var c = 0; c < window.CyloComboList.length; c++) {
		that = window.CyloComboList[c];
		if (that.DisabledDivs != null) {
			pdiv = that.DisabledDivs.parentNode;
			that.DisabledDivs.style.height = pdiv.offsetHeight + "px";
			that.DisabledDivs.style.left = that.findPosX(pdiv) + "px";
			that.DisabledDivs.style.width = pdiv.offsetWidth + "px";
			lextraT = 0;
			if (window.navigator.userAgent.indexOf("MSIE") == -1) {
				if (that.Size == 0) lextraT = -1;
			}
			that.DisabledDivs.style.top = (that.findPosY(pdiv) + lextraT) + "px";
		}
	}
}
CyloCombo.prototype.closeOpenDDCallee = function () {
	var code = window.CyloCurrentCombo + ".openDropDown(true,true);";
	eval(code);
}
CyloCombo.prototype.resetCurComb = function () {
	window.CyloCurrentCombo = null;
}
CyloCombo.prototype.CyloHandleMouseDown = function () {
	try {
		try {
			window.addEventListener('mouseup', function (Event) {
				try {
					code = window.CyloCurrentCombo + ".RemoveDragTabs();" + window.CyloCurrentCombo + ".checkTempSelectedOptions();";
					eval(code);
					this.removeEventListener('mouseup', arguments.callee, true);
					return;
					return;
				}
				catch(e) {}
			},
			true);
		}
		catch(e) {
			window.document.attachEvent("onmouseup", function (Event) {
				try {
					code = window.CyloCurrentCombo + ".RemoveDragTabs();" + window.CyloCurrentCombo + ".checkTempSelectedOptions();";
					eval(code);
					window.document.detachEvent('onmouseup', arguments.callee, true);
					return;
				}
				catch(e) {}
			});
		}
		window.tempMouseUp = document.onmouseup;
		document.onmouseup = this.StopMouseDown;
		window.tempSelectStart = document.onselectstart;
		window.onselectstart = false;
		window.tempSelect = document.onselectstart;
		document.onselectstart = new Function("return false");
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.StopMouseDown = function () {
	try {
		window.CyloMouseDown = false;
		document.onmouseup = window.tempMouseUp;
		document.onselectstart = window.tempSelectStart;
		document.onselectstart = window.tempSelect;
		if (this.Size > 0) {
			this.RemoveDragTabs();
		}
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.keyUp = function (evt) {
	try {
		evt = (evt) ? evt : ((window.event) ? event : null);
		switch (evt.keyCode) {
		case 16:
			window.CyloShiftIsPressed = false;
			break;
		case 17:
			window.CyloCTRLIsPressed = false;
			break;
		}
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.keyDown = function (evt) {
	try {
		evt = (evt) ? evt : ((window.event) ? event : null);
		switch (evt.keyCode) {
		case 16:
			window.CyloShiftIsPressed = true;
			break;
		case 17:
			window.CyloCTRLIsPressed = true;
			break;
		case 9:
			if (window.CyloCurrentCombo == null) return true;
			cc = window.CyloCurrentCombo;
			code = "" + cc + ".doOnBlur();";
			eval(code);
			break;
		case 32:
			if (window.CyloDropDownComboIsOpen == true) {
				cc = window.CyloCurrentCombo;
				code = "ci=" + cc + ".currentIndex;";
				eval(code);
				code = "" + cc + ".doUserKeyPressAction(ci);";
				eval(code);
				return false;
			}
			break;
		case 13:
			if (window.CyloDropDownComboIsOpen == true) {
				cc = window.CyloCurrentCombo;
				code = "ci=" + cc + ".currentIndex;";
				eval(code);
				code = "" + cc + ".doUserKeyPressAction(ci);";
				eval(code);
				return false;
			}
			break;
		case 38:
			if (typeof(window.CyloCurrentCombo) == "undefined" || window.CyloCurrentCombo == null) return true;;
			cc = window.CyloCurrentCombo;
			code = "ci=" + cc + ".currentIndex;";
			eval(code);
			var allowOnChange = true;
			ci = document.getElementById(ci);
			if (ci.previousSibling) {
				ps = ci.previousSibling;
				code = "tm=" + cc + ".Multiple;";
				eval(code);
				if (tm == true) {
					if (window.CyloShiftIsPressed == false) {
						code = "x=" + cc + ".removeAllSelectedIndexes();";
						eval(code);
						code = "" + cc + ".AddSelectedIndex(ps.id);";
						eval(code);
						code = cc + ".currentIndex=ps.id;";
						eval(code)
					}
					if (window.CyloShiftIsPressed == true) {
						code = "initid=" + cc + ".InitialIndex;";
						code += "initid=initid.replace(" + cc + ".ComboName,\"\");";
						code += "rowid=ps.id;";
						code += "rowid=rowid.replace(" + cc + ".ComboName,\"\");";
						eval(code);
						if (parseInt(rowid) >= parseInt(initid)) {
							code = "" + cc + ".RemoveSelectedIndex(ci.id);";
							eval(code);
							code = cc + ".currentIndex=ps.id;";
							eval(code)
						} else {
							code = "" + cc + ".AddSelectedIndex(ps.id);";
							eval(code);
							code = cc + ".currentIndex=ps.id;";
						}
					}
				} else {
					code = "sz=" + cc + ".Size;";
					eval(code);
					if (sz > 0) {
						code = "x=" + cc + ".removeAllSelectedIndexes();";
						eval(code);
						code = "" + cc + ".AddSelectedIndex(ps.id);";
						eval(code);
						code = cc + ".currentIndex=ps.id;";
						eval(code);
					} else {
						code = "var dd=document.getElementById(" + cc + ".ParentContainer);";
						eval(code);
						code = cc + ".currentIndex=ps.id;";
						eval(code);
						code = "" + cc + ".removeAllSelectedIndexes();" + cc + ".unhighlightAllSelectedIndexes();" + cc + ".AddSelectedIndex(ps.id);" + cc + ".setDDLable(ps.id);";
						eval(code);
						if (dd.style.display == "") {
							allowOnChange = false;
							code = cc + ".closedChanged=true;";
							eval(code);
						} else {
							code = cc + ".closedChanged=false;";
							eval(code);
						}
					}
				}
				if (ps.offsetTop < ps.parentNode.parentNode.parentNode.scrollTop) ps.parentNode.parentNode.parentNode.scrollTop = ps.offsetTop;
				if (allowOnChange == true) {
					code = "if(document.getElementById(\"" + window.CyloCurrentCombo + "inp\").onchange)document.getElementById(\"" + window.CyloCurrentCombo + "inp\").onchange();";
					eval(code);
				}
				return false;
			} else {
				if (window.CyloShiftIsPressed == false) {
					code = "x=" + cc + ".removeAllSelectedIndexes();";
					eval(code);
					code = "" + cc + ".AddSelectedIndex(ci.id);";
					eval(code);
					code = cc + ".currentIndex=ci.id;";
					eval(code)
				}
				return false;
			}
			break;
		case 40:
			if (typeof(window.CyloCurrentCombo) == "undefined" || window.CyloCurrentCombo == null) return true;;
			cc = window.CyloCurrentCombo;
			code = "ci=" + cc + ".currentIndex;";
			eval(code);
			ci = document.getElementById(ci);
			var allowOnChange = true;
			if (ci.nextSibling) {
				ns = ci.nextSibling;
				code = "tm=" + cc + ".Multiple;";
				eval(code);
				if (tm == true) {
					if (window.CyloShiftIsPressed == false) {
						code = "x=" + cc + ".removeAllSelectedIndexes();";
						eval(code);
						code = "" + cc + ".AddSelectedIndex(ns.id);";
						eval(code);
						code = cc + ".currentIndex=ns.id;";
						eval(code)
					}
					if (window.CyloShiftIsPressed == true) {
						code = "initid=" + cc + ".InitialIndex;";
						code += "initid=initid.replace(" + cc + ".ComboName,\"\");";
						code += "rowid=ns.id;";
						code += "rowid=rowid.replace(" + cc + ".ComboName,\"\");";
						eval(code);
						if (parseInt(rowid) <= parseInt(initid)) {
							code = "" + cc + ".RemoveSelectedIndex(ci.id);";
							eval(code);
							code = cc + ".currentIndex=ns.id;";
							eval(code)
						} else {
							code = "" + cc + ".AddSelectedIndex(ns.id);";
							eval(code);
							code = cc + ".currentIndex=ns.id;";
							eval(code)
						}
					}
				} else {
					code = "sz=" + cc + ".Size;";
					eval(code);
					if (sz > 0) {
						code = "x=" + cc + ".removeAllSelectedIndexes();";
						eval(code);
						code = "" + cc + ".AddSelectedIndex(ns.id);";
						eval(code);
						code = cc + ".currentIndex=ns.id;";
						eval(code);
					} else {
						code = "var dd=document.getElementById(" + cc + ".ParentContainer);";
						eval(code);
						code = cc + ".currentIndex=ns.id;";
						eval(code);
						code = "" + cc + ".removeAllSelectedIndexes();" + cc + ".unhighlightAllSelectedIndexes();" + cc + ".AddSelectedIndex(ns.id);" + cc + ".setDDLable(ns.id);";
						eval(code);
						if (dd.style.display == "") {
							allowOnChange = false;
							code = cc + ".closedChanged=true;";
							eval(code);
						} else {
							code = cc + ".closedChanged=false;";
							eval(code);
						}
					}
				}
				if (ns.offsetTop > ns.parentNode.parentNode.parentNode.scrollTop + ns.parentNode.parentNode.parentNode.offsetHeight - ns.offsetHeight) ns.parentNode.parentNode.parentNode.scrollTop = ns.offsetTop - ns.parentNode.parentNode.parentNode.offsetHeight + ns.offsetHeight;
				if (allowOnChange == true) {
					code = "if(document.getElementById(\"" + window.CyloCurrentCombo + "inp\").onchange)document.getElementById(\"" + window.CyloCurrentCombo + "inp\").onchange();";
					eval(code);
				}
				return false;
			} else {
				if (window.CyloShiftIsPressed == false) {
					code = "x=" + cc + ".removeAllSelectedIndexes();";
					eval(code);
					code = "" + cc + ".AddSelectedIndex(ci.id);";
					eval(code);
					code = cc + ".currentIndex=ci.id;";
					eval(code);
				}
				return false;
			}
			break;
		}
		return true;
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.doUserKeyPressAction = function (rowid) {
	this.removeAllSelectedIndexes();
	this.AddSelectedIndex(rowid);
	this.openDropDown(-1);
	if (this.closedChanged == true) {
		this.closedChanged = false;
		this.doOnChange();
	}
}
CyloCombo.prototype.selectedIndex = function (n) {
	try {
		if (n == -1) {
			this.removeAllSelectedIndexes();
			document.getElementById(this.InputName).selectedIndex = -1;
			if (this.Size == 0) this.setDDLable("");
			return;
		}
		if (typeof(n) != "undefined" && isNaN(n) == false && typeof(this.options[n]) != "undefined") {
			if (this.Multiple == false) {
				this.removeAllSelectedIndexes();
			}
			this.AddSelectedIndex(this.options[n].id);
			return n;
		} else {
			return document.getElementById(this.InputName).selectedIndex;
		}
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.getScrolled = function () {
	try {
		return document.getElementById(this.ParentContainer).scrollTop;
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.setScrolled = function (x) {
	try {
		document.getElementById(this.ParentContainer).scrollTop = x;
		return 0;
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.dropUpOrDown = function (surround) {
	try {
		var brSize = this.getBrowserSize();
		var bodyWidth = brSize[0];
		var bodyHeight = brSize[1];
		var topOffset = Math.max(document.body.scrollTop, document.documentElement.scrollTop);
		y = this.findPosY(surround);
		if (y < (bodyHeight) / 2 + topOffset) {
			return "down|" + y + "|" + bodyHeight + "|" + topOffset;
		} else {
			return "up|" + y + "|" + bodyHeight + "|" + topOffset;
		}
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.getBrowserSize = function () {
	try {
		var bodyWidth = document.documentElement.clientWidth;
		var bodyHeight = document.documentElement.clientHeight;
		var bodyWidth, bodyHeight;
		if (self.innerHeight) {
			bodyWidth = self.innerWidth;
			bodyHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) {
			bodyWidth = document.documentElement.clientWidth;
			bodyHeight = document.documentElement.clientHeight;
		} else if (document.body) {
			bodyWidth = document.body.clientWidth;
			bodyHeight = document.body.clientHeight;
		}
		return [bodyWidth, bodyHeight];
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.findPosX = function (obj) {
	try {
		var curleft = 0;
		if (obj.offsetParent) while (1) {
			curleft += obj.offsetLeft;
			if (!obj.offsetParent) break;
			obj = obj.offsetParent;
		} else if (obj.x) curleft += obj.x;
		return curleft;
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.findPosY = function (obj) {
	try {
		var curtop = 0;
		if (obj.offsetParent) while (1) {
			curtop += obj.offsetTop;
			if (!obj.offsetParent) break;
			obj = obj.offsetParent;
		} else if (obj.y) curtop += obj.y;
		return curtop;
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.disableSelection = function(target)
{
	try
	{
		if (typeof target.onselectstart!="undefined") //IE route
			target.onselectstart=function(){return false}
		else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
			target.style.MozUserSelect="none"
		else //All other route (ie: Opera)
			target.onmousedown=function(){return false}
		target.style.cursor = "default"
	}catch(e)
	{
		alert(e.message);return false;
	}
}
CyloCombo.prototype.createSingleClickCode = function () {
	var singleclick = "if(" + this.ComboName + ".Multiple==false){" + this.ComboName + ".removeAllSelectedIndexes();" + this.ComboName + ".AddSelectedIndex(this.id);}";
	singleclick += "if(" + this.ComboName + ".Multiple==true){";
	singleclick += "if(window.CyloCTRLIsPressed==false && window.CyloShiftIsPressed==false){x=" + this.ComboName + ".removeAllSelectedIndexes();}";
	singleclick += "if(window.CyloShiftIsPressed==true){" + this.ComboName + ".SelectedRowsInbetweenInitialAndIndex(this.id);" + this.ComboName + ".AddSelectedIndex(this.id);}else{if(" + this.ComboName + ".thisIsSelected(this.id)==false){" + this.ComboName + ".AddSelectedIndex(this.id);}";
	singleclick += "else{" + this.ComboName + ".RemoveSelectedIndex(this.id);}";
	singleclick += "}}";
	return singleclick;
}
CyloCombo.prototype.insertBefore = function (parent, nodeToAppend, appendToNode) {
	try {
		parent.insertBefore(nodeToAppend, appendToNode);
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.insertAfter = function (parent, nodeToAppend, appendToNode) {
	try {
		if (appendToNode.nextSibling) {
			parent.insertBefore(nodeToAppend, appendToNode.nextSibling);
		} else {
			parent.appendChild(nodeToAppend);
		}
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.getFunctionName = function (whole) {
	try {
		whole = whole.substr('function '.length);
		whole = whole.substr(0, whole.indexOf('('));
		return whole;
	} catch(e) {
		alert(e.message);return false;
	}
}
CyloCombo.prototype.execute = function (code) {
	code = "try{" + code + "}catch(e){}";
	eval(code);
}
CyloCombo.prototype.isArray = function (obj) {
	try {
		if (obj.constructor.toString().indexOf("Array") == -1) return false;
		else return true;
	} catch(e) {
		alert(e.message);return false;
	}
}
