/* GUIFW v1.1 - Copyright 2011., Dean Martinis */

var guifw = new Object();


guifw.defaultskinpath = function() {
	return "img/core/";
}

guifw.iefixneed = function() {
	var u_agent = navigator.userAgent;
	if ((u_agent.indexOf("MSIE") != -1) && (u_agent.indexOf("Opera") == -1)) return true;
	return false;
}

guifw.eid = function(i_name) {
	if (i_name != undefined && i_name != null && i_name != "") {
		var t_obj = document.getElementById(i_name);
		if (t_obj != undefined && t_obj != null) return t_obj;
	}
	return null;
}

guifw.gettype = function(i_value) {
	var t_value = typeof i_value;
	if (t_value === "object") {
		if (t_value) {
			if (typeof i_value.length === "number" && !(i_value.propertyIsEnumerable("length")) && typeof i_value.splice === "function") t_value = "array";
		} else {
			t_value = "null";
		}
	}
	return t_value;
}

guifw.getstyle = function(i_obj, i_style) {
	var t_result = false;
	if (i_obj != undefined && i_style != undefined) {
		if (document.defaultView && document.defaultView.getComputedStyle) {
			t_result = document.defaultView.getComputedStyle(i_obj, "").getPropertyValue(i_style);
		} else if (i_obj.currentStyle) {
			i_style = i_style.replace(/\-(\w)/g, function(str_match, p1) {return p1.toUpperCase();});
			t_result = i_obj.currentStyle[i_style];
		}
	}
	return t_result;
}

guifw.getposition = function(i_obj) {
	var t_pos = {x:0, y:0};
	var t_border;
	if (i_obj.offsetParent) {
		do {
			if (guifw.getstyle(i_obj, "position") == "relative") {
				if (t_border = guifw.getstyle(i_obj, "border-left-width")) {
					t_border = parseInt(t_border.replace(/[^0-9]/g, ""), 10);
					if (!isNaN(t_border)) t_pos.x += t_border;
				}
				if (t_border = guifw.getstyle(i_obj, "border-top-width")) {
					t_border = parseInt(t_border.replace(/[^0-9]/g, ""), 10);
					if (!isNaN(t_border)) t_pos.y += t_border;
				}
			}
			t_pos.x += i_obj.offsetLeft;
			t_pos.y += i_obj.offsetTop;
		} while (i_obj = i_obj.offsetParent);
	} else if (i_obj.x && i_obj.y) {
		t_pos.x += i_obj.x;
		t_pos.y += i_obj.y;
	}
	return t_pos;
}

guifw.getdimension = function(i_obj) {
	var t_size = {width:0, height:0}
	if (i_obj != undefined && i_obj != null && guifw.gettype(i_obj) == "object") {
		t_size.width = i_obj.offsetWidth;
		t_size.height = i_obj.offsetHeight;
	}
	return t_size;
}

guifw.getallchilds = function(i_obj, i_tag) {
	var t_childs = new Array();
	if (i_obj != undefined && guifw.gettype(i_obj) == "object") {
		var t_obj = i_obj.childNodes;
		for (t_inx = 0; t_inx < t_obj.length; t_inx++) {
			if (i_tag != undefined && i_tag != null && i_tag != "") {
				if (t_obj[t_inx].nodeName == String(i_tag).toUpperCase()) t_childs.push(t_obj[t_inx]);
			} else {
				t_childs.push(t_obj[t_inx]);
			}
		}
	}
	return t_childs;
}

guifw.clearattributes = function(i_obj, i_attr) {
	if (i_obj != undefined && guifw.gettype(i_obj) == "object" && i_attr != undefined && i_attr != null) {
		var t_attr = i_attr.split("|");
		for (var t_inx = 0; t_inx < t_attr.length; t_inx++) {
			i_obj.removeAttribute(t_attr[t_inx]);
		}
		return true;
	}
	return false;
}

guifw.browsersize = function() {
	var t_screen = {clientHeight:0, clientWidth:0, scrollHeight:0, scrollWidth:0, scrollLeft:0, scrollTop:0};
	if (window.innerWidth && window.innerHeight) {
		t_screen.clientHeight = window.innerHeight;
		t_screen.clientWidth = window.innerWidth;
		t_screen.scrollLeft = window.pageXOffset;
		t_screen.scrollTop = window.pageYOffset;
	} else if (!(document.documentElement.clientWidth == 0) && !(document.documentElement.clientHeight == 0)) {
		t_screen.clientHeight = document.documentElement.clientHeight;
		t_screen.clientWidth = document.documentElement.clientWidth;
		t_screen.scrollLeft = document.documentElement.scrollLeft;
		t_screen.scrollTop = document.documentElement.scrollTop;
	} else {
		t_screen.clientHeight = document.body.clientHeight;
		t_screen.clientWidth = document.body.clientWidth;
		t_screen.scrollLeft = document.body.scrollLeft;
		t_screen.scrollTop = document.body.scrollTop;
	}
	if (!(document.documentElement.scrollWidth == 0) && !(document.documentElement.scrollHeight == 0)) {
		t_screen.scrollHeight = document.documentElement.scrollHeight;
		t_screen.scrollWidth = document.documentElement.scrollWidth;
	} else {
		t_screen.scrollHeight = document.body.scrollHeight;
		t_screen.scrollWidth = document.body.scrollWidth;
	}
	return t_screen;
}

guifw.elementvalidname = function(i_name) {
	if (i_name != undefined && i_name != null && i_name != "") {
		i_name = i_name.replace(/\W/g, "");
		i_name = i_name.substr(0, 20);
		i_name = i_name.toLowerCase();
		return i_name;
	}
	return null;
}

guifw.elementactionparse = function(i_action, i_size) {
	if (i_action != undefined && i_action != null) {
		var t_action = i_action.split("|");
		var t_link = new Array();
		var t_result = "";
		var t_inx;
		if (i_size == undefined || i_size == null || i_size == 0) return t_action;
		if (t_action.length > i_size) {
			for (t_inx = 0; t_inx < i_size; t_inx++) {
				t_link.push(t_action[t_inx]);
			}
			for (t_inx = i_size; t_inx < t_action.length; t_inx++) {
				if (t_result != "") t_result += "|";
				t_result += t_action[t_inx];
			}
			t_link.push(t_result);
			return t_link;
		} else {
			return t_action;
		}
	}
	return false;
}

