function spcObject()
{
	this.recursionCount = 0;
}

spcObject.prototype.consoleLogObject = function(object)
{
	var self = this;
	self.foreachObject({data:object,callback:self.consoleLog});
}

spcObject.prototype.consoleLog = function(objProperty,objPropertyValue)
{
	console.log(objProperty + "=" + objPropertyValue);
}

spcObject.prototype.foreachObject = function(controlBlock)
{
	var object = controlBlock.data;
	var operation = controlBlock.callback;

	if (this.recursionCount>10) {
		console.log('Error: this.recursionCount>10 spcObject.prototype.propertyParse()' + object);
		return;
	}
	
	//console.log('typeof(object): ' + typeof object );
	
	for (var objectItem in object) 
	{

		if (isNaN(objectItem) && typeof(object[objectItem])!='object') {
			if (operation) {
				var objectValue = object[objectItem];
				operation(objectItem, objectValue);
			}
		}
		else {
			this.recursionCount++;
			this.foreachObject({data:object[objectItem], callback:operation});
			this.recursionCount--;
		}
	}	
	
	return;
}

spcObject.prototype.foreachRow = function(controlBlock)
{
	var object = controlBlock.data;
	var operation = controlBlock.callback;

	if (this.recursionCount>10) {
		console.log('Error: this.recursionCount>10 spcObject.prototype.propertyParse()' + object);
		return;
	}
	
	//console.log('typeof(object): ' + typeof object );
	
	for (var objectItem in object) 
	{
		/*
		if (isNaN(objectItem) && typeof(object[objectItem])!='object') {
			if (operation) {
				var objectValue = object[objectItem];
				operation(objectItem, objectValue);
			}
		}
		else {
		*/
			this.recursionCount++;
			operation(object[objectItem]);
			this.recursionCount--;
		//}
	}	
	
	return;
}

spcObject.prototype.foreachObjectPair = function(controlBlock)
{
	var object = controlBlock.data;
	var operation = controlBlock.callback;

	if (this.recursionCount>10) {
		console.log('Error: this.recursionCount>10 spcObject.prototype.propertyParse()' + object);
		return;
	}
	
	//console.log('typeof(object): ' + typeof object );
	
	for (var objectItem in object) 
	{
		
		if (isNaN(objectItem) && typeof(object[objectItem])!='object') {
			if (operation) {
				var objectValue = object[objectItem];
				
				var objectresultvalue = operation(objectItem, objectValue);
				if (objectresultvalue)
					object[objectItem] = objectresultvalue;
			}
		}
		else {
			this.recursionCount++;
			this.foreachObjectPair({data:object[objectItem], callback:operation});
			this.recursionCount--;
		}
	}	
	
	return;
}



