//////////////////////////////////////////////////////////////////////////////////////////////////
// CLASS Utils
//////////////////////////////////////////////////////////////////////////////////////////////////
function Utils () {

}

//////////////////////////////////////////////////////////////////////////////////////////////////
// GEOMETRY-SECTION
//////////////////////////////////////////////////////////////////////////////////////////////////

Utils.GEOM = {};

Utils.GEOM.getElemInfos = function (elem) {
	try {
		var infos = {};
		infos["width"] = elem.scrollWidth;
		infos["height"] = elem.scrollHeight;
		infos["inner_width"] = elem.clientWidth;
		infos["inner_height"] = elem.clientHeight;
		infos["left"] = getElementXPos(elem);
		infos["top"] = getElementYPos(elem);
		infos["tag"] = elem.nodeName;
		infos["has_children"] = elem.childNodes.length;
		infos["parent"] = elem.parentNode;
		return infos;
	}
	catch (e) {
		return null;
	}
}

Utils.GEOM.getElementYPos = function (elem) {
	var y = 0, t = null;
	t = elem;
	try {
		y = t.offsetTop;
		while (t && t != document) {
			y += t.offsetTop;
			t = t.offsetParent;
		}
	} catch (e) {
		var str="";
		for (var i in e) {
			str+=""+i+": "+e[i]+", ";
		}
		alert(str);
	}
	return y;
}

Utils.GEOM.getElementXPos = function (elem) {
	var x = 0, t = null;
	t = elem;
	try {
		while (t && t != document) {
			x += t.offsetLeft;
			t = t.offsetParent;
		}
	} catch (e) {
		var str="";
		for (var i in e) {
			str+=""+i+": "+e[i]+", ";
		}
		alert(str);
	}
	return x;
}


Utils.GEOM.eventX = function (event) {
	if (Browser.is(IE)) {
		return event.clientX;
	}
	else if (Browser.is(FX)) {
		return event.pageX;
	}
}

Utils.GEOM.eventY = function (event) {
	if (Browser.is(IE)) {
		return event.clientY;
	}
	else if (Browser.is(FX)) {
		return event.pageY;
	}
}

Utils.GEOM.getElemIntersection = function (elem1, elem2) {
	try {
		var eRect1 = Utils.GEOM.Shape.rectFromDOMNode(elem1);
		var eRect2 = Utils.GEOM.Shape.rectFromDOMNode(elem2);
		if (eRect1 == null || eRect2 == null)
			throw new Error("Could not create shapes for elements...");
		return eRect1.intersectionTest(eRect2);
	}
	catch (e) { 
		show(e);
	}
}

Utils.GEOM.Shape = function () {	
	this._vertexes = [];
	this._width = 0.0;
	this._height = 0.0;
	this._x = 0.0;
	this._y = 0.0;
}

Utils.GEOM.Shape.rectFromDOMNode = function (node) {
	try {
		var elemInfos = Utils.GEOM.getElemInfos(node);
		var rect = {x: elemInfos.left, y: elemInfos.top, w: elemInfos.width, h: elemInfos.height};
		var shape = new Utils.GEOM.Shape_Rectangle(rect);
		return shape;
	}
	catch (e) {
		return null;
	}
}

Utils.GEOM.Shape.prototype.getWidth = function () {
	return this._width;
}

Utils.GEOM.Shape.prototype.getHeight = function () {
	return this._height;
}

Utils.GEOM.Shape.prototype.getX = function () {
	return this._x;
}

Utils.GEOM.Shape.prototype.getY = function () {
	return this._y;
}

Utils.GEOM.Shape.prototype.getBounds = function () {
	return {x: this._x, y: this._y, width: this._width, height: this._height, bounding_box: {x1: this._x, y1: this._y, x2: this._x+this._width, y2: this._y+this._height}};
}

Utils.GEOM.Shape.prototype.transform2D = function (kernel) {

}

Utils.GEOM.Shape_Rectangle = function (rect) {
	this._makeGeometry(rect);
}

Utils.GEOM.Shape_Rectangle.prototype = new Utils.GEOM.Shape();