guifw.events = {
	add:function(i_obj, i_event, i_func) {
		if (i_obj != undefined && i_event != undefined && i_func != undefined) {
			if (i_obj.addEventListener) {
				i_obj.addEventListener(String(i_event).toLowerCase(), i_func, false);
				return true;
			} else if (i_obj.attachEvent) {
				i_obj.attachEvent("on" + String(i_event).toLowerCase(), i_func);
				return true;
			}
		}
		return false;
	},
	remove:function(i_obj, i_event, i_func) {
		if (i_obj != undefined && i_event != undefined && i_func != undefined) {
			if (i_obj.removeEventListener) {
				i_obj.removeEventListener(String(i_event).toLowerCase(), i_func, false);
				return true;
			} else if (i_obj.detachEvent) {
				i_obj.detachEvent("on" + String(i_event).toLowerCase(), i_func);
				return true;
			}
		}
		return false;
	},
	create:function(i_obj, i_type, i_event) {
		if (i_obj != undefined && i_type != undefined && i_event != undefined) {
			if (document.all) {
				i_obj.fireEvent("on" + String(i_event).toLowerCase());
				return true;
			} else {
				var t_evt = document.createEvent(i_type);
				t_evt.initEvent(String(i_event).toLowerCase(), true, true);
				i_obj.dispatchEvent(t_evt);
				return true;
			}
		}
		return false;
	}
}

guifw.ajaxobject = function() {
	var lv_ajax_modul = null;
	if (String(window.location.protocol).indexOf("http") == -1) {
		if (window.XMLHttpRequest && !(window.ActiveXObject)) {
			lv_ajax_modul = new XMLHttpRequest();
		} else if (window.ActiveXObject) {
			try {
				lv_ajax_modul = new ActiveXObject("MSXML2.XMLHTTP");
			} catch (e) {
				try {
					lv_ajax_modul = new ActiveXObject("MICROSOFT.XMLHTTP");
				} catch (e) {
					lv_ajax_modul = null;
				}
			}
		} else {
			lv_ajax_modul = null;
		}
	} else {
		if (window.XMLHttpRequest) {
			lv_ajax_modul = new XMLHttpRequest();
		} else if (window.ActiveXObject) {
			try {
				lv_ajax_modul = new XMLHttpRequest();
			} catch(e) {
				try {
					lv_ajax_modul = new ActiveXObject("MSXML2.XMLHTTP");
				} catch (e) {
					try {
						lv_ajax_modul = new ActiveXObject("MICROSOFT.XMLHTTP");
					} catch (e) {
						lv_ajax_modul = null;
					}
				}
			}
		} else {
			lv_ajax_modul = null;
		}
	}
	this.ajaxid = lv_ajax_modul;
	this.error = false;
	if (lv_ajax_modul == null) this.error = true;

	this.get = function(i_url_path, fn_callback_method) {
		var lv_ajax_modul = this.ajaxid;
		if (lv_ajax_modul != undefined && lv_ajax_modul != null && typeof(lv_ajax_modul) == "object") {
			lv_ajax_modul.abort();
			lv_ajax_modul.open("GET", i_url_path, true);
			lv_ajax_modul.onreadystatechange = fn_callback_method;
			lv_ajax_modul.send(null);
			return true;
		} else {
			throw new Error("XMLHTTP Ajax not supported!");
			return false;
		}
	}

	this.post = function(i_url_path, i_url_parm, fn_callback_method) {
		var lv_ajax_modul = this.ajaxid;
		if (lv_ajax_modul != undefined && lv_ajax_modul != null && typeof(lv_ajax_modul) == "object") {
			lv_ajax_modul.abort();
			lv_ajax_modul.open("POST", i_url_path, true);
			lv_ajax_modul.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			lv_ajax_modul.onreadystatechange = fn_callback_method;
			lv_ajax_modul.send(i_url_parm);
			return true;
		} else {
			throw new Error("XMLHTTP Ajax not supported!");
			return false;
		}
	}

	this.abort = function() {
		var lv_ajax_modul = this.ajaxid;
		if (lv_ajax_modul != undefined && lv_ajax_modul != null && typeof(lv_ajax_modul) == "object") {
			lv_ajax_modul.abort();
			return true;
		} else {
			throw new Error("XMLHTTP Ajax not supported!");
			return false;
		}
	}

	this.readystate = function() {
		var lv_ajax_modul = this.ajaxid;
		if (lv_ajax_modul != undefined && lv_ajax_modul != null && typeof(lv_ajax_modul) == "object") {
			return lv_ajax_modul.readyState;
		} else {
			return -1;
		}
	}

	this.status = function() {
		var lv_ajax_modul = this.ajaxid;
		if (lv_ajax_modul != undefined && lv_ajax_modul != null && typeof(lv_ajax_modul) == "object") {
			return lv_ajax_modul.status;
		} else {
			return -1;
		}
	}

	this.responsetext = function() {
		var lv_ajax_modul = this.ajaxid;
		if (lv_ajax_modul != undefined && lv_ajax_modul != null && typeof(lv_ajax_modul) == "object") {
			return lv_ajax_modul.responseText;
		} else {
			return "";
		}
	}

	this.removescripts = function() {
		var lv_ajax_modul = this.ajaxid;
		var i_result = "";
		if (lv_ajax_modul != undefined && lv_ajax_modul.responseText != "") {
			i_result = lv_ajax_modul.responseText;
			i_result = i_result.replace(/&(lt|gt);/g, function(strMatch, p1){ return (p1 == "lt") ? "<" : ">"; });
			i_result = i_result.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi, "");
		}
		return i_result;
	}

	this.runscripts = function() {
		var lv_ajax_modul = this.ajaxid;
		try {
			if (lv_ajax_modul != undefined && lv_ajax_modul.responseText != "") {
				var i_html = lv_ajax_modul.responseText;
				var i_script = "";
				i_html = i_html.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi, function(){ if (i_html !== null) i_script += arguments[1] + '\n'; return ""; });
				if (i_script) {
					if (window.execScript) {
						window.execScript(i_script);
					} else {
						window.setTimeout(i_script, 0);
					}
				}
			}
		} catch(e) {
			alert(e);
			return false;
		}
		return true;
	}
}

guifw.urlencode = function(i_parm, i_name, i_value) {
	var t_result = "";
	var t_text = "";
	var t_code, t_inx;
	if (i_parm != undefined) {
		if (i_name != undefined && i_name != "" && i_value != undefined) {
			i_value = i_value.toString();
			for (t_inx = 0; t_inx < i_value.length; t_inx++) {
				t_code = encodeURI(i_value.charAt(t_inx));
				switch (t_code.toUpperCase()) {
					case "%C5%A0":
						t_text += "%A9";
						break;
					case "%C4%90":
						t_text += "%D0";
						break;
					case "%C4%8C":
						t_text += "%C8";
						break;
					case "%C4%86":
						t_text += "%C6";
						break;
					case "%C5%BD":
						t_text += "%AE";
						break;
					case "%C5%A1":
						t_text += "%B9";
						break;
					case "%C4%91":
						t_text += "%F0";
						break;
					case "%C4%8D":
						t_text += "%E8";
						break;
					case "%C4%87":
						t_text += "%E6";
						break;
					case "%C5%BE":
						t_text += "%BE";
						break;
					default:
						t_text += t_code;
						break;
				}
			}
			if (String(i_parm).length > 0) t_result = "&";
			t_result += i_name + "=" + t_text;
		}
	}
	return t_result;
}

