var dhtmlXProtobarObject=function() {
}
dhtmlXProtobarObject.prototype.setOnShowHandler = function (func) {
	if (typeof (func) == "function") {
		this.onShow = func;
	} else {
		this.onShow = eval(func);
	}
};
dhtmlXProtobarObject.prototype._getItemIndex = function (id) {
	for (var i = 0; i < this.itemsCount; i++) {
		if (this.items[i].id == id) {
			return i;
		}
	}
	return -1;
};
dhtmlXProtobarObject.prototype.setGfxPath = function (path) {
	this.sysGfxPath = path;
};
dhtmlXProtobarObject.prototype.setOnHideHandler = function (func) {
	if (typeof (func) == "function") {
		this.onHide = func;
	} else {
		this.onHide = eval(func);
	}
};
dhtmlXProtobarObject.prototype.setItemAction = function (id, action) {
	var z = this._getItemIndex(id);
	if (z >= 0) {
		this.items[z].setSecondAction(action);
	}
};
dhtmlXProtobarObject.prototype.getItem = function (itemId) {
	var z = this._getItemIndex(itemId);
	if (z >= 0) {
		return this.items[z];
	}
};
dhtmlXProtobarObject.prototype.hideButtons = function (idList) {
	if (!idList) {
		for (var i = 0; i < this.itemsCount; i++) {
			this.items[i].getTopNode().style.display = "none";
			this.items[i].hide = 1;
		}
		return 0;
	}
	var temp = idList.split(",");
	for (var i = 0; i < temp.length; i++) {
		this.hideItem(temp[i]);
	}
};
dhtmlXProtobarObject.prototype.showButtons = function (idList) {
	if (!idList) {
		for (var i = 0; i < this.itemsCount; i++) {
			this.items[i].getTopNode().style.display = "";
			this.items[i].hide = 0;
		}
		return 0;
	}
	var temp = idList.split(",");
	for (var i = 0; i < temp.length; i++) {
		this.showItem(temp[i]);
	}
};
dhtmlXProtobarObject.prototype.disableItem = function (itemId) {
	var z = this.getItem(itemId);
	if (z) {
		if (z.disable) {
			z.disable();
		}
	}
};
dhtmlXProtobarObject.prototype.enableItem = function (itemId) {
	var z = this.getItem(itemId);
	if (z) {
		if (z.enable) {
			z.enable();
		}
	}
};
dhtmlXProtobarObject.prototype.hideItem = function (itemId) {
	var z = this.getItem(itemId);
	if (z) {
		z.getTopNode().style.display = "none";
		z.hide = 1;
	}
};
dhtmlXProtobarObject.prototype.showItem = function (id) {
	var z = this.getItem(id);
	if (z) {
		z.getTopNode().style.display = "";
		z.hide = 0;
	}
};
dhtmlXProtobarObject.prototype.setOnClickHandler = function (func) {
	if (typeof (func) == "function") {
		this.defaultAction = func;
	} else {
		this.defaultAction = eval(func);
	}
};
dhtmlXProtobarObject.prototype.setTitleText = function (newText) {
	this.tname = newText;
	this.nameCell.innerHTML = newText;
	this.preNameCell.innerHTML = newText;
};
dhtmlXProtobarObject.prototype.setBarSize = function (width, height) {
	if (width) {
		this.topNod.width = width;
	}
	if (height) {
		this.topNod.height = height;
	}
};
dhtmlXProtobarObject.prototype.resetBar = function (idList) {
	for (var i = 0; i < this.itemsCount; i++) {
		this.hideItem(this.items[i].id);
		this.items[i].persAction = 0;
	}
	var temp = idList.split(",");
	for (var i = 0; i < temp.length; i++) {
		this.showItem(temp[i]);
	}
};
dhtmlXProtobarObject.prototype.loadXML = function (file) {
	this.xmlUnit.loadXML(file);
};
dhtmlXProtobarObject.prototype.loadXMLString = function (xmlString) {
	this.xmlUnit.loadXMLString(xmlString);
};
dhtmlXProtobarObject.prototype.showBar = function () {
	this.topNod.style.display = "";
	if (this.onShow) {
		this.onShow();
	}
};
dhtmlXProtobarObject.prototype.hideBar = function () {
	this.topNod.style.display = "none";
	if (this.onHide) {
		this.onHide();
	}
};
dhtmlXProtobarObject.prototype.setBarAlign = function (align) {
	if ((align == "left") || (align == "top")) {
		this.preNameCell.innerHTML = "";
		this.preNameCell.style.display = "none";
		this.nameCell.style.display = "";
		this.nameCell.width = "100%";
		this.nameCell.innerHTML = this.tname;
	}
	if ((align == "center") || (align == "middle")) {
		this.preNameCell.style.display = "";
		this.preNameCell.width = "50%";
		this.nameCell.style.display = "";
		this.nameCell.width = "50%";
		this.nameCell.innerHTML = this.tname;
		this.preNameCell.innerHTML = this.tname;
	}
	if ((align == "right") || (align == "bottom")) {
		this.nameCell.innerHTML = "";
		this.nameCell.style.display = "none";
		this.preNameCell.style.display = "";
		this.preNameCell.width = "100%";
		this.preNameCell.innerHTML = this.tname;
	}
};
dhtmlXProtobarObject.prototype.dummyFunc = function () {
	return true;
};
dhtmlXProtobarObject.prototype.badDummy = function () {
	return false;
};
function dhtmlXButtonPrototypeObject() {
	return this;
}
dhtmlXButtonPrototypeObject.prototype.setAction = function (func) {
	if (typeof (func) == "function") {
		this.action = func;
	} else {
		this.action = eval(func);
	}
};
dhtmlXButtonPrototypeObject.prototype.setSecondAction = function (func) {
	if (typeof (func) == "function") {
		this.persAction = func;
	} else {
		this.persAction = eval(func);
	}
};
dhtmlXButtonPrototypeObject.prototype.enable = function () {
	if (this.disableImage) {
		this.imageTag.src = this.src;
	} else {
		if (!this.className) {
			this.topNod.className = this.objectNode.className;
		} else {
			this.topNod.className = this.className;
		}
	}
	if (this.textTag) {
		this.textTag.className = this.textClassName;
	}
	this.topNod.onclick = this._onclickX;
	this.topNod.onmouseover = this._onmouseoverX;
	this.topNod.onmouseout = this._onmouseoutX;
	this.topNod.onmousedown = this._onmousedownX;
	this.topNod.onmouseup = this._onmouseupX;
};
dhtmlXButtonPrototypeObject.prototype.disable = function () {
	if (this.disableImage) {
		this.imageTag.src = this.disableImage;
	} else {
		this.topNod.className = "iconGray";
	}
	if (this.textTag) {
		this.textTag.className = "buttonTextDisabled";
	}
	this.topNod.onclick = this.dummy;
	this.topNod.onmouseover = this.dummy;
	this.topNod.onmouseout = this.dummy;
	this.topNod.onmousedown = this.dummy;
	this.topNod.onmouseup = this.dummy;
};
dhtmlXButtonPrototypeObject.prototype._onclickX = function (e, that) {
	if (!that) {
		that = this.objectNode;
	}
	if (that.topNod.dstatus) {
		return;
	}
	if ((!that.persAction) || (that.persAction())) {
		if (that.action) {
			that.action(that.id);
		}
	}
};
dhtmlXButtonPrototypeObject.prototype.setHTML = function (htmlText) {
	this.topNod.innerHTML = htmlText;
};
dhtmlXButtonPrototypeObject.prototype.setAltText = function (imageText) {
	this.imageTag.alt = imageText;
};
dhtmlXButtonPrototypeObject.prototype.setImage = function (imageSrc, disabledImageSrc) {
	this.src = imageSrc;
	if (disabledImageSrc) {
		this.disableImage = disabledImageSrc;
	}
	if (this.topNod.onclick == this.dummy) {
		if (disabledImageSrc) {
			this.imageTag.src = disabledImageSrc;
		}
	} else {
		this.imageTag.src = imageSrc;
	}
};
dhtmlXButtonPrototypeObject.prototype.dummy = function () {
};
dhtmlXButtonPrototypeObject.prototype.getTopNode = function () {
	return this.topNod;
};
dhtmlXButtonPrototypeObject.prototype._onmouseoverY = function () {
	if (this.topNod.className != this.className + "Over") {
		this.topNod.className = this.className + "Over";
	}
	return true;
};
dhtmlXButtonPrototypeObject.prototype._onmouseoutY = function () {
	this.topNod.className = this.className;
	return true;
};
dhtmlXButtonPrototypeObject.prototype._onmousedownX = function () {
	this.className = this.objectNode.className + "Down";
	return true;
};
dhtmlXButtonPrototypeObject.prototype._onmouseupX = function () {
	this.className = this.objectNode.className;
	return true;
};
dhtmlXButtonPrototypeObject.prototype._onmouseoutX = function (e) {
	if (!e) {
		e = event;
	}
	e.cancelBubble = true;
	if (this.timeoutop) {
		clearTimeout(this.timeoutop);
	}
	this.timeoutop = setTimeout(this.objectNode._delayedTimerCall(this.objectNode, "_onmouseoutY"), 10);
};
dhtmlXButtonPrototypeObject.prototype._onmouseoverX = function (e) {
	if (!e) {
		e = event;
	}
	e.cancelBubble = true;
	if (this.timeoutop) {
		clearTimeout(this.timeoutop);
	}
	this.timeoutop = setTimeout(this.objectNode._delayedTimerCall(this.objectNode, "_onmouseoverY"), 10);
};
dhtmlXButtonPrototypeObject.prototype._delayedTimerCall = function (object, functionName, time) {
	this.callFunc = function () {
		eval("object." + functionName + "();");
	};
	return this.callFunc;
};