Utils.GEOM.Shape_Rectangle.prototype._makeGeometry = function (rect) {
	try {
		if (rect.w != undefined) {
			this._x = rect.x;
			this._y = rect.y;
			this._width = rect.w;
			this._height = rect.h;
		}
		else if (rect.x1 != undefined) {
			this._x = rect.x1;
			this._y = rect.y1;
			this._width = rect.x2 - rect.x1;
			this._height = rect.y2 - rect.y1;
		}
		/*this._vertexes.push({x: rect.x, y: rect.y});
		this._vertexes.push({x: rect.x, y: rect.y+rect.h});
		this._vertexes.push({x: rect.x+rect.w, y: rect.y+rect.h});
		this._vertexes.push({x: rect.x+rect.w, y: rect.y});*/
	}
	catch (e) {
		show(e);
	}
}

Utils.GEOM.Shape_Rectangle.prototype.intersectionTest = function (shape) {
	try {
		var bb1 = this.getBounds().bounding_box;
		var bb2 = shape.getBounds().bounding_box;
		var rparm = {x1: Math.max(bb1.x1, bb2.x1),
					 y1: Math.max(bb1.y1, bb2.y1),
					 x2: Math.min(bb1.x2, bb2.x2),
					 y2: Math.min(bb1.y2, bb2.y2)
					 }
		if (rparm.x2 > rparm.x1 && rparm.y2 > rparm.y1) {
		//if (!((bb1.x1 > bb2.x2) || (bb2.x1 > bb1.x2) || (bb1.y1 < bb2.y2) || (bb2.y1 < bb1.y2))) {
			return new Utils.GEOM.Shape_Rectangle(rparm);
		}
		else {
			return false;
		}
	}
	catch (e) {
	
	}
}

//////////////////////////////////////////////////////////////////////////////////////////////////
// DV-SECTION
//////////////////////////////////////////////////////////////////////////////////////////////////

Utils.transformCssSelector = function (selector) {
	var chunks = selector.split('-');
	var transformed = "", i;
	for (i = 0; i < chunks.length; i++) {
		if (i == 0)
			transformed += new String(chunks[i]).toLowerCase();
		else 
			transformed += new String(chunks[i]).substr(0,1).toUpperCase()+new String(chunks[i]).substring(1,chunks[i].length).toLowerCase();
	}
	return transformed;
};

Utils.getHTMLBody = function () {
	var wnd;
	if (arguments.length == 1) {
		wnd = arguments[0];
	}
	else {
		wnd = self;
	}
	if (wnd.document.getElementsByTagName("BODY")[0] == undefined) {
		return null;
	}
	return wnd.document.getElementsByTagName("BODY")[0];
}

Utils.strtrim = function (str) {
	var s = 0, e = 0, chrS = '', chrE = '', sFound = false, eFound = false, sl = 0;
	sl = str.length;
	for (var i = 0; i < sl; i++) {
		chrS = str.charAt(i);
		chrE = str.charAt((sl-1)-i);
		if ((chrS != " " && chrS != "\134t" &&  chrS != "\134r" &&  chrS != "\134n" &&  chrS != "\1340") && sFound == false) {
			s=i;
			sFound = true;
		}
		if ((chrE != " " && chrE != "\134t" &&  chrE != "\134r" &&  chrE != "\134n" &&  chrE != "\1340") && eFound == false) {
			e=((sl)-i);
			eFound = true;
		}
		if (sFound == true && eFound == true) 
			break;
	}
	var result = new String(str).substring(s, e);
	return (arguments.length == 2) ? ((Utils.strtrim(result) == "&nbsp;") ? "" : ((escape(result) == "%A0") ? "" : result)) : result;
}

Utils.parseCSS = function (css) {
	var error = false;
	var cssDefs = {};
	if (typeof css != 'string') return false;
	if (css.length == 0) return null;
	css = Utils.strtrim(css);
	var styles = css.split(';');
	for (var i = 0; i < styles.length; i++) {
		var cssDef = styles[i];
		var pair = cssDef.split(':');
		if (pair.length != 2) {
			error = true;
			continue;
		}
		var prop = Utils.strtrim(pair[0]);
		var value = Utils.strtrim(pair[1]);
		prop = Utils.transformCssSelector(prop);
		cssDefs[""+prop] = ""+value;
	}
	return (error == true) ? false : cssDefs;
};

Utils.applyCSS = function (css, target) {
	try {
		var i;
		var styles = Utils.parseCSS(css);
		if (styles == false) return false;
		for (i in styles) {
			target.style[""+i] = styles[i];
		}
		return true;
	}
	catch (e) {
		show("Utils.applyCSS");
		show(e);
		show(styles);
	}
}