guifw.dragobject = function() {
	var lv_obj_id = null;
	var fn_get_target = function(i_evt) {
		var t_obj = null;
		if (i_evt.target) {
			t_obj = i_evt.target;
		} else if (i_evt.srcElement) {
			t_obj = i_evt.srcElement;
		}
		if (t_obj.nodeType == 3) t_obj = t_obj.parentNode;
		return t_obj;
	}
	var fn_iefix_need = function(i_evt) {
		var t_evt = window.event ? window.event : i_evt;
		if (typeof t_evt.layerX == "undefined") t_evt.layerX = t_evt.offsetX;
		if (typeof t_evt.layerY == "undefined") t_evt.layerY = t_evt.offsetY;
		return t_evt;
	}
	var fn_drag_start = function(i_evt) {
		var t_evt = fn_iefix_need(i_evt);
		if ((t_evt.button == 1 && window.event != null) || t_evt.button == 0) {
			lv_obj_id = fn_get_target(t_evt);
			var y = parseInt(lv_obj_id.vmode ? lv_obj_id.root.style.top : lv_obj_id.root.style.bottom);
			var x = parseInt(lv_obj_id.hmode ? lv_obj_id.root.style.left : lv_obj_id.root.style.right );
			lv_obj_id.root.onDragStart(x, y);
			lv_obj_id.lastMouseX = t_evt.clientX;
			lv_obj_id.lastMouseY = t_evt.clientY;
			if (lv_obj_id.hmode) {
				if (lv_obj_id.minX != null) lv_obj_id.minMouseX = t_evt.clientX - x + lv_obj_id.minX;
				if (lv_obj_id.maxX != null) lv_obj_id.maxMouseX = lv_obj_id.minMouseX + lv_obj_id.maxX - lv_obj_id.minX;
			} else {
				if (lv_obj_id.minX != null) lv_obj_id.maxMouseX = -lv_obj_id.minX + evt.clientX + x;
				if (lv_obj_id.maxX != null) lv_obj_id.minMouseX = -lv_obj_id.maxX + evt.clientX + x;
			}
			if (lv_obj_id.vmode) {
				if (lv_obj_id.minY != null) lv_obj_id.minMouseY = t_evt.clientY - y + lv_obj_id.minY;
				if (lv_obj_id.maxY != null) lv_obj_id.maxMouseY = lv_obj_id.minMouseY + lv_obj_id.maxY - lv_obj_id.minY;
			} else {
				if (lv_obj_id.minY != null) lv_obj_id.maxMouseY = -lv_obj_id.minY + evt.clientY + y;
				if (lv_obj_id.maxY != null) lv_obj_id.minMouseY = -lv_obj_id.maxY + evt.clientY + y;
			}
			guifw.events.add(document, "mousemove", fn_drag_active);
			guifw.events.add(document, "mouseup", fn_drag_stop);
			return false;
		}
	}
	var fn_drag_active = function(i_evt) {
		var t_evt = fn_iefix_need(i_evt);
		var ey = t_evt.clientY;
		var ex = t_evt.clientX;
		var y = parseInt(lv_obj_id.vmode ? lv_obj_id.root.style.top : lv_obj_id.root.style.bottom);
		var x = parseInt(lv_obj_id.hmode ? lv_obj_id.root.style.left : lv_obj_id.root.style.right);
		var nx, ny;
		if (lv_obj_id.minX != null) ex = lv_obj_id.hmode ? Math.max(ex, lv_obj_id.minMouseX) : Math.min(ex, lv_obj_id.maxMouseX);
		if (lv_obj_id.maxX != null) ex = lv_obj_id.hmode ? Math.min(ex, lv_obj_id.maxMouseX) : Math.max(ex, lv_obj_id.minMouseX);
		if (lv_obj_id.minY != null) ey = lv_obj_id.vmode ? Math.max(ey, lv_obj_id.minMouseY) : Math.min(ey, lv_obj_id.maxMouseY);
		if (lv_obj_id.maxY != null) ey = lv_obj_id.vmode ? Math.min(ey, lv_obj_id.maxMouseY) : Math.max(ey, lv_obj_id.minMouseY);
		nx = x + ((ex - lv_obj_id.lastMouseX) * (lv_obj_id.hmode ? 1 : -1));
		ny = y + ((ey - lv_obj_id.lastMouseY) * (lv_obj_id.vmode ? 1 : -1));
		if (lv_obj_id.xMapper) {
			nx = lv_obj_id.xMapper(y);
		} else if (lv_obj_id.yMapper) {
			ny = lv_obj_id.yMapper(x);
		}
		lv_obj_id.root.style[lv_obj_id.hmode ? "left" : "right"] = nx + "px";
		lv_obj_id.root.style[lv_obj_id.vmode ? "top" : "bottom"] = ny + "px";
		lv_obj_id.lastMouseX = ex;
		lv_obj_id.lastMouseY = ey;
		lv_obj_id.root.onDrag(nx, ny);
		return false;
	}
	var fn_drag_stop = function() {
		guifw.events.remove(document, "mousemove", fn_drag_active);
		guifw.events.remove(document, "mouseup", fn_drag_stop);
		lv_obj_id.root.onDragEnd(parseInt(lv_obj_id.root.style[lv_obj_id.hmode ? "left" : "right"]), parseInt(lv_obj_id.root.style[lv_obj_id.vmode ? "top" : "bottom"]));
		lv_obj_id = null;
	}
	return {
		init:function(oHook, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper) {
			if (typeof(oHook) == "object") {
				oHook.hmode = bSwapHorzRef ? false : true ;
				oHook.vmode = bSwapVertRef ? false : true ;
				oHook.root = oRoot && oRoot != null ? oRoot : oHook ;
				if (oHook.hmode && isNaN(parseInt(oHook.root.style.left))) oHook.root.style.left = "0px";
				if (oHook.vmode && isNaN(parseInt(oHook.root.style.top))) oHook.root.style.top = "0px";
				if (!oHook.hmode && isNaN(parseInt(oHook.root.style.right))) oHook.root.style.right = "0px";
				if (!oHook.vmode && isNaN(parseInt(oHook.root.style.bottom))) oHook.root.style.bottom = "0px";
				oHook.minX = typeof minX != "undefined" ? minX : null;
				oHook.minY = typeof minY != "undefined" ? minY : null;
				oHook.maxX = typeof maxX != "undefined" ? maxX : null;
				oHook.maxY = typeof maxY != "undefined" ? maxY : null;
				oHook.xMapper = fXMapper ? fXMapper : null;
				oHook.yMapper = fYMapper ? fYMapper : null;
				oHook.root.onDragStart = new Function();
				oHook.root.onDragEnd = new Function();
				oHook.root.onDrag = new Function();
				guifw.events.add(oHook, "mousedown", fn_drag_start);
			}
		}
	}
}();


