/* * TIMETOACT Object Module (TOM) * copyright by TIMETOACT GmbH, Cologne (2007) *//* * to be integrated/developed: * - web 2.0 function lib aus timetoweb? * - event adder/modifier * - class/attribute adder/modifier * Set aSource etc. in e.g. Array.prototype.begins as lokal variable, not as global (var forgotten!)  */function isArray(oSource) {	try{		var bIsArray = true;		if(!oSource || !oSource.hasOwnProperty || !(oSource instanceof Array) ) { // checking for "!oSource.hasOwnProperty" avoids known memory leak with "instanceof" on "document" and "window" object in IE because instanceof is not executed in those cases, because in IE those objects don't have a "hasOwnProperty" method				bIsArray = false;		}		return bIsArray;	}catch(e){TOM.ee(TOM.ei("isArray",this),e);return false;}}/** @id TOM */if (!TOM) {	var TOM = {        //Variables & Constants		VERSION: "0.2",		NEWLINE: "\n",		// Global flag for debugging 		DEBUG:false,		/** @id TOM.alert */		// General alert function, use instead normal alert for future improvements (like nice inline layer messages, instead of grey alert box)   		alert:function (sMessage) {			alert(sMessage);		},				// createFunctionInfoObj is DEPRICATED use ei (for errorInfo -> shorter!) instead		createFunctionInfoObj:function (sFunctionName, vThisElement, sReturnType, sSourceFile) {// for backwards compatibility to TOM 0.1, use ei instead			TOM.ei(sFunctionName, vThisElement, sReturnType, sSourceFile);		},		// General function information, added to error information in error handling function 		ei:function (sFunctionName, vThisElement, sReturnType, sSourceFile) {			var sCaller;			try{				sCaller = vThisElement.caller;			}catch(e){				sCaller = "undefined";			}			sReturnType = (typeof sReturnType === "undefined")?"undefined":sReturnType;			sSourceFile = (typeof sSourceFile === "undefined")?"undefined":sSourceFile;						// create function info element based on parameter values			var oFunctionInfo = {};			oFunctionInfo.FunctionName = sFunctionName;			oFunctionInfo.ThisElement = vThisElement;			oFunctionInfo.Caller = sCaller;			oFunctionInfo.ReturnType = sReturnType;			oFunctionInfo.SourceFile = sSourceFile;			// add further individuall information, that are handed over as further parameters of the "createFunctionInfoObj" function			return oFunctionInfo;		},		// Standard error information for intercepted errors		createErrorInfoObj:function(cErrorLevel, cErrorType, cErrorCode, sMessage, sErrorID) {			var sCaller;			var oErrorInfo = {};			oErrorInfo.ErrorLevel=cErrorLevel;			oErrorInfo.ErrorType=cErrorType;			oErrorInfo.ErrorCode=cErrorCode;			oErrorInfo.Message=sMessage;			oErrorInfo.ErrorID=sErrorID;			return oErrorInfo;		}, 		// Global error constants object  		ERROR:{			NEWLINE: "\n",			// Error Levels			LEVEL:{ 				INFO: "[1] Information",				WARNING: "[2] Warnung",				ERROR: "[3] Fehler"			},			// Error types			TYPE:{				USERERROR: "UserError",				CONTENTERROR: "ContentError",				TYPEERROR: "TypeError",				UNEXPECTEDERROR: "UnexpectedError"			},			// Standardized error messages			/** @id TOM.ERROR.MESSAGE */			MESSAGE:{				STRINGNOTFOUND: "Zeichenkette wurde nicht gefunden",				STRINGISEMPTY: "Die Zeichenkette ist leer",				STRINGEXPECTED: "Zeichenketten erwartet",				NUMBEREXPECTED: "Zahl erwarted",				POSITIVENUMBEREXPECTED:"Zahl >= 0 erwarted",				NEGATIVENUMBEREXPECTED:"Zahl < 0 erwarted",				BOOLEANEXPECTED: "Wahr (true) oder Falsch (false) erwarted",				OBJECTEXPECTED: "Object erwarted"			},			/** @id TOM.ERROR.ERROROBJECT */			ERROROBJECT:function(sErrorMsg) {				this.msg = sErrorMsg;				return this.msg;			}		},		// General error handling for all scripts, to be modified by SWA, just my way of using it right now ;-)		// handleError is DEPRICATED use ee (for 'error entry' -> shorter!) instead		handleError:function(oFunctionInfo,oError) { // for backwards compatibility to TOM 0.1, use ee instead			TOM.ee(oFunctionInfo,oError);		},		ee:function (oFunctionInfo,oError) {			var sErrorMsg = "";			var e;			for (e in oFunctionInfo) {				if(oFunctionInfo.hasOwnProperty(e)) {					sErrorMsg += e + "=" + oFunctionInfo[e]+TOM.ERROR.NEWLINE;				}			}			for (e in oError) {				if (oError.hasOwnProperty(e)) {					sErrorMsg += e + "=" + oError[e] + TOM.ERROR.NEWLINE;				}			}			if (TOM.DEBUG) {				TOM.alert("An Error occured! Detailed error description:" + TOM.ERROR.NEWLINE+sErrorMsg);			}			//var error = new TOM.ERROR.LEVEL.ERROROBJ(sErrorMsg);			//error.prototype = Error; 			//throw error;		},		// Logging Function		log:function(vElement,iMaxlevel){			this.init = function(vNewElement, iNewMaxlevel) {				oSource.NEWLINE = "\n"; //"<br>";				oSource.INDENT = "\t"; //"&nbsp;&nbsp;&nbsp;&nbsp;";				oSource.text = "TOM Log:" + oSource.NEWLINE;				oSource.vElement = vNewElement;				oSource.maxLevel = (typeof iNewMaxlevel == "number")?iNewMaxlevel:-1;			};			this.add = function(sLogMessage,iLevel) {				var sLevelIndent="";				if(typeof iLevel == "number") {					for(var c=1;c<=iLevel; c++) {						sLevelIndent += oSource.INDENT;					}				} else {					iLevel = 0;				}				if (oSource.maxLevel === -1 || iLevel <= oSource.maxLevel) {					oSource.text += sLevelIndent + sLogMessage + oSource.NEWLINE;				}			};			this.clear = function() {				oSource.init();			};			this.show = function() {				var vContainer;								this.printToNode = function(vContainer){					if(vContainer && vContainer.value) {						vContainer.value = oSource.text;					} else if(vContainer && vContainer.innerHTML){						vContainer.innerHTML = oSource.text;					}				};				if(oSource.vElement) {					switch(typeof oSource.vElement){						case "string":							vContainer = document.getElementById(oSource.vElement);							if(!vContainer) {								vContainer = document.getElementsByName(oSource.vElement);								if(vContainer && vContainer[0]) {									vContainer = vContainer[0];								}							}							this.printToNode(vContainer);														break;						case "object":							vContainer = vElement;							this.printToNode(vContainer);							break;						case "function":							vContainer = vElement;							vContainer(oSource.text);							break;						default:							alert(oSource.text);							break;					}				} else {					alert(oSource.text);				}				return oSource.text;			};			try {				var oSource = this;				oSource.init(vElement,iMaxlevel);			}catch(e){TOM.ee(TOM.ei("TOM.log",this),e);return "An error occured in TOM.log";}		}	};}/** @id TOM.ajax */TOM.ajax = function (fHandleRequest, fHandleError, fHandleReadyState) {	var oSource = this;		this.createXMLHttpReqObj = function(){		var oXmlHttpReq = null;		try {			oXmlHttpReq = new ActiveXObject("Msxml2.XMLHTTP");			return oXmlHttpReq;		}		catch (e) {			try {				if (typeof ActiveXObject !== "undefined") {					oXmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");					return oXmlHttpReq;				} else {					if (typeof XMLHttpRequest !== "undefined") {						oXmlHttpReq = new XMLHttpRequest();						return oXmlHttpReq;					} else {						return false;					}				}			}			catch (e2) {				try {					oXmlHttpReq = new XMLHttpRequest();					return oXmlHttpReq;				}				catch (e3) {					oXmlHttpReq = false;					return oXmlHttpReq;				}			}		}	};	this.request = function(sURL, sMethod, vData) {		try {			//var oXmlHttpReq = this.httpReq;			oSource.httpReq = oSource.createXMLHttpReqObj();			oSource.url = sURL;//			oSource.timer(sURL);			oSource.active = true;			if (!oSource.httpReq || sURL === "" || typeof sURL !== "string") {				return false;			}			if(typeof sMethod === "undefined") {				sMethod = "GET";			} else {				sMethod = sMethod.toUpperCase();			}			if(typeof vData === "undefined") { //if the information is contained in the url or as value pairs in the vData var as string, we post normal form data 				vData = null;			}			if (sMethod === "POST") {				oSource.httpReq.open(sMethod, sURL, true);				if(typeof vData === "string") { //if the information is contained in the url or as value pairs in the vData var as string, we post normal form data 					oSource.httpReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8");					oSource.httpReq.setRequestHeader("Method", "POST "+sURL+" HTTP/1.1");					oSource.httpReq.overrideMimeType("text/html; charset=utf-8"); 				} else { // otherwise the requests expects to submit xml data					// oSource.httpReq.setRequestHeader("Content-Type","text/xml");					oSource.httpReq.setRequestHeader("Content-Type", "text/html; charset=utf-8");					oSource.httpReq.overrideMimeType("text/html; charset=utf-8"); 				}			} else {				oSource.httpReq.open(sMethod, sURL, true);			}			oSource.httpReq.onreadystatechange = function(){				try{					if(oSource.httpReq.readyState === 4 && oSource.active === true) {//						window.clearTimeout(oSource.timeout);						if(oSource.httpReq.status === 200) {							oSource.text = oSource.httpReq.responseText;							oSource.xml = oSource.httpReq.responseXML;							if(oSource.returnMiddle === true) {								oSource.middleText = oSource.text.middle(oSource.startMarker,oSource.endMarker,true);								oSource.handleRequest(oSource.middleText);							} else {								oSource.handleRequest(oSource.httpReq);							}							oSource.active = false;						} else {							oSource.active = false;							oSource.handleError(oSource.url, oSource.httpReq.status);							return false;						}					} else {						oSource.active = true;//						if(oSource.httpReq.readyState === 2) {//							alert("clear timeout");//							window.clearTimeout(oSource.timeout);//						}						oSource.handleReadyState(oSource.httpReq.readyState);					}				} catch(oError) {					var failsilent = oError;					//due to a unsolved problem in the ajax handling, this error statement will be executed if the user leaves the page or reloads the url while an ajax request is active!					//until a solution for this problem exits, we will omit the error handling					//var oFunctionInfo = TOM.createFunctionInfoObj("TOM.ajax.httpReq.onreadystatechange", this, "None", "TOM.js");					//TOM.handleError(oFunctionInfo,oError);				}			};			console.debug("TOM: send with POST: " + vData);			oSource.httpReq.send(vData);			return true;		}catch(e){TOM.ee(TOM.ei("TOM.ajax.request",this),e);return false;}	};		this.get = function(sURL) {		try {			oSource.abort();			var ret = oSource.request(sURL, "GET");			return ret;		}catch(e){TOM.ee(TOM.ei("TOM.ajax.get",this),e);return false;}	};	this.middle = function(sURL, sStartMarker, sEndMarker) {		try {			oSource.abort();			oSource.returnMiddle = true;			oSource.startMarker = sStartMarker;			oSource.endMarker = sEndMarker;			var ret = oSource.request(sURL, "GET");			return ret;		}catch(e){TOM.ee(TOM.ei("TOM.ajax.middle",this),e);return false;}	};	this.post = function(sURL, vData) {		try {			oSource.abort();			var ret = oSource.request(sURL, "POST", vData);			return ret;		}catch(e){TOM.ee(TOM.ei("TOM.ajax.post",this),e);return false;}	};		this.abort = function () {		try {			if (oSource.active === true) {				oSource.active = false;				//TOM.alert(typeof oSource.httpReq.abort);				if (oSource.httpReq.abort) {					oSource.httpReq.abort();				}				oSource.httpReq = null;			}		}catch(e){TOM.ee(TOM.ei("TOM.ajax.abort",this),e);return false;}	};	this.timer = function(failedURL) {		oSource.timeout = window.setTimeout(function(){			oSource.abort();			oSource.handleError(failedURL,503);		},oSource.period);	};	try {		if(typeof fHandleRequest !== "undefined") {			oSource.handleRequest = fHandleRequest;		} else {			oSource.handleRequest = function () {};		}			if(typeof fHandleError !== "undefined") {			oSource.handleError = fHandleError;		} else {			oSource.handleError = function () {};		}			if(typeof fHandleReadyState !== "undefined") {			oSource.handleReadyState = fHandleReadyState;		} else {			oSource.handleReadyState = function () {};		}				oSource.period = 30000;		oSource.text = "";		oSource.middleText = "";		oSource.xml = "";		oSource.url = "";		oSource.timeout = null;		oSource.active = false;				oSource.returnMiddle = false;		oSource.startMarker = "";		oSource.endMarker = "";		}catch(e){TOM.ee(TOM.ei("TOM.ajax",this),e);return false;}};/** @id String.prototype.contains */String.prototype.contains = function (aSearchList,bCaseSensitive) {	try {		var sSource = this;		var bMatch = false;		bCaseSensitive = (bCaseSensitive !== false)?true:bCaseSensitive;		if(bCaseSensitive === false) {			sSource = sSource.toLowerCase();		}		if(isArray(aSearchList) === true) {			for (var i=0; i<aSearchList.length; i++) {				if(typeof aSearchList[i] === "string") {					if(bCaseSensitive === false) {								aSearchList[i] = aSearchList[i].toLowerCase();					}					if(sSource.indexOf(aSearchList[i])>-1) {						bMatch = true;					}				} 			}		} else if (typeof aSearchList === "string") {			if(sSource.indexOf(aSearchList) >= 0) {				bMatch = true;			}		}		return bMatch;	}catch(e){TOM.ee(TOM.ei("String.prototype.contains",this),e);return false;}};/** @id String.prototype.left */String.prototype.left = function (sStartMarker, bCaseSensitive, bSearchBackwards) {	try {		var sSource = this;		var sWorkingSource = sSource;		var sReturn = "";		var iStartPos = -1;		bSearchBackwards = (typeof bSearchBackwards === "undefined" || typeof bSearchBackwards !== "boolean")?false:bSearchBackwards;		bCaseSensitive = (typeof bCaseSensitive === "undefined" || typeof bCaseSensitive !== "boolean")?true:bCaseSensitive;				if(typeof sStartMarker === "string") {		    if(sStartMarker === "") {				throw TOM.createErrorInfoObj(TOM.ERROR.LEVEL.ERROR, TOM.ERROR.TYPE.CONTENTERROR, TOM.ERROR.MESSAGE.STRINGISEMPTY, "", "SPL_sStartMarkerEmpty");			}			if(bCaseSensitive === false) { //ffffff				sWorkingSource = sWorkingSource.toLowerCase();				sStartMarker = sStartMarker.toLowerCase();			}			iStartPos = (bSearchBackwards)?sWorkingSource.lastIndexOf(sStartMarker):sWorkingSource.indexOf(sStartMarker);		} else if(typeof sStartMarker === "number") {			sStartMarker = (sStartMarker !== Math.ceil(sStartMarker))?Math.round(sStartMarker):sStartMarker;			iStartPos = (sStartMarker < 0)?sWorkingSource.length:((bSearchBackwards)?(sWorkingSource.length - sStartMarker):sStartMarker);			if(iStartPos < 0) {				throw TOM.createErrorInfoObj(TOM.ERROR.LEVEL.ERROR, TOM.ERROR.TYPE.CONTENTERROR, TOM.ERROR.MESSAGE.POSITIVENUMBEREXPECTED, "", "SPL_sStartMarkerIsNegativ");			}		} else {			throw TOM.createErrorInfoObj(TOM.ERROR.LEVEL.ERROR, TOM.ERROR.TYPE.CONTENTERROR, TOM.ERROR.MESSAGE.NUMBEREXPECTED + TOM.ERROR.NEWLINE + TOM.ERROR.MESSAGE.STRINGEXPECTED, "", "SPL_sStartMarkerTypeError");		}		sReturn = sSource.substr(0,iStartPos);		return sReturn;	}catch(e){TOM.ee(TOM.ei("String.prototype.left",this),e);return "";}};/** @id String.prototype.leftBack */String.prototype.leftBack = function (sStartMarker, bCaseSensitive) {	try {		bCaseSensitive = (typeof bCaseSensitive === "undefined" || typeof bCaseSensitive !== "boolean")?true:bCaseSensitive;				var sResult = this.left(sStartMarker,bCaseSensitive,true);		return sResult;	}catch(e){TOM.ee(TOM.ei("String.prototype.leftBack",this),e);return "";}};/** @id String.prototype.right */String.prototype.right = function (sStartMarker, bCaseSensitive, bSearchBackwards) {	try {		var sSource = this; 		var sWorkingSource = sSource;		var sReturn = "";		var iStartPos = -1;		bSearchBackwards = (typeof bSearchBackwards === "undefined" || typeof bSearchBackwards !== "boolean")?false:bSearchBackwards;		bCaseSensitive = (typeof bCaseSensitive === "undefined" || typeof bCaseSensitive !== "boolean")?true:bCaseSensitive;				if(typeof sStartMarker === "string") {		    if(sStartMarker === "") {				throw {context:"Intercepted Error",name:"Parameter Error",type:"The first parameter must not be empty, please use a string with at least one character or a positiv integer instead!"};			}			if(!bCaseSensitive) {				sWorkingSource = sWorkingSource.toLowerCase();				sStartMarker = sStartMarker.toLowerCase(); 			}			iStartPos = (bSearchBackwards)?sWorkingSource.lastIndexOf(sStartMarker):sWorkingSource.indexOf(sStartMarker);			sReturn = (iStartPos<0)?"":sSource.substr(iStartPos+sStartMarker.length);		} else if(typeof sStartMarker === "number") {			sStartMarker = (sStartMarker !== Math.ceil(sStartMarker))?Math.round(sStartMarker):sStartMarker;			sStartMarker = (sStartMarker > sWorkingSource.length)?sWorkingSource.length:sStartMarker;			iStartPos = (sStartMarker < 0)?((bSearchBackwards)?"":sWorkingSource.length):((bSearchBackwards)?(sStartMarker):(sWorkingSource.length - sStartMarker));			if(iStartPos < 0) {				throw("The value '"+iStartPos+"' is not allowed for the first parameter, please use only positiv integer values");			}			sReturn = sSource.substr(iStartPos);		} else {			throw {context:"Intercepted Error",name:"Parameter Error",type:"Wrong type for first parameter ("+(typeof sStartMarker)+"), please use string or number"};		}		return sReturn;	}catch(e){TOM.ee(TOM.ei("String.prototype.right",this),e);return "";}};/** @id String.prototype.rightBack */String.prototype.rightBack = function (sStartMarker, bCaseSensitive) {	try {		bCaseSensitive = (typeof bCaseSensitive === "undefined" || typeof bCaseSensitive !== "boolean")?true:bCaseSensitive;				var sResult = this.right(sStartMarker,bCaseSensitive,true);		return sResult;	}catch(e){TOM.ee(TOM.ei("String.prototype.rightBack",this),e);return "";}};/** @id String.prototype.middle */String.prototype.middle = function (sStartMarker, sEndMarker, bCaseSensitive, bAllowPlaceholder, bEndMarkerRequired, bSearchBackwards) {	try {		var sSource = this; //source object, the string the function is executed on		var sWorkingSource = sSource; //object to work with, if search should be case insensitiv, we need a lowercase source to search on and a original case source to extract and return the middle from   		var sWorkingRestSource = ""; //temp source for search with placeholders		var sReturn = ""; 		var iStartPos = -1; 		var iEndPos = -1;		var aReplacementList = ['*'];		var iTempPos,i,aStarChunks;		//check parameters and set default values if they are omitted or from the wrong type 		bCaseSensitive = (typeof bCaseSensitive === "undefined" || typeof bCaseSensitive !== "boolean")?true:bCaseSensitive;		bAllowPlaceholder = (typeof bAllowPlaceholder === "undefined" || typeof bAllowPlaceholder !== "boolean")?false:bAllowPlaceholder;		bEndMarkerRequired = (typeof bEndMarkerRequired === "undefined" || typeof bEndMarkerRequired !== "boolean")?false:bEndMarkerRequired;		bSearchBackwards = (typeof bSearchBackwards === "undefined" || typeof bSearchBackwards !== "boolean")?false:bSearchBackwards;		//check if case sesitivity is disablbed, then use a lowercase version of source to work with		if(!bCaseSensitive) {			sWorkingSource = sWorkingSource.toLowerCase();		}		//sStartMarker could be a string or a number, so let's first check if it's a string and do the necessary operations		if(typeof sStartMarker === "string") {			//empty strings are not allowed for the first parameter		    if(sStartMarker === "") {				throw TOM.createErrorInfoObj(TOM.ERROR.LEVEL.ERROR, TOM.ERROR.TYPE.CONTENTERROR, TOM.ERROR.MESSAGE.STRINGISEMPTY, "Leere Zeichenkette nicht zul&auml;ssig f&uuml;r ersten Parameter!", "FN00000236");			}			//if case insensitiv, search for lowercase string (sWorkingSource is set to lowecase somewhere above ;-)			if(!bCaseSensitive) {				sStartMarker = sStartMarker.toLowerCase();			}			//check if the placeholder option is activ and if so, if the current sStartMarker does not contain any placeholders, because if it doesn't we don't need to work with placeholders and can use the short rountine ;-)			if(!bAllowPlaceholder || sStartMarker.contains(aReplacementList) === false) {				//get the position of the sStartMarker, if search backwards is activ, we will start with the last occurence of sStartMarker				iStartPos = (bSearchBackwards)?sWorkingSource.lastIndexOf(sStartMarker):sWorkingSource.indexOf(sStartMarker);				if(iStartPos === -1) {					sReturn = "";				} else if(!bSearchBackwards){					iStartPos = iStartPos + sStartMarker.length;				}			} else {			//here we start the more complex search of sStartMarker with placeholder in it 				iTempPos = 0;				sWorkingRestSource = sWorkingSource;				iStartPos = 0;				//we create an array of the single chunks that we get by using the * as delimiter 				aStarChunks = sStartMarker.split("*");				//now we search for every chunk, begining with the first and searching for the next behind the previous chunk ;-) 				for(i = 0; i < aStarChunks.length; i++) {					iTempPos = (i === 0 && bSearchBackwards)?sWorkingRestSource.lastIndexOf(aStarChunks[i]):sWorkingRestSource.indexOf(aStarChunks[i]);					if(iTempPos > -1) {						iStartPos += iTempPos+aStarChunks[i].length;						sWorkingRestSource = sWorkingRestSource.substr(iTempPos + aStarChunks[i].length);					} else {						//if a single chunk is not found, the whole sStartMarker search was unsuccessfull 						i = aStarChunks.length+1;						iStartPos = -1;						sReturn = "";					}				}			}		//sStartMarker could be a string or a number, so let's now check if it's a number and do the necessary operations		} else if(typeof sStartMarker === "number") {			//sStartMarker must not be negativ if it's a number			if(sStartMarker < 0) {				throw {context:"Intercepted Error",name:"Parameter Error",type:"The value '"+iStartPos+"' is not allowed for the first parameter, please use only positiv integer values"};			}			//check if the marker is a non decimal number 			sStartMarker = (sStartMarker !== Math.ceil(sStartMarker))?Math.round(sStartMarker):sStartMarker;			//if the search is backwards we need to substract the number from the end of the string			iStartPos = (bSearchBackwards)?(sWorkingSource.length+1-sStartMarker):sStartMarker;			if(iStartPos>sSource.length) {				iStartPos = sSource.length; 			}			if(iStartPos<0) {				iStartPos = 0; 			}		} else {			throw {context:"Intercepted Error",name:"Parameter Error",type:"Wrong type for first parameter ("+(typeof sStartMarker)+"), please use string or number"};		}		if(iStartPos !== -1) {			if(typeof sEndMarker === "undefined") {				sReturn = bSearchBackwards?sSource.substr(0,iStartPos):sSource.substr(iStartPos);				//sReturn = sSource.substr(iStartPos);			} else {				if(typeof sEndMarker === "string") {				    if(sEndMarker === "") {						throw {context:"Intercepted Error",name:"Parameter Error",type:"The second parameter must not be empty, please use a string with at least one character or a positiv or negativ integer instead!"};					}					if(bCaseSensitive === false) {						sEndMarker = sEndMarker.toLowerCase();					}					sWorkingRestSource = bSearchBackwards?sWorkingSource.substr(0,iStartPos):sWorkingSource.substr(iStartPos);					if(bAllowPlaceholder === false || sEndMarker.contains(aReplacementList) === false) {						iEndPos = bSearchBackwards?sWorkingRestSource.lastIndexOf(sEndMarker):sWorkingRestSource.indexOf(sEndMarker);						if(iEndPos !== -1 && bSearchBackwards) {							iEndPos += sEndMarker.length;						}						iEndPos = (iEndPos === -1)?(bSearchBackwards?0:(-1)):(bSearchBackwards?iEndPos:(iStartPos + iEndPos));					} else {						iTempPos = 0;						//sWorkingRestSource = sWorkingSource;						iEndPos = -1;						aStarChunks = sEndMarker.split("*");						for(i = 0; i < aStarChunks.length; i++) {							//iTempPos = sWorkingRestSource.indexOf(aStarChunks[i]);							iTempPos = (i === 0 && bSearchBackwards)?sWorkingRestSource.lastIndexOf(aStarChunks[i]):sWorkingRestSource.indexOf(aStarChunks[i]);							if(iTempPos > -1) {								if(i===0) {									iEndPos = iStartPos + iTempPos;								}								sWorkingRestSource = sWorkingRestSource.substr(iTempPos+aStarChunks[i].length);							} else {								i = aStarChunks.length+1;								iEndPos = -1;							}						}					}				} else if(typeof sEndMarker === "number") {					sEndMarker = (sEndMarker !== Math.ceil(sEndMarker))?Math.round(sEndMarker):sEndMarker;					if(sEndMarker === 0) {						throw {context:"Intercepted Error",name:"Parameter Error",type:"The value '"+iEndPos+"' is not allowed for the second parameter, please use only positiv or negativ integer values or a string"};					}					if(sEndMarker < 0) {						iTempPos = iStartPos;						if(typeof sStartMarker === "string" && !bSearchBackwards) {							iTempPos = iTempPos - sStartMarker.length;						}						iStartPos = iTempPos + sEndMarker;						if(iStartPos<0) {							iStartPos = 0;						}						iEndPos = iTempPos; 					} else {						if(bSearchBackwards) {							if(typeof sStartMarker === "string") {								iStartPos = iStartPos + sStartMarker.length;								iEndPos = iStartPos + sEndMarker;							} else {								iEndPos = iStartPos + sEndMarker;							}						} else {							iEndPos = iStartPos+sEndMarker; 						}					}				} else {					throw {context:"Intercepted Error",name:"Parameter Error",type:"Wrong type for second parameter ("+(typeof sEndMarker)+"), please use string or number"};				}				// if we search backwards, the search for start string ist conducted from right to left and the search for endstring is conducted to the left of iStartPos. So we need to switch the  values to wirk proper with js substring				if(bSearchBackwards && iStartPos > iEndPos) {					iTempPos = iEndPos;					iEndPos = iStartPos;					iStartPos = iTempPos;				}				sReturn = (iEndPos === -1)?(bEndMarkerRequired?"":sSource.substr(iStartPos)):sSource.substring(iStartPos,iEndPos); 			}		}		return sReturn;	}catch(e){TOM.ee(TOM.ei("String.prototype.middle",this),e);return "";}};/** @id String.prototype.middleBack */String.prototype.middleBack = function (sStartMarker, sEndMarker, bCaseSensitive, bAllowPlaceholder, bEndMarkerRequired) {	try {		bCaseSensitive = (typeof bCaseSensitive === "undefined" || typeof bCaseSensitive !== "boolean")?true:bCaseSensitive;		bAllowPlaceholder = (typeof bAllowPlaceholder === "undefined" || typeof bAllowPlaceholder !== "boolean")?false:bAllowPlaceholder;		bEndMarkerRequired = (typeof bEndMarkerRequired === "undefined" || typeof bEndMarkerRequired !== "boolean")?false:bEndMarkerRequired;		var bSearchBackwards = (typeof bSearchBackwards === "undefined" || typeof bSearchBackwards !== "boolean")?false:bSearchBackwards;		var sReturn = this.middle(sStartMarker, sEndMarker, bCaseSensitive, bAllowPlaceholder, bEndMarkerRequired, true);		return sReturn;	}catch(e){TOM.ee(TOM.ei("String.prototype.middleBack",this),e);return "";}};/** @id String.prototype.trim */String.prototype.trim = function () {	try {  		var sSource = this;  		while (sSource.substring(0,1) === ' ') {    		sSource = sSource.substring(1, sSource.length);  		}  		while (sSource.substring(sSource.length - 1,sSource.length) === ' ') {    		sSource = sSource.substring(0,sSource.length - 1);  		}  		return sSource.replace(/\s+/g," ");	}catch(e){TOM.ee(TOM.ei("String.prototype.trim",this),e);return "";}}; /** @id String.prototype.begins */String.prototype.begins = function (sMarker, bCaseSensitive) {	try {		var sSource;				if (typeof bCaseSensitive === "undefined"){			bCaseSensitive = true;		}		if (typeof sMarker !== "string" ){			return false;		}		if (bCaseSensitive){			sSource = this;		}		else {			sSource = this.toLowerCase();			sMarker = sMarker.toLowerCase();		}		var nLength = sMarker.length;		if (sMarker === sSource.substr(0,nLength)){ 			return true;		}		else{			return false;		}	}catch(e){TOM.ee(TOM.ei("String.prototype.begins",this),e);return false;}};/** @id String.prototype.ends */String.prototype.ends = function (sMarker, bCaseSensitive){	try {		var sContainer;		var sSource;		if (typeof bCaseSensitive === "undefined"){			bCaseSensitive = true;		}		if (typeof sMarker !== "string" ){			return false;		}		if (bCaseSensitive === true){			sSource = this;		}		else {			sSource = this.toLowerCase();			sMarker = sMarker.toLowerCase();		}		var nLength = sMarker.length;		if (sMarker === sSource.substring(sSource.length - nLength ,sSource.length)){			return true;		}		else{			return false;		}	}catch(e){TOM.ee(TOM.ei("String.prototype.ends",this),e);return false;}};/** @id String.prototype.explode */String.prototype.explode = function (sSeparators, bIncludeEmpties, bNewlineAsSeparator){	/*@Explode( string )@Explode( string ; separators )@Explode( string ; separators ; includeEmpties )@Explode( string ; separators ; includeEmpties ; newlineAsSeparator ) */	try {		var sSource = this; // Source string		var aSeparators = []; // Array for separators		var defaultSeparators = [" ",",",";"]; // Default separator(s)		var aArray = []; // Result array		var count = 0;		var nEmptyCount = 1;				if (!sSource || sSource === "" || sSource.length === 0) {			// Nothing to replace. Ciao!			return aArray;		}				if (bIncludeEmpties !== true){			bIncludeEmpties = false;		}				if (bNewlineAsSeparator !== false){			bNewlineAsSeparator = true;		}				if (typeof sSeparators !== "string" || sSeparators === "" || sSeparators === null) {			aSeparators = defaultSeparators;		} else {			// Saves all separators in the array sSeparators			for (var ii = 0; ii < sSeparators.length; ii++) {				aSeparators[ii] = sSeparators.substring(ii, (ii+1));			}		}		// Replace the Newline(/n) with separator (bNewlineAssepaarator = true) or with a Space 		if (bNewlineAsSeparator === true){			sSource = sSource.replace(/\n/g,aSeparators[0]);		}		count = 0;		// Runs over all chars of the string		for (var i = 0; i < sSource.length; i++) {			// Checks all separators for the char			for (var j = 0; j < aSeparators.length; j++) {				////TOM.alert("e");				if (aSeparators[j] === sSource.charAt(i)) {					// Found separator					////TOM.alert("fseparator");					if (sSource.substring(0,i) !== "" || bIncludeEmpties === true) {						// Checks the next char for a separator						for (var p = 0; p < aSeparators.length; p++) {							if (sSource.substring(i+1, i+2) === aSeparators[p]) {								nEmptyCount = 2;							}						}						// Add element to result array						aArray[count] = sSource.substring(0, i);						count++;						// adds a empty element when the next char is a separator and Include Empties is activated						if (nEmptyCount === 2 && bIncludeEmpties === true){							aArray[count] = "";							count++;						}					}					sSource = sSource.substring(i + nEmptyCount, sSource.length);					i = -1;					nEmptyCount = 1;				}			}//for(j)		}//for(i)				// Copy the remaining chars in the last array element		aArray[count] = sSource;			return aArray;	}catch(e){TOM.ee(TOM.ei("String.prototype.explode",this),e);return "";}};/** @id String.prototype.escapeRegExp */String.prototype.escapeRegExp = function () {	var sSource = this;	var aEscape = ["\\","^","$","*","+",".","(",")","[","]","/","|","&","?","!",":"];	var sEscape;	for(var i=0; i<aEscape.length; i++) { 		sEscape = new RegExp("\\" + aEscape[i], 'g');		sSource = sSource.replace(sEscape,"\\" + aEscape[i]);	}	return sSource;};/** @id String.prototype.replaceSubstring */String.prototype.replaceSubstring = function (vFromList, vToList, bCaseSensitive) {	try{		var sReplaceOptions = (bCaseSensitive === false)?'ig':'g';		var aFromList = [];		var aToList = [];		var sSource = this;		var sFromEntry, vFromEntry, sToEntry;//		alert("vFromList="+vFromList+"\ntype=" + typeof vFromList + "\n" + "vToList="+vToList+"\ntype=" + typeof vToList + "\n")		if (typeof vFromList === "string" || typeof vFromList === "number") {			aFromList[0] = vFromList + "";//			if(!bCaseSensitive) aFromList[0]= aFromList[0].toLowerCase();		}		else			if (isArray(vFromList)) {				aFromList = vFromList;//				aFromList = (!bCaseSensitive)?vFromList.toLowerCase():vFromList;			}		if (typeof vToList === "string" || typeof vToList === "number") {			aToList[0] = vToList + "";//			alert("aToList[0]="+aToList[0]+"\ntype=" + typeof aToList[0])		} else if(isArray(vToList)) {			aToList = vToList;		}//		//TOM.alert("vFromList:" + vFromList+ "\nvToList:" +vToList + "\nvalid? -> " + !(sSource === "" || aFromList.length === 0 || aFromList.length === 0));		if(!(sSource === "" || aFromList.length === 0 || aFromList.length === 0)) {			for(var e1 = 0; e1 < aFromList.length; e1++) {				sFromEntry = aFromList[e1] + "";				vFromEntry = new RegExp(sFromEntry.escapeRegExp(), sReplaceOptions);				sToEntry = ((e1 >= (aToList.length-1))?aToList[(aToList.length-1)]:aToList[e1]) + "";//				//TOM.alert(sSource + " -> replace " + sFromEntry.escapeRegExp() + " with " + sToEntry +" (" +sReplaceOptions+ ")")//				while (sSource.indexOf(sFromEntry) > -1) {				sSource = sSource.replace(vFromEntry, sToEntry);//				//TOM.alert("replaced sSource:" + sSource);//				}			}		} else {			sSource = null;		}		return sSource;	}catch(e){TOM.ee(TOM.ei("String.prototype.replaceSubstring",this),e);return "";}};/** @id String.prototype.occurrence */String.prototype.occurrence = function (sSearchText,bCaseSensitive) {	try {		var sSource = this;		var iHits = 0;		if ((typeof sSearchText !== "string" && typeof sSearchText !== "number") || sSearchText === "") {			iHits = -1; // invalid type for parameter		}		else {			if (typeof sSearchText === "number") {				sSearchText = sSearchText + "";			}			var iHitPos;			var bReachedEnd = false;			bCaseSensitive = (bCaseSensitive !== false) ? true : bCaseSensitive;			if (bCaseSensitive === false) {				sSource = sSource.toLowerCase();				sSearchText = sSearchText.toLowerCase();			}			var ex = 0;			while (!bReachedEnd && ex < 1000000) {				ex++;				iHitPos = sSource.indexOf(sSearchText);				if (iHitPos >= 0) {					sSource = sSource.substr(iHitPos + sSearchText.length);					iHits++;				}				else {					bReachedEnd = true;				}			}		}		return iHits;	}catch(e){TOM.ee(TOM.ei("String.prototype.occurrence",this),e);return -1;}};/** @id String.prototype.convert */String.prototype.convert = function(sSourceType,sReturnType,vCustom1,vCustom2) {	/*	 * converts a string from anything to almost everything:	 * from and to:	 * - string	 * - number (integer, fraction, exponential, negative)	 * - hexadecimal	 * - binary	 * - currency	 * - days	 * - hours	 * - minutes	 * - seconds	 * 	 */	try{		var sSource = this;		var sCurrentChar;		var sReturn = "";		sSource = sSource.toLowerCase();				sSourceType = (typeof sSourceType !== "string" || sSourceType === "")?"string":sSourceType.toLowerCase();		sReturnType = (typeof sReturnType !== "string" || sReturnType === "")?"integer":sReturnType.toLowerCase();		var aAllowedTransformations = ['string','integer']; //,'fraction','exponential','hexadecimal','binary','currency','days','hours','minutes','seconds'		aAllowedTransformations.string = aAllowedTransformations;		aAllowedTransformations.integer = aAllowedTransformations;		// aAllowedTransformations['fraction'] = aAllowedTransformations;		// aAllowedTransformations['exponential'] = aAllowedTransformations;				var bTransformationSupported = (aAllowedTransformations[sSourceType].indexOf(sReturnType) > -1);				if (bTransformationSupported) {			var aAllowedIntegerChars = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];			//var aAllowedFractionChars = [".","e","+","-"];			//var aAllowedHexadecimalChars = ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];						var sDecimalDelimiter = (typeof sDecimalDelimiter !== "string") ? "," : sDecimalDelimiter;			var sCurrencyDelimiter = ".";			//sDecimalDelimiter = ",";						var aAllowedChars = [];			var aAllowedFirstChars = [];						switch (sReturnType) {				case "integer": // 32234					aAllowedChars = aAllowedIntegerChars;					aAllowedFirstChars = ["-","+"];					break;				case "fraction": // 2231,34634566					break;				case "binary": // 1001111010100					break;				case "hexadecimal": // AF3790E					break;				case "currency": // 12.343,23					break;			}						for (var n = 0; n < sSource.length; n++) {				sCurrentChar = sSource.charAt(n);				if (( (sReturn.length === 0) && (aAllowedFirstChars.indexOf(sCurrentChar) > -1) ) || (aAllowedChars.indexOf(sCurrentChar) > -1)) {					sReturn += sCurrentChar;				}			}						//bAllowNegative = (typeof bAllowNegative === "boolean")?bAllowNegative:true;						switch (sSourceType.toLowerCase()) {				case "integer": // 32234					break;				case "fraction": // 2231,34634566					break;				case "binary": // 1001111010100					break;				case "hexadecimal": // AF3790E					break;				case "currency": // 12.343,23					break;			}		}		return sReturn;	}catch(e){TOM.ee(TOM.ei("String.prototype.convert",this),e);return this;}};/** @id Array.prototype.toLowerCase */Array.prototype.toLowerCase = function () {	try{		var aSource = this;		for(var n=0; n< aSource.length; n++) {			if(typeof aSource[n] === "string") {				aSource[n] = aSource[n].toLowerCase();			} else if(isArray(aSource[n])) {				aSource[n] = aSource[n].toLowerCase();			}		}		return aSource;	}catch(e){TOM.ee(TOM.ei("Array.prototype.toLowerCase",this),e);return null;}};/** @id Array.prototype.toUpperCase */Array.prototype.toUpperCase = function () {	try{		var aSource = this;		for(var n=0; n< aSource.length; n++) {			if(typeof aSource[n] === "string") {				aSource[n] = aSource[n].toUpperCase();			} else if(isArray(aSource[n])) {				aSource[n] = aSource[n].toUpperCase();			}		}		return aSource;	}catch(e){TOM.ee(TOM.ei("Array.prototype.toUpperCase",this),e);return null;}};/** @id Array.prototype.contains */Array.prototype.contains = function (aSearchList,bCaseSensitive) {	try {		var aSource = this;		var bMatch = false;		bCaseSensitive = (bCaseSensitive !== false)?true:bCaseSensitive;		if(bCaseSensitive === false) {			aSource = aSource.toLowerCase();		}		for(var n = 0; n<aSource.length; n++) {	//.length added			if(typeof aSource[n] === "string" || isArray(aSource[n])) {				if(aSource[n].contains(aSearchList,bCaseSensitive)) {					bMatch = true;				}			}		}		return bMatch;	}catch(e){TOM.ee(TOM.ei("Array.prototype.contains",this),e);return false;}};/** @id Array.prototype.left */Array.prototype.left = function (sStartMarker, bCaseSensitive, bSearchBackwards) {	try {		var aSource = this;		var aReturn = [];		var entry;		bSearchBackwards = (typeof bSearchBackwards === "undefined" || typeof bSearchBackwards !== "boolean")?false:bSearchBackwards;		bCaseSensitive = (typeof bCaseSensitive === "undefined" || typeof bCaseSensitive !== "boolean")?true:bCaseSensitive;				for (entry in aSource) {			if (aSource.hasOwnProperty(entry)) {				if (typeof aSource[entry] === "string" || isArray(aSource[entry])) {					aReturn[entry] = aSource[entry].left(sStartMarker, bCaseSensitive, bSearchBackwards);				}				else {					aReturn[entry] = aSource[entry];				}			}		}		return aReturn;	}catch(e){TOM.ee(TOM.ei("Array.prototype.left",this),e);return null;}};/** @id Array.prototype.leftBack */Array.prototype.leftBack = function (sStartMarker, bCaseSensitive) {	try {		var aSource = this;		var aReturn = [];		var entry;		bCaseSensitive = (typeof bCaseSensitive === "undefined" || typeof bCaseSensitive !== "boolean")?true:bCaseSensitive;				for (entry in aSource) {			if (aSource.hasOwnProperty(entry)) {				if (typeof aSource[entry] === "string" || isArray(aSource[entry])) {					aReturn[entry] = aSource[entry].leftBack(sStartMarker, bCaseSensitive);				}				else {					aReturn[entry] = aSource[entry];				}			}		}		return aReturn;	}catch(e){TOM.ee(TOM.ei("Array.prototype.leftBack",this),e);return null;}};/** @id Array.prototype.right */Array.prototype.right = function (sStartMarker, bCaseSensitive, bSearchBackwards) {	try {		var aSource = this;		var aReturn = [];		var entry;		bSearchBackwards = (typeof bSearchBackwards === "undefined" || typeof bSearchBackwards !== "boolean")?false:bSearchBackwards;		bCaseSensitive = (typeof bCaseSensitive === "undefined" || typeof bCaseSensitive !== "boolean")?true:bCaseSensitive;				for (entry in aSource) {			if (aSource.hasOwnProperty(entry)) {				if (typeof aSource[entry] === "string" || isArray(aSource[entry])) {					aReturn[entry] = aSource[entry].right(sStartMarker, bCaseSensitive, bSearchBackwards);				}				else {					aReturn[entry] = aSource[entry];				}			}		}		return aReturn;	}catch(e){TOM.ee(TOM.ei("Array.prototype.right",this),e);return null;}};/** @id Array.prototype.rightBack */Array.prototype.rightBack = function (sStartMarker, bCaseSensitive) {	try {		var aSource = this;		var aReturn = [];		var entry;		bCaseSensitive = (typeof bCaseSensitive === "undefined" || typeof bCaseSensitive !== "boolean")?true:bCaseSensitive;				for (entry in aSource) {			if (aSource.hasOwnProperty(entry)) {				if (typeof aSource[entry] === "string" || isArray(aSource[entry])) {					aReturn[entry] = aSource[entry].rightBack(sStartMarker, bCaseSensitive);				}				else {					aReturn[entry] = aSource[entry];				}			}		}		return aReturn;	}catch(e){TOM.ee(TOM.ei("Array.prototype.rightBack",this),e);return null;}};/** @id Array.prototype.middle */Array.prototype.middle = function (sStartMarker, sEndMarker, bCaseSensitive, bAllowPlaceholder, bEndMarkerRequired, bSearchBackwards) {	try {		var aSource = this;		var aReturn = [];		var entry;		bCaseSensitive = (typeof bCaseSensitive === "undefined" || typeof bCaseSensitive !== "boolean")?true:bCaseSensitive;		bAllowPlaceholder = (typeof bAllowPlaceholder === "undefined" || typeof bAllowPlaceholder !== "boolean")?false:bAllowPlaceholder;		bEndMarkerRequired = (typeof bEndMarkerRequired === "undefined" || typeof bEndMarkerRequired !== "boolean")?false:bEndMarkerRequired;		bSearchBackwards = (typeof bSearchBackwards === "undefined" || typeof bSearchBackwards !== "boolean")?false:bSearchBackwards;		for (entry in aSource) {			if (aSource.hasOwnProperty(entry)) {				if (typeof aSource[entry] === "string" || isArray(aSource[entry])) {					aReturn[entry] = aSource[entry].middle(sStartMarker, sEndMarker, bCaseSensitive, bAllowPlaceholder, bEndMarkerRequired, bSearchBackwards);				}				else {					aReturn[entry] = aSource[entry];				}			}		}		return aReturn;	}catch(e){TOM.ee(TOM.ei("Array.prototype.middle",this),e);return null;}};/** @id Array.prototype.middleBack */Array.prototype.middleBack = function (sStartMarker, sEndMarker, bCaseSensitive, bAllowPlaceholder, bEndMarkerRequired) {	try {		var aSource = this;		var aReturn = [];		var entry;		bCaseSensitive = (typeof bCaseSensitive === "undefined" || typeof bCaseSensitive !== "boolean")?true:bCaseSensitive;		bAllowPlaceholder = (typeof bAllowPlaceholder === "undefined" || typeof bAllowPlaceholder !== "boolean")?false:bAllowPlaceholder;		bEndMarkerRequired = (typeof bEndMarkerRequired === "undefined" || typeof bEndMarkerRequired !== "boolean")?false:bEndMarkerRequired;		for (entry in aSource) {			if (aSource.hasOwnProperty(entry)) {				if (typeof aSource[entry] === "string" || isArray(aSource[entry])) {					aReturn[entry] = aSource[entry].middleBack(sStartMarker, sEndMarker, bCaseSensitive, bAllowPlaceholder, bEndMarkerRequired);				}				else {					aReturn[entry] = aSource[entry];				}			}		}		return aReturn;	}catch(e){TOM.ee(TOM.ei("Array.prototype.middleBack",this),e);return null;}};/** @id Array.prototype.implode */Array.prototype.implode = function (sSeparator) {	try{		sSeparator = sSeparator || " ";		var aSource = this;		if (typeof sSeparator === "string") {			var result = "";			for (var i = 0; i < aSource.length; i++) {				result += aSource[i] + sSeparator;			}			result = result.substring(0,result.lastIndexOf(sSeparator));			return result;		}		else {			return null;		}	}catch(e){TOM.ee(TOM.ei("Array.prototype.implode",this),e);return "";}};/** @id Array.prototype.trim */Array.prototype.trim = function () {	try {		var aSource = this;		var aReturn = [];		var count = 0;		for (var i = 0; i < aSource.length; i++){			if(typeof aSource[i] === "string" || isArray(aSource[i])){				if(aSource[i].trim() !== ""){					aReturn[count] = aSource[i].trim();					count++;				}			}			else{				aReturn[count] = aSource[i];				count++;			}		}		return aReturn;	}catch(e){TOM.ee(TOM.ei("Array.prototype.trim",this),e);return "";}};/** @id Array.prototype.begins */Array.prototype.begins = function (sMarker, bCaseSensitive){	try {		var aSource = this;		if (typeof bCaseSensitive === "undefined"){			bCaseSensitive = true;		}		if (typeof sMarker !== "string" ){			throw createErrorInfoObj(TOM.ERROR.LEVEL.ERROR, TOM.ERROR.TYPE.USERERROR, TOM.ERROR.MESSAGE.STRINGEXPECTED, "Eine Zeichenkette wurde erwartet", "FN00000234");		}		if (bCaseSensitive === false){			sMarker = sMarker.toLowerCase();			}		var nLength = sMarker.length;		var sTmp;		for (var i = 0; i < aSource.length; i++){			if (bCaseSensitive === false){				sTmp = aSource[i].toLowerCase();			}			else{				sTmp = aSource[i];			}			if (sMarker === sTmp.substring(0,nLength)){				return true;			}		}		return false;	}catch(e){TOM.ee(TOM.ei("Array.prototype.begins",this),e);return false;}};/** @id Array.prototype.ends */Array.prototype.ends = function (sMarker, bCaseSensitive){	try {		var aSource = this;		var bReturn = false;		if (typeof bCaseSensitive === "undefined"){			bCaseSensitive = true;		}		if (typeof sMarker === "string" ){			if (bCaseSensitive === false){				sMarker = sMarker.toLowerCase();			}			var nLength = sMarker.length;			var sTmp;			for (var i = 0; i < aSource.length; i++){				if (bCaseSensitive === false){					sTmp = aSource[i].toLowerCase();				}				else{					sTmp = aSource[i];				}				if (sMarker === sTmp.substring(sTmp.length - nLength ,sTmp.length)){					bReturn = true;				}			}		}		return bReturn;	}catch(e){TOM.ee(TOM.ei("Array.prototype.ends",this),e);return false;}};/** @id Array.prototype.replace */Array.prototype.replace = function (aFromList, aToList) {	try{		var aSource = null;		var i,j;		if (aFromList instanceof Array && aToList instanceof Array) {			// WORKAROUND: this object, the string, is not writeable! So a temporary variable 'aSource' is used.			aSource = this;						//Loop through source list			for (i = 0; i < aSource.length; i++) {				// For loop through 'aFromList'				for (j = 0; j < aFromList.length; j++) {					// If a item at the FromList is found					if(aSource[i] === aFromList[j]) {						// Replace item with appropriate item of the aToList 						aSource[i] = aToList[j];					}				}			}						return aSource;		}		else if (typeof aFromList === "string" && typeof aToList === "string") {			// WORKAROUND: this object, the string, is not writeable! So a temporary variable 'aSource' is used.			aSource = this;						//Loop through source list			for (i = 0; i < aSource.length; i++) {				// For loop through 'aFromList'				for (j = 0; j < aFromList.length; j++) {					// If a item at the FromList is found					if(aSource[i] === aFromList) {						// Replace item with appropriate item of the aToList 						aSource[i] = aToList;					}				}			}						return aSource;		}		else {			return aSource;		}	}catch(e){TOM.ee(TOM.ei("Array.prototype.replace",this),e);return null;}};/** @id Array.prototype.replaceSubstring */Array.prototype.replaceSubstring = function (fromList, toList, bCaseSensitive) {	try{		var aSource = this;		var vReturnEntry;		if ( (typeof fromList === "string" || typeof fromList === "number" ) && (typeof toList === "string" || typeof toList === "number") && fromList !== "") {			for (var i = 0; i < aSource.length; i++) {				vReturnEntry = aSource[i].replaceSubstring(fromList, toList, ((bCaseSensitive !== false)?true:false));				if (vReturnEntry !== null) {					aSource[i] = vReturnEntry;				}			}			return aSource;		}		else {			return null;		}	}catch(e){TOM.ee(TOM.ei("Array.prototype.replaceSubstring",this),e);return null;}};/** @id Array.prototype.remove */Array.prototype.remove = function (element) {	try{		if (typeof element === "number") {			var aSource = this;						//var position = this.indexOf(element);						//if (position) {				var partOneOfNewArray = aSource.slice(0, element);				var partTwoOfNewArray = aSource.slice(element);				// Remove first element				partTwoOfNewArray.shift();								aSource = partOneOfNewArray.concat(partTwoOfNewArray);			//}						return aSource;		}				else {			return this;		}	}catch(e){TOM.ee(TOM.ei("Array.prototype.remove",this),e);return null;}};/** @id Array.prototype.indexOf */Array.prototype.indexOf = function (element) {	try{		for (var i = 0; i < this.length; i++) {			if (this[i] === element) {				return i;			}		}		return -1;	}catch(e){TOM.ee(TOM.ei("Array.prototype.indexOf",this),e);return -1;}};/*TOM.db = {};TOM.db.language = "";TOM.db.domain = [];TOM.db.path = [];TOM.db.name = [];TOM.db.nsfpath = [];TOM.db.title = [];TOM.db.homepagename = [];TOM.db.homeurl = [];TOM.db.unid = "";TOM.db.user = "";TOM.db.username = "";TOM.db.usercompany = "";TOM.db.domain[TOM.db.language] = "www.example.com";TOM.db.path[TOM.db.language] = "/folder/folder/";TOM.db.name[TOM.db.language] = "dbname.nsf"TOM.db.nsfpath[TOM.db.language] = "/folder/folder/" + name + "/";TOM.db.title[TOM.db.language] = "CMS DB Title";TOM.db.homepagename[TOM.db.language] = "DE_Home";TOM.db.homeurl[TOM.db.language] = TOM.db.protocol + "://" + TOM.db.domain + TOM.db.nsfpath + "id/" + TOM.db.homepagename;TOM.db.unid = "";TOM.db.language = "";TOM.db.user = "";TOM.db.username = "";TOM.db.usercompany = "";*//** @id TOM.storage */TOM.storage = function(sStorageId, sScope, iDays) {	var oSource = this;	var e; //counter for elements in array	/*	this.replace(entryId,value);	this.add(entryId,value);	this.get(entryId);	this.remove(entryId);	this.delete(); // deletes the cookie	this.clear(); // clears the cookie and removes all entries	*/			this.decode = function(vReturnObj) {		if (typeof vReturnObj !== "undefined") {			if (typeof vReturnObj === "number") {				vReturnObj = ""+vReturnObj;			}			//TOM.alert(" before decode replace:" + vReturnObj);			var aTempEncoded = oSource.encodedChars;			var aTempDecoded = oSource.decodedChars;			var vRet = (vReturnObj==="")?"":vReturnObj.replaceSubstring(aTempEncoded.reverse(), aTempDecoded.reverse());			//TOM.alert(" after decode replace:" + vRet);			return vRet;		} else {// TOM.alert("decode -> vReturn:" + vReturn + "\ntype:" + typeof vReturn);			return null;		}	};	this.encode = function(vReturnObj,opt) {		if (typeof vReturnObj !== "undefined") {			var vRet = (vReturnObj==="")?"":vReturnObj.replaceSubstring(oSource.decodedChars, oSource.encodedChars);			return vRet;		} else {			return null;		}	};		this.setCookie = function (sValue) {		var sCookieValue = sValue;		var sCookieExpirationAttribute = (sValue==="")?"; expires=Thu, 01-Jan-70 00:00:01 GMT":(oSource.expires?"; expires="+oSource.expires:"");		var sCookiePathAttribute = oSource.path!==""?"; path="+oSource.path:"";		var sCookieDomainAttribute = oSource.domain!==""?"; domain="+oSource.domain:"";		var sCookieSecureAttribute = oSource.secure?"; secure":"";		var sCookie = oSource.encode(oSource.sStorageId,"1") + oSource.sElementIdentifier + sCookieValue + sCookieExpirationAttribute +  sCookiePathAttribute + sCookieDomainAttribute + sCookieSecureAttribute;		//TOM.alert("cookie value:\n" + sCookie);		document.cookie = sCookie;	};		this.serializeEntries = function(aEntries) { // sets a single value for the storage object, because in cookies no array etc. are allowed		var sReturn = "";		if (isArray(aEntries)) {			//var aEntries = oSource.encode(aEntries,"7");			var aTemp = [];			for(e in aEntries) {				if (aEntries.hasOwnProperty && aEntries.hasOwnProperty(e)) {					if (typeof aEntries[e] === "string") {						//TOM.alert("Serialize:\ne=" + e+"\naEntries[e]=" + aEntries[e]);						aTemp[aTemp.length] = oSource.encode(e) + oSource.sEntryIdentifier + oSource.encode(aEntries[e]);					}				}			}			sReturn = aTemp.join(oSource.sEntrySeparator);		//		var sReturn = ((typeof sEntryId === "string")?oSource.encode(sEntryId):"") + oSource.sEntrySeparator + oSource.encode(sValue);		}		return sReturn;	};	this.expires = function(years, month, days, hours, minutes, seconds) {			var date = new Date();			var days = iDays?iDays:365;			date.setTime(date.getTime()+(days*24*60*60*1000));			oSource.expires = date.toGMTString();	};		this.expirationDate = function(){		//{oSource.period.toGMT};	};		this.set = function(sValue, sEntryId) { // sets a single value for the storage object, no array etc. allowed		var aReturn = [];		var vCookie = oSource.get();		var aCookie;		sValue = sValue+""; //convert to string, to avoid problems		//TOM.alert("set.. get vCookie type = " + typeof vCookie);		//TOM.alert("set.. get vCookie serialized values = " + oSource.serializeEntries(vCookie));		switch (oSource.method) {			case "cookie":				var sCookieValue;				if (typeof sEntryId === "string") {					if(isArray(vCookie)) {						//TOM.alert("vCookie is an array");						aCookie = vCookie;					}					else {						//TOM.alert("vCookie is NOT an array, create empty array");						aCookie = [];					}					aCookie[sEntryId] = sValue;					// sCookieValue = ((typeof sEntryId === "string")?oSource.encode(sEntryId):"") + oSource.sEntrySeparator + oSource.encode(sValue);					sCookieValue = oSource.serializeEntries(aCookie);//TOM.alert("this.set -> aCookie serialized:" + sCookieValue);				}				else {					sCookieValue = oSource.encode(sValue);				}				//TOM.alert("oSource.setCookie(sCookieValue) -> sCookieValue=" + sCookieValue);				oSource.setCookie(sCookieValue);				break;			case "cookie":				break;			case "cookie":				break;		}		return aReturn;			};		this.get = function(sEntryId) {		var vReturn = null;		switch (oSource.method) {			case "cookie":				var sCookie = document.cookie;				if(sCookie!=="") {					var aCookies = sCookie.split(oSource.sElementSeparator);					var sCurrentCookie = "";					var sEncodedCookieId = oSource.encode(oSource.sStorageId,"2");					for (var n = 0; n < aCookies.length; n++) {														//TOM.alert("Cookie["+n+"] pos of '"+ (sEncodedCookieId + oSource.sElementIdentifier)+"': " + aCookies[n].indexOf(sEncodedCookieId + oSource.sElementIdentifier));						if (aCookies[n].indexOf(sEncodedCookieId + oSource.sElementIdentifier) === 0) {							sCurrentCookie = aCookies[n].right(sEncodedCookieId + oSource.sElementIdentifier);														//TOM.alert("set sCurrentCookie -> " + sCurrentCookie);						}					}														//TOM.alert("sCurrentCookie:" + sCurrentCookie);					if (sCurrentCookie !== "") {						var aEntries = sCurrentCookie.split(oSource.sEntrySeparator);						if (typeof sEntryId === "string" && sEntryId !== "") { //if an entry id was specified, lets try to return the assigned value of the entry														//TOM.alert("if an entry id was specified, lets try to return the assigned value of the entry");							var sEncodedEntryId = oSource.encode(sEntryId,"3");							for (e = 0; e < aEntries.length; e++) {								if (aEntries[e].indexOf(sEncodedEntryId + oSource.sEntryIdentifier) === 0) {														//TOM.alert("special aEntries[e].right: " + aEntries[e].right(sEncodedEntryId + oSource.sEntryIdentifier));									vReturn = aEntries[e].right(sEncodedEntryId + oSource.sEntryIdentifier);									//TOM.alert("type 1: " + typeof vReturn);														//TOM.alert("this.get -> special vReturn: " + vReturn);									vReturn = oSource.decode(vReturn);									//TOM.alert("type 2: " + typeof vReturn);								}							}						} else if(aEntries.contains(oSource.sEntryIdentifier) === false && typeof aEntries[0] !== "undefined"){ // if no alias was specified and no alias assignment used, then this cookie is just one single text value														//TOM.alert("if no alias was specified and no alias assignment used, then this cookie is just one single text value");							vReturn = oSource.decode(aEntries[0]);							//TOM.alert("type 3: " + typeof vReturn);						} else { // if no entry id was specified and the cookie contains an alias assignment, it should be a multi value cookie, which will be returned as named-index array (assoziativer array -> uses string identification instead of indexed numbers)														//TOM.alert("if no entry id was specified and the cookie contains an alias assignment, it should be a multi value cookie, which will be returned as named-index array (assoziativer array -> uses string identification instead of indexed numbers)");							var sCurrentEntryId,sCurrentEntryValue;							vReturn = [];							//TOM.alert("type 4: " + typeof vReturn);							for (e = 0; e < aEntries.length; e++) {								//TOM.alert("get id and entry from:\n" + aEntries[e]);								sCurrentEntryId = oSource.decode(aEntries[e].left(oSource.sEntryIdentifier));								sCurrentEntryValue = oSource.decode(aEntries[e].right(oSource.sEntryIdentifier));								vReturn[sCurrentEntryId] = sCurrentEntryValue;								//TOM.alert("type 5: " + typeof vReturn);								//TOM.alert("vReturn["+sCurrentEntryId+"] = "+sCurrentEntryValue+";");							}						}					}				} else {					vReturn = null;					//TOM.alert("type 6: " + typeof vReturn);				}				break;			case "firefoxstorage":				break;			case "flash":				break;			case "activex":				break;		}		if (vReturn === null) {			vReturn = "";			//TOM.alert("type 7: " + typeof vReturn);		}		//TOM.alert("return type: " + typeof vReturn);		return vReturn;	};		this.getall = function() {//		TOM.alert("getall...");		var aReturn = [];		var aEntries = oSource.get();//		TOM.alert("aEntries.length:" + aEntries.length);		var sCurrentEntryId,sCurrentEntryValue;		for (e in aEntries) {			if (aEntries.hasOwnProperty && aEntries.hasOwnProperty(e)) {				if (typeof aEntries[e] === "string") {					aReturn[aReturn.length] = "\"" + e.replaceSubstring('"', '\\"') + "\":\"" + aEntries[e].replaceSubstring('"', '\\"') + "\"";				}			}		}		return "{" + aReturn.join(",") + "}";	};		this.remove = function(sEntryId) { // removes an entry from multivalue storage object or if no entryId specified, deletes the cookie, but not the object		var sValue = "";		var aReturn = [];		var vCookie = oSource.get();		var aCookie;		//TOM.alert("set.. get vCookie type = " + typeof vCookie);		//TOM.alert("set.. get vCookie serialized values = " + oSource.serializeEntries(vCookie));		switch (oSource.method) {			case "cookie":				var sCookieValue;				if (typeof sEntryId === "string") {					var aNewCookie = [];					var iCnt=0;					if (isArray(vCookie)) {						//TOM.alert("vCookie is an array");						for(e in vCookie) {							if (vCookie.hasOwnProperty && vCookie.hasOwnProperty(e)) {								if (e !== sEntryId) {									aNewCookie[e] = vCookie[e];									iCnt++;								}							}						}					}					// sCookieValue = ((typeof sEntryId === "string")?oSource.encode(sEntryId):"") + oSource.sEntrySeparator + oSource.encode(sValue);					sCookieValue = (iCnt===0)?"":oSource.serializeEntries(aNewCookie);				//TOM.alert("this.set -> aCookie serialized:" + sCookieValue);				}				else {					sCookieValue = "";				}				//TOM.alert("oSource.setCookie(sCookieValue) -> sCookieValue=" + sCookieValue);				oSource.setCookie(sCookieValue);				break;			case "cookie":				break;			case "cookie":				break;		}		return aReturn;	};	/*	TOM. .set		TOM. .get	TOM. .value		*/	this.period = function(years, month, days, hours, minutes, seconds){		var aArguments = [];		for(var cnt=0; cnt<arguments.length; cnt++) {			aArguments[cnt] = arguments[cnt];		}		if(aArguments.length===1) {			//	oSource.period(days);		} else if(aArguments.length>1) {			//	oSource.period(years, month, days, hours, minutes, seconds) // seconds, minutes, hours, days, month, years);		} else {			//-> without parameter returns the expiration time as date object		}	};		try {		oSource.sStorageId = sStorageId;		oSource.method = "cookie"; // "flash", "storageobject", "activex", "server?"		if (oSource.method == "cookie") {			oSource.sElementIdentifier = "="; //for cookies this must be "=" !!!			oSource.sElementSeparator = "; ";		} else {			oSource.sElementIdentifier = "=";			oSource.sElementSeparator = "; ";		}		oSource.sEntryIdentifier = "|";		oSource.sEntrySeparator = ",";		oSource.cmsscope = "domain"; // "subdomain","database","design","document"			var date = new Date();		var days = iDays?iDays:365;		date.setTime(date.getTime()+(days*24*60*60*1000));		oSource.expires = date.toGMTString();				oSource.path = sScope;		oSource.domain = "";		oSource.secure = (location.protocol === "https")?true:false;		var sEscapeChar = "%";		oSource.decodedChars = [sEscapeChar, oSource.sElementSeparator , oSource.sEntrySeparator , oSource.sElementIdentifier , oSource.sEntryIdentifier]; //, String.fromCharCode(13), String.fromCharCode(10)		oSource.encodedChars = [sEscapeChar+"00" , sEscapeChar+"01", sEscapeChar+"02" , sEscapeChar+"03" , sEscapeChar+"04"]; // , sEscapeChar+"05" , sEscapeChar+"06", sEscapeChar+"07", sEscapeChar+"08", sEscapeChar+"09"	}catch(e){TOM.ee(TOM.ei("TOM.storage",this),e);return null;}};/** @id TOM.i */TOM.i = {};/** @id TOM.i.browser */TOM.i.browser = {};/** @id TOM.i.os */TOM.i.os = {};if(navigator.appName==="Netscape") {	TOM.i.browser.name="netscape navigator";} else if (navigator.appName==="Microsoft Internet Explorer") {	TOM.i.browser.name="internet explorer";}TOM.i.browser.version=parseInt(navigator.appVersion,10);TOM.i.browser.nn=(TOM.i.browser.name==="netscape navigator");if(TOM.i.browser.nn && (navigator.userAgent.indexOf('Netscape6')>0)) {		TOM.i.browser.version = 6;}if (TOM.i.browser.nn && (navigator.userAgent.indexOf('Netscape7') > 0)) {	TOM.i.browser.version = 7;}TOM.i.browser.ie=(TOM.i.browser.name==="internet explorer");// if(TOM.i.browser.ie && (navigator.userAgent.indexOf('Netscape6')>0)) TOM.i.browser.version = 6;if (navigator.appVersion.indexOf('MSIE 4') > 0) {	TOM.i.browser.version = 4;}if (navigator.appVersion.indexOf('MSIE 5') > 0) {	TOM.i.browser.version = 5;}if (navigator.appVersion.indexOf('MSIE 6') > 0) {	TOM.i.browser.version = 6;}if (navigator.appVersion.indexOf('MSIE 7') > 0) {	TOM.i.browser.version = 7;}if (navigator.appVersion.indexOf('MSIE 8') > 0) {	TOM.i.browser.version = 8;}TOM.i.browser.mozilla=((navigator.appName === "Netscape") && (navigator.appVersion.substring(0,1) >= "5"));TOM.i.browser.opera=((navigator.appName === "Opera") || (navigator.userAgent.indexOf("Opera")>0));TOM.i.browser.konqueror = /Konqueror/i.test(navigator.userAgent);TOM.i.browser.safari = /Safari/i.test(navigator.userAgent);TOM.i.browser.khtml = /KHTML/i.test(navigator.userAgent);if (TOM.i.browser.opera && (parseInt(navigator.appVersion.substring(0, 1), 10) >= 6 || navigator.userAgent.indexOf("Opera 6") > 0)) {	TOM.i.browser.version = 6;}if (TOM.i.browser.opera && parseInt(navigator.appVersion.substring(0, 1), 10) >= 6) {	TOM.i.browser.version = parseInt(navigator.appVersion.substring(0, 1), 10);}// Opera pretends to be another Browserif (TOM.i.browser.opera) {	TOM.i.browser.ns=false;	TOM.i.browser.ie=false;	TOM.i.browser.mozilla=false;	TOM.i.browser.konqueror=false;	TOM.i.browser.safari=false;	TOM.i.browser.khtml=false;}TOM.i.os.windows=(navigator.appVersion.toLowerCase().indexOf("windows")==-1)?false:true;TOM.i.os.linux=(navigator.appVersion.toLowerCase().indexOf("linux")==-1)?false:true;TOM.i.os.mac=(navigator.appVersion.toLowerCase().indexOf("macintosh")==-1)?false:true;TOM.i.browser.info = "browser appName:" + navigator.appName + "\n" +"browser appVersion:" + navigator.appVersion + "\n" +"TOM.i.browser.name:" + TOM.i.browser.name + "\n" +"TOM.i.browser.version:" + TOM.i.browser.version + "\n" +"TOM.i.browser.ie?:" + TOM.i.browser.ie + "\n" +"TOM.i.browser.nn?:" + TOM.i.browser.nn + "\n" +"TOM.i.browser.mozilla?:" + TOM.i.browser.mozilla + "\n" +"TOM.i.browser.opera?:" + TOM.i.browser.opera + "\n" +"TOM.i.browser.konqueror?:" + TOM.i.browser.konqueror + "\n" +"TOM.i.browser.safari?:" + TOM.i.browser.safari + "\n" +"TOM.i.browser.khtml?:" + TOM.i.browser.khtml + "\n";//TOM.alert(TOM.i.browser.info);TOM.i.objHasOwnProperty = function(oElement,e) {	var bReturn = false;	if(!oElement.hasOwnProperty || oElement.hasOwnProperty(e)) {		bReturn = true;	}	return bReturn;};/** @id TOM.i.window */TOM.i.window = function () {	var e;	var res = "Window:";	var maximumWidth = 0;	var maximumHeight = 0;	this.targetObj = window;	var info = this.targetObj.document.documentElement?this.targetObj.document.documentElement:this.targetObj.document.body;	this.windowInnerWidth = info.clientWidth;	this.windowInnerHeight = info.clientHeight;	this.screenWidth = info.scrollWidth > info.clientWidth?info.scrollWidth:info.clientWidth;	this.screenHeight = info.scrollHeight > info.clientHeight?info.scrollHeight:info.clientHeight;	var oElement = document;	for(e in oElement) {		if (true){ // oElement.hasOwnProperty && oElement.hasOwnProperty(e)) {			if (e.indexOf("idth") > -1 || e.indexOf("eight") > -1 || e.indexOf("op") > -1 || e.indexOf("eft") > -1) {				res += e + " = " + oElement[e] + "\n";				if ((e.indexOf("idth") > -1 || e.indexOf("eft") > -1) && oElement[e] > maximumWidth) {					maximumWidth = oElement[e];				}				if ((e.indexOf("eight") > -1 || e.indexOf("op") > -1) && oElement[e] > maximumHeight) {					maximumHeight = oElement[e];				}			}		}	}	res += "\nDocument:\n";	oElement = document;	for(e in oElement) {		if (true){ // oElement.hasOwnProperty && oElement.hasOwnProperty(e)) {			if (e.indexOf("idth") > -1 || e.indexOf("eight") > -1 || e.indexOf("op") > -1 || e.indexOf("eft") > -1) {				res += e + " = " + oElement[e] + "\n";				if ((e.indexOf("idth") > -1 || e.indexOf("eft") > -1) && oElement[e] > maximumWidth) {					maximumWidth = oElement[e];				}				if ((e.indexOf("eight") > -1 || e.indexOf("op") > -1) && oElement[e] > maximumHeight) {					maximumHeight = oElement[e];				}			}		}	}	res += "\nScreen:\n";	oElement = screen;	for(e in oElement) {		if (true){ // oElement.hasOwnProperty && oElement.hasOwnProperty(e)) {			if (e.indexOf("idth") > -1 || e.indexOf("eight") > -1 || e.indexOf("op") > -1 || e.indexOf("eft") > -1) {				res += e + " = " + oElement[e] + "\n";				if ((e.indexOf("idth") > -1 || e.indexOf("eft") > -1) && oElement[e] > maximumWidth) {					maximumWidth = oElement[e];				}				if ((e.indexOf("eight") > -1 || e.indexOf("op") > -1) && oElement[e] > maximumHeight) {					maximumHeight = oElement[e];				}			}		}	}		res += "\ndocument.body:\n";	oElement = document.body;	for(e in oElement) {		if (true){ // oElement.hasOwnProperty && oElement.hasOwnProperty(e)) {			if (e.indexOf("idth") > -1 || e.indexOf("eight") > -1 || e.indexOf("op") > -1 || e.indexOf("eft") > -1) {				res += e + " = " + oElement[e] + "\n";				if ((e.indexOf("idth") > -1 || e.indexOf("eft") > -1) && oElement[e] > maximumWidth) {					maximumWidth = oElement[e];				}				if ((e.indexOf("eight") > -1 || e.indexOf("op") > -1) && oElement[e] > maximumHeight) {					maximumHeight = oElement[e];				}			}		}	}	res += "\ndocument.documentElement:\n";	oElement = document.documentElement;	for(e in oElement) {		if (true){ // oElement.hasOwnProperty && oElement.hasOwnProperty(e)) {			if (e.indexOf("idth") > -1 || e.indexOf("eight") > -1 || e.indexOf("op") > -1 || e.indexOf("eft") > -1) {				res += e + " = " + oElement[e] + "\n";				if ((e.indexOf("idth") > -1 || e.indexOf("eft") > -1) && oElement[e] > maximumWidth) {					maximumWidth = oElement[e];				}				if ((e.indexOf("eight") > -1 || e.indexOf("op") > -1) && oElement[e] > maximumHeight) {					maximumHeight = oElement[e];				}			}		}	}	this.maximumWidth = maximumWidth;	this.maximumHeight = maximumHeight;//	res = "";	res +=  "windowInnerWidth:"+this.windowInnerWidth+"\nwindowInnerHeight:"+this.windowInnerHeight;	res +=  "\nmaximumWidth:"+this.maximumWidth+"\nmaximumHeight:"+this.maximumHeight;	this.info = res;};TOM.xml = {	/** @id TOM.xml.loadXMLFile */	loadXMLFile: function (sFilename) {		var xmlDoc = null;				if (document.implementation && document.implementation.createDocument) {			// Firefox			xmlDoc = document.implementation.createDocument("", "", null);		} else if (window.ActiveXObject) {			// Internet Explorer			xmlDoc = new ActiveXObject("Microsoft.XMLDOM");	 	} else {			return xmlDoc;		}		// Load file		if (sFilename && xmlDoc) {			xmlDoc.load(sFilename);		}				return xmlDoc;	},	/** @id TOM.xml.parseXML */	parseXML: function (sXMLData) {		var oXMLDoc = null;				if (typeof sXMLData === "string") {			if (!sXMLData) {				return null;			}			/* IE */			if (window.ActiveXObject) {				oXMLDoc = new ActiveXObject("Microsoft.XMLDOM");				oXMLDoc.async = false;					//IE uses the loadXML method when the source document is NOT XML				if (oXMLDoc) {					oXMLDoc.loadXML(sXMLData);				}			}			/* Firefox */ 			else if(document.implementation.createDocument) {				//Firefox requires a parser object to read the text				var vParser = new DOMParser();				if (vParser) {					oXMLDoc = vParser.parseFromString(sXMLData, "text/xml");				}			}		}		return oXMLDoc;	}};