Utils.isUniqueID = function (doc, id) {
	id = ""+new String(id);
	if (typeof id != 'string') return false;
	if (id.length == 0) return false;
	if (doc == null) doc = document;
	return (document.getElementById(id) == undefined) ? true : false;
}

Utils.createUniqueID = function (id) {
	var rnd = new String(""+Math.random()).replace(/\./g, '').substr(0, 4);
	var ts = new String(""+ (new Date.getTime())).substr(0, 4);
	var newId = "";
	for (var i = 0; i < ts.length; i++) {
		newId += rnd.charAt(i);
		newId += ts.charAt(i);
	}
	return ""+id+"_"+newId;
} 

Utils.inArray = function (arr, val) {
	var inArr = false;
	if (arr == undefined || arr == null || arr.join == undefined) return inArr;
	if (arr.length == 0) return inArr;
	for (var i = 0; i < arr.length; i++) {
		if (arr[i] == val) {
			inArr = true;
			break;
		}
	}
	return inArr;
}

Utils.obj2arr = function (obj) {
	var arr = [];
	var i;
	for (i = 0; i < obj.length; i++) {
		if (typeof(obj[i]) != 'function')
			arr.push(obj[i]);
	}
	return arr;
}

Utils.ObjectIterator = function (obj) {
	this._START = 0;
	this._PTR = 0;
	this._END = 0;
	this._client = obj;
	this._keySet = [];
	this._init();
}

Utils.ObjectIterator.prototype._init = function () {
	var iK;
	var obj = this._client;
	if (obj.length != undefined) {
		for (iK = 0; iK < obj.length; iK++) {
			this._keySet.push(iK);
		}
	}
	else {
		for (iK in obj) {
			this._keySet.push(iK);
		}
	}
	this._START = 0;
	this._PTR = parseInt(this._START);
	this._END = (this._keySet.length)-1;
	return true;
}

Utils.ObjectIterator.prototype.previous = function () {
	if ((this._PTR-1) < 0) {
		throw new Error("index out of bounds exception");
		return false;
	}
	else {
		this._PTR--;
		return this._client[this._keySet[this._PTR]];
	}
}

Utils.ObjectIterator.prototype.current = function () {
	return this._client[this._keySet[this._PTR]];
}

Utils.ObjectIterator.prototype.next = function () {
	if (this.hasNext() == false) {
		throw new Error("index out of bounds exception...");
		return false;
	}
	else {
		this._PTR++;
		return this._client[this._keySet[this._PTR]];
	}
}

Utils.ObjectIterator.prototype.hasNext = function () {
	return (this._PTR <= this._END);
}

Utils.ObjectIterator.prototype.hasOffset = function (ofs) {
	return (((this._PTR+ofs) >= 0) && ((this._PTR+ofs) <= this._END));
}

Utils.ObjectIterator.prototype.hasPrevious = function () {
	return (this._PTR > this._START);
}

Utils.ObjectIterator.prototype.offset = function (ofs) {
	var check = (this._PTR+ofs);
	if (this.hasOffset(ofs) == false) {
		throw new Error("index out of bounds exception");
		return false;
	}
	else {
		return this._client[this._keySet[check]];
	}
}

Utils.ObjectIterator.prototype.rewind = function () {
	this._PTR = parseInt(this._START);
}

Utils.ObjectIterator.prototype.start = function () {
	return this._client[this._keySet[this._START]];
}

Utils.ObjectIterator.prototype.end = function () {
	return this._client[this._keySet[this._END]];
}

Utils.TYPE_FORMATS = ['s', 'S', 'd', 'b', 'x', 'X', 'f', 'F'];
Utils.TYPE_OCFG = ['s', 'S', 'd', 'b', 'x', 'X', 'f', 'F'];

