//	------------------------------------------------------------------------------------------
//	------------------------------------------------------------------------------------------
//	-----   feel free to use this stuff   ---   play with it   ---   copy as You  like   -----
//	-----   but leave this authors comment untouched:   pseliger@gmx.net [april 2003]    -----
//	------------------------------------------------------------------------------------------
//	------------------------------------------------------------------------------------------
//
//	extended javascript-api-methods		:
//	* jsApi-extension-name / file-name	: "jsApi.ObjectArray.getScanLog.js"
//	* original download-location		: "http://www.pseliger.de/jsExtendedApi/"
//
//	first revision		:   may 26-2003	- major changes  in order to handle  every build-
//										  in-js-object as well as  all self-defined-ones;
//										- "Object.getConstructorName()"  got part now of
//										  the package  "jsApi.ObjectArray.getScanLog.js";
//										- "Object.getObjectType()"  is new and returns a
//										  more  precise type of the object that uses that;
//	first public release: april 17-2003	- clones every js-object whose constructor is "array"
//										  or "object"  regardless of its level of complexity;
//										  returns a tab-formatted log;  the log comments and
//										  visualizes the complete structure of the js-object;
//										  (properties: methods,arguments)
//
Object.prototype.getConstructorName=function(){var thisConstructor=this.constructor;var thisConstructorString=thisConstructor.toString();var regExpDefault=/^\s*function\s+([a-zA-Z0-9_\(]{2,}[^\)])\)/;var regExpMsie5x=/^\s*\[object\s+([a-zA-Z0-9_]{1,})/;return((thisConstructor)?((regExpDefault.test(thisConstructorString))?(regExpDefault.exec(thisConstructorString)[1]+")"):((regExpMsie5x.test(thisConstructorString))?(regExpMsie5x.exec(thisConstructorString)[1]+"()"):(null))):(null));};
	/*	(01)	-	EN: returns the name of an objects constructor (like "className");
					DE: liefert den namen des objekt-konstruktors zurueck (bei einem oo-klassenkonzept entspraeche dies dem klassennamen);
	*/