/* ToolTip section */

guifw.tooltip = function() {
	var lv_ttip = {id:null, width:0, height:0, xpos:3, ypos:3, active:false};
	var lv_fade = {alphacurrent:0, alphamax:100, speed:10, timer:null, inout:1};
	var lv_max_height = 50;
	var lv_max_width = 320;
	var lv_tag_height = 0;
	var lv_tag_list = "a,tr,td,th,div,img,span,label,input,button";
	var lv_iebrowser = guifw.iefixneed();
	var lv_iefixneed = (document.all ? true : false);
	var fn_mousemove_event = function(evt) {
		var t_ypos = lv_iefixneed ? event.clientY + document.documentElement.scrollTop : evt.pageY;
		var t_xpos = lv_iefixneed ? event.clientX + document.documentElement.scrollLeft : evt.pageX;
		lv_ttip.id.style.top = (t_ypos - lv_tag_height) + "px";
		lv_ttip.id.style.left = (t_xpos + lv_ttip.xpos) + "px";
	}
	var fn_fade_inout = function() {
		var t_speed = lv_fade.speed;
		if ((lv_fade.alphacurrent != lv_fade.alphamax && lv_fade.inout == 1) || (lv_fade.alphacurrent != 0 && lv_fade.inout == -1)) {
			if ((lv_fade.alphamax - lv_fade.alphacurrent) < lv_fade.speed && lv_fade.inout == 1) {
				t_speed = lv_fade.alphamax - lv_fade.alphacurrent;
			} else if (lv_fade.alphacurrent < lv_fade.speed && lv_fade.inout == -1) {
				t_speed = lv_fade.alphacurrent;
			}
			lv_fade.alphacurrent = lv_fade.alphacurrent + (t_speed * lv_fade.inout);
			if (lv_iebrowser) {
				lv_ttip.id.style.filter = "alpha(opacity=" + lv_fade.alphacurrent + ")";
			} else {
				lv_ttip.id.style.opacity = lv_fade.alphacurrent * .01;
			}
		} else {
			if (lv_fade.timer) {
				clearInterval(lv_fade.timer);
				lv_fade.timer = null;
			}
			if (lv_fade.inout == -1) fn_remove_span_items();
		}
	}
	var fn_remove_span_items = function() {
		if (lv_ttip.active) {
			lv_ttip.id.style.visibility = "hidden";
			lv_ttip.id.style.left = "0px";
			lv_ttip.id.style.top = "0px";
			lv_ttip.id.style.height = "auto";
			lv_ttip.id.style.width = "auto";
			while (lv_ttip.id.hasChildNodes()) {
				lv_ttip.id.removeChild(lv_ttip.id.lastChild);
			}
			lv_ttip.id.style.display = "none";
			lv_ttip.active = false;
		}
	}
	var fn_create_span_item = function(i_type) {
		if (i_type != undefined) {
			var t_obj = document.createElement("span");
			switch (i_type.toUpperCase()) {
				case "TL":
					t_obj.className = "tlbox";
					t_obj.style.background = "url(" + guifw.defaultskinpath() + "guifw-tooltip-default1.png) no-repeat 0px 0px";
					break;
				case "TM":
					t_obj.className = "tmbox";
					t_obj.style.background = "url(" + guifw.defaultskinpath() + "guifw-tooltip-default2.png) repeat-x 0px 0px";
					break;
				case "TR":
					t_obj.className = "trbox";
					t_obj.style.background = "url(" + guifw.defaultskinpath() + "guifw-tooltip-default1.png) no-repeat -10px 0px";
					break;
				case "ML":
					t_obj.className = "mlbox";
					t_obj.style.background = "url(" + guifw.defaultskinpath() + "guifw-tooltip-default3.png) repeat-y 0px 0px";
					break;
				case "MM":
					t_obj.className = "mmbox";
					t_obj.style.background = "#FFFFFF";
					break;
				case "MR":
					t_obj.className = "mrbox";
					t_obj.style.background = "url(" + guifw.defaultskinpath() + "guifw-tooltip-default3.png) repeat-y -10px 0px";
					break;
				case "BL":
					t_obj.className = "blbox";
					t_obj.style.background = "url(" + guifw.defaultskinpath() + "guifw-tooltip-default1.png) no-repeat 0px -10px";
					break;
				case "BM":
					t_obj.className = "bmbox";
					t_obj.style.background = "url(" + guifw.defaultskinpath() + "guifw-tooltip-default2.png) repeat-x 0px -10px";
					break;
				case "BR":
					t_obj.className = "brbox";
					t_obj.style.background = "url(" + guifw.defaultskinpath() + "guifw-tooltip-default1.png) no-repeat -10px -10px";
					break;
			}
			return t_obj;
		}
		return false;
	}
	return {
		init:function() {
			var i_obj, i_title, i_elements;
			var i_taglist = lv_tag_list.split(",");
			for (var inx_1 = 0; inx_1 < i_taglist.length; inx_1++) {
				i_elements = document.getElementsByTagName(i_taglist[inx_1]);
				if (i_elements) {
					for (var inx_2 = 0; inx_2 < i_elements.length; inx_2++) {
						i_obj = i_elements[inx_2];
						i_title = i_obj.getAttribute("title");
						if (i_title) {
							i_obj.setAttribute("guifw-ttip", String(i_title).replace(/(\r\n|[\r\n])/g, "<br />"));
							i_obj.removeAttribute("title");
							i_obj.removeAttribute("alt");
							i_obj.onmouseover = function() {
								guifw.tooltip.show(this);
							}
							i_obj.onmouseout = function() {
								guifw.tooltip.hide(this);
							}
						}
					}
				}
			}
		},
		show:function(i_obj) {
			var t_span;
			lv_ttip.id = guifw.eid("guifw_tooltip_container");
			if (lv_ttip.id == undefined || lv_ttip.id == null) {
				lv_ttip.id = document.createElement("div");
				lv_ttip.id.setAttribute("id", "guifw_tooltip_container");
				document.body.appendChild(lv_ttip.id);
			} else {
				while (lv_ttip.id.hasChildNodes()) {
					lv_ttip.id.removeChild(lv_ttip.id.lastChild);
				}
			}
			lv_ttip.id.className = "guifw-tooltip-container";
			lv_ttip.id.style.visibility = "hidden";
			lv_ttip.id.style.display = "block";
			lv_ttip.id.appendChild(fn_create_span_item("TL"));
			lv_ttip.id.appendChild(fn_create_span_item("TM"));
			lv_ttip.id.appendChild(fn_create_span_item("TR"));
			lv_ttip.id.appendChild(fn_create_span_item("ML"));
			lv_ttip.id.appendChild(fn_create_span_item("MR"));
			lv_ttip.id.appendChild(fn_create_span_item("BL"));
			lv_ttip.id.appendChild(fn_create_span_item("BM"));
			lv_ttip.id.appendChild(fn_create_span_item("BR"));
			t_span = fn_create_span_item("MM");
			t_span.innerHTML = String(i_obj.getAttribute("guifw-ttip")).replace(/(\r\n|[\r\n])/g, "<br />");
			lv_ttip.id.appendChild(t_span);
			lv_ttip.width = t_span.offsetWidth + 16;
			if (lv_ttip.width > lv_max_width) {
				lv_ttip.width = lv_max_width;
				t_span.style.width = Number(lv_ttip.width - 16) + "px";
				t_span.style.whiteSpace = "normal";
			}
			lv_ttip.height = t_span.offsetHeight + 12;
			if (lv_ttip.height > lv_max_height) {
				lv_ttip.height = lv_max_height;
				t_span.style.height = Number(lv_ttip.height - 12) + "px";
			}
			lv_ttip.id.style.height = Number(lv_ttip.height) + "px";
			lv_ttip.id.style.width = Number(lv_ttip.width) + "px";
			t_span = lv_ttip.id.childNodes;
			if (t_span != undefined && t_span.length == 9) {
				t_span[1].style.width = Number(lv_ttip.width - 20) + "px";
				t_span[3].style.height = Number(lv_ttip.height - 20) + "px"
				t_span[4].style.height = Number(lv_ttip.height - 20) + "px"
				t_span[6].style.width = Number(lv_ttip.width - 20) + "px"
			}
			lv_tag_height = parseInt(lv_ttip.id.offsetHeight) + lv_ttip.ypos;
			guifw.events.add(document, "mousemove", fn_mousemove_event);
			guifw.events.create(i_obj, "MouseEvents", "mousemove");
			lv_ttip.active = true;
			if (lv_fade.timer) clearInterval(lv_fade.timer);
			if (lv_iebrowser) {
				lv_ttip.id.style.visibility = "visible";
			} else {
				lv_ttip.id.style.opacity = 0;
				lv_ttip.id.style.visibility = "visible";
				lv_fade.inout = 1;
				lv_fade.timer = setInterval(fn_fade_inout, 10);
			}
		},
		hide:function() {
			guifw.events.remove(document, "mousemove", fn_mousemove_event);
			if (lv_ttip.active) {
				if (lv_fade.timer) clearInterval(lv_fade.timer);
				if (lv_iebrowser) {
					fn_remove_span_items();
				} else {
					lv_fade.inout = -1;
					lv_fade.timer = setInterval(fn_fade_inout, 10);
				}
			}
		}
	}
}();