Utils.sprintf = function (fmtStr) {
	var tockens = fmtStr.split('%');
	var mkCount = 0;
	var buffer = "";
	var args = Utils.obj2arr(arguments);
	args.shift();
	
	for (var i = 0; i < tockens.length; i++) {
		var t = tockens[i];
		var t_buffer = "";
		if (i == 0 && fmtStr.charAt(i) != "%") {
			buffer += t;
			continue;
		}
		//if (t == "") {
		if (false) {
			t_buffer = "%"+tockens[++i];
		}
		if (true) {
			var cfg = "";
			var fT = "";
			var j = 0;
			var k = 0;
			var val;
			for (; j < t.length; j++) {
				if (j == 0) {
					while (Utils.inArray(['0','1','2','3','4','5','6','7','8','9','.'], t.charAt(j))) {
						k = j++;
					}
					if (Utils.inArray(['s', 'S', 'd', 'b', 'x', 'X', 'f', 'F'], t.charAt(j))) {	
						fT = t.charAt(j);
						mkCount++;
						if (args.length == 0) {
							alert("too few arguments...");
							return false;
						}
						else {
							val = args.shift();
						}
						j++;
						break;
					}
				}
			}
			cfg = t.substr(0, k);
			switch (fT) {
				case 's':
					t_buffer += ""+val;
					break;
					
				case 'S':
					t_buffer += new String(""+val).toUpperCase();
					break;
					
				case 'd':
					t_buffer += ""+parseInt(""+val);
					break;
					
				case 'b':
					var itNum = Math.ceil((Math.log(8)/Math.LN2));
					var intVal = parseInt(val);
					for (var it = itNum; it >= 0; it--) {
						t_buffer += (((intVal >> it) & 1) == 1) ? "1" : "0";
					}
					break;
					
				case 'x':
					break;
					
				case 'X':
					break;
					
				case 'f':
					t_buffer += ""+ new Number(""+val).toString();
					break;
					
				case 'F':
					break;
			}
			t_buffer += t.substr(j);
		}
		buffer += t_buffer;
	}
	return buffer;
	
	return;
	if (tockens.length > arguments.length)
	var buffer = "";
	for (var i = 0; i < tockens.length; i++) {
	}
}
			
Utils.stripPath = function (fileName) {
	var chunks;
	if (fileName.match(/\\/g)) {
		chunks = fileName.split("\\");
	}
	else {
		chunks = fileName.split("/");
	}
	return chunks[(chunks.length - 1)];
}

//////////////////////////////////////////////////////////////////////////////////////////////////
// DEBUGGING-SECTION
//////////////////////////////////////////////////////////////////////////////////////////////////

Utils.DEBUG = {};

Utils.DEBUG.DBG_ACTIVE = false;

Utils.DEBUG.DBG_DISPLAY_MODE = 'NORMAL';

Utils.DEBUG.showObj = function (obj) {
	var i, str = "", lb = "\n";
	if (arguments.length == 2) {
		lb = new String(arguments[1]);
	}
	for (i in obj) {
		if (typeof obj[i] != 'function') {
			str += ''+i+': '+obj[i]+lb;
		}
	}
	return str;
}

Utils.DEBUG.show = function (thing) {
	var msg;
	if (typeof thing == 'object') {
		msg = Utils.DEBUG.showObj(thing);
	}
	else {
		msg = new String(thing);
	}
	Utils.DEBUG.debug(msg);
}

Utils.DEBUG.debug = function (msg) {
	if (!Utils.DEBUG.DBG_ACTIVE) return;
	switch (Utils.DEBUG.DBG_DISPLAY_MODE) {
		case 'ALERT':
			alert(msg);
			break;
			
		default:
			alert(msg);
			break;
	}
}

//////////////////////////////////////////////////////////////////////////////////////////////////
// BROWSER-DETECTOR
//////////////////////////////////////////////////////////////////////////////////////////////////
var IE, FX, NS, OP, IE3, IE4, IE4UP, IE5, 
	IE55, IE55UP, IE6, IE7, FX1, FX2, NS4, 
	NS4UP, NS6, NS6UP, OP4, OP5, OP5UP;
	
var BROWSER, MAX_BROWSER_VERSION, GENERALISATION_SHIFT, BROWSERTYPE_SHIFT, VERSION_MASK;

Utils.Browser = function () {}
		
Utils.Browser._detected = false;
		