Object.prototype.getObjectType=function(){var thisConstructor=this.constructor;var thisConstructorString=thisConstructor.toString();var regExpDefault=/^\s*function\s+([a-zA-Z0-9_]{1,})/;var regExpMsie5x=/^\s*\[object\s+([a-zA-Z0-9_]{1,})/;return((thisConstructor)?((regExpDefault.test(thisConstructorString))?(regExpDefault.exec(thisConstructorString)[1].toLowerCase()):((regExpMsie5x.test(thisConstructorString))?(regExpMsie5x.exec(thisConstructorString)[1].toLowerCase()):("object"))):("object"));};
	/*	(01)	-	EN: returns a more specific type of an object than the build in global function "typeof" does;
					DE: liefert einen genaueren objekt-typen zurueck als die eingebaute globale funktion "typeof";
	*/
Object.prototype.getScanLog=function(tabulators){tabulators=((tabulators)?(tabulators):(""));var thisConstructor=this.constructor;var thisConstructorName=((thisConstructor)?(this.getConstructorName()):(null));if(thisConstructorName){thisConstructorName=(((thisConstructor==Object)||(thisConstructor==Function)||(thisConstructor==RegExp)||(thisConstructor==Date)||(thisConstructor==Error))?("[ native constructor: new "):("[ alien constructor: new "))+thisConstructorName+" ]";}else{thisConstructorName="[ constructor: not found ]";}if(thisConstructor==Object){var scanLog=">>> OBJECT - "+thisConstructorName+" ---\n";var memberName="";var memberObject=null;var memberType="";var functionName="";var stringQuotes="";for(memberName in this){memberObject=this[memberName];memberType=((memberObject)?(memberObject.getObjectType()):("object"));if((memberType=="object")||(memberType=="array")){if(memberObject===null){scanLog+=tabulators+"\tNAME: \""+memberName+"\"\n\t\t"+tabulators+"TYPE : [object]\n\t\t"+tabulators+"VALUE: null\n";}else{scanLog+=tabulators+"\tNAME: \""+memberName+"\"\n\t\t"+tabulators+"TYPE : ["+memberType+"]\n\t\t"+tabulators+"VALUE:\n"+memberObject.getScanLog(tabulators+"\t\t\t");}}else if(memberType=="function"){functionName=functionName.toString();functionName=functionName.substring(0,functionName.indexOf(")")+1).replace(/\s+/g,"")+"{[native code]}\n";scanLog+=tabulators+"\tNAME: \""+memberName+"\"\n\t\t"+tabulators+"TYPE : [method]\n\t\t"+tabulators+"VALUE: "+functionName;}else{stringQuotes=((memberType=="string")?("\""):(""));scanLog+=tabulators+"\tNAME: \""+memberName+"\"\n\t\t"+tabulators+"TYPE : ["+memberType+"]\n\t\t"+tabulators+"VALUE: "+stringQuotes+memberObject+stringQuotes+"\n";}}return(scanLog+tabulators+"--- OBJECT - "+thisConstructorName+" <<<\n");}else{var objectType=((this)?(this.getObjectType()):("object"));var memberLog="";var memberName="";var memberCount=0;var memberObject=null;var memberType="";var stringQuotes="";for(memberName in this){if(!Object.prototype[memberName]){memberCount++;memberObject=this[memberName];memberType=((memberObject)?(memberObject.getObjectType()):(typeof(memberObject)));stringQuotes=((memberType=="string")?("\""):(""));memberLog+=tabulators+"\t\tNAME: \""+memberName+"\"\n\t\t\t"+tabulators+"TYPE : ["+memberType+"]\n\t\t\t"+tabulators+"VALUE: "+stringQuotes+memberObject+stringQuotes+"\n";}}memberLog=((memberCount==0)?(tabulators+"\t* there is not a single none-prototype-property;\n"):((memberCount==1)?(tabulators+"\t* none-prototype-property:\n"):(tabulators+"\t* none-prototype-properties:\n")))+memberLog;var protoLog="";var protoCount=0;if(this.prototype){for(memberName in this.prototype){if(!Object.prototype[memberName]){protoCount++;memberObject=this[memberName];memberType=((memberObject)?(memberObject.getObjectType()):(typeof(memberObject)));stringQuotes=((memberType=="string")?("\""):(""));if(memberType=="function"){memberType="method";memberObject=memberObject.toString();memberObject=memberObject.substring(0,memberObject.indexOf(")")+1).replace(/\s+/g,"")+"{[native code]}";}protoLog+=tabulators+"\t\tNAME: \""+memberName+"\"\n\t\t\t"+tabulators+"TYPE : ["+memberType+"]\n\t\t\t"+tabulators+"VALUE: "+stringQuotes+memberObject+stringQuotes+"\n";}}}for(memberName in Object.prototype){protoCount++;memberObject=this[memberName];memberType=((memberObject)?(memberObject.getObjectType()):(typeof(memberObject)));stringQuotes=((memberType=="string")?("\""):(""));if(memberType=="function"){memberType="method";memberObject=memberObject.toString();memberObject=memberObject.substring(0,memberObject.indexOf(")")+1).replace(/\s+/g,"")+"{[native code]}";}protoLog+=tabulators+"\t\tNAME: \""+memberName+"\"\n\t\t\t"+tabulators+"TYPE : ["+memberType+"]\n\t\t\t"+tabulators+"VALUE: "+stringQuotes+memberObject+stringQuotes+"\n";}protoLog=(((memberCount==0)&&(protoCount==0))?(tabulators+"\t* there is not even a single prototype-property;\n"):((protoCount==0)?(tabulators+"\t* there is not a single prototype-property;\n"):((protoCount==1)?(tabulators+"\t* prototype-property:\n"):(tabulators+"\t* prototype-properties:\n"))))+protoLog;return(tabulators+">>> "+objectType.toUpperCase()+" - "+thisConstructorName+" ---\n"+memberLog+protoLog+tabulators+"--- "+objectType.toUpperCase()+" - "+thisConstructorName+" <<<\n");}};
	/*	(01)	-	EN: object-types get scanned RECURSIVELY  - array-types get explored by the method "Array.getScanLog()";
					DE: object-typen werden REKURSIV gescannt - array-typen werden mit der methode "Array.getScanLog()" erforscht;
		(02)	-	EN: the bodies of function-types will not be logged;
					DE: die bodies der function-typen werden nicht mitgeschrieben;
		(03)	-	EN: information regarding primitive types simply gets logged;
					DE: informationen zu primitiven typen werden einfach mitgeschrieben;
	*/
Array.prototype.getScanLog=function(tabulators){tabulators=((tabulators)?(tabulators):(""));var arrayType="[ indices only ]";var arrayLength=this.length;var entryName="";if(arrayLength>=1){for(entryName in this){if(!(new RegExp("[0-9]{"+entryName.length+"}","").test(entryName))){arrayType="[ hybrid ]";break;}}}else{var isEmpty=true;for(entryName in this){isEmpty=false;}if(isEmpty){arrayType="[ no entries ]";}else{arrayType="[ pure associative ]";}}var scanLog=">>> ARRAY - "+arrayType+" ---\n";var entryObject=null;var entryType="";var keyType="";var functionName="";var stringQuotes="";for(entryName in this){entryObject=this[entryName];entryType=((entryObject)?(entryObject.getObjectType()):("object"));keyType=((new RegExp("[0-9]{"+entryName.length+"}","").test(entryName))?("INDEX["):("KEYWORD["));if((entryType=="object")||(entryType=="array")){if(entryObject===null){scanLog+=tabulators+keyType+"] - TYPE: \"object\" - VALUE :\n"+tabulators+"\tnull\n";}else{scanLog+=tabulators+keyType+"] - TYPE: \""+entryType+"\" - VALUE :\n"+tabulators+"\t"+entryObject.getScanLog(tabulators+"\t");}}else if(entryType=="function"){functionName=entryObject.toString();functionName=functionName.substring(0,functionName.indexOf(")")+1);scanLog+=tabulators+keyType+"] - TYPE: \"function\" - VALUE :\n"+tabulators+"\t"+functionName+" {[native code]}\n";}else{stringQuotes=((entryType=="string")?("\""):(""));scanLog+=tabulators+keyType+"] - TYPE: \""+entryType+"\" - VALUE :\n"+tabulators+"\t"+stringQuotes+entryObject+stringQuotes+"\n";}}return(scanLog+tabulators+"--- ARRAY - "+arrayType+" <<<\n");};
	/*	(01)	-	EN:	array-types get scanned RECURSIVELY  - object-types get explored by the method "Object.getScanLog()";
					DE: array-typen werden REKURSIV gescannt - object-typen werden mit der methode "Object.getScanLog()" erforscht;
		(02)	-	EN: the bodies of function-types will not be logged;
					DE: die bodies der function-typen werden nicht mitgeschrieben;
		(03)	-	EN: information regarding primitive types simply gets logged;
					DE: informationen zu primitiven typen werden einfach mitgeschrieben;
	*/
//
//	------------------------------------------------------------------------------------------
//	------------------------------------------------------------------------------------------