/* ModalWindow section */

guifw.modalwindow = function() {
	var lv_mwin = {id:null, fid:null, items:null, timer:null, active:false}
	var lv_ajax = {id:null, conid:null, timer:null, wname:null}
	var lv_fade = {alphacurrent:0, alphamax:50, speed:15, timer:null, inout:1};
	var fn_iefix_need = function() {
		var u_agent = navigator.userAgent;
		var b_ver = 0;
		if ((u_agent.indexOf("MSIE") != -1) && (u_agent.indexOf("Opera") == -1)) {
			b_ver = parseFloat(u_agent.substring(u_agent.indexOf("MSIE")+5));
			if (b_ver < 7) return true;
		}
		return false;
	}
	var fn_auto_resize = function() {
		if (lv_mwin.id != null && lv_mwin.active) {
			if (lv_mwin.fid != undefined && lv_mwin.fid != null) {
				var u_screen = guifw.browsersize();
				var t_height = Math.max(u_screen.clientHeight, u_screen.scrollHeight);
				var t_width = Math.max(u_screen.clientWidth, u_screen.scrollWidth);
				lv_mwin.id.style.height = t_height + "px";
				lv_mwin.id.style.width = t_width + "px";
				lv_mwin.fid.style.height = t_height + "px";
				lv_mwin.fid.style.width = t_width + "px";
			}
			setTimeout(fn_auto_refresh, 100);
		}
	}
	var fn_auto_refresh = function() {
		if (lv_mwin.active && lv_mwin.items.length > 0) {
			var t_obj = null;
			var t_height = 0;
			var t_width = 0;
			var u_screen = guifw.browsersize();
			for (var w_inx = 0; w_inx < lv_mwin.items.length; w_inx++) {
				t_obj = lv_mwin.items[w_inx];
				t_obj.style.overflow = "hidden";
				t_obj.style.margin = "0px";
				t_obj.style.height = "1px";
				t_obj.style.width = "1px";
				t_obj.style.left = "0px";
				t_obj.style.top = "0px";
				if (t_obj.guifwdata.resize == "off") {
					t_height = t_obj.guifwdata.height;
					t_width = t_obj.guifwdata.width;
				} else {
					if (t_obj.guifwdata.resize == "auto" || t_obj.guifwdata.resize == "height") {
						t_height = t_obj.scrollHeight;
						if (t_height == undefined || t_height == null || t_height < 1) t_height = t_obj.guifwdata.height;
					} else {
						t_height = t_obj.guifwdata.height;
					}
					if (t_obj.guifwdata.resize == "auto" || t_obj.guifwdata.resize == "width") {
						t_width = t_obj.scrollWidth;
						if (t_width == undefined || t_width == null || t_width < 1) t_width = t_obj.guifwdata.width;
					} else {
						t_width = t_obj.guifwdata.width;
					}
					if (t_height > (u_screen.clientHeight - 20) && t_obj.guifwdata.oversize != "auto" && t_obj.guifwdata.oversize != "height") {
						t_height = u_screen.clientHeight - 20;
						if (t_obj.guifwdata.height > 0 && t_obj.guifwdata.height > t_height) t_height = t_obj.guifwdata.height;
					}
					if (t_width > (u_screen.clientWidth - 20) && t_obj.guifwdata.oversize != "auto" && t_obj.guifwdata.oversize != "width") {
						t_width = u_screen.clientWidth - 20;
						if (t_obj.guifwdata.width > 0 && t_obj.guifwdata.width > t_width) t_width = t_obj.guifwdata.width;
					}
				}
				t_obj.style.height = Number(t_height) + "px";
				t_obj.style.width = Number(t_width) + "px";
				if (t_obj.guifwdata.top == -1) {
					if (u_screen.clientHeight > t_height) {
						t_obj.style.top = Number(Math.floor((u_screen.clientHeight - t_height) / 2) + u_screen.scrollTop) + "px";
					} else {
						t_obj.style.top = "8px";
					}
				}
				if (t_obj.guifwdata.left == -1) {
					if (u_screen.clientWidth > t_width) {
						t_obj.style.left = Number(Math.floor((u_screen.clientWidth - t_width) / 2) + u_screen.scrollLeft) + "px";
					} else {
						t_obj.style.left = "0px";
					}
				}
				t_obj.style.visibility = "visible";
				if (typeof(t_obj.guifwdata.resizeaction) == "function") t_obj.guifwdata.resizeaction(t_obj);
			}
		}
	}
	var fn_fade_inout = function() {
		var t_speed = lv_fade.speed;
		if ((lv_fade.alphacurrent != lv_fade.alphamax && lv_fade.inout == 1) || (lv_fade.alphacurrent != 0 && lv_fade.inout == -1)) {
			if ((lv_fade.alphamax - lv_fade.alphacurrent) < lv_fade.speed && lv_fade.inout == 1) {
				t_speed = lv_fade.alphamax - lv_fade.alphacurrent;
			} else if (lv_fade.alphacurrent < lv_fade.speed && lv_fade.inout == -1) {
				t_speed = lv_fade.alphacurrent;
			}
			lv_fade.alphacurrent = lv_fade.alphacurrent + (t_speed * lv_fade.inout);
			if (guifw.iefixneed()) {
				lv_mwin.id.style.filter = "alpha(opacity=" + lv_fade.alphacurrent + ")";
			} else {
				lv_mwin.id.style.opacity = lv_fade.alphacurrent * .01;
			}
		} else {
			if (lv_fade.timer) {
				clearInterval(lv_fade.timer);
				lv_fade.timer = null;
			}
			if (lv_fade.inout == -1) {
				document.body.removeChild(lv_mwin.id);
				lv_fade.alphacurrent = 0;
				lv_mwin.id = null;
				lv_mwin.fid = null;
				lv_mwin.active = false;
			}
		}
	}
	var fn_ajax_callback = function() {
		if (lv_ajax.id.readystate() == 4 && (lv_ajax.id.status() == 200 || window.location.href.indexOf("http") == -1)) {
			var t_obj = lv_ajax.conid;
			if (lv_ajax.timer) {
				clearTimeout(lv_ajax.timer);
				lv_ajax.timer = null;
			}
			if (t_obj != undefined && t_obj != null) {
				t_obj.style.visibility = "hidden";
				t_obj.style.left = "0px";
				t_obj.style.top = "0px";
				t_obj.innerHTML = lv_ajax.id.removescripts();
				lv_ajax.id.runscripts();
			}
		}
	}
	var fn_ajax_timeout = function() {
		if (lv_mwin.active && lv_ajax.timer) {
			clearTimeout(lv_ajax.timer);
			lv_ajax.id.abort();
			lv_ajax.conid.innerHTML = "";
			this.removeItem(lv_ajax.wname);
			if (lv_mwin.items.length == 0) this.timeout(100);
		}
	}
	var fn_get_item_id = function(i_name) {
		i_name = guifw.elementvalidname(i_name);
		if (i_name == null) return null;
		var t_obj = null;
		for (var w_inx = 0; w_inx < lv_mwin.items.length; w_inx++) {
			if (lv_mwin.items[w_inx].guifwdata.name == i_name) {
				t_obj = lv_mwin.items[w_inx];
				break;
			}
		}
		return t_obj;
	}
	return {
		active:function() {
			if (lv_mwin.id != undefined && lv_mwin.id != null && lv_mwin.active) {
				return true;
			} else {
				return false;
			}
		},
		open:function(i_parm) {
			if (lv_mwin.id == null && !lv_mwin.active) {
				var t_data = {color:"", image:"", alpha:50};
				if (i_parm != undefined) {
					if (i_parm.color != undefined) t_data.color = i_parm.color;
					if (i_parm.image != undefined) t_data.image = i_parm.image;
					if (i_parm.alpha != undefined && !isNaN(parseInt(i_parm.alpha))) t_data.alpha = parseInt(i_parm.alpha);
					var t_iefix = fn_iefix_need();
					var t_obj = document.createElement("div");
					t_obj.setAttribute("id", "guifw_modalwindow_background");
					t_obj.style.overflow = "hidden";
					t_obj.style.cursor = "not-allowed";
					t_obj.style.left = "0px";
					t_obj.style.top = "0px";
					if (t_iefix) {
						t_obj.style.position = "absolute";
						t_obj.style.height = "1px";
						t_obj.style.width = "1px";
					} else {
						t_obj.style.position = "fixed";
						t_obj.style.height = "100%";
						t_obj.style.width = "100%";
					}
					if (t_data.image != "") t_obj.style.background = "url(" + t_data.image + ") repeat 0px 0px";
					if (t_data.color != "") t_obj.style.backgroundColor = t_data.color;
					if (guifw.iefixneed()) {
						t_obj.style.filter = "alpha(opacity=0)";
					} else {
						t_obj.style.opacity = 0;
					}
					t_obj.style.zIndex = 10000;
					document.body.appendChild(t_obj);
					lv_mwin.id = t_obj;
					if (t_iefix) {
						var t_frm = document.createElement("iframe");
						t_frm.setAttribute("frameBorder", "0");
						t_frm.setAttribute("scrolling", "no");
						t_frm.style.filter = "mask()";
						t_obj.appendChild(t_frm);
						lv_mwin.fid = t_frm;
					}
					/*
					var t_img = document.createElement("img");
					t_img.src = guifw.defaultskinpath() + "guifw-modalwindow-close.png";
					t_img.style.height = "16px";
					t_img.style.width = "16px";
					t_img.style.border = "none";
					t_img.style.cursor = "pointer";
					t_img.onclick = this.close;
					t_obj.appendChild(t_img);
					*/
					lv_fade.alphamax = t_data.alpha;
					lv_ajax.id = new guifw.ajaxobject();
					lv_mwin.items = new Array();
					lv_mwin.active = true;
					fn_auto_resize();
					guifw.events.add(window, "resize", fn_auto_resize);
					guifw.events.add(window, "scroll", fn_auto_resize);
					lv_fade.inout = 1;
					lv_fade.timer = setInterval(fn_fade_inout, 10);
				}
			}
		},
		close:function(i_fade) {
			if (lv_mwin.id != null && lv_mwin.active) {
				guifw.tooltip.hide();
				guifw.events.remove(window, "scroll", fn_auto_resize);
				guifw.events.remove(window, "resize", fn_auto_resize);
				if (lv_ajax.timer) clearTimeout(lv_ajax.timer);
				for (var w_inx = 0; w_inx < lv_mwin.items.length; w_inx++) {
					var t_obj = lv_mwin.items[w_inx];
					while (t_obj.hasChildNodes()) {
						t_obj.removeChild(t_obj.lastChild);
					}
					document.body.removeChild(t_obj);
				}
				lv_mwin.id.style.cursor = "default";
				lv_ajax.id = null;
				lv_mwin.items = new Array();
				if (lv_fade.timer) clearInterval(lv_fade.timer);
				if (i_fade == undefined || i_fade == null || i_fade != "nofade") {
					lv_fade.inout = -1;
					lv_fade.timer = setInterval(fn_fade_inout, 10);
				} else {
					if (lv_fade.timer) {
						clearInterval(lv_fade.timer);
						lv_fade.timer = null;
					}
					document.body.removeChild(lv_mwin.id);
					lv_fade.alphacurrent = 0;
					lv_mwin.id = null;
					lv_mwin.fid = null;
					lv_mwin.active = false;
				}
			}
		},
		timeout:function(i_timer) {
			if (lv_mwin.id != null && lv_mwin.active) {
				if (i_timer != undefined && !isNaN(parseInt(i_timer))) {
					if (lv_mwin.timer) clearTimeout(lv_mwin.timer);
					lv_mwin.timer = setTimeout(this.close, i_timer);
				}
			}
		},
		cleartimeout:function() {
			if (lv_mwin.id != null && lv_mwin.active && lv_mwin.timer) {
				clearTimeout(lv_mwin.timer);
				lv_mwin.timer = null;
			}
		},
		addItem:function(i_name, i_parm) {
			if (!lv_mwin.active || i_name == undefined) return false;
			var t_data = {top:-1, left:-1, width:0, height:0, resize:"auto", oversize:"off", resizeaction:null, background:"none"};
			if (i_parm != undefined) {
				if (i_parm.top != undefined && !isNaN(parseInt(i_parm.top))) t_data.top = parseInt(i_parm.top);
				if (i_parm.left != undefined && !isNaN(parseInt(i_parm.left))) t_data.left = parseInt(i_parm.left);
				if (i_parm.width != undefined && !isNaN(parseInt(i_parm.width))) t_data.width = parseInt(i_parm.width);
				if (i_parm.height != undefined && !isNaN(parseInt(i_parm.height))) t_data.height = parseInt(i_parm.height);
				if (i_parm.resize != undefined) t_data.resize = String(i_parm.resize).toLowerCase();
				if (i_parm.oversize != undefined) t_data.oversize = String(i_parm.oversize).toLowerCase();
				if (i_parm.resizeaction != undefined && typeof(i_parm.resizeaction) == "function") t_data.resizeaction = i_parm.resizeaction;
				if (i_parm.background != undefined) t_data.background = String(i_parm.background);
			}
			i_name = guifw.elementvalidname(i_name);
			if (i_name == null) return false;
			for (var w_inx = 0; w_inx < lv_mwin.items.length; w_inx++) {
				if (lv_mwin.items[w_inx].guifwdata.name == i_name) return false;
			}
			w_inx = (lv_mwin.items.length + 1);
			if (w_inx < 1 || w_inx > 99) return false;
			var t_obj = document.createElement("div");
			t_obj.setAttribute("id", "guifw_modalwindow_" + i_name.toLowerCase());
			t_obj.style.position = "absolute";
			t_obj.style.overflow = "hidden";
			t_obj.style.margin = "10px";
			t_obj.style.height = "1px";
			t_obj.style.width = "1px";
			if (t_data.top == -1) {
				t_obj.style.top = "0px";
			} else {
				t_obj.style.top = Number(t_data.top) + "px";
			}
			if (t_data.left == -1) {
				t_obj.style.left = "0px";
			} else {
				t_obj.style.left = Number(t_data.left) + "px";
				}
			t_obj.style.background = t_data.background;
			t_obj.style.visibility = "hidden";
			t_obj.style.zIndex = 10000 + w_inx;
			t_obj.guifwdata = {name:i_name, top:t_data.top, left:t_data.left, width:t_data.width, height:t_data.height, resize:t_data.resize, visible:true};
			document.body.appendChild(t_obj);
			lv_mwin.items.push(t_obj);
			this.refreshItem(i_name);
			return true;
		},
		refreshItem:function(i_name) {
			if (lv_mwin.active && lv_mwin.items.length > 0 && i_name != undefined) {
				i_name = guifw.elementvalidname(i_name);
				if (i_name == null) return false;
				var t_obj = null;
				for (var w_inx = 0; w_inx < lv_mwin.items.length; w_inx++) {
					if (lv_mwin.items[w_inx].guifwdata.name == i_name) {
						t_obj = lv_mwin.items[w_inx];
						break;
					}
				}
				if (t_obj == undefined || t_obj == null) return false;
				t_obj.style.zIndex = 10001 + w_inx;
				fn_auto_refresh();
				return true;
			}
			return false;
		},
		resizeItem:function(i_name, i_parm) {
			if (lv_mwin.active && lv_mwin.items.length > 0 && i_name != undefined && i_parm != undefined) {
				var t_obj = fn_get_item_id(i_name);
				if (t_obj == undefined || t_obj == null) return false;
				if (i_parm.height != undefined && !isNaN(parseInt(i_parm.height))) t_obj.guifwdata.height = parseInt(i_parm.height);
				if (i_parm.width != undefined && !isNaN(parseInt(i_parm.width))) t_obj.guifwdata.width = parseInt(i_parm.width);
				if (i_parm.resize != undefined && i_parm.resize != "") t_obj.guifwdata.resize = String(i_parm.resize).toLowerCase();
				if (i_parm.oversize != undefined && i_parm.oversize != "") t_obj.guifwdata.oversize = String(i_parm.oversize).toLowerCase();
				if (i_parm.resizeaction != undefined && typeof(i_parm.resizeaction) == "function") t_obj.guifwdata.resizeaction = i_parm.resizeaction;
				if (i_parm.bgcolor) this.setItemBackground(i_name, {color:i_parm.bgcolor});
				if (i_parm.delay != undefined) {
					var t_delay = parseInt(i_parm.delay, 10);
					if (isNaN(t_delay)) t_delay = 100;
					setTimeout(fn_auto_refresh, t_delay);
				} else {
					fn_auto_refresh();
				}
				return true;
			}
			return false;
		},
		removeItem:function(i_name, i_close) {
			if (lv_mwin.active && lv_mwin.items.length > 0 && i_name != undefined) {
				i_name = guifw.elementvalidname(i_name);
				if (i_name == null) return false;
				guifw.tooltip.hide();
				var t_mwin_last_item = "";
				for (var w_inx = 0; w_inx < lv_mwin.items.length; w_inx++) {
					if (lv_mwin.items[w_inx].guifwdata.name == i_name) {
						var t_obj = lv_mwin.items[w_inx];
						lv_mwin.items.splice(w_inx, 1);
						while (t_obj.hasChildNodes()) {
							t_obj.removeChild(t_obj.lastChild);
						}
						document.body.removeChild(t_obj);
						if (i_close == 1 || lv_mwin.items.length == 0) {
							this.close();
						} else {
							this.showItems(0);
							if (t_mwin_last_item != "") this.activeItem(t_mwin_last_item, 1);
						}
						return true;
					}
					t_mwin_last_item = lv_mwin.items[w_inx].guifwdata.name;
				}
			}
			return false;
		},
		removeAll:function() {
			if (lv_mwin.active && lv_mwin.items.length > 0) {
				if (lv_ajax.timer) clearTimeout(lv_ajax.timer);
				for (var w_inx = 0; w_inx < lv_mwin.items.length; w_inx++) {
					var t_obj = lv_mwin.items[w_inx];
					while (t_obj.hasChildNodes()) {
						t_obj.removeChild(t_obj.lastChild);
					}
					document.body.removeChild(t_obj);
				}
				lv_mwin.items = new Array();
				return true;
			}
			return false;
		},
		activeItem:function(i_name, i_status) {
			if (lv_mwin.active && lv_mwin.items.length > 0 && i_name != undefined && i_status != undefined) {
				i_name = guifw.elementvalidname(i_name);
				if (i_name == null) return false;
				for (var w_inx = 0; w_inx < lv_mwin.items.length; w_inx++) {
					if (lv_mwin.items[w_inx].guifwdata.name == i_name) {
						if (parseInt(i_status) == 1) {
							lv_mwin.items[w_inx].style.zIndex = 10001 + w_inx;
							lv_mwin.items[w_inx].guifwdata.visible = true;
						} else {
							lv_mwin.items[w_inx].style.zIndex = 9999;
							lv_mwin.items[w_inx].guifwdata.visible = false;
						}
						return true;
					}
				}
			}
			return false;
		},
		showItems:function(i_status) {
			if (lv_mwin.active && lv_mwin.items.length > 0 && i_status != undefined) {
				for (var w_inx = 0; w_inx < lv_mwin.items.length; w_inx++) {
					if (parseInt(i_status) == 1) {
						lv_mwin.items[w_inx].style.zIndex = 10001 + w_inx;
						lv_mwin.items[w_inx].guifwdata.visible = true;
					} else {
						lv_mwin.items[w_inx].style.zIndex = 9999;
						lv_mwin.items[w_inx].guifwdata.visible = false;
					}
				}
				return true;
			}
			return false;
		},
		itemsCount:function() {
			if (lv_mwin.active && lv_mwin.items.length > 0) {
				return lv_mwin.items.length;
			} else {
				return 0;
			}
		},
		itemExist:function(i_name) {
			if (lv_mwin.active && lv_mwin.items.length > 0 && i_name != undefined) {
				var t_obj = fn_get_item_id(i_name);
				if (t_obj != undefined && t_obj != null) return true;
			}
			return false;
		},
		getItemId:function(i_name) {
			if (lv_mwin.active && lv_mwin.items.length > 0 && i_name != undefined) {
				var t_obj = fn_get_item_id(i_name);
				if (t_obj != undefined && t_obj != null) return t_obj;
			}
			return null;
		},
		getItemName:function(i_name) {
			if (lv_mwin.active && lv_mwin.items.length > 0 && i_name != undefined) {
				var t_obj = fn_get_item_id(i_name);
				if (t_obj != undefined && t_obj != null) return "guifw_modalwindow_" + t_obj.guifwdata.name;
			}
			return null;
		},
		setItemContent:function(i_name, i_parm) {
			if (lv_mwin.active && lv_mwin.items.length > 0 && i_name != undefined && i_parm != undefined) {
				var t_obj = fn_get_item_id(i_name);
				if (t_obj == undefined || t_obj == null) return false;
				if (lv_ajax.timer) clearTimeout(lv_ajax.timer);
				lv_ajax.timer = null;
				if (i_parm.html != undefined) {
					t_obj.innerHTML = i_parm.html;
					this.refreshItem(i_name);
				} else if (i_parm.urlpath != undefined) {
					var t_timer = 5000;
					var t_date = new Date();
					var t_urlpath = i_parm.urlpath;
					var t_urlparm = "";
					if (t_urlpath.indexOf("?") == -1) {
						t_urlpath += "?";
					} else {
						t_urlpath += "&";
					}
					t_urlpath += "rndseed=" + t_date.getTime();
					if (i_parm.urlparm != undefined) t_urlparm = i_parm.urlparm;
					if (i_parm.timeout != undefined) t_timer = parseInt(i_parm.timeout);
					if (isNaN(t_timer)) t_timer = 5000;
					lv_ajax.conid = t_obj;
					lv_ajax.wname = t_obj.guifwdata.name;
					lv_ajax.timer = setTimeout(fn_ajax_timeout, t_timer);
					lv_ajax.id.post(t_urlpath, t_urlparm, fn_ajax_callback);
				}
				return true;
			}
			return false;
		},
		setItemBackground:function(i_name, i_parm) {
			if (lv_mwin.active && lv_mwin.items.length > 0 && i_name != undefined && i_parm != undefined) {
				var t_obj = fn_get_item_id(i_name);
				if (t_obj == undefined || t_obj == null) return false;
				if (i_parm.image != undefined) {
					if (i_parm.image == "") {
						t_obj.style.background = "none";
					} else {
						t_obj.style.background = "url(" + i_parm.image + ") center center no-repeat";
					}
				} else if (i_parm.color != undefined) {
					t_obj.style.backgroundColor = i_parm.color;
				} else {
					return false;
				}
				return true;
			}
			return false;
		}
	}
}();