Utils.Browser.sniff = function () {
	IE = 0x10000000;
	FX = 0x20000000;
	NS = 0x40000000;
	OP = 0x50000000;

	IE3 = 0x00000001;
	IE4 = 0x00000002;
	IE4UP = 0x01000000;
	IE5 = 0x00000008;
	IE55 = 0x0000000f;
	IE5UP = 0x02000000;
	IE55UP = 0x04000000;
	IE6 = 0x0000004f;
	IE7 = 0x0000008f;

	FX1 = 0x00000100;
	FX2 = 0x00000200;

	NS4 = 0x00001000;
	NS4UP = 0x06000000;
	NS6 = 0x00004000;
	NS6UP = 0x08000000;

	OP4 = 0x00010000;
	OP5 = 0x00020000;
	OP5UP = 0x0c000000;

	BROWSER = 0x00000000;
	MAX_BROWSER_VERSION = OP5;
	GENERALISATION_SHIFT = 24;
	BROWSERTYPE_SHIFT = 28;
	VERSION_MASK = 0x000fffff;

	var browser = navigator.userAgent.toLowerCase();
	var majorRelease = parseInt(navigator.appVersion);
	var revision = parseFloat(navigator.appVersion);

	if ((browser.indexOf('mozilla')!=-1) && (browser.indexOf('spoofer')==-1) && (browser.indexOf('compatible') == -1) && (browser.indexOf('opera')==-1) && (browser.indexOf('webtv')==-1) && (browser.indexOf('hotjava')==-1)) {
		//ist es netscape
		BROWSER |= NS;
		if (majorRelease == 4) {
			BROWSER |= NS4;
		}
		if (majorRelease >= 4) {
			BROWSER |= NS4UP;
		}
		if (majorRelease == 5) {
			BROWSER |= NS6;
		}
		if (majorRelease >= 5) {
			BROWSER |= NS6UP;

			if (browser.indexOf('gecko') != -1) {	
				BROWSER = 0x00000000;
				BROWSER |= FX;
				BROWSER |= FX2;
			}
		}
	}

	if ((browser.indexOf("msie") != -1) && (browser.indexOf("opera") == -1)) {
		BROWSER |= IE;
		if (majorRelease < 4) {
			BROWSER |= IE3;
		}
		if ((majorRelease == 4) && (browser.indexOf("msie 5")==-1) && (browser.indexOf("msie 5")!=-1) && (browser.indexOf("msie 6") !=-1) && (browser.indexOf("msie 7") !=-1)) {
			BROWSER |= IE4;
		}
		if (majorRelease >= 4) {
			BROWSER |= IE4UP;
		}
		if ((majorRelease == 4) && (browser.indexOf("msie 5.0")!=-1)) {
			BROWSER |= IE5;
		}
		if ((majorRelease == 4) && (browser.indexOf("msie 5.5") !=-1)) {
			BROWSER |= IE55;
		}
		if ((BROWSER != (IE | IE3)) && (BROWSER != (IE | IE4))) {
			BROWSER |= IE5UP;
		}
		if ((BROWSER != (IE | IE3)) && (BROWSER != (IE | IE4)) && (BROWSER != (IE | IE5))) {
			BROWSER |= IE55UP;
		}
		if ((majorRelease == 4) && (browser.indexOf("msie 6.0") !=-1)) {
			BROWSER |= IE6;
		}
		if ((majorRelease == 4) && (browser.indexOf("msie 7.0") !=-1)) {
			BROWSER |= IE7;
		}
	}

	if (browser.indexOf("opera") != -1) {
		BROWSER |= OP;
		if (browser.indexOf("opera 4") != -1) {
			BROWSER |= OP4;
		}
		if ((majorRelease == 5)) {
			BROWSER |= OP5;
		}
		if ((majorRelease >=5)) {
			BROWSER |= OP5UP;
		}
	}
	this._detected = true;
}
		
Utils.Browser.is = function (flg) {
	if (this._detected == false) {
		this.sniff();
	}
	var generalisationResult = true;
	var check = 0x00000000;
	switch (BROWSER >> 28) {
		case 0x1:
			check |= IE;
			break;
			
		case 0x2:
			check |= FX;
			break;
			
		case 0x4:
			check |= NS;
			break;
			
		case 0x5:
			check |= OP;
			break;
	}
	
	if (flg <= MAX_BROWSER_VERSION) {
		return ((flg == (BROWSER & VERSION_MASK))) ? true : false;
	}
	else {
		var shift = Math.ceil((Math.log(flg)/Math.LN2));
		if (shift >= GENERALISATION_SHIFT && shift <= BROWSERTYPE_SHIFT) {
			var generalisation = ((BROWSER >> shift) & 0xf);
			var gVal = ((flg >> shift) & 0xf);
			generalisationResult = new Boolean((generalisation & gVal));
			return (generalisationResult == true) ? true : false;
		}
		else {
			return ((check == flg)) ? true : false;
		}
	}
}