var dhtmlXToolbarObject = function(htmlObject, width, height, name, vMode) {
	this.width = width;
	this.height = height;
	if (typeof(htmlObject) != "object") {
		this.parentObject = document.getElementById(htmlObject);
	} else {
		this.parentObject = htmlObject;
	}
	this.xmlDoc = 0;
	this.topNod = 0;
	this.dividerCell = 0;
	this.firstCell = 0;
	this.nameCell = 0;
	this.crossCell = 0;
	this.items = new Array();
	this.itemsCount = 0;
	this.defaultAction = 0;
	this.extraMode = convertStringToBoolean(vMode);
	this.onShow = 0;
	this.onHide = 0;
	this.oldMouseMove = 0;
	this.tname = name;
	this.gecko = (document.all ? 0 : 1);
	this.tableCSS = "toolbarTable";
	this.titleCSS = "toolbarName";
	if (!this.extraMode) {
		this._create_self();
	} else {
		this._create_self_vertical();
		this.addItem = this._addItem_vertical;
	}
	if (this._extendedInit) {
		this._extendedInit();
	}
	this.xmlUnit = new dtmlXMLLoaderObject(this._parseXMLTree, this);
	return this;
}
dhtmlXToolbarObject.prototype = new dhtmlXProtobarObject();
dhtmlXToolbarObject.prototype.addItem = function(item, position) {
	if ((!position) || (position > this.itemsCount)) {
		position = this.itemsCount;
	}
	if (position == this.itemsCount) {
		this.firstCell.parentNode.insertBefore(item.getTopNode(),
				this.firstCell);
	} else {
		this.firstCell.parentNode.insertBefore(item.getTopNode(),
				this.items[position].getTopNode());
	}
	item.parentNod = this;
	if (this.defaultAction) {
		item.setAction(this.defaultAction);
	}
	for (var i = position; i < this.itemsCount + 1; i++) {
		var a = this.items[i];
		this.items[i] = item;
		item = a;
	}
	this.itemsCount++;
};
dhtmlXToolbarObject.prototype._addItem_vertical = function(item, position) {
	if ((!position) || (position > this.itemsCount)) {
		position = this.itemsCount;
	}
	var tr = document.createElement("tr");
	tr.style.verticalAlign = "top";
	tr.appendChild(item.getTopNode());
	if (position == this.itemsCount) {
		this.firstCell.parentNode.parentNode.insertBefore(tr,
				this.firstCell.parentNode);
	} else {
		this.firstCell.parentNode.parentNode.insertBefore(tr,
				this.items[position].getTopNode().parentNode);
	}
	item.parentNod = this;
	if (this.defaultAction) {
		item.setAction(this.defaultAction);
	}
	for (var i = position; i < this.itemsCount + 1; i++) {
		var a = this.items[i];
		this.items[i] = item;
		item = a;
	}
	this.itemsCount++;
};
dhtmlXToolbarObject.prototype._getItemIndexByPosition = function(position) {
	var j = 0;
	for (var i = 0; i < this.itemsCount; i++) {
		if (this.items[i].hide != 1) {
			j++;
		}
		if (j == position) {
			return i;
		}
	}
	return -1;
};
dhtmlXToolbarObject.prototype.getItemByPosition = function(position) {
	var z = this._getItemIndexByPosition(position);
	if (z >= 0) {
		return this.items[z];
	}
};
dhtmlXToolbarObject.prototype.removeItemById = function(itemId) {
	var z = this._getItemIndex(itemId);
	if (z >= 0) {
		if (this.items[z].removeItem) {
			this.items[z].removeItem();
		}
		this.firstCell.parentNode.removeChild(this.items[z].getTopNode());
		this.items[z] = 0;
		this.itemsCount--;
		for (var i = z; i < this.itemsCount; i++) {
			this.items[i] = this.items[i + 1];
		}
	}
};
dhtmlXToolbarObject.prototype.removeItemByPosition = function(position) {
	var z = this._getItemIndexByPosition(position);
	if (z) {
		if (this.items[z].removeItem) {
			this.items[z].removeItem();
		}
		this.firstCell.parentNode.removeChild(this.items[z].getTopNode());
		this.items[z] = 0;
		this.itemsCount--;
		for (var i = z; i < this.itemsCount; i++) {
			this.items[i] = this.items[i + 1];
		}
	}
};
dhtmlXToolbarObject.prototype.hideItemByPosition = function(position) {
	var z = this.getItemByPosition(position);
	if (z) {
		z.getTopNode().style.display = "none";
		z.hide = 1;
	}
};
dhtmlXToolbarObject.prototype._parseXMLTree = function(that, node) {
	if (!node) {
		node = that.xmlUnit.getXMLTopNode("toolbar");
	}
	var toolbarAlign = node.getAttribute("toolbarAlign");
	if (toolbarAlign) {
		that.setBarAlign(toolbarAlign);
	}
	var absolutePosition = node.getAttribute("absolutePosition");
	if (absolutePosition == "yes") {
		that.topNod.style.position = "absolute";
		that.topNod.style.top = node.getAttribute("left") || 0;
		that.topNod.style.left = node.getAttribute("top") || 0;
	}
	if ((absolutePosition != "auto") && (absolutePosition != "yes")) {
		that.dividerCell.style.display = "none";
	}
	var name = node.getAttribute("name");
	if (name) {
		that.setTitleText(name);
	}
	var width = node.getAttribute("width");
	var height = node.getAttribute("height");
	that.setBarSize(width, height);
	var globalTextCss = node.getAttribute("globalTextCss");
	var globalCss = node.getAttribute("globalCss");
	if (node.childNodes.length == 0) {
		var staticOpsId = that.sftToolbar.config.sftGrid.config.staticOps;
		var staticOps = null;
		if (staticOpsId) {
			staticOps = document.getElementById(staticOpsId);
		}
		if (staticOps) {
			that.parentObject.innerHTML = staticOps.innerHTML;
		} else {
			that.parentObject.style.display = "none";
		}
	} else {
		for (var i = 0; i < node.childNodes.length; i++) {
			var localItem = node.childNodes[i];
			if (localItem.nodeType == 1) {
				if ((!localItem.getAttribute("className")) && (globalCss)) {
					localItem.setAttribute("className", globalCss);
				}
				if ((!localItem.getAttribute("textClassName"))
						&& (globalTextCss)) {
					localItem.setAttribute("textClassName", globalTextCss);
				}
				var z = eval("window.dhtmlX" + localItem.tagName + "Object");
				if (z) {
					var TempNode = new z(localItem);
				} else {
					var TempNode = null;
				}
				if (localItem.tagName == "divider") {
					var imid = localItem.getAttribute("id");
					if (that.extraMode) {
						that.addItem(new dhtmlXToolbarDividerYObject(imid));
					} else {
						that.addItem(new dhtmlXToolbarDividerXObject(imid));
					}
				} else {
					if (TempNode) {
						that.addItem(TempNode);
						if (that._extendedParse) {
							that._extendedParse(that, TempNode, localItem);
						}
					}
				}
			}
		}
	}
};
dhtmlXToolbarObject.prototype.setToolbarCSS = function(table, title) {
	this.tableCSS = table;
	this.titleCSS = title;
	this.topNod.className = this.tableCSS;
	this.preNameCell.className = this.titleCSS;
	this.nameCell.className = this.titleCSS;
};
var dhtmlXToolbarObjectScrollAll = function(id, right) {
	var divOps = document.getElementById(id);
	var divOpsParent = divOps.parentNode;
	var width = divOps.clientWidth;
	var parentWidth = divOpsParent.clientWidth;
	if (!divOps.left) {
		divOps.left = 0;
	}
	if (right) {
		divOps.left = parentWidth - width;
	} else {
		divOps.left = 0;
	}
	divOps.style.left = divOps.left;
};
var dhtmlXToolbarObjectScroll = function(id, right) {
	var divOps = document.getElementById(id);
	var divOpsParent = divOps.parentNode;
	var width = divOps.clientWidth;
	var parentWidth = divOpsParent.clientWidth;
	if (!divOps.left) {
		divOps.left = 0;
	}
	if (right) {
		divOps.left -= 50;
	} else {
		divOps.left += 50;
	}
	if (parentWidth - divOps.left > width) {
		divOps.left = parentWidth - width;
	}
	if (divOps.left > 0) {
		divOps.left = 0;
	}
	divOps.style.left = divOps.left;
};
dhtmlXToolbarObject.prototype._create_self = function() {
	if (!this.width) {
		this.width = 1;
	}
	if (!this.height) {
		this.height = 1;
	}
	var div = document.createElement("div");
	var id = this.parentObject.id + "OPS";
	var scrollHTML1 = "<img ondblclick='dhtmlXToolbarObjectScrollAll(\"" + id
			+ "\",false)' onclick='dhtmlXToolbarObjectScroll(\"" + id
			+ "\",false)' style='vertical-align:bottom;cursor:hand;' src='"
			+ SFT.contextPath + SFT.getTheme().imagePath
			+ "scrl_l.gif' border='0'/>";
	var scrollHTML2 = "<img ondblclick='dhtmlXToolbarObjectScrollAll(\""
			+ id
			+ "\",true)' onclick='dhtmlXToolbarObjectScroll(\""
			+ id
			+ "\",true)' src='"
			+ SFT.contextPath
			+ SFT.getTheme().imagePath
			+ "scrl_r.gif' border='0' style='vertical-align:bottom;cursor:hand;'/>";
	div.innerHTML = "<table style='table-layout: fixed' width='100%' cellpadding='0' cellspacing='0' border='0'><tbody><tr><td align='right'><div style='overflow:hidden;width:100%;text-align:right;'><div id='"
			+ id
			+ "' style='position:relative;width:100%;margin:0 0 0 0;text-align:right;'><table cellpadding=\"0\" cellspacing=\"1\" class=\""
			+ this.tableCSS
			+ "\" style=\"display:none\" width=\""
			+ this.width
			+ "\" height=\""
			+ this.height
			+ "\" align='right'><tbody>"
			+ "<tr>"
			+ "<td width=\""
			+ (this.gecko ? 5 : 3)
			+ "px\" align='right'><div class=\"toolbarHandle\" style='text-align:right;'>&nbsp;</div></td><td class=\""
			+ this.titleCSS
			+ "\" style=\"display:none\">"
			+ this.name
			+ "</td><td></td><td align=\"right\" width=\"100%\" class=\""
			+ this.titleCSS
			+ "\" style=\"display:none\">"
			+ this.name
			+ "</td><td align='right'></td></tr></tbody></table></div></div></td><td class='toolbarscroller' align='left'><div style='text-align:right;position:relative;'>"
			+ scrollHTML1 + scrollHTML2 + "</div></td></tr></tbody></table>";
	var table0 = div.childNodes[0];
	var table = div.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0];
	table.setAttribute("UNSELECTABLE", "on");
	table.onselectstart = this.badDummy;
	this.topNod = table;
	this.dividerCell = table.childNodes[0].childNodes[0].childNodes[0];
	this.dividerCell.toolbar = this;
	this.preNameCell = this.dividerCell.nextSibling;
	this.firstCell = this.preNameCell.nextSibling;
	this.nameCell = this.firstCell.nextSibling;
	this.crossCell = this.nameCell.nextSibling;
	this.parentObject.appendChild(table0);
};
dhtmlXToolbarObject.prototype._create_self_vertical = function() {
	if (!this.width) {
		this.width = 1;
	}
	if (!this.height) {
		this.height = 1;
	}
	var div = document.createElement("div");
	div.innerHTML = "<table cellpadding=\"0\" cellspacing=\"1\" class=\""
			+ this.tableCSS
			+ "\" style=\"display:none\" width=\""
			+ this.width
			+ "\" height=\""
			+ this.height
			+ "\"><tbody>"
			+ "<tr><td heigth=\""
			+ (this.gecko ? 5 : 3)
			+ "px\"><div class=\"vtoolbarHandle\" style=\"height: 3px; width:100%; overflow:hidden\"></div></td></tr>"
			+ "<tr><td height=\"100%\" class=\"" + this.titleCSS
			+ "\" style=\"display:none\">" + this.name + "</td></tr>"
			+ "<tr><td></td></tr>"
			+ "<tr><td align=\"right\" height=\"100%\" class=\""
			+ this.titleCSS + "\" style=\"display:none\">" + this.name
			+ "</td></tr>" + "<tr><td></td></tr>" + "</tbody></table>";
	var table = div.childNodes[0];
	table.onselectstart = this.badDummy;
	table.setAttribute("UNSELECTABLE", "on");
	this.topNod = table;
	this.dividerCell = table.childNodes[0].childNodes[0].childNodes[0];
	this.dividerCell.toolbar = this;
	this.preNameCell = table.childNodes[0].childNodes[1].childNodes[0];
	this.firstCell = table.childNodes[0].childNodes[2].childNodes[0];
	this.nameCell = table.childNodes[0].childNodes[3].childNodes[0];
	this.crossCell = table.childNodes[0].childNodes[4].childNodes[0];
	this.parentObject.appendChild(table);
};
function dhtmlXImageButtonObject(src, width, height, action, id, tooltip,
		className, disableImage) {
	if (src.tagName == "ImageButton") {
		width = src.getAttribute("width");
		height = src.getAttribute("height");
		id = src.getAttribute("id");
		action = src.getAttribute("imaction");
		tooltip = src.getAttribute("tooltip");
		className = src.getAttribute("className");
		disableImage = src.getAttribute("disableImage");
		src = src.getAttribute("src");
	}
	this.topNod = 0;
	this.action = 0;
	this.persAction = 0;
	this.id = id || 0;
	this.className = className || "defaultButton";
	this.src = src;
	this.disableImage = disableImage;
	this.tooltip = tooltip || "";
	td = document.createElement("td");
	this.topNod = td;
	td.height = height;
	td.width = width;
	td.align = "center";
	td.innerHTML = "<img src='" + src + "' border='0' title='" + this.tooltip
			+ "' style='padding-left:2px; padding-right:2px;'>";
	td.className = this.className;
	td.objectNode = this;
	this.imageTag = td.childNodes[0];
	this.enable();
}
dhtmlXImageButtonObject.prototype = new dhtmlXButtonPrototypeObject();
function dhtmlXToolbarDividerYObject(id) {
	this.topNod = 0;
	if (id) {
		this.id = id;
	} else {
		this.id = 0;
	}
	td = document.createElement("td");
	this.topNod = td;
	td.align = "center";
	td.style.paddingRight = "2";
	td.style.paddingLeft = "2";
	td.innerHTML = "<div class='toolbarDividerY'>&nbsp;</div>";
	if (!document.all) {
		td.childNodes[0].style.height = "0px";
	}
	return this;
}
dhtmlXToolbarDividerYObject.prototype = new dhtmlXButtonPrototypeObject();
function dhtmlXToolbarDividerXObject(id) {
	this.topNod = 0;
	if (id) {
		this.id = id;
	} else {
		this.id = 0;
	}
	td = document.createElement("td");
	this.topNod = td;
	td.align = "center";
	td.style.paddingRight = "2";
	td.style.paddingLeft = "2";
	td.width = "4px";
	td.innerHTML = "<div class='toolbarDivider'></div\t>";
	if (!document.all) {
		td.childNodes[0].style.width = "0px";
		td.style.padding = "0 0 0 0";
		td.style.margin = "0 0 0 0";
	}
	return this;
}
dhtmlXToolbarDividerXObject.prototype = new dhtmlXButtonPrototypeObject();
function dhtmlXImageTextButtonObject(src, text, width, height, action, id,
		tooltip, className, textClassName, disableImage) {
	if (src.tagName == "ImageTextButton") {
		width = src.getAttribute("width");
		height = src.getAttribute("height");
		id = src.getAttribute("id");
		action = src.getAttribute("imaction");
		tooltip = src.getAttribute("tooltip");
		className = src.getAttribute("className");
		disableImage = src.getAttribute("disableImage");
		textClassName = src.getAttribute("textClassName");
		if (src.childNodes[0]) {
			text = src.childNodes[0].data;
		} else {
			text = "";
		}
		src = src.getAttribute("src");
	}
	this.topNod = 0;
	this.action = 0;
	this.persAction = 0;
	this.className = className || "defaultButton";
	this.textClassName = textClassName || "defaultButtonText";
	this.src = src;
	this.disableImage = disableImage;
	this.tooltip = tooltip || "";
	this.id = id || 0;
	td = document.createElement("td");
	this.topNod = td;
	td.height = height;
	td.width = width;
	td.align = "center";
	td.noWrap = true;
	td.innerHTML = "<table title='"
			+ this.tooltip
			+ "' width='100%' height='100%' cellpadding='0' cellspacing='0'><tr><td valign='middle'><img src='"
			+ src
			+ "' border='0'  style='padding-left:2px; padding-right:2px;'></td><td width='100%' style='padding-left:5px' align='left' class='"
			+ this.textClassName + "'>" + text + "</td></tr></table>";
	td.className = this.className;
	td.objectNode = this;
	this.imageTag = td.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0];
	this.textTag = td.childNodes[0].childNodes[0].childNodes[0].childNodes[1];
	this.enable();
	return this;
}
dhtmlXImageTextButtonObject.prototype = new dhtmlXButtonPrototypeObject();
dhtmlXImageTextButtonObject.prototype.setText = function(newText) {
	this.textTag.innerHTML = newText;
};
function dhtmlXSelectButtonObject(id, valueList, displayList, action, width,
		height, className) {
	if (id.tagName == "SelectButton") {
		width = id.getAttribute("width");
		height = id.getAttribute("height");
		className = id.getAttribute("className");
		action = id.getAttribute("imaction");
		valueList = "";
		displayList = "";
		for (var j = 0; j < id.childNodes.length; j++) {
			var z = id.childNodes[j];
			if ((z.nodeType == 1) && (z.tagName == "option")) {
				if (valueList) {
					valueList += "," + z.getAttribute("value");
				} else {
					valueList = z.getAttribute("value");
				}
				if (z.childNodes[0]) {
					if (displayList) {
						displayList += "," + z.childNodes[0].data;
					} else {
						displayList = z.childNodes[0].data;
					}
				} else {
					displayList += ",";
				}
			}
		}
		id = id.getAttribute("id");
	}
	this.topNod = 0;
	this.action = 0;
	this.persAction = 0;
	this.selElement = 0;
	if (id) {
		this.id = id;
	} else {
		this.id = 0;
	}
	td = document.createElement("td");
	this.topNod = td;
	td.align = "center";
	td.width = width;
	var sel = document.createElement("select");
	this.selElement = sel;
	var self = this;
	sel.onclick = function() {
		sel.value = "0";
	};
	sel.onchange = this._onclickX;
	sel.objectNode = this;
	if (className) {
		sel.className = className;
	}
	if (width) {
		sel.style.width = "100%";
	}
	var temp1 = valueList.split(",");
	if (displayList) {
		var temp2 = displayList.split(",");
	} else {
		var temp2 = valueList.split(",");
	}
	for (var i = 0; i < temp1.length; i++) {
		var option = new Option(temp2[i], temp1[i]);
		option.onclick = function() {
			alert(this.tagName);
		};
		sel.options[sel.options.length] = option;
	}
	td.appendChild(sel);
	td.className = "toolbarNormalButton";
	td.objectNode = this;
	return this;
}
dhtmlXSelectButtonObject.prototype = new dhtmlXButtonPrototypeObject();
dhtmlXSelectButtonObject.prototype.disable = function() {
	this.selElement.disabled = true;
};
dhtmlXSelectButtonObject.prototype.enable = function() {
	this.selElement.disabled = false;
};
dhtmlXSelectButtonObject.prototype._onclickX = function() {
	if ((!this.objectNode.persAction)
			|| (this.objectNode.persAction(this.objectNode.selElement.value))) {
		if (this.objectNode.action) {
			this.objectNode.action(this.objectNode.id,
					this.objectNode.selElement.value);
		}
	}
};
dhtmlXSelectButtonObject.prototype.addOption = function(value, display) {
	this.selElement.options[this.selElement.options.length] = new Option(
			display, value);
};
dhtmlXSelectButtonObject.prototype.removeOption = function(value) {
	var z = getIndexByValue(value);
	if (z >= 0) {
		this.selElement.removeChild(this.selElement.options[i]);
	}
};
dhtmlXSelectButtonObject.prototype.setOptionValue = function(oldValue, newValue) {
	var z = getIndexByValue(oldValue);
	if (z >= 0) {
		this.selElement.options[i].value = newValue;
	}
};
dhtmlXSelectButtonObject.prototype.setOptionText = function(value, newText) {
	var z = getIndexByValue(value);
	if (z >= 0) {
		this.selElement.options[i].text = newText;
	}
};
dhtmlXSelectButtonObject.prototype.setSelected = function(value) {
	var z = getIndexByValue(value);
	if (z >= 0) {
		this.selElement.options[i].selected = true;
	}
};
dhtmlXSelectButtonObject.prototype.getIndexByValue = function(value) {
	for (var i = 0; i < this.selElement.options.lenght; i++) {
		if (this.selElement.options[i].value == value) {
			return i;
		}
	}
	return -1;
};
function dhtmlXTwoStateButtonObject(id, src, text, width, height, action,
		tooltip, className, textClassName, disableImage, pressedState) {
	if (id.tagName == "TwoStateButton") {
		width = id.getAttribute("width") || 1;
		height = id.getAttribute("height") || 1;
		action = id.getAttribute("imaction");
		tooltip = id.getAttribute("tooltip");
		className = id.getAttribute("className");
		disableImage = id.getAttribute("disableImage");
		textClassName = id.getAttribute("textClassName");
		pressedState = id.getAttribute("pressedState");
		if (id.childNodes[0]) {
			text = id.childNodes[0].data;
		} else {
			text = "";
		}
		src = id.getAttribute("src");
		id = id.getAttribute("id");
	}
	this.state = 0;
	this.topNod = 0;
	this.action = 0;
	this.persAction = 0;
	this.className = className || "defaultButton";
	this.textClassName = textClassName || "defaultButtonText";
	this.disableImage = disableImage;
	this.tooltip = tooltip || "";
	this.id = id || 0;
	if (text) {
		this.textP = text.split(",");
	} else {
		this.textP = ",".split(",");
	}
	if (src) {
		this.srcA = src.split(",");
	} else {
		this.srcA = ",".split(",");
	}
	this.src = this.srcA[0];
	td = document.createElement("td");
	this.topNod = td;
	td.height = height;
	td.width = width;
	td.align = "center";
	td.noWrap = true;
	td.innerHTML = "<table title='"
			+ this.tooltip
			+ "'  width='100%' height='100%' cellpadding='0' cellspacing='0'><tr><td valign='middle'><img src='"
			+ this.srcA[0]
			+ "' border='0'  style='padding-left:2px;padding-right:2px;'></td><td width='100%' style='padding-left:5px' align='left' class='"
			+ this.textClassName + "'>" + this.textP[0] + "</td></tr></table>";
	td.className = this.className;
	td.objectNode = this;
	this.imageTag = td.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0];
	this.textTag = td.childNodes[0].childNodes[0].childNodes[0].childNodes[1];
	if (!text) {
		this.textTag.style.display = "none";
	}
	if (!src) {
		this.imageTag.style.display = "none";
	}
	this.enable();
	if (convertStringToBoolean(pressedState)) {
		this.state = 1;
		this.topNod.className = this.className + "down";
		if (this.textP[1]) {
			this.textTag.innerHTML = this.textP[1];
		}
		if (this.srcA[1]) {
			this.imageTag.src = this.srcA[1];
		}
	}
	return this;
}
dhtmlXTwoStateButtonObject.prototype = new dhtmlXButtonPrototypeObject();
dhtmlXTwoStateButtonObject.prototype._onclickX = function(e, that) {
	if (!that) {
		that = this.objectNode;
	}
	if (that.topNod.dstatus) {
		return;
	}
	if (that.state == 0) {
		that.state = 1;
		this.className = that.className + "down";
	} else {
		that.state = 0;
		this.className = that.className;
	}
	if (that.textP[that.state]) {
		that.textTag.innerHTML = that.textP[that.state];
	}
	if (that.srcA[that.state]) {
		that.imageTag.src = that.srcA[that.state];
	}
	if ((!that.persAction) || (that.persAction())) {
		if (that.action) {
			that.action(that.id, that.state);
		}
	}
};
dhtmlXTwoStateButtonObject.prototype._onmouseoutX = function(e) {
};
dhtmlXTwoStateButtonObject.prototype._onmouseoverX = function(e) {
};
dhtmlXTwoStateButtonObject.prototype.getState = function() {
	return this.state;
};
dhtmlXTwoStateButtonObject.prototype.setState = function(state) {
	this.state = state;
	if (state == 0) {
		this.topNod.className = this.className;
	} else {
		this.topNod.className = this.className + "down";
	}
	if (this.textP[this.state]) {
		this.textTag.innerHTML = this.textP[this.state];
	}
	if (this.srcA[this.state]) {
		this.imageTag.src = this.srcA[this.state];
	}
};
