var getProps = function(variable, varname, level){
	if(!varname){ varname = 'var'; }
	if(!level){ level = 5; }
	var string = '';
	for(var o in variable){
		if(typeof(variable[o]) == 'object' || typeof(variable[o]) == 'function'){
			if(level <= 1 || typeof(variable[o]) == 'function'){
				string += varname + '.' + o + ' = ' + typeof(variable[o]) + '\n';
				}
			else{
				string += getProps(variable[o], varname + '.' + o, level - 1);
				}
			}
		else{
			string += varname + '.' + o + ' = ' + variable[o] + '\n';
			}
		}
	return string;
	};

function prev( theObj ) {
	theParent = theObj.parentNode;
	childFound = 0;
	childIndex = 0;
	do{
		if(theParent.childNodes[childIndex] == theObj){
			if(childIndex > 0) {
				return theParent.childNodes[childIndex - 1];
			} else {
				return null;
			}
			childFound = 1;
		}
		childIndex++;
	}while(childFound == 0 && childIndex < theParent.childNodes.length);
}