//////////////////////////////////////////////////////////////////////////////////////////////////
// CROSS-BROWSER-EVENTHANDLING
//////////////////////////////////////////////////////////////////////////////////////////////////
		
Utils.EVENTS = {};		
		
Utils.EVENTS.CB_addEventListener = function (listener, evID) {
	try {
		if (Browser.is(IE)) {
			if (Browser.is(IE5UP)) {
				if (Browser.is(IE7)) {
					listener.attachEvent("on"+evID, arguments[2]);
				}
				else {
					if (listener.attachEvent) {
						listener.attachEvent("on"+evID, arguments[2]);
					}
					else {
						listener["on"+evID] = arguments[2];
					}
				}
			}
		}
		else if (Browser.is(FX)) {
			if (listener.attachEvent) {
				listener.attachEvent("on"+evID, arguments[2]);
			}
			else {
				listener.addEventListener(evID, arguments[2], arguments[3]);
			}
		}
	}
	catch (e) {
		show(e);
	}
}

Utils.EVENTS.CB_removeEventListener = function (listener, evID) {
	try {
		if (Browser.is(IE)) {
			if (Browser.is(IE5UP)) {
				if (Browser.is(IE7)) {
					listener.detachEvent("on"+evID, arguments[2]);
				}
				else {
					if (listener.detachEvent) {
						listener.detachEvent("on"+evID, arguments[2]);
					}
					else {
						delete listener["on"+evID];
						listener["on"+evID] = function () {};
					}
				}
			}
		}
		else if (Browser.is(FX)) {
			if (listener.detachEvent) {
				listener.detachEvent("on"+evID);
			}
			else {
				listener.removeEventListener(evID, arguments[2], arguments[3]);
			}
		}
	}
	catch (e) {
		show(e);
	}
}

Utils.EVENTS.CB_getEvent = function (argVector) {
	try {
		if (Browser.is(IE)) {
			if (Browser.is(IE7)) {
				if (argVector.length != undefined) {
					argVector[0].cancelBubble = true;
					return argVector[0];
				}
				else {
					if (typeof(argVector) == 'object') {
						return argVector;
					}
					else {
						throw new error("Could not get event...");
					}
				}
			}
			else {
				if (document.attachEvent) {
					if (argVector.length != undefined) {
						return argVector[0];
					}
					else {
						if (typeof(argVector) == 'object') {
							return argVector;
						}
						else {
							throw new error("Could not get event...");
						}
					}
				}
				else {
					if (typeof(argVector) == 'object') {
						return argVector;
					}
					else {
						throw new error("Could not get event...");
					}
				}
			}
		}
		else if (Browser.is(FX)) {
			argVector[0].cancelBubble = true;
			return argVector[0];
		}
	}
	catch (e) {
		show(e);
		return null;
	}
}

Utils.EVENTS.CB_getEventTarget = function () {	
	var ev = CB_getEvent(arguments[0]);
	if (ev == null) ev = arguments[1];  
	if (Browser.is(IE)) {
		if (ev.type != undefined) {
			if (Browser.is(IE7)) {	
				var lowest = ev.srcElement;
				return (lowest != null) ? lowest : ev.fromElement; 
			}
			else {
				var lowest = ev.srcElement;
				return (lowest != null) ? lowest : ev.fromElement; 
			}
		}
		else {
			return ev;
		}
	}
	else if (Browser.is(FX)) {
		if (ev.type != undefined) {
			var lowest = ev.currentTarget;
			return lowest;
		}
		else {
			return ev;
		}
	}
};

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////	
	sprintf = Utils.sprintf;
	getElemInfos = Utils.GEOM.getElemInfos;
	getElementXPos = Utils.GEOM.getElementXPos;
	getElementYPos = Utils.GEOM.getElementYPos;
	getElemIntersection = Utils.GEOM.getElemIntersection;
	cb_eventX = Utils.GEOM.eventX;
	cb_eventY = Utils.GEOM.eventY;
	strtrim = Utils.strtrim;
	show = Utils.DEBUG.show;
	stripPath = Utils.stripPath;
	ObjectIterator = Utils.ObjectIterator;
	Browser = Utils.Browser;
	CB_addEventListener = Utils.EVENTS.CB_addEventListener;
	CB_removeEventListener = Utils.EVENTS.CB_removeEventListener;
	CB_getEvent = Utils.EVENTS.CB_getEvent;
	CB_getEventTarget = Utils.EVENTS.CB_getEventTarget;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
